Published
Edited
Feb 21, 2020
Insert cell
Insert cell
viewof value = html`<select><option value="one">one</option><option value="two">two</option></select>`
Insert cell
cloakedValue = value
Insert cell
eventDispatcher = {
let ev = new Event('select-value')
ev.value = value
window.dispatchEvent(ev)
return html`<h1>Don't forget to include the eventDispatcher which will have to be hidden for now</h1>`
}
Insert cell
hiddenEventDispatcher = {
let ev = new Event('select-value')
ev.value = value
window.dispatchEvent(ev)
return html`<h1 style="display: none">Don't forget to include the eventDispatcher which will have to be hidden for now</h1>`
}
Insert cell
mightWorkAsWell = {
let ev = new Event('select-value')
ev.value = value
window.dispatchEvent(ev)
return value
}
Insert cell
{
window.addEventListener('select-value', ev => console.log('ev.value', ev.value))
}
Insert cell
Insert cell
cell2incomponent2 = md`## This is coming from ObservableHQ, Cell 2 in Component 2`
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