You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be ideal for me if we could reference the elements by its id's ('tx-port-1' and 'tx-port-2').
I can edit the .svg file in any way if necessary.
I believe this should be very simple, so I'm sorry if this is a dumb question, but after a whole day searching I still can't find any useful resource to help me with this. Can anyone help here?
Edit: fixing code formatting
The text was updated successfully, but these errors were encountered:
Well, I figured out a solution.
It was to use d3, of course! I thought I could solve my life without adding another dependency to the project, but I think it wasn't possible.
If anyone's interested, here is my working JS code:
import * as d3 from 'd3';
let ledElement = d3.select('.tx-port-1');
ledElement.style("fill", green)
(I had to add a class to the elements on the .svg so I could select them from the JS, because I couldn't select them via id for some reason and don't have a lot of time to spend on this right now.)
bonus, adding a blinking animation to the element:
Hello everyone,
I need to change fill color from some path elements inside my .svg. How should I approach this?
We can pretend this is my .svg file:
And this is my template, if it matters
It would be ideal for me if we could reference the elements by its id's ('tx-port-1' and 'tx-port-2').
I can edit the .svg file in any way if necessary.
I believe this should be very simple, so I'm sorry if this is a dumb question, but after a whole day searching I still can't find any useful resource to help me with this. Can anyone help here?
Edit: fixing code formatting
The text was updated successfully, but these errors were encountered: