score:1

i managed to solve the problem and it was easier than i thought. the solution was to first calculate the bounding area of china then to draw the map there. here are some code:

var projectionchina = d3.geomercator();
var pathchina = d3.geopath(projection);

g.append("g")
  .attr("class", "china")
  .attr("width", boundingarea.width)
  .attr("height", boundingarea.height)
  .selectall("path")
    .data(data.geometries)
  .enter().append("path")
    .attr("d", pathchina);

where boundingarea is the rectangle that encapsulates the chinese border.

hope this helps some one with the same problem.


Related Query