Code Monkey home page Code Monkey logo

d3-weighted-voronoi's Issues

why is index == 0 for all cells?

Two questions about the cell<->site correspondance

  1. How can I easily get all points that have no matching cell? In the classic (non-weighted) voronoi, all cells are returned in the same order as the points, but here it seems different.

  2. In https://observablehq.com/d/128a52368e482305 I can see that for all cells we have cell.site.index == 0. Is this expected?

"Cannot read property 'x' of null" with identical sites (same locations, same weights)

2 sites with the same x, y and weight raise a "Cannot read property 'x' of null".

stackTrace:
Uncaught TypeError: Cannot read property 'x' of null
at dot (VM2965 d3-weighted-voronoi.js:16)
at Face.orient (VM2965 d3-weighted-voronoi.js:399)
at ConvexHull.prep (VM2965 d3-weighted-voronoi.js:531)
at ConvexHull.compute (VM2965 d3-weighted-voronoi.js:635)
at computePowerDiagramIntegrated (VM2965 d3-weighted-voronoi.js:792)
at _weightedVoronoi (VM2965 d3-weighted-voronoi.js:876)
at computeAllCells (blob:http://blockbuilder.org/7558f499-9ca0-4287-9051-82ab1eb0ca1e:345)
at blob:http://blockbuilder.org/7558f499-9ca0-4287-9051-82ab1eb0ca1e:335

data:
[{x:halfWidth, y:halfHeight, weight: 0},
{x:halfWidth, y:halfHeight, weight: 0}]

I get an infinite loop in ConvexHull.prototype.compute

next.conflicts.isEmpty() is false, so current is not increased
this.visible[jF].getHorizon() is null
this.horizon.length is 0
first and last are null
this.created.length is 0, so current is not increased

repeat...

Input to _weightedVoronoi :

[[0.3,-1.5,1.7542563288623765],[-0.3,-1.5,1.7542563288623765],[0.3,-0.8999999999999999,1.7542563288623765],[-0.3,-0.8999999999999999,1.7542563288623765],[-0.3,-0.3,1.7542563288623765],[-0.8999999999999999,-0.8999999999999999,1.7542563288623765],[0.8999999999999999,-1.5,1.7542563288623765],[-0.8999999999999999,-1.5,1.7542563288623765]]

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.