Skip to content

Migration guide v5.3.0

Nicolas Rol edited this page May 5, 2026 · 14 revisions

Common

BasicForceLayoutParameters

In com.powsybl.diagram.util.layout.algorithms.parameters.BasicForceLayoutParameters, the following methods have been renamed:

  • getRepulsion to getRepulsionIntensity
  • getFriction to getFrictionIntensity

Boundary lines

Following the changes made in powsybl-core, all references to dangling lines were renamed to boundary lines.

NAD

Default Force layout algorithm

The default force layout algorithm was changed from BasicForceLayout to Atlas2ForceLayout.

If you have tests that check for the SVG generated by NetworkAreaDiagram.Draw by default, the generated SVG will change. You can either:

  • change your result files to match the new default (simply replace the old file with the new generated file)
  • specify that you want to use BasicForceLayout:
NadParameters parameters = new NadParameters().setLayoutFactory(new BasicForceLayoutFactory());
NetworkAreaDiagram.draw(network, outputPath, parameters, VoltageLevelFilter.NO_FILTER);

Foreign objects

To fix the compatibility of the generated SVGs with Safari and JavaFX, instead of having one foreignObject with multiple text boxes inside, we are now back to having multiple foreignObject, each with a single text box inside.

The corresponding CSS has also to be modified, from

foreignObject.nad-text-nodes {
    ...
}

to

.nad-text-nodes foreignObject {
    ...
}

SVG writer

The constructor SvgWriter(SvgParameters, StyleProvider, NadComponentLibrary, EdgeRouting) has been replaced by the new constructor SvgWriter(SvgParameters, NadComponentLibrary, EdgeRouting edgeRouting).

If you used to generate the SVG through the method svgWriter.writeSvg(graph, writer), it is now expected that you call the following method before calling writeSvg: NetworkGraphBuilder.applyStyle(graph, getStyleProvider(network))

Parameters

The following parameters were added:

  • scaleFactor (default value: 1) in LayoutParameters
  • doubleArrowsDisplayed (default value: false) in LabelProviderParameters
  • doubleArrowShiftFactorArrows (default value: 1.5) in SvgParameters
  • doubleArrowShiftFactorText (default value: 1.8) in SvgParameters
  • displayWithAbs (default value: false) in DefaultLabelProvider

Refactoring

  • EdgeInfoEnum inner class has been moved from within com.powsybl.nad.svg.iidm.DefaultLabelProvider to a separate class com.powsybl.nad.svg.EdgeInfoEnum.
  • EdgeInfoParameters inner record has been moved from within com.powsybl.nad.svg.iidm.DefaultLabelProvider to a separate record com.powsybl.nad.svg.EdgeInfoParameters.

SLD

CGMES Parameters

  • cgmesScaleFactor has been moved from LayoutParameters to CgmesSubstationLayoutFactory, CgmesVoltageLevelLayoutFactory, CgmesZoneLayoutFactory
  • cgmesDiagramName has been moved from LayoutParameters to CgmesSubstationLayoutFactory, CgmesVoltageLevelLayoutFactory, CgmesZoneLayoutFactory. Note that his parameter is now optional: when not specified, the first diagram data in the DL is taken.
  • cgmesUseNames has been removed from LayoutParameters, use parameter useName of SvgParameter instead.

Component library changes

If you're using your own component library, the components metadata needs to be updated , due to vertical-busbars voltage levels (feature available in CGMES DL only so far). You need to specify which transformations to operate (if any) for LEFT and RIGHT components orientation.

Clone this wiki locally