Public
Edited
Apr 16, 2023
1 fork
Insert cell
md`# textarea, tsv ... awk-like processing of data`
Insert cell
viewof g = textarea()
Insert cell
v2=g
Insert cell
s3=v2.split('\n')
Insert cell
//x=s3[0]
Insert cell
//x.split('\t')
Insert cell
m4=s3.map(x=> x.split('\t'))
Insert cell
//m5=m4.map(x=> x[2]+ '():' +x[3])
m5=m4.map(x=>
`${x[2-1]}:${x[3-1]}`
///`${x[2]}:${x[3]}`
//`<button title="${x[3]}" class=style1 type="button" >${x[2]}</button>`
)
//<button type="button" title='forward' class=style1 ></button
Insert cell
//s6=m5.join('\n')
s6=m5.join(' ')
Insert cell
s7=`[\n"` + s6 + `"\n]\n`
Insert cell
s8=s7.replace(/ undefined[:]undefined /g,`",\n"`)
Insert cell
s85=s8.replace(/ (.[:] )+/g,` :(not_a_symbol) `)
Insert cell
s9=s85
Insert cell
hstd1=html`<textarea class="form-control2" id=std1 ></textarea>`
Insert cell
hstd1.value = s9
Insert cell
import {textarea} from "@jashkenas/inputs"
Insert cell
viewof bio = Inputs.textarea({label: "Biography", placeholder: "What’s your story?"})
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
function textarea456464(config = {}) {
const {
value = "",
title,
description,
autocomplete,
cols = 45,
rows = 3,
width,
height,
maxlength,
placeholder,
spellcheck,
wrap,
submit,
disabled,
getValue
} = typeof config === "string" ? { value: config } : config;
const form = input({
form: html`<form><textarea style="display: block; font-size: 0.8em;" name=input>${value}</textarea></form>`,
title,
description,
submit,
getValue,
attributes: {
autocomplete,
cols,
rows,
maxlength,
placeholder,
spellcheck,
wrap,
disabled
}
});
form.output.remove();
if (width != null) form.input.style.width = width;
if (height != null) form.input.style.height = height;
if (submit) form.submit.style.margin = "0";
if (title || description) form.input.style.margin = "3px 0";
return form;
}
Insert cell
////v2+v2
Insert cell
////x0=textarea()
Insert cell
////g. .children[0].children[0].value = 34
Insert cell
//// x0.children[0].children[0].value = 34434
Insert cell
////x0.value
Insert cell
////viewof y=x0
Insert cell
////z.children[0].value
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more