jsPlumb: fat arrow?

Viewed 1029

I want a fat arrow in jsPlumb with a pretty tip.

This is what I want:
enter image description here

This is what I get:
enter image description here

How can I change the settings?

Here's what I currently use:

PaintStyle: { stroke: "#f00", strokeWidth: 20 },
connector: ["Straight"],
connectorOverlays:[["Arrow", { location:1, width:70, length:70 } ]]

I have been using arrows in SVG before. There, I could simply change the SVG code of the head to be moved forward so that the end of the line (the coordinates of the line end point) is inside the arrowhead triangle. I don't seem to be able to do this in jsPlumb.

I see it is difficult to convey the problem.

Here's a next try: enter image description here

3 Answers

Setting the location to 0.99 actually did the thing for me. Try this:

PaintStyle: { stroke: "#f00", strokeWidth: 20 },
connector: ["Straight"],
connectorOverlays:[["Arrow", { location:0.99, width:70, length:70 } ]]

This has no solution till date I guess by looking at github, It's still an open issue. Issue was opened in 2014.

One solution would be hacking library itself to add margin or padding kind of property to Arrow Object.

update:

I tried to figure out in library itself. See this below image where it's doing some math calculations. If you're good at it, tweak it and you're done!

Extent calculations

And extents are being user here:

Extent usage

Update2:

Try Location array like below: (demo: http://jsfiddle.net/crerhawn/)

["Arrow", { location:[0.5,0.5], width:70, length:70 } ]
Related