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

241
Views
TopoJSON arcs is undefined, coordinates is undefined, o is undefined

I am very new to d3 and topojson and I am trying to render a map of the UK to overlay some data onto later. I have taken a topojson file from an online repository which is clearly fine since GitHub can render it. I am running this in a view specific json file for rails with d3 and topojson installed using webpacker.

I am currently importing d3, topojson and the uk map json file:

import * as d3 from 'd3';
import * as topojson from 'topojson';
import * as uk from './uk.json';

Then I try to draw the map:

let svg = d3.select('#geo-plot');
let feature = topojson.feature(uk, uk.objects.GBR_adm2);
svg.append("g")
        .selectAll("path")
        .data(feature)
        .join("path")
        .attr("fill", "#ed87c8")
        .attr("stroke", "white")
        .attr("stroke-width", 0.4)
        .attr("d", d3.geoPath(d3.geoMercator()));

I get the error arcs is undefined while running topology.feature(...)

If I pass uk.objects.GBR_adm2.geometries to feature is of type Feature but has no geometries.

I have a degree of success when passing uk.objects.GBR_adm2.geometries to .data() directly but I get the error coordinates is undefined.

If I pass uk.objects.GBR_adm2 or uk.objects to .data(), nothing happens and I get no error.

I have tried all of these steps with another map and had the exact same outcome

I am trying to follow online tutorials but nobody seems to be running into these problems. Any help or advice is much appreciated.

Thanks a lot

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!