Published
Edited
Dec 31, 2021
Importers
37 stars
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

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