powsybl / powsybl-diagram

SVG diagrams generation: single-line substation diagrams and network graph diagrams
Mozilla Public License 2.0
72 stars 13 forks source link

In the single line diagram of a substation, each voltage level's style index now starts at zero #633

Open EstherDarkish opened 1 month ago

EstherDarkish commented 1 month ago

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?

Fixes the discrepancy of style applied to buses between a voltage level and the same voltage level in a substation.

What is the current behavior?

When a voltage level is displayed inside a substation and if the voltage level shares a nominal voltage with another voltage level in the substation, then the voltage level's buses' colors do not match the colors of this same voltage level displayed by itself in another SLD.

What is the new behavior (if this is a feature change)? When drawing a substation's SLD, the styles applied to the voltage level's buses are consistent with the styles used when the voltage level is displayed by itself in another SLD.

Does this PR introduce a breaking change or deprecate an API?

If yes, please check if the following requirements are fulfilled

What changes might users need to make in their application due to this PR? (migration steps)

Because the SVG generated when drawing a SLD are fixed, users might need to check that the new colors do not break their unit tests.

Other information:

flo-dup commented 1 month ago

I'm not fully convinced by the resulting diagrams. When using TopologicalStyleProvider, one expects one colour for each electrical node. With this dev, in substation diagrams two nodes might have the same colour but different voltage and angle values. That implies there cannot be a single legend ("NodesInfo") in a substation diagram.

flo-dup commented 4 weeks ago

I understand the need here (the user requires that one bus has the same colour in the substation diagram as in the votlage level diagram), but I think some users might want different colours for each electrical node displayed in the substation diagram. So we'd better add a parameter inside SvgParameter (which needs to be passed to TopologicalyStyleProvider) to enable/disable this behaviour.

sonarcloud[bot] commented 16 hours ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud