d3 / d3-delaunay

Compute the Voronoi diagram of a set of two-dimensional points.
https://d3js.org/d3-delaunay
ISC License
611 stars 57 forks source link

context.moveTo and context.lineTo implementation #133

Closed MLouis8 closed 3 years ago

MLouis8 commented 3 years ago

Hello, I'm using canvas.getContext('2d') as a context for displaying a voronoi diagram. But when I call voronoi.render([context]) the following error comes up : "TypeError: context.moveTo is not a function" How can I use d3-delaunay API without creating my own context ?

here is my code:

thanks

Fil commented 3 years ago

try voronoi.render(context) without brackets (the brackets indicate that the context is optional).