GithubHelp home page GithubHelp logo

Comments (4)

mbostock avatar mbostock commented on April 24, 2024

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.

Fil avatar Fil commented on April 24, 2024

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 intersectshould 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.

Fil avatar Fil commented on April 24, 2024

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.

Fil avatar Fil commented on April 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.