I have to select SVG elements with a specific transform
attribute, knowing just a part of it. Let me better explain with an example.
These are the elements I'd like to select:
<g transform='matrix(96, 0, 0, -96, 217.04, 43.052)'></g>
<g transform='matrix(96, 0, 0, -96, 317.04 53.052)'></g>
<g transform='matrix(96, 0, 0, -96, 417.04, 63.052)'></g>
<g transform='matrix(96, 0, 0, -96, 517.04, 73.052)'></g>
<g transform='matrix(96, 0, 0, -96, 617.04, 83.052)'></g>
I want to select them all and (initially) using something like the code below did sound like a good idea:
d3.selectAll("g").filter("[transform='matrix(96, 0, 0, -96)]'");
The problem is that, obliviously, the selection is returned as empty and I am wondering how can I tell to d3 to select just those <g>
elements with a match on the first 4 parameters of the transform attribute.