I have modified the force-multi-foci example to add a convex hull around each cluster of nodes.
I achieved this by using d3.nest() to create a new dataset of clusters containing the nodes in each cluster. Then in the tick() method I create and update the path element for each cluster in this dataset.
Modified http://mbostock.github.com/d3/d3.js?2.9.2 to a secure url
https://mbostock.github.com/d3/d3.js?2.9.2