nad-viewer: Drop nad-edge-infos from the SVG in adaptiveTextZoom mode at init#424
nad-viewer: Drop nad-edge-infos from the SVG in adaptiveTextZoom mode at init#424sBouzols wants to merge 5 commits into
adaptiveTextZoom mode at init#424Conversation
… mode it will be created from metadata even at init. Add a console warning if this kind of svg file is used with this mode Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
CBiasuzzi
left a comment
There was a problem hiding this comment.
Apparently, if the SVGhas already a nad-edge-infos, this fix creates a second nad-edge-infos (empty).
You can verify it, for example, if you reload the demo, without pan/zoom or anything, and look at the svg for the "Partial network with adaptive zoom" using some browser's dev tools
massimo-ferraro
left a comment
There was a problem hiding this comment.
Dropping the edge info section at the init is done because there could be some inconsistencies in the input SVG w.r.t. the metadata, or it's a first step toward having the adaptive zoom functionality create what is needed in the svg also when loading the page, instead of possibly getting it from the input svg content?
Oupsy you right. I would like to remove the existing |
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
…h_edgeInfos_at_init
CBiasuzzi
left a comment
There was a problem hiding this comment.
with the latest update in init, the section is not duplicated, anymore.
However, a comment about this change: first, it removes the existing nad-edge-infos; then, it recreates the section, appending it after the other existing sections. Still using the "Partial network with adaptive zoom" as an example:
these are the sections in the SVG file, in order:
- nad-vl-nodes
- nad-branch-edges
- nad-edge-infos
- nad-text-edges
- nad-text-nodes
these are the sections, after the updated init ran:
- nad-vl-nodes
- nad-branch-edges
- nad-text-edges
- nad-text-nodes
- nad-edge-infos
The effect is that with the original SVG, the text boxes are displayed above the other sections, while with the new init it's the edge-infos to be apparently at the top.
So far the nad-edge-infos section has always been in that position in the SVGs, and the adaptive zoom code has never actually removed and recreated it (it simply emptied it).
…h_edgeInfos_at_init
|
But the previous |
|
I just wanted to point out the potential issue of having different ordering for the edge-infos. The question is: is it actually a problem for a client using the viewer? |
|
This version below should keep the order of the three sections as it was intended. |



Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
If we use a SVG file containing
nad-edge-infosat initialisation with theadaptiveTextZoommode then edgeInfos aren't written from metadata nor updated from it (no classes added etc...).Note: This is not the common case, but could happen in the demo app for example
What is the new behavior (if this is a feature change)?
Drop nad-edge-infos from the SVG in adaptiveTextZoom mode it will be created from metadata even at init.
Add a console warning if this kind of svg file is used with this mode
Does this PR introduce a breaking change or deprecate an API?