Search code examples
d3.jstopojson

Topojson missing outside boundaries


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");

Solution

  • 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");