Published
Edited
Sep 30, 2020
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md `
One can make this super advanced. Matthew Bloch has an [example](https://youtu.be/X-CGAS4YaPA?t=958) of how he uses Makefiles with mapshaper:

\`\`\`
map:
mapshaper countyp010.shp name=counties \
-filter 'STATE_FIPS < 72' \
-filter 'COUNTY != ""' \
-dissolve FIPS copy-fields=STATE \
-simplify 2% \
-proj albersusa \
-points inner + name=points \
-i 2012-president-general-counties.csv string-fields=fips name=data \
-filter-fields fips,votes,obama,romney \
-each 'margin = obama - romney' \
-each 'absmargin = Math.abs(margin)' \
-join target=points data keys=FIPS,fips \
-sort absmargin descending \
-svg-style r='Math.sqrt(absmargin) * 0.02' \
-svg-style opacity=0.5 fill='margin > 0 ? "#0061aa" : "#cc0000"' \
-lines STATE target=counties \
-svg-style stroke="#ddd" where='TYPE == "inner"' \
-svg-style stroke="#777" where='TYPE == "outer"' \
-svg-style stroke="#999" where='TYPE == "STATE"' \
-o map.svg target=counties,points
\`\`\`
`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require('d3')
Insert cell
topojson = require('topojson')
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