Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
Coropletas que no se muestran

Estoy trabajando en un proyecto en d3.js y parece que no puedo hacer que mi mapa funcione. Cada vez que lo ejecuto no hay errores de sintaxis, pero solo hay una pantalla en blanco. Aquí está el código:

 <svg id="my_dataviz" width="1000" height="1000"></svg> <script> // The svg var svg = d3.select("svg"), width = +svg.attr("width"), height = +svg.attr("height"); // Map and projection var path = d3.geoPath(); var projection = d3.geoMercator() .scale(10000) .center([30, -85]) .translate([width / 2, height / 2]); // Data and color scale var data = d3.map(); var colorScale = d3.scaleThreshold() .domain([-5000, -3000, -1000, 1000, 3000, 5000]) .range(d3.schemeReds[7]); // Load external data and boot d3.queue() .defer(d3.json, "G2.geojson") .defer(d3.csv, "ps.csv", function(d) { data.set(d.GEOID20, +d.PRE_SC); }) .await(ready); function ready(error, topo) { // Draw the map svg.append("g") .selectAll("path") .data(topo.features) .enter() .append("path") // draw each country .attr("d", d3.geoPath() .projection(projection) ) // set the color of each country .attr("fill", function (d) { d.total = data.get(d.id) || 0; return colorScale(d.total); }); } </script> </body> </html>

Me aseguré de que mi proyección fuera WGS 84. Si tengo algún error en el código, ¡házmelo saber! ¡Gracias a todos!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!