Closed flo-dup closed 2 months ago
Note that the POC was also using the classes of SVG objects to move them. With glued / stretchable classes, see powsybl/powsybl-diagram#459, which allows to identify the part which should remain at fixed distance of the moved node / of its neighbours. This mechanism seems to me more complex than redrawing, at least for the 2 or 3 points of the half-lines. As we plan here to redraw lines, it could therefore be removed, both from powsybl-diagram and from the javascript.
Describe the current behavior
The typescript network-area diagram viewer is static: https://github.com/powsybl/powsybl-diagram-viewer/blob/main/src/network-area-diagram-viewer.ts
Describe the expected behavior
The typescript network-area diagram viewer allows to move nodes
Describe the motivation
use case: the users want to rearrange the positions calculated from powsybl-network-area-diagram layout.
Extra Information
A proof-of-concept has been done in powsybl/powsybl-dev-tools#59. The corresponding javascript is available here. This promising POC was not redrawing anything but only adding geometrical transformation to modified objects, using the metadata which is inside the SVG. This POC has nonetheless limitations listed below, which forces us to recompute ("redraw") some part of the SVG.
This javascript can be used as a starting point for developing the feature. Note that it should be first translated into typescript.
The limitations of that POC are:
Before moving: After moving:
Before moving: After moving:
Before moving: After moving: