Arrows on the end of lines have many of the same properties as stand
alone arrows OBJ_Arrow.
The align property descripes where the line stops relative to the arrow.
'start' will be most useful for pointed arrows. When there is no tail, or
a zero length tail, 'mid' can be useful with 'polygon', 'circle' and
'bar' as then the shapes will be centered on the end of the line. Note
that in this case the shape will extend past the line.
scalenumber — scale the default dimensions of the arrow
lengthnumber — dimension of the arrow head along the line
widthnumber — dimension of the arrow head along the line width
rotationnumber — rotation of the polygon when head = 'polygon'
sidesnumber — number of sides in polygon or circle arrow head
radiusnumber — radius of polygon or circle arrow head
barbnumber — barb length (along the length of the line) of the
barb arrow head
tailboolean — true includes a tail in the arrow of
with tailWidth. A number gives the tail a length where 0 will not
extend the tail beyond the boundaries of the head
alignstart | mid — define which part of
the arrow is aligned at (0, 0) in draw space ('start')
Example
// Line with triangle arrows on both ends figure.add({ name:'a', make:'polyline', points: [[0, 0], [1, 0]], width:0.02, arrow:'triangle', });
Example
// Line with customized barb arrow at end only figure.add({ name:'a', make:'shapes.line', p1: [0, 0], p2: [0, 1], width:0.02, arrow: { end: { head:'barb', width:0.15, length:0.25, barb:0.05, scale:2 }, }, dash: [0.02, 0.02], });
Example
// Three lines showing the difference between mid align and start align for // circle heads figure.add([ { name:'reference', make:'polyline', points: [[0, 0.3], [0.5, 0.3]], }, { name:'start', make:'polyline', points: [[0, 0], [0.5, 0]], arrow: { head:'circle', radius:0.1, }, }, { name:'mid', make:'polyline', points: [[0, -0.3], [0.5, -0.3]], arrow: { head:'circle', radius:0.1, align:'mid', // circle mid point is at line end }, }, ]);
Arrow end for a line or polyline.
Arrows on the end of lines have many of the same properties as stand alone arrows OBJ_Arrow.
The
alignproperty descripes where the line stops relative to the arrow.'start'will be most useful for pointed arrows. When there is no tail, or a zero length tail,'mid'can be useful with 'polygon', 'circle' and 'bar' as then the shapes will be centered on the end of the line. Note that in this case the shape will extend past the line.headTypeArrowHead — head style ('triangle')scalenumber— scale the default dimensions of the arrowlengthnumber— dimension of the arrow head along the linewidthnumber— dimension of the arrow head along the line widthrotationnumber— rotation of the polygon whenhead = 'polygon'sidesnumber— number of sides in polygon or circle arrow headradiusnumber— radius of polygon or circle arrow headbarbnumber— barb length (along the length of the line) of the barb arrow headtailboolean—trueincludes a tail in the arrow of withtailWidth. Anumbergives the tail a length where 0 will not extend the tail beyond the boundaries of the headalignstart|mid— define which part of the arrow is aligned at (0, 0) in draw space ('start')Example
Example
Example