Note that there are some explanatory texts on larger screens.

plurals
  1. POTopojson v.0 to v.1 migration difficulties
    text
    copied!<p>I used recommendations by Mike Bostock on <a href="https://stackoverflow.com/questions/17404239/">Topojson: list of differences between v0 and v1?</a> to migrate my code from v0 to v1. </p> <ul> <li><a href="https://codio.io/hugolpz/D3-map/Topojson%20v0.html" rel="nofollow noreferrer">Topojson_v0</a> -- Working.</li> <li><a href="https://codio.io/hugolpz/D3-map/Topojson%20v1.html" rel="nofollow noreferrer">Topojson_v1</a> -- Labels of points are shut down.</li> </ul> <p>No other changes made.</p> <p>My data is <a href="https://codio.io/hugolpz/D3-map/data/adm/final_adms_France.json" rel="nofollow noreferrer">the same final_adms_France.json file</a>.</p> <p><strong>What is the issue ? How to make it work ?</strong></p> <hr> <p><strong>Comment:</strong> Seems I got an issue with :</p> <pre><code> .attr("transform", function(d) { return "translate(" + projection(d.coordinates) + ")"; }) </code></pre> <p>out of :</p> <pre><code>// Positioning: place-label svg.selectAll(".place-label") .data(topojson.object(fra, fra.objects.places).geometries) .enter().append("text") .attr("class", "place-label") .attr("transform", function(d) { return "translate(" + projection(d.coordinates) + ")"; }) .attr("dy", ".35em") .text(function(d) { if (d.properties.name!=="Paris"&amp;&amp;d.properties.name!=="Bremen"){return d.properties.name;} }) .attr("x", function(d) { return d.coordinates[0] &gt; -1 ? 6 : -6; }) .style("text-anchor", function(d) { return d.coordinates[0] &gt; -1 ? "start" : "end"; }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload