Layouts¶
A layout represents the way in which the elements of a graph are arranged.
It is possible to use your own graph layout implementation, but there are also existing layouts in powsybl-diagram, ready to use.
Layouts for voltage levels¶
Existing implementations¶
PositionVoltageLevelLayout¶
This layout positions the different elements inside a voltage level according to the following process:
Clean the graph to have the expected patterns (see Graph Refiner)
Detect the cells (intern / extern / shunt) (see Cell detection)
Organize the cells into blocks (see CellBlockDecomposer)
Compute real coordinates of busNode and blocks connected to busbars (see PositionFinder)
The PositionVoltageLevelLayoutFactoryParameters class¶
TODO
The PositionFinder class¶
TODO
RandomVoltageLevelLayout¶
With this layout, the graph node coordinates are randomly fixed:
Between 0 and
widthfor the x coordinate;Between 0 and
heightfor the y coordinate. Thewidthandheightvariables are provided by the user.
CgmesVoltageLevelLayout¶
With this layout, the elements of the graph are arranged according to the data included in the CGMES DL profile.
Choosing a VoltageLevelLayout¶
The voltageLevelLayoutFactoryCreator attribute in the SldParameters class is the customization parameter to use to choose a specific VoltageLevelLayout.
The VoltageLevelLayoutFactoryCreator creates a VoltageLevelLayoutFactory which in turn creates a VoltageLevelLayout.
Choose a specific PositionVoltageLevelLayout¶
Static methods are available in the VoltageLevelLayoutFactoryCreator interface to help users manipulate those objects.
Some examples are shown below.
Example 1
PositionVoltageLevelLayout using default parameters:
VoltageLevelLayoutFactoryCreator voltageLevelLayoutFactoryCreator = VoltageLevelLayoutFactoryCreator.newPositionVoltageLevelLayoutFactoryCreator();
SldParameters sldParameters = new SldParameters().setVoltageLevelLayoutFactoryCreator(voltageLevelLayoutFactoryCreator);
Example 2
PositionVoltageLevelLayout with a chosen PositionFinder:
VoltageLevelLayoutFactoryCreator voltageLevelLayoutFactoryCreator = VoltageLevelLayoutFactoryCreator.newPositionVoltageLevelLayoutFactoryCreator(positionFinder);
SldParameters sldParameters = new SldParameters().setVoltageLevelLayoutFactoryCreator(voltageLevelLayoutFactoryCreator);
Example 3
PositionVoltageLevelLayout with chosen PositionVoltageLevelLayoutFactoryParameters:
VoltageLevelLayoutFactoryCreator voltageLevelLayoutFactoryCreator = VoltageLevelLayoutFactoryCreator.newPositionVoltageLevelLayoutFactoryCreator(positionVoltageLevelLayoutFactoryParameters);
SldParameters sldParameters = new SldParameters().setVoltageLevelLayoutFactoryCreator(voltageLevelLayoutFactoryCreator);
Example 4
PositionVoltageLevelLayout with a chosen PositionFinder and chosen PositionVoltageLevelLayoutFactoryParameters:
VoltageLevelLayoutFactoryCreator voltageLevelLayoutFactoryCreator = VoltageLevelLayoutFactoryCreator.newPositionVoltageLevelLayoutFactoryCreator(positionFinder, positionVoltageLevelLayoutFactoryParameters);
SldParameters sldParameters = new SldParameters().setVoltageLevelLayoutFactoryCreator(voltageLevelLayoutFactoryCreator);
Use the SmartVoltageLevelLayoutFactory¶
The SmartVoltageLevelLayoutFactory picks the “best” VoltageLevelLayout according to the information available in the network.
There is also a static method in the VoltageLevelLayoutFactoryCreator interface to help users pick the SmartVoltageLevelLayoutFactory:
VoltageLevelLayoutFactoryCreator voltageLevelLayoutFactoryCreator = VoltageLevelLayoutFactoryCreator.newSmartVoltageLevelLayoutFactoryCreator();
SldParameters sldParameters = new SldParameters().setVoltageLevelLayoutFactoryCreator(voltageLevelLayoutFactoryCreator);
Layouts for substations¶
TODO
Layouts for multi-substation graphs¶
Multi-substation graphs can use a matrix-like layout for the different substations. See Zone Matrix Layout for more details.