Public
Edited
Jan 25, 2024
1 fork
Importers
Insert cell
Insert cell
viewof mapView = createMap({
getData: (d) => Math.random() * 2,
colorScale
})
Insert cell
viewof mapView.update({
isHighlighted: (d) => d.ART_C === 17 && d.GEBIET_C === "D052D092",
isSelected: (d) => d.ART_C === 17 && d.GEBIET_C === "A001",
getSymbol: () => d3.symbol().type(d3.symbolCircle),
getSymbolColor: () => "#D40053"
})
Insert cell
strokeColor = "#fff"
Insert cell
strokeColorHighlighted = "#000"
Insert cell
Select a data source…
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mapGeoJSON = d3.json(
"https://www.web.statistik.zh.ch/geodaten_visualisierungen/VIS_OS_Schulgemeinden_GEN_F_KTZH/VIS_OS_Schulgemeinden_GEN_F_KTZH_2023_01_01_union.json"
)
Insert cell
Select a data source…
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
projection = d3 // When a GeoJSON is encoded in WGS84 planar coordinates, and you need to project it with D3
.geoMercator()
.fitExtent(mapExtent, mapGeoJSON)
Insert cell
path = d3.geoPath(projection)
Insert cell
height = Math.min(500, width * (584 / 464))
Insert cell
Select a data source…
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
mapExtent = [
// [100, 16],
[0, 0],
[width, height]
]
Insert cell
dropshadow = DOM.uid("dropshadow")
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