create convex hulls around circles in a motion chart

30 views
Skip to first unread message

Tomas Jedno

unread,
Aug 26, 2015, 7:11:08 AM8/26/15
to d3-js

I would like to create convex hulls around circles according to their type (color). Here is the jsfiddle with a simple motion chart:


http://jsfiddle.net/msm6qxoe/12/


There are six circles of two types ("Blue" and "Green"). As the result, two convex hulls should be drawn around both triplets during the whole animation.

I already group data according to type and create two paths, but I don't know how to input circle positions to d3.geom.hull function correctly to fill their d attribute.


hull.datum(d3.geom.hull(XXX)).attr("d", function(d) { return "M" + d.join("L") + "Z"; });

Thanks in advance for any guidance.

Tomas Jedno

unread,
Aug 30, 2015, 4:55:13 AM8/30/15
to d3-js
OK, I made some progress. I already have two paths, but both surround all circles: jsfiddle.net/rqk5jj75

Dne středa 26. srpna 2015 13:11:08 UTC+2 Tomas Jedno napsal(a):
Reply all
Reply to author
Forward
0 new messages