Public
Edited
Jan 24, 2023
Importers
1 star
Insert cell
md`# McNulty's Inputs`
Insert cell
Insert cell
Insert cell
Insert cell
viewof balh = RangeSelection({max: 10});
Insert cell
Insert cell
balh
Insert cell
Insert cell
viewof yadda = TimelineSelections({n})
Insert cell
yadda

Insert cell
viewof n = Inputs.range([1, 10], {step: 1});
Insert cell
yadda

Insert cell
function TimelineSelections({n = 3, min = 1, max = 10, value = []}) {
const el = html`<div style=${{ display: "flex", flexDirection: 'column'}}></div>`;
const children = [...Array(n)].map((x,i) => RangeSelection({min, max, value: value.length? value[i] : []}));
el.append(html.fragment`${children}`);
children.forEach(x => {x.addEventListener('input', e => el.value = [...el.querySelectorAll('span')].map(x => x.value) );});
el.value = children.map(x => x.value);
return el;
}
Insert cell
yadda
Insert cell
function set(input, value) {
input.value = value;
input.dispatchEvent(new Event("input", { bubbles: true })); // Native events bubble, so we should too
}
Insert cell
svg = htl.svg
Insert cell
html = htl.html
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more