Published
Edited
Jan 24, 2021
1 fork
Importers
1 star
Utilities
SVG Utilities
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

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