Skip to main content

Questions tagged [d3-geo]

The tag has no usage guidance.

1 vote
1 answer
51 views

Why doesn't d3 like this GeoJSON file?

Does anyone have any idea why D3 is failing to render the following GeoJSON? <!DOCTYPE html> <meta charset="utf-8"> <body> <svg width="960" height="720"></svg> &...
jbeard4's user avatar
  • 12.8k
1 vote
1 answer
91 views

D3 globe with country names label layer

I'm struggling to find any example of a D3 globe (or Globe-gl etc.) that has country names as a label layer. I'm essentially looking for this demo https://observablehq.com/@michael-keith/draggable-...
Alexander Huber's user avatar
5 votes
1 answer
97 views

How do I update a d3 projection to match zoom transform?

This is my zoom handler for my map: const zoom = d3.zoom() .scaleExtent([1,25]) .translateExtent([[width * -0.5, height * -0.5], [width * 1.5,height*1.5]]) .on('zoom', (ev) => { ...
digitalWestie's user avatar
0 votes
0 answers
23 views

How can I animate scale and rotation of d3-geo projection at the same time with different durations and ease functions?

The title is pretty descriptive of my question. I'm trying to find the most idiomatic/easy way to animate the scale and rotation property of a d3-geo projection (https://d3js.org/d3-geo/projection). I'...
trumanf_'s user avatar
1 vote
0 answers
26 views

What could explain this apparent slowdown on Firefox when using d3-geo projections with React.js?

I'm completely stumped by this, so please let me know if I should tag this differently or post elsewhere - also please let me know if you need more information. I'm working on a project using React ...
trumanf_'s user avatar
0 votes
0 answers
19 views

d3-geo: Is there a way to not show the division between territories spanning 180/-180 degrees of longitude?

The question from the title. I'm running a code with D3-geo, Miller projection with .rotate([-10, 0]);, so The US would be on the left side of the map, and Russia entirely on the right side. However, ...
cezarlamann's user avatar
  • 1,493
0 votes
0 answers
41 views

D3: How to 'rotate' background texture along with the projection

I am building a spinning globe with D3 with a image texture. I have built the globe and spinning it using this.projection = d3.geoOrthographic() .fitExtent([[this.inset, ...
Jagan Veeraraghavan's user avatar
2 votes
0 answers
63 views

d3-geo coordinate in feature always returning true

I have a geojson file defined, and I am checking to see whether a coordinate is in the given feature inside that geojson file. No matter what coordinate I plug in to the d3.geocontains() function, ...
nickcoding2's user avatar
1 vote
0 answers
110 views

Path elements outside svg [d3-geo, topojson]

I made a choropleth map for freecodecamp project. https://codepen.io/prewol/pen/rNvxGZy the g elements start outside the svg parent .graphCont { margin: auto; background-color: beige; box-...
P W's user avatar
  • 11
0 votes
0 answers
202 views

D3 path not showing

I am trying to make some features from a .geojson file render using D3 and D3geo and i am following this https://www.d3indepth.com/geographic/ as a guide. I don't really know what i am doing since i ...
Kris Biturku's user avatar
0 votes
1 answer
472 views

Simplifying a GeoJson FeatureCollection using mapshaper causes issues

More specifically, it causes the same code to render an outline on the map, and only recognizes the last path element when using pointer events. I simplified a continents.json file on mapshaper using ...
Mason Clark's user avatar
5 votes
2 answers
961 views

Can't import d3-geo package into Node.js TypeScript project

I'm trying to create code to test whether specific latitude/longitude coordinates can be found within various GeoJSON Features. If I do this: import d3 from 'd3-geo'; // or: import * as d3 from 'd3-...
kshetline's user avatar
  • 13.3k