I'm using D3.js to draw some SVG shapes. When the shapes overlap, I would like to either dilate or erode the parent/child shapes accordingly to get rid of overlap.
However, these shapes only have a stroke outline, no fill.
There are several examples that use the native SVG filters to achieve this effect, but they all rely on shapes having a fill color.
When I set fill="none"
for erode filter, the shape disappears. When I do so for the dilate filter, I am left with a shape with a big stroke-width. I just want a static shape stroke (with transparent fill or no fill).
Here's my JSFiddle. https://jsfiddle.net/programmingprincess/2q3zd0o5/4/
The red/blue/green shape on the left would be perfect IF the blue shape had an empty fill, and only the blue outline. In the JS Fiddle, they use the green to create a "mocked" blue stroke.
The two shapes to the right show what happens when I mess with the stroke and fill values for the green shape.