Public
Edited
Aug 3, 2023
Importers
8 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof numbers = combo ({a:number({title:"a",value:4}),b:number({title:"b",value:5})},md`### Title`,md`*description*`)
Insert cell
numbers
Insert cell
Insert cell
Insert cell
Insert cell
function combo(inputs, title, description) {
const root = html`<div class="inputs-combo"></div>`;
if (title) root.append(title);
root.value = {};

Object.entries(inputs).forEach(([key, input]) => {
root.value[key] = input.value;
input.addEventListener("input", (e) => {
root.value[key] = input.value;
root.dispatchEvent(new CustomEvent("input"));
//e.preventDefault();-
});
const box = DOM.element("div", {
style: "padding: 5px ; display:inline-block;"
});
box.appendChild(input);
root.appendChild(box);
});

if (description) root.append(description);
return root;
}
Insert cell
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