Published
Edited
Feb 10, 2021
1 fork
5 stars
Insert cell
Insert cell
Insert cell
Insert cell
n_col = Math.floor(width / cell_size)
Insert cell
n_row = Math.ceil(projections.length / n_col)
Insert cell
height = n_row * cell_size
Insert cell
Insert cell
path_data = topojson.mesh(shapefile)
Insert cell
import { projections } from "@d3/projection-transitions"
Insert cell
d3 = require("d3", "d3-geo@2", "d3-geo-projection@3")
Insert cell
// Load shapefile
shapefile = d3.json(
"https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json"
)
Insert cell
topojson = require("topojson-client@3")
Insert cell
import { Button, Range } from "@observablehq/inputs"
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