Published
Edited
Nov 15, 2021
2 stars
Insert cell
# #30DayMapChallenge - Line & OSM
Insert cell
## Non-Vehicle Routes in Paris
Insert cell
map = {
const svg = d3
.create("svg")
.attr("viewBox", [0, 0, width, height])
.style("width", "100%")
.style("height", "auto")
.style("background", "white");
const g = svg.append('g')
g.append("path")
.datum(route_paris)
.attr("fill", "none")
.attr("stroke", "green")
.attr("stroke-width", 0.5)
.attr("d", path);
g.append("path")
.datum(departements)
.attr("fill", "none")
.attr("stroke", "#525861")
.attr("stroke-width", 1.2)
.attr("d", path);

g.append("path")
.datum(arrondissements)
.attr("fill", "none")
.attr("stroke", "#525861")
.attr("stroke-width", 0.9)
.attr("d", path);

return svg.node()
}
Insert cell
height = 700
Insert cell
projection = d3
.geoMercator()
.scale(Math.pow(2, 20.5) / (2 * Math.PI))
.translate([width / 2, height / 2])
.center(coords)
Insert cell
path = d3.geoPath(projection)
Insert cell
import {departements,arrondissements } from '@neocartocnrs/bars-pubs-in-paris'
Insert cell
route_paris = FileAttachment("route_paris.json").json()
Insert cell
import {coords} from '@mydu/30dmc-data'
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