D3.JS - An open source JS library for Data Visualization
A Choropleth map is a map that encodes data using colour of a region.It is a a simple vector map using SVG https://gist.githubusercontent.com/AngelMathew/cba118c19f4956c8b9cde568fae6e517/raw/map.json
.
npm install d3
To render world map geographical data is needed, in the form of GeoJSON
or TopoJSON
GeoJSON : A JSON based format to interchange geographic data.Due to high precision canβt stream for web
TopoJSON : An extension of geoJSON, contains geospatial data and attribute data.
What kind of projection is needed to visualize data on the page has to be specified, the one used in the code is geoMercator
which is like a flat projection.
Geographic Path Generators generates an SVG path data with a given feature object.
https://github.com/d3/d3-geo-projection
Source code
https://github.com/AngelMathew/choroplethMap.git