There appears to have been a recent change in how multiple browsers measure the "bounding box" of SVG elements.
This caused graph nodes to be measured much larger than the area they actually render to.
This messed with the graph because we feed these dimensions into GraphViz when creating the virtual graph causing the nodes in the virtual graph to be given too much space. An error which is subsequently translated to the SVG graph.
The changes in "bounding box" measurement appear to affect SVG Symbols and rotations.
This commit removes the use of SVG symbols (and their related "use" elements) and moves the rotation from the circle element to a group.
The use of SVG symbols made it easier for us to capture click events from behind the svgPanZoom layer.
Removing SVG symbols required changes to the way click events are captured in the graph. Note in SVG the click events land on graphical elements (i.e. children), not their containing groups (i.e. parents).
I think this will do it, it's also a simplification that uses fewer elements in the graph which is good. We will need to try this out with a bunch of different browsers, especially Safari as we previously encountered an issue with Safari calculating the rotation centre differently.
Things to test:
Opening / closing the command menu by clicking on icons in the graph view and elsewhere.
The progress animations rendering correctly in the graph view and elsewhere.
The graph layout fix itself.
Check List
[x] I have read CONTRIBUTING.md and added my name as a Code Contributor.
[x] Contains logically grouped changes (else tidy your branch by rebase).
[x] Does not contain off-topic changes (use other PRs for other changes).
[x] Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
[x] Please check the appearance of the generated component test screenshots by hand (these are not presently compared to known good output)
[x] CHANGES.md entry included if this is a change that can affect users
[x] Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
[x] If this is a bug fix, PR should be raised against the relevant ?.?.x branch.
I think this will do it, it's also a simplification that uses fewer elements in the graph which is good. We will need to try this out with a bunch of different browsers, especially Safari as we previously encountered an issue with Safari calculating the rotation centre differently.
Things to test:
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.