-
Notifications
You must be signed in to change notification settings - Fork 18
Add limit violation custom highlighting style support #729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add limit violation custom highlighting style support #729
Conversation
Signed-off-by: Ayoub LABIDI <[email protected]>
network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/TopologicalStyleProvider.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/TopologicalStyleProvider.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/TopologicalStyleProvider.java
Outdated
Show resolved
Hide resolved
...-diagram-core/src/main/java/com/powsybl/sld/svg/styles/iidm/LimitHighlightStyleProvider.java
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/TopologicalStyleProvider.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/TopologicalStyleProvider.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/TopologicalStyleProvider.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ayoub LABIDI <[email protected]>
Signed-off-by: Ayoub LABIDI <[email protected]>
9249e32 to
574e7f2
Compare
|
| // Check custom violations first | ||
| if (!limitViolationStyles.isEmpty()) { | ||
| String customStyle = limitViolationStyles.get(branchEdge.getEquipmentId()); | ||
| if (customStyle != null && !customStyle.isBlank()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringUtils.isBlank() ?
| */ | ||
| public class TopologicalStyleProvider extends AbstractVoltageStyleProvider { | ||
|
|
||
| private Map<String, String> limitViolationStyles = Map.of(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
limitViolationStylesByBranchId ?
| for (Node node : edge.getNodes()) { | ||
| if (node instanceof FeederNode feederNode) { | ||
| String style = limitViolationStyles.get(feederNode.getEquipmentId()); | ||
| if (style != null && !style.isBlank()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringUtils.isBlank() ?
| */ | ||
| public class LimitHighlightStyleProvider extends EmptyStyleProvider { | ||
| private final Network network; | ||
| private Map<String, String> limitViolationStyles = Map.of(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
limitViolationStylesByBranchId ?
| */ | ||
| public class LimitHighlightStyleProvider extends EmptyStyleProvider { | ||
| private final Network network; | ||
| private Map<String, String> limitViolationStyles = Map.of(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a problem here, there's nothing which links these styles to limit violations here. Why didn't you include the logic which gives a style to a specific violation limit in this class? Similarly to isOverloaded method.
If you keep that map you should rather call it something like overrideStyles, but then why do include this in a LimitHighlight class? That could be in a separate one.



Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
A feature update adding customizable limit-violation styling logic
What is the current behavior?
Branch and edge styles rely solely on built-in overload detection without recognizing externally provided styles.
What is the new behavior (if this is a feature change)?
Both TopologicalStyleProvider and LimitHighlightStyleProvider now accept limitViolationStyles maps that supply explicit classes per equipment; when absent or blank they fall back to the existing overload-based styling
Does this PR introduce a breaking change or deprecate an API?