0
votes

When rendering my topojson, I'm missing the outside boundaries of the states.

For example, my view of the south looks like this:

enter image description here

Instead, I need all outside boundaries filled.

My style for the map is as follows:

.state-boundary {
        stroke: #00001d;
        stroke-width: .5px;
        fill: white;
        stroke-linejoin: round;
        stroke-linecap: round;
      }

The geojson looks as follows prior to conversion to topojson: enter image description here

My d3 is as follows:

svg.append("path")
        .datum(topojson.mesh(topology, topology.objects.south, function(a, b) { return a !== b; }))
        .attr("d", path)
        .attr("class", "state-boundary");
1
How do you render your topojson? What library are you using? - Falk Schuetzenmeister
D3 in the browser. I made the Topojson file with the topojson command line util. - Union find
You cannot use mesh on this. Mesh is used when you just want to have the inner boundaries. For all you need to use topojson.feature. - kwoxer

1 Answers

0
votes

So, it was just a matter of changing the mesh method. I don't really understand the difference, so maybe someone can chime in:

svg.append("path")
        .datum(topojson.mesh(topology, topology.objects.south))
        .attr("d", path)
        .attr("class", "state-boundary");