Now this is working perfectly fine when using default renderer.
But when using svg renderer duplicate node elements are created every time on mouseEnter and mouseLeave.
I think this has something to do with node shadow because on commenting out part.isShadowed line from code, duplicate nodes are not created.
thanks @walter one more issue with svg width
I have a collapsible panel and a gojs diagram placed next to one another.
when I collapse the panel the svg width increases which is fine.
But when I expand the panel back the svg width doesn’t decrease back to original.
This results in horizontal scrolling on the screen.
When svg renderer is disabled, the canvas width increases and decreases as expected.
This is unrelated to the bug, but note that shadowBlur cannot be null, and neither can shadowColor. And rather than allocate points unnecessarily, it might be best to keep the point as (0,2) if you are only toggling the shadow on/off. So I’d suggest:
Thanks @simon the duplicate nodes issue is fixed. But the svg width change issue mentioned above is still present.
One more issue that I see is that there’re these empty clipPath elements that gets created every time I hover a node or change the node data array.
When I change renderer to default things are working as expected.
But when using svg renderer expand/collapse is not working as expected, which I think is because of the svg width.
In your real-world use case, does setting the Diagram’s main SVG element to position:absolute fix the issue? You could write:
// after diagram init
myDiagram.div.lastChild.style.position = 'absolute';
Or in the CSS something like:
#myDiagramDiv SVG {
position: absolute;
}
We will add this to the library regardless (the canvas is already position: absolute and we want them to work identically), I just want to be sure its the only thing that’s wrong, here.
@simon while using version 2.3.17 with svg renderer enabled, I’m now not able to add shadows. It’s working fine with svg renderer disabled. Can you please check it?