Public
Edited
Feb 22, 2024
2 forks
12 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
observeEvents = {
const lastEvent = new Mutable();
const input = viewof slider;

// remember to trigger dataflow on transaction
const transaction = (e) => {
lastEvent.value = e;
input.value = yMap.get('value')
input.dispatchEvent(new Event('input'))}

const setMap = (e) => {
if( e.isTrusted ) yMap.set('value', input.value )}
input.addEventListener('input', setMap);
yMap.observe(transaction)
invalidation.then(() => {
input.removeEventListener('input', setMap)
yMap.unobserve(transaction)})
return lastEvent.generator }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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