powsybl-diagram
powsybl-diagram copied to clipboard
Animate feeder arrows
-
Do you want to request a feature or report a bug? Feature
-
What is the current behavior? Static feeder arrows
-
What is the expected behavior? Animated feeder arrows, if corresponding layout parameter enabled (with speed depending on the power flow values?)
-
What is the motivation / use case for changing the behavior? Nice looking? SVG. Not completely convinced of result so far (see below), a bit irritating instead.
-
Other information Simply adding the following lines to the components.css does the job, but we could go further to have a speed depending on flow values. With a file like the base-voltages.yml to define the 3 (for instance) speeds with min and max values.
.sld-arrow-down {
offset-rotate: 0deg;
offset-path: path('M 0,-3 0,3 0,-3');
animation: move 2s linear infinite;}
.sld-arrow-up {
offset-rotate: 0deg;
offset-path: path('M 0,3 0,-3 0,3');
animation: move 2s linear infinite;}
@keyframes move {
to {
offset-distance: 100%;
}
}
The CSS properties needed are still marked as experimental, but work in most browsers, see browser compatibility sheet.
(here in gif, as github doesn't support svg files - result's smoother in svg)