javascript - d3.js mouseover overlapping circles -
i trying solve problem overlapping circles larger circles prevent mouseover event on smaller ones. here have far demonstrate problem: http://bl.ocks.org/lilyc5459/raw/a35687613ab0f4991f37/
the code can found here: http://bl.ocks.org/lilyc5459/a35687613ab0f4991f37
any ideas how solve appreciated! thanks.
you should sort received data padeedits
field in descending order, bigger circles inserted before smaller , there won't overlapping more.
so modify code way:
... svg.selectall(".loading").remove(); // code block inserting data.sort(function(a,b) { if (a.pageedits > b.pageedits) return -1; if (a.pageedits < b.pageedits) return 1; return 0; }); // end of block svg.selectall("circle") .data(data) .enter() .append("circle") ...
Comments
Post a Comment