I couldn't find an answer to a (hopefully) very easy question. I use filtering like in this chord diagram example http://bl.ocks.org/mbostock/4062006:
.filter(function(d) { return d.source.index != i && d.target.index != i; })
What I need now is to filter only those connections with, let's say, an orange fill. Is there something like
.filter(style('fill') == 'orange')
that works? Any advice highly appreciated.
To search everything with fill = orange, you can do:
svg.selectAll('path[style = "fill: orange;"]')
If you want to limit the search to a particular element type, for example "rect", you can do:
svg.selectAll('rect[style = "fill: orange;"]')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With