Arrowheads adjustments?

3,172 views
Skip to first unread message

appeo...@hotmail.com

unread,
Mar 1, 2016, 10:09:54 AM3/1/16
to JSXGraph
Hey,

is it possible to adjust the size or shape of the arrowheads?
I found alternative ways with adding unicode symbols to text elements but its a pretty funky solution. These can be quite useful and fun to use in other cases for illustrating things though.
http://www.charbase.com/block/dingbats

Or is it possible to do a custom drawing on the jsx canvas like this:
https://jsfiddle.net/api/mdn/

Been trying to get a minimal example to work but haven't quite got there, maybe someone here has done something similar?

In the end I would just want to have slightly different arrowheads on normal arrows apart from the the axis.

Thanksful for any input, cheers!
Andreas

Cleonis

unread,
Mar 1, 2016, 12:56:26 PM3/1/16
to JSXGraph, appeo...@hotmail.com

Andreas wrote:

is it possible to adjust the size or shape of the arrowheads?


It may well be that supporting multiple arrowhead shapes would be too burdensome.

Positioning an arrowhead is difficult. The tip of the point must be on the end point of the line. This makes it difficult to use the native SVG markers. If I recall correctly, when you position SVG markers the center of the marker falls on the supplied coordinates. So you would have to adjust for that. Also, for every line width the arrowhead is proportionally larger, you have take that into account too.

Alfred Wasserman has sorted out the arrowheads back in 2013, and he mentioned that it was a difficult thing to do. 
https://groups.google.com/forum/#!msg/jsxgraph/XN1v0yjTKC0/l_A4ud16dN8J

So I expect that adding support for additional arrowhead shapes would be quite difficult.
And while it would be nice, having several different types of arrowheads doesn't extend JSXGraph's functionality.

Cleon Teunissen

Appe Olsson

unread,
Feb 13, 2017, 11:32:02 AM2/13/17
to JSXGraph, appeo...@hotmail.com


Okay yeah I can imagine.

I understand that size and shape of arrow heads are not top priority but it would be great to have the option to adjust these eventually so that there can be more clear distinction between different types of pointers. 
For example and arrow like this would be an great addition. I guess it shouldn't be too much difference from the existing arrow?

Sorry for bumpinig this again :)
Take care,
Andreas

1paris...@gmail.com

unread,
Feb 13, 2017, 3:26:46 PM2/13/17
to JSXGraph, appeo...@hotmail.com
I have found that using a curve to draw the arrow heads fits my needs. Here is a fiddle. It works with different aspect ratios and allows you to adjust the length and width. The "indent" option adjusts the shape with 0 being a triangle and 1 being a V shape. The default of 0.5 allows a bit more of an arrow shape.

https://jsfiddle.net/tparise/Luzpoeve/

Alfred Wassermann

unread,
Feb 14, 2017, 5:05:36 PM2/14/17
to JSXGraph, appeo...@hotmail.com, 1paris...@gmail.com
Great work! 
I see there is a demand for different arrow heads and we will implement them.
Which kind of arrow heads should be supported? How should the attribute to choose the arrow head type look like?
I would be happy, if we can get some suggestions.

Best wishes,
Alfred

Appe Olsson

unread,
Mar 3, 2017, 10:26:42 AM3/3/17
to JSXGraph, appeo...@hotmail.com, 1paris...@gmail.com

Very nice example with the fiddle above!
If possible, then I guess just some basic attributes to control the verticies of the arrowhead shape would give all the flexibility to create whichever type.
Reply all
Reply to author
Forward
0 new messages