projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.6k stars 1.17k forks source link

Set color of a Link object #777

Open bastienJS opened 3 years ago

bastienJS commented 3 years ago
const link = flatOutPort.link(buildingAreaInPort);

How can I set the color of a link object? In the sample apps I have found nothing and the link object itself has no function to set any color like the nodes have...

renato-bohler commented 3 years ago

Hmmm I believe that if you want to change the link appearance, you'll probably have to build a custom link entity.

I've done it in my project, if you want to take a look here.

bastienJS commented 3 years ago

Thx I will have a look at it. I thought setting a color could be an easy link.setColor('rgb...') like your competitors do from https://github.com/wbkd/react-flow 👍

renato-bohler commented 3 years ago

Well, digging a little bit I've found out that apparently the DefaultLink has a setColor method. Never used it though, so I'm not sure if it works as intended.

But overall, I think the idea of react-diagrams is to offer a good basis where you can build upon and customize freely to your needs. That's different than any other "competitors", where you can more easily customize simple stuff, but you really can't change whatever you want.