#How to update marker with css?
1 messages · Page 1 of 1 (latest)
Not sure if there's a css only solution to this but this would work instead: https://codesandbox.io/p/sandbox/jovial-thompson-sn5jxm?file=%2FCustomEdge.js%3A53%2C53
With a custom marker inside of a custom edge you could style the marker with css only though and just drop the useState (i just wrote this rather quickly sorry for that ^^)
Here's a version of the same sandbox but without a useState: https://codesandbox.io/p/devbox/goofy-shockley-tvth5f?file=%2FCustomEdge.js%3A21%2C1&workspaceId=ws_7iZPUfEyQC7Podbs7wwbxV
Cool workaround of the hover state
I will use that for now but if there is a way to do it with CSS only it would be ideal
Problem is that the built-in marker tags aren't part of the edge itself so a css only solution probably won't work for them ^^
You can add as many defs as you want in your custom edge based on the styles that you want(with unique ids) and then use those ids based on selection/hover etc.
You will have to add the defs code nonetheless. After that, you can consider it a black box and just use css(as part of some markerStyle object in the data object of the edge)