Public
Edited
Jul 17, 2023
Paused
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof pixelEstate = Inputs.input(probe())
Insert cell
Insert cell
pixelEstate
Insert cell
Insert cell
Insert cell
onOrientationChange = screen.orientation && (window.onresize = snoop)
Insert cell
probe = () =>
((mode = ["portrait", "landscape"][+(screen.width > screen.height)]) =>
Object.freeze(
Object.assign(
{
color: query.matches,
depth: screen.colorDepth,
mode
},
/\blandscape\b/i.test(mode)
? {
width: Math.max(screen.availHeight, screen.availWidth),
height: Math.min(screen.availHeight, screen.availWidth)
}
: {
width: screen.availWidth,
height: screen.availHeight
}
)
))(screen.orientation?.type)
Insert cell
query = window.matchMedia("(min-color: 8)")
Insert cell
query.addListener
? query.addListener(snoop)
: query.addEventListener("change", snoop)
Insert cell
snoop = (e) =>
((input) => (
(input.value = probe()),
input.dispatchEvent(new Event("input", { bubbles: true }))
))(viewof pixelEstate)
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