block by rveciana 51cfe6249cf7de532000af68fb3b5183

d3CompositeProjections using the new d3js v5

Full Screen

This block shows how to use the d3-composite-projections with the version 5 of d3js.

The only change is the json request, that adds a then function instead of returning the data directly.

So this:

d3.json("malaysia.json", function(error, malaysia) {

Becomes this:

d3.json("malaysia.json").then(function(malaysia) {

The library works exactly the same way! Changes won’t bring the same job as in the v3 to v4.

index.html