Public
Edited
Feb 16, 2024
3 stars
Insert cell
Insert cell
Insert cell
{
viz.tool.addfonts([
{
fontFamily: "Varela Round",
url: await FileAttachment("VarelaRound-Regular.ttf").url()
}
]);
let svg = viz.create({
projection: d3.geoMercator(),
domain: paris,
margin: [55, 20, 25, 20],
fontFamily: "Varela Round"
});

viz.tile(svg, {
url: (x, y, z) =>
`https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/${z}/${y}/${x}.png`,
opacity: 0.5,
increasetilesize: 0.3
});
viz.path(svg, {
datum: paris,
fill: "black",
fillOpacity: 0.7,
stroke: "none",
filter: svg.effect.blur({ stdDeviation: 3 }),
transform: "translate(4,4)"
});
viz.effect.clipPath(svg, { datum: paris, id: "clipparis" });
viz.tile(svg, {
url: (x, y, z) =>
`https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/${z}/${y}/${x}.png`,
clipPath: svg.effect.clipPath({ datum: paris })
});

let dots = viz.tool.dodge(ChargingPoints, {
projection: svg.projection,
r: 2,
gap: 1
});

viz.circle(svg, {
coords: "svg",
data: dots,
r: 2,
fill: "yellow",
stroke: "none",
strokeWidth: 0
});

viz.scalebar(svg, { pos: [20, svg.height - 40] });
viz.header(svg, {
text: "Charging points for electric vehicles in Paris"
});
viz.footer(svg, {
text: "Nicolas LAMBERT, 2023 - Sources: arcgisonline.com, 2023 & Paris Data, 2023",
textAnchor: "end"
});
return svg.render();
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

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