Published
Edited
May 25, 2020
Importers
Insert cell
Insert cell
Insert cell
Insert cell
viewof data = new NonRepeatingView({love:true,peace:false,understanding:false})
Insert cell
Insert cell
bind(form(html`<form>
<input name='love' type='checkbox' ${data.love?'checked':''}>love<br>
<input name='peace' type='checkbox' ${data.peace?'checked':''}>peace<br>
<input name='understanding' type='checkbox' ${data.understanding?'checked':''}>understanding<br>
${button(!(data.love && data.peace && data.understanding))}
</form>`),viewof data)

Insert cell
Insert cell
data
Insert cell
Insert cell
button = newval => {
const button = html`<button>${newval?'all':'none'}</button>`;
button.onclick = () => {viewof data.value = {love:newval,peace:newval,understanding:newval}};
return button
};
Insert cell
Insert cell
Insert cell
Insert cell
_ = require('lodash')
Insert cell
import {bind} from '@mbostock/synchronized-views'
Insert cell
import {form} from '@mbostock/form-input'
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