powsybl-diagram icon indicating copy to clipboard operation
powsybl-diagram copied to clipboard

[NAD] StyleProvider direct styling on edges and bus nodes

Open flo-dup opened this issue 1 week ago • 1 comments

Please check if the PR fulfills these requirements

  • [x] The commit message follows our guidelines
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem? No

What kind of change does this PR introduce? Feature + API renaming

What is the current behavior? Styling can only be done through CSS classes and rules

What is the new behavior (if this is a feature change)? Styling can also be done directly on the bus nodes and edges, overriding the CSS class styling.

Does this PR introduce a breaking change or deprecate an API?

  • [x] Yes
  • [ ] No

If yes, please check if the following requirements are fulfilled

  • [x] The Breaking Change or Deprecated label has been added
  • [x] The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps) These changes impact only users who defined their own StyleProvider. If that's the case, you need to

  • rename your implementation of getNodeStyleClasses(BusNode) into getBusNodeStyleClasses(BusNode)
  • rename your implementation of getEdgeInfoStyles into getBranchEdgeInfoStyleClasses and use the given BranchEdge instead of the given Edge. The part dealing with ThreeWtEdge should be done in getThreeWtEdgeStyleClasses mentioned just after
  • rename your implementation of getThreeWtNodeStyle into getThreeWtEdgeStyleClasses and use the given ThreeWtEdge parameters instead of the 2 parameters ThreeWtNode and ThreeWtEdge.Side

flo-dup avatar Feb 21 '25 11:02 flo-dup