Comments (4)
Yep. This is almost certainly a bug in clipping because the points on the graticule exactly fall on the clip circle. It goes away if you change the clip angle to 60.0001°, for example.
FYI, I probably won’t be able to fix this bug and #55 anytime soon, since it would require a much deeper understanding of Jason’s geographic clipping code than I currently have.
from d3-geo.
In intersect(a,b,two)
there is the possibility to return;
, which makes point2 = undefined
on lines 15090 and 15102 of the current d3.v4 build and throws the error.
Either intersect
should never return undefined
, or we must check that point2
is defined in those lines. With both solutions the graticule does display correctly.
Note that, when I log the value of t2 = w * w - uu * (cartesianDot(A, A) - 1);
when the bug happens, it is ~ - 1e-16
. Adding some epsilon to this determinant computation when it is negative seems like a possible solution:
- if (t2 < 0) return;
+ if (t2 < 0 && (t2 += epsilon) && t2 < 0) return;
from d3-geo.
My understanding of the code is that this test on t2 < 0
is here only to avoid throwing an error on the next sqrt
because of a rounding error. There is no case where this is "really" negative.
The test can be replaced instead by:
var t = sqrt$1(Math.max(t2, 0));
The test was introduced in d3/d3@d93f45e .
Side note: there is an utf8 ⨯
in one of the comments.
from d3-geo.
Amazingly I couldn't reproduce this bug anymore on any newer browser (Firefox, Safari Chrome). However, launching an old copy of "Brave.app" that hadn't updated, the bug was reproducible. Fixed by #91
from d3-geo.
Related Issues (20)
- How can I clamp a geodesic to between a max/min latitude? HOT 1
- fit-test.js Remove duplicate test HOT 1
- Geojson to SVG offset HOT 1
- Geojson to SVG offset
- Cannot import d3-geo in node with typescript HOT 8
- Geographic or Geodetic HOT 1
- D3 uses GeoJSON to represent geographic features in JavaScript HOT 2
- postclip with polygon path maybe... HOT 10
- Error [ERR_REQUIRE_ESM]: Must use import to load ES Module / require() of ES modules is not supported HOT 2
- geoAzimuthalEqualArea not rendering straight lines HOT 2
- clipCircle's precision is too low
- Configurable precision for d3.geoPath
- Mercator. Getting boundary values by longitude HOT 2
- Mercator with rotate. Incorrect conversion from projection to geographic coordinates HOT 3
- Сonvert geographic points considering antimeridian and pole HOT 1
- geoContains function doesn't seem to handle MultiPolygons HOT 9
- path.bounds should return numbers even when input coordinates are strings
- [Question] API for chekcing if point is in view or not given projection HOT 3
- Mercator Map centered on the Pacific HOT 1
- geoCircle produces an open LinearRing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-geo.