0

Is there a way to select all circle with style visibility===visible? Something like this: svg.selectAll("circle").filter(function(d) { return this.style.visibility === 'visible'; })

Łukasz
  • 2,131
  • 1
  • 13
  • 28
bigcarp
  • 25
  • 5

1 Answers1

-1

You can use d3.selectAll to select all circle svgs (https://github.com/mbostock/d3/wiki/Selections#d3_selectAll).

This is going to return a 2 dimensional array. It's essentially an array containing arrays of what you selected. Assuming you have 25 circles:

circs = d3.selectAll("circle") // here circs may be [Array[25]]
circs = circs[0] //now circs is an array of circles

Now all you need to do is filter based on the computed style for that element. Check out this answer for how you'd do that :)

Community
  • 1
  • 1
akmodi
  • 1
  • 2