Published
Edited
Dec 31, 2021
Importers
37 stars
Also listed in…
Widgets and helpers
Insert cell
Insert cell
Insert cell
width_between_600_and_1000px = matchMedia('(min-width: 600px) and (max-width: 1000px)')
Insert cell
// View on a touch device (or enable the device toolbar in your browser's dev tools) to set to false
has_fine_pointer = matchMedia('(any-pointer: fine)')
Insert cell
// Click the button below to set the notebook iframe to fullscreen. Note that editors are not included.
is_fullscreen = matchMedia('(display-mode: fullscreen)')
Insert cell
Insert cell
Insert cell
function matchMedia(query) {
return Generators.observe(notify => {
const list = window.matchMedia(query);
const onchange = e => { notify(e.matches) };
list.addEventListener('change', onchange);
notify(list.matches);
return () => list.removeEventListener('change', onchange);
});
}
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