GithubHelp home page GithubHelp logo

Comments (8)

mourner avatar mourner commented on April 25, 2024

Hmm, maybe browser-specific? I'm seeing results for both in your notebook:

image

Are there any errors in the console?

from d3-delaunay.

chnn avatar chnn commented on April 25, 2024

Ah, great! I had not thought to try another browser.

I was using Firefox 59.0.2 on macOS. It throws no errors in the console.

from d3-delaunay.

mourner avatar mourner commented on April 25, 2024

When I replace the render line to this:

voronoi.render({moveTo: console.log, lineTo: console.log});

I see some weird huge values, which Firefox probably can't handle:

664.4831297076121 -31.1735912402529
672.3576712448785 -72.0304244992434
664.4831297076121 -31.1735912402529
680.819008033027 -16.631376838536138
633.5412543174806 393.00884225846926
23813793908081870 21199061956212450
121.41720113242671 -231.98418498812734
-26277289829606750 -23392068365475628
121.41720113242671 -231.98418498812734
154.39760765467472 -237.02142549637443
...

@mbostock I suspect this is some unhandled edge case in the clipping code?

from d3-delaunay.

mbostock avatar mbostock commented on April 25, 2024

Confirmed. If you zoom out in Chrome:

image

This is almost certainly caused by the collinear points, but I don’t know yet whether it’s a problem with the construction of the Delaunay hull or with Voronoi clipping.

from d3-delaunay.

mbostock avatar mbostock commented on April 25, 2024

The issue here is that because the points are (nearly) collinear, some of the circumcenters have huge coordinates. We’re not doing anything special to handle these huge coordinates in voronoi.render, but we probably should clip the line segments before rendering, as we do in voronoi.renderCell.

from d3-delaunay.

mbostock avatar mbostock commented on April 25, 2024

image

from d3-delaunay.

mbostock avatar mbostock commented on April 25, 2024

Unfortunately, it looks like voronoi.renderCell is still broken with this fix:

image

from d3-delaunay.

mbostock avatar mbostock commented on April 25, 2024

Made some progress, but now I’m stuck.

image

from d3-delaunay.

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.