Skip to content

Style edges and marker arrow head #143

@volotovskyy

Description

@volotovskyy

extend doc or feature request

I'm wondering if it's possible to style edges?
I found one helpful tip in #128
Currently I'm using afterRenderEdge for this purpose.
So far I can conditionally handle edge styles by adding new class
Like this:
edgeContainer.querySelector('.edge').classList.add('default');
Unfortunately It seems like we have to handle edge's arrow separately.
I'd been looking through source code and found workaround which i'm using inside afterRenderEdge.
E.g:
wrapperRef.querySelector('defs>marker>.arrow').classList.add('defaultConnection');
where wrapperRef is html element <div class='view-wrapper><svg class='graph'>...
But this hack let us only change some styles for all arrowhead-markers among graph.

  1. How can I style edges and arrow by some condition?
  2. Are you going to implement edge styling by some props in near future?

Would you be so kind to share some approaches to achieve my final goal - have different styles/colors for edges including arrowhead markers.
Thank for you attention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions