From 43d8504179d357de54019829f74676b320673619 Mon Sep 17 00:00:00 2001 From: BOUTIER Charly Date: Wed, 18 Sep 2024 23:05:00 +0200 Subject: [PATCH] Helps NAD readability in dense area Signed-off-by: BOUTIER Charly --- .../com/powsybl/nad/layout/GeographicalLayoutFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network-area-diagram/src/main/java/com/powsybl/nad/layout/GeographicalLayoutFactory.java b/network-area-diagram/src/main/java/com/powsybl/nad/layout/GeographicalLayoutFactory.java index fb154a516..0adbcd6c4 100644 --- a/network-area-diagram/src/main/java/com/powsybl/nad/layout/GeographicalLayoutFactory.java +++ b/network-area-diagram/src/main/java/com/powsybl/nad/layout/GeographicalLayoutFactory.java @@ -29,8 +29,8 @@ public class GeographicalLayoutFactory extends FixedLayoutFactory implements Lay protected static final Logger LOGGER = LoggerFactory.getLogger(GeographicalLayoutFactory.class); - private static final int SCALING_FACTOR = 150000; - private static final double RADIUS_FACTOR = 150; + private static final int SCALING_FACTOR = 450000; + private static final double RADIUS_FACTOR = 300; public GeographicalLayoutFactory(Network network) { this(network, SCALING_FACTOR, RADIUS_FACTOR, () -> new BasicForceLayout(false, false)); @@ -73,7 +73,7 @@ private static void fillPositionMap(Substation substation, Map fi double angle = 2 * Math.PI / voltageLevelListSize; int i = 0; for (VoltageLevel voltageLevel : voltageLevelList) { - double angleVoltageLevel = angle * i; + double angleVoltageLevel = angle * i + 45.0; // We add 45° to help readability when the voltage levels have their labels fixedNodePositionMap.put(voltageLevel.getId(), new Point(scalingFactor * mercatorCoordinates.getFirst() + radiusFactor * Math.cos(angleVoltageLevel), scalingFactor * mercatorCoordinates.getSecond() + radiusFactor * Math.sin(angleVoltageLevel))); i++; }