Voronoi overlay on force layout

13 views
Skip to first unread message

Pierre Massat

unread,
Oct 19, 2016, 5:51:53 AM10/19/16
to d3...@googlegroups.com
Dear all,

I need a voronoi overlay on a force layout. The force is always hot, so the voronoi cells need to be updated on every tick. In addition to that, nodes keep being removed or added over time.

For now I got it to work by putting the whole data-join, enter, exit, update thing into my "tick" function. The data for my voronoi cells is my simulation.nodes(). So I keep binding new data at every tick.

Is there a more efficient way to do that ? I mean bind the data only when nodes are added and removed, and only update the paths of voronoi cells in the tick function ? For some reason I couldn't get this to work.

Thanks in advance,

Pierre.

Pierre Massat

unread,
Oct 19, 2016, 11:37:15 AM10/19/16
to d3-js
Nevermind, Voronoi was too slow anyway, so I used a quadtree to facilitate mouse interaction and it worked like a charm.
Reply all
Reply to author
Forward
0 new messages