import { select, json, csv, geoPath, geoAlbersUsa, geoMercator, scaleOrdinal, schemeCategory10, } from 'd3'; import { feature, mesh } from 'topojson'; const svg = select('svg'); const projection = geoAlbersUsa(); const pathGenerator = geoPath().projection(projection); const csvFile = csv(''); const colorScale = scaleOrdinal(schemeCategory10); json( 'https://cdn.jsdelivr.net/npm/us-atlas@3.0.0/counties-10m.json', ).then((data) => { const counties = feature(data, data.objects.states); console.log(counties.features); console.log(data.objects); svg .selectAll('path') .data(counties.features) .enter() .append('path') .attr('class', 'counties') .attr('fill', (d) => colorScale(d.properties.name)) .attr('d', (d) => pathGenerator(d)) .append('title') .text((d) => d.properties.name); });