jgraph / mxgraph

mxGraph is a fully client side JavaScript diagramming library
Other
6.82k stars 2.06k forks source link

Define direction for edge at connection point in mxGraph #508

Closed lprc closed 4 years ago

lprc commented 4 years ago

Since I don't get a response on StackOverflow using the tag mxgraph as suggested in the Readme of the main repo, I'll try it here. (SO thread)

I have a T-piece for splitting and edge into two. Is it possible to define a direction for edges which are connected to the connection points of the T-piece? I need to use the orthogonalEdgeStyle. Maybe STYLE_PORT_CONSTRAINT can help here but I don't quiet know how to use it. I tried inserting e.g. portConstraint=west,east; into the style of the T-piece but with no appeal. I would have to be able to do it for each connection constraint individually anyways.

What it looks like now:

What I want it to look like:

Thanks!

PrudhviMadasu commented 4 years ago

You can use mxMarker.addMarker and get the style of edge and append new style Use startArrow and endArrow to decide in which direction you need a pointer