Published
Edited
Jan 24, 2021
1 fork
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
withBackground(
grid(
[0, 1, 2, 3].map(
() =>
svg`<svg width=100 height=50><rect width=100% height=100% fill="blue"/></svg>`
)
)
)
Insert cell
{
let colors = Array(256)
.fill()
.map((_, i) => `rgb(${i},128,128)`);
let swatches = colors.map(
color =>
svg`<svg width=15 height=10><rect width=100% height=100% fill="${color}"/></svg>`
);
return grid(swatches, { width: width / 2, padding: 2 });
}
Insert cell
Insert cell
Insert cell
hcat([
svg`<svg width="50" height="100"><rect width=100% height=100% fill="blue"/></svg>`,
svg`<svg width="100" height="50"><rect width=100% height=100% fill="green"/></svg>`
])
Insert cell
hcat([
svg`<svg width="50" height="100"><rect width=100% height=100% fill="blue"/></svg>`,
svg`<svg width="100" height="50"><rect width=100% height=100% fill="green"/></svg>`
], {valign: 0.5})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
withBackground(
svg`<svg width="50" height="100"><ellipse cx=50% cy=50% rx=20 ry=45 stroke="lightblue" stroke-width="10"/></svg>`,
{ padding: 5 }
)
Insert cell
Insert cell
Insert cell
withLegend(
svg`<svg width="100" height="100"><rect width="100%" height="100%"/></svg>`,
"label px"
)
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