-
Notifications
You must be signed in to change notification settings - Fork 18
Migration guide v5.0.0
powsybl-diagram now only supports Java 21 and higher. Please check that your installed SDK is still compatible.
Starting from this release, in the metadata the type HvdcLineEdge has been replaced by either HvdcLineLccEdge or HvdcLineVscEdge depending on the corresponding converter station type.
Starting from this release the LabelProvider methods have been refactored as the label provider is called before the graph is fully constructed:
-
getEdgeInfo(g, branchEdge, side)has been replaced bygetBranchEdgeInfo(branchId, side, branchType) -
getEdgeInfo(g, threeWtEdge)has been replaced bygetThreeWindingTransformerEdgeInfo(threeWindingTransformerId, side) -
getEdgeInfo(g, injection)has been replaced bygetInjectionEdgeInfo(injectionId) -
getVoltageLevelDescription(VoltageLevelNode n),getVoltageLevelDetails(VoltageLevelNode n)andgetBusDescription(BusNode bn)have been renplaced bygetVoltageLevelLegend(String voltageLevelId) -
getLabel(Edge e)has been replaced bygetBranchLabel(String branchId) -
getArrowPathDIn()is now given bySvgParameters.getArrowPathIn()instead -
getArrowPathDOut()is now given bySvgParameters.getArrowPathOut()instead
Starting from this release, the svg structure has changed. Hence, you need to change the CSS rules if you're using some of your own:
- replace
.nad-disconnected .nad-edge-pathwith.nad-disconnected.nad-edge-path - replace
.nad-vlXXXtoYYY.nad-bus-Zwith.nad-vlXXXtoYYY .nad-bus-Z - remove
path.nad-arrow-out:not(.nad-state-out .nad-arrow-out) {visibility: hidden} - remove
path.nad-arrow-in:not(.nad-state-in .nad-arrow-in) {visibility: hidden}
As an example, below is a comparison for an edge inside a SVG generated by v4.9.0 / the same edge inside a SVG generated by v5.0.0.
Before, both edge polyline and edge infos (arrow, value) were in <g class="nad-branch-edges">:
<g id="25">
<g id="25.1" class="nad-vl0to30">
<polyline class="nad-edge-path" points="172.27,-645.72 122.28,-526.91"/>
<g class="nad-edge-infos" transform="translate(159.67,-615.77)">
<g class="nad-active">
<g transform="rotate(-157.18)">
<path class="nad-arrow-in" transform="scale(10.00)" d="M-1 -1 H1 L0 1z"/>
<path class="nad-arrow-out" transform="scale(10.00)" d="M-1 1 H1 L0 -1z"/>
</g>
<text transform="rotate(-67.18)" x="-19.00" style="text-anchor:end">143.2</text>
</g>
</g>
</g>
<g id="25.2" class="nad-vl0to30">
<polyline class="nad-edge-path" points="72.29,-408.09 122.28,-526.91"/>
<g class="nad-edge-infos" transform="translate(84.89,-438.04)">
<g class="nad-active">
<g transform="rotate(22.82)">
<path class="nad-arrow-in" transform="scale(10.00)" d="M-1 -1 H1 L0 1z"/>
<path class="nad-arrow-out" transform="scale(10.00)" d="M-1 1 H1 L0 -1z"/>
</g>
<text transform="rotate(-67.18)" x="19.00">-144.5</text>
</g>
</g>
</g>
</g>After,
- in
<g class="nad-branch-edges">:
<g id="25">
<polyline class="nad-vl0to30 nad-edge-path" points="172.27,-645.72 122.28,-526.9"/>
<polyline class="nad-vl0to30 nad-edge-path" points="72.29,-408.09 122.28,-526.91"/>
</g>- in
<g class="nad-edge-infos">
<g id="16" transform="translate(159.67,-615.77)" class="nad-active">
<path transform="rotate(-157.18)" class="nad-arrow-in" d="M-10 -10 H10 L0 10z"/>
<text transform="rotate(-67.18)" x="-19.00" style="text-anchor:end">143.2</text>
</g>
<g id="18" transform="translate(84.89,-438.04)" class="nad-active">
<path transform="rotate(22.82)" class="nad-arrow-in" d="M-10 -10 H10 L0 10z"/>
<text transform="rotate(-67.18)" x="19.00">-144.5</text>
</g>All the following breaking changes are only for advanced users of the powsybl-network-area-diagram library, it doesn't affect you if you're using the NetworkAreaDiagram static methods.
- Starting from this release the IdProvider has only one method which takes a
Stringto provide an id, instead of one forIdentifiableand one forThreeWindingTranformer.Leg, and is called several times with the same object as parameter. This is to avoid addding more and more methods giving ids to specific part of the svg (edge infos, text nodes, text edges, ...), knowing that the default and recommended provider is just a counter. - Starting from this release, if you were constructing the graph based on
NetworkGraphBuilderandSvgWriter, you need to adapt your call to their constructors asNetworkGraphBuilderconstructor now needs theLabelProvider, whereasSvgWriterdoes not expect aLabelProvideranymore. - Starting from this release, if you were constructing the graph based on you own
GraphBuilder, you need to adapt your code to following changes:- The
BranchEdgeconstructor needs theIdProviderand the (nullable) parametersedgeInfo1,edgeInfo2andlabelrelated to the information displayed on the edge. Similarly theThreeWtEdgeandInjectionconstructors expect the (nullable) parametersvgEdgeInfo. - The
VoltageLevelNodeconstructor needs theIdProvider, a (nullable) legendDiagramId and a list of string for both the legend header and legend footer. - The
BusNodeconstructor needs theIdProviderand a (nullable) legend string.
- The