#How to dynamically set markerEnd color?

1 messages · Page 1 of 1 (latest)

deft gate
#

I have a custom Edge, and I want to dynamically set markerEnd color within the Edge component.

For example, the passed markerEnd config is converted to string url('#1__color=#6D6E70&height=16&type=arrow&width=16'). Under some condition, I'd like to change the color to another. When I try change the color code in the string and pass to the Edge props, the whole MakerEnd disappeared.

Is there a way to work around that? Thank you!

small roost
#

The edge object with the marker info looks like this

[
    {
        "source": "57dff693-1708-4f5d-85a4-a3864b963626",
        "sourceHandle": null,
        "target": "ca666e7c-9a41-43bf-a91c-0eaf3e28360a",
        "targetHandle": null,
        "animated": true,
        "id": "b3613444-517b-4f32-a280-6cbb668cd1a0",
        "markerEnd": {
            "type": "arrowclosed",
            "color": "yellow",
            "height": 20,
            "width": 20
        }
    }
]

Why cant you change the color from here based on whatever your logic is

deft gate
#

It's complicated from outside of the Edge component.

deft gate
#

is there a way to initialize with multiple styles of markers?

small roost