Public
Edited
Oct 25, 2023
16 forks
Importers
133 stars
Insert cell
Insert cell
viewof x = Inputs.range([0,1])
Insert cell
x
Insert cell
Insert cell
viewof message = Inputs.text({placeholder: "Say hello"})
Insert cell
message
Insert cell
Insert cell
viewof color = Inputs.select(["red", "orange", "yellow", "green", "blue", "violet"], {value: "green"})
Insert cell
color
Insert cell
Insert cell
Insert cell
Insert cell
point
Insert cell
Insert cell
Insert cell
stroke
Insert cell
Insert cell
Insert cell
viewof silly = {
const element = htl.html`<div>I am a silly view!</div>`;
element.value = "I am a silly value.";
return element;
}
Insert cell
silly
Insert cell
Insert cell
explicitView = Inputs.range([0,100])
Insert cell
explicitValue = Generators.input(explicitView)
Insert cell
Insert cell
md `The value of *x* is ${viewof x.value}.`
Insert cell
Insert cell
viewof count = {
const element = html`<div style="display: inline-block; font-size: 64px; user-select: none;">🤪</div>`;
element.value = 0;
element.onmousedown = () => {
element.style.transition = "none";
element.style.transform = `scale(1.5) rotate(${Math.random() * 90 - 45}deg)`;
};
element.onclick = () => {
++element.value;
element.dispatchEvent(new Event("input", {bubbles: true}));
requestAnimationFrame(() => {
element.style.transition = "transform 250ms ease";
element.style.transform = "inherit";
});
};
return element;
}
Insert cell
count
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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