woodenconsulting / react-js-diagrams

A flow based diagramming library written in React
MIT License
220 stars 61 forks source link

Is there any way to specify a custom link widget? #7

Closed umarashfaq closed 7 years ago

umarashfaq commented 7 years ago

I'm able to specify custom node widgets but custom link widgets aren't working.

On line 388 of DiagramWidget#onMouseDown, we're instantiating new LinkModel(). Shouldn't this be coming from one of the instance factories?

umarashfaq commented 7 years ago

Fixed it here: https://github.com/emumba-com/react-js-diagrams/commit/034f7282da51bd90814e36ac70f7b32bd55ffdf2

umarashfaq commented 7 years ago

@woodenconsulting You could've asked for a PR instead of copy pasting :)

woodenconsulting commented 7 years ago

@umarashfaq I went with a slightly different approach, please see demo5. When a link instance factory is registered that will be used by default rather than setting via a prop. Please feel free to create PRs for future issues, it's much appreciated!