The Collections Line is a convient and powerful line
FigureElementCollection that includes the line, arrows, a label
annotation and some methods to make it convient to use dynamically.
A line can either be defined by its two end points (p1, p2), or a
point (p1), length and angle.
offset can be used to draw the line some offset away from the line
definition where a positive offset is on the side of the line that the line
rotates toward when rotating in the positive direction. This is especially
useful for creating lines that show dimensions of shapes.
The line also has a control point which is positioned on the line with the
align property. The control point is the line's center of rotation, and
fixes the point from which the line changes length. This is also the point
where the line collection position will be if getPosition is called on the
element.
For instance, setting the control point at align: 'start' will mean that
if the line can rotate, it will rotate around p1, and if the length is
changed, then p1 will remain fixed while p2 changes.
width sets the width of the line. Setting the width to 0 will hide the
line itself, but if arrows or a label are defined they will still be
displayed.
Use the label property to define and position a label relative to the line.
The label can be any string, equation or the actual length of the line and
be oriented relative to the line or always be horizontal.
Use the arrow and dash properties to define arrows and the line style.
Pulsing this collection normally would pulse both the length and width of
the line. If it often desirable to pulse a line without changing its length,
and so this collection provides a method pulseWidth to allow this. This
options object can define the default values for pulseWidth if desired.
Default pulse values can then be specified with the pulse property.
CollectionsLine options object that extends OBJ_Collection options object (without
parent).The Collections Line is a convient and powerful line FigureElementCollection that includes the line, arrows, a label annotation and some methods to make it convient to use dynamically.
A line can either be defined by its two end points (
p1,p2), or a point (p1),lengthandangle.offsetcan be used to draw the line some offset away from the line definition where a positive offset is on the side of the line that the line rotates toward when rotating in the positive direction. This is especially useful for creating lines that show dimensions of shapes.The line also has a control point which is positioned on the line with the
alignproperty. The control point is the line's center of rotation, and fixes the point from which the line changes length. This is also the point where the line collection position will be ifgetPositionis called on the element.For instance, setting the control point at
align: 'start'will mean that if the line can rotate, it will rotate aroundp1, and if the length is changed, thenp1will remain fixed whilep2changes.widthsets the width of the line. Setting the width to 0 will hide the line itself, but if arrows or a label are defined they will still be displayed.Use the
labelproperty to define and position a label relative to the line. The label can be any string, equation or the actual length of the line and be oriented relative to the line or always be horizontal.Use the
arrowanddashproperties to define arrows and the line style.Pulsing this collection normally would pulse both the length and width of the line. If it often desirable to pulse a line without changing its length, and so this collection provides a method
pulseWidthto allow this. This options object can define the default values for pulseWidth if desired.Default pulse values can then be specified with the
pulseproperty.