Published
Edited
Jul 8, 2020
1 fork
Insert cell
md`# MAP`
Insert cell
Insert cell
Insert cell
Insert cell
md`### Pop100`
Insert cell
countriesPop = countriesValue.map(x => ({
country: x.key,
pop: parseInt(x.values[0].popData2019)
}))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md`### Funktions`
Insert cell
Insert cell
Insert cell
md`#### Style`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md`#### Data preparing`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// transforms latitudes and longitudes on the surface of a sphere into positions on a plane.
projection = d3
.geoNaturalEarth1() //The Natural Earth projection.
.rotate([0, 0]) // rotate the sphere
.precision(0.1) // set the precision for the graticule (default 2,5)
.fitSize([width, height], { type: "Sphere" }) //dynamically fitting a d3 topojson map to a resizeable container
Insert cell
Insert cell
path = d3.geoPath().projection(projection)
Insert cell
Insert cell
height = width <= 500 ? Math.round(width / 1.3) : Math.round(width / 1.8)
Insert cell
Insert cell
md`### Appendix`
Insert cell
d3 = require('d3')
Insert cell
curve = d3.curveLinear
Insert cell
import { Scrubber } from "@mbostock/scrubber"
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