Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Smaller node for single-bus voltage level #55

Merged
merged 2 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/powsybl/nad/svg/SvgParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class SvgParameters {
private double arrowShift = 0.3;
private double arrowLabelShift = 0.12;
private double converterStationWidth = 0.6;
private double voltageLevelCircleRadius = 0.6;
private double voltageLevelCircleRadius = 0.3;
private double fictitiousVoltageLevelCircleRadius = 0.15;
private double transformerCircleRadius = 0.2;
private double nodeHollowWidth = 0.1;
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/powsybl/nad/svg/SvgWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,10 @@ protected double getVoltageLevelCircleRadius(VoltageLevelNode vlNode) {
}

protected static double getVoltageLevelCircleRadius(VoltageLevelNode vlNode, SvgParameters svgParameters) {
return vlNode.isFictitious() ? svgParameters.getFictitiousVoltageLevelCircleRadius() : svgParameters.getVoltageLevelCircleRadius();
if (vlNode.isFictitious()) {
return svgParameters.getFictitiousVoltageLevelCircleRadius();
}
int nbBuses = vlNode.getBusNodes().size();
return Math.min(Math.max(nbBuses, 1), 2) * svgParameters.getVoltageLevelCircleRadius();
}
}
24 changes: 12 additions & 12 deletions src/test/resources/3wt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/test/resources/3wt_partial.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading