Public
Edited
Jul 15, 2024
1 star
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
let svg = viz.create({ domain: aus, width: 600, margin: 20 });

// Filter definition
svg.effect.blur({ id: "blur", stdDeviation: stdDeviation });

// Layer display with filter
svg.path({ datum: aus, fill: "#38896F", filter: "url(#blur)" });

// Or directly
// svg.path({ datum: aus, fill: "#38896F", filter: svg.defs.blur({ stdDeviation: stdDeviation }) });

return svg.render();
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
let svg = viz.create({ domain: aus, width: 600, margin: 20 });

// Shadow Effect
svg.path({
datum: aus,
fill: "black",
fillOpacity: 0.6,
filter: svg.effect.shadow({
stdDeviation: stdDeviation2,
fill: "black",
fillOpacity: 0.7,
dx: dx,
dy: dy
})
});

// Australia
svg.path({ datum: aus, fill: "#38896F" });

return svg.render();
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
let svg = viz.create({ domain: aus, width: 600, margin: 20 });

svg.path({
datum: aus,
fill: svg.effect.radialGradient({
color1,
color2,
offset1,
offset2,
fx,
fy
})
});

return svg.render();
}
Insert cell
Insert cell
Insert cell
Insert cell
{
let svg = viz.create({
domain: aus,
width: 600,
margin: 20,
projection: "mercator"
});

// clip definition
const ausclip = svg.effect.clipPath({ datum: aus });

// Clipped tiles
svg.tile({ url: "worldStreet", clipPath: ausclip });

// Outline of australia
svg.path({ data: aus, fill: "none", stroke: "#38896F", strokeWidth: 1 });

return svg.render();
}
Insert cell
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