Nivo: No Delaunay triangulation exists for this input

Created on 14 May 2019  Â·  18Comments  Â·  Source: plouc/nivo

https://codesandbox.io/s/k3ml29nv2r?fontsize=14

I am keep getting No Delaunay triangulation exists for this input for my data. Is it because my data size is too small?

I have looked at
https://github.com/d3/d3-delaunay/issues/19
https://github.com/d3/d3-delaunay/issues/20
https://github.com/plouc/nivo/issues/400

but there doesn't seem to be much explanation to the issue. How do I avoid this error?

bug voronoi

Most helpful comment

@plouc Is there are fix for same data values? I just need to produce a straight line via the line chart. See this for example: https://codesandbox.io/s/nivoline-triangulation-issue-llvjd

All 18 comments

The codesandbox link is just a basic example without any nivo chart, can you please check?

@plouc oh sorry must have forgotten to save. Does it work now?

https://codesandbox.io/s/k3ml29nv2r?fontsize=14

@serendipity1004, it's OK now, I've got the same error, but the error has nothing to do with d3-delaunay, you didn't provided the required data format, that's why it throws, please have a look at the documentation about the data property.

Oh Bummer... you are right I'm sorry. Should pull my eyes out

However this error could happen, for example if you have a single line which ends up being a straight line (collinear)

@plouc got it

@plouc so what should we do if the data is singular or in a straight line?

I'm trying to display a one line line graph from a data source that may produce a straight line, or has only a single value (which also triggers this error.)

Unfortunately, nothing if using a voronoi overlay, I rely on d3-delaunay to compute the mesh and the math involved to compute it is beyond my knowledge…
Another option could be to allow to use the line points to detect events.

I'd be fine with line points for event detection. Frankly while the voronoi overlay method is really cool, I'm not sure they'll ever support empty or single value data and waiting for collinear to be fixed only solves part of the problem.

For any future visitors that get this issue here's the short.

If useMesh is enabled -- which is used to facilitate event handling (like hovering) -- and your data is either empty, a single value, or a set of values that produces a straight line; the graph will fail to render throwing the error in the topic.

@noetix, coincident points can also be problematic

empty, single value and coincident points could be fixed directly in nivo, skipping mesh computation for empty dataset, always returning the single point and deduping the coincident points, however the collinear problem will remains.

@plouc @noetix would it be possible to detect the error type and if voronoi triagulation error occurs set useMesh to be false? If you can point me to right direction I could submit a pull request

It seems weird to silently change the way interactions are captured.
What I had in mind was trying to fix things directly inside nivo:

  • replacing the implementation if there's a single point, always returning it and returning a rect covering the whole surface instead of the voronoi cell
  • ensuring x/y coordinates are uniques amongst the whole set of points

This work should be done inside the voronoi package.

I guess the collinear input problem will be fixed directly inside d3-delaunay at some point :)

@plouc Is there are fix for same data values? I just need to produce a straight line via the line chart. See this for example: https://codesandbox.io/s/nivoline-triangulation-issue-llvjd

Hi there, sorry for the delay, I'm aware that this issue could have been quite annoying… it has been fixed by https://github.com/plouc/nivo/pull/640 and the fix will be released soon, please let me know if you still have problem with this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tj picture tj  Â·  4Comments

dubzzz picture dubzzz  Â·  3Comments

vagnervst picture vagnervst  Â·  4Comments

Haaziq-Uvais picture Haaziq-Uvais  Â·  3Comments

p45mark picture p45mark  Â·  3Comments