Open flo-dup opened 4 months ago
Indeed! I missed the fact that the map was indexed by the voltage level id...
The SVG constructed by powsybl-single-line-diagram has always y position equals for all the feeder nodes within the same voltage level: it corresponds to the top extern cell height or the bottom extern cell heigh which are both constant within a voltage level. So we could keep this simplification anyway
It's not always the case, apparently. In the SVG created with this code, the two bottom elements have different y:
Network network = Importer.find("CGMES")
.importData(CgmesConformity1Catalog.microGridBaseCaseBE().dataSource(), new NetworkFactoryImpl(), null);
//let's create an SLD for the 4th VL
SingleLineDiagram.draw(network, "b10b171b-3bc5-4849-bb1f-61ed9ea1ec7c", "/tmp/sld-example.svg");
with the new logic for the diagram-viewer, the bottom arrows are not aligned:
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? Refactor / simplification
What is the current behavior?
What is the new behavior (if this is a feature change)?
querySelector
would return the same svg element, hence the same ordinate.Set
Does this PR introduce a breaking change or deprecate an API?