<lineSegment>
<lineSegment>
is a Graphical
component that renders a line segment when nested within a <graph>
component.
Attributes and Properties
Attribute | Type | Values |
---|---|---|
applyStyleToLabel = "…" | boolean | "true" "false" |
displayDecimals = "…" | integer | |
displayDigits = "…" | integer | |
displaySmallAsZero = "…" | number | |
draggable = "…" | boolean | "true" "false" |
endpoints = "…" | [ math ] | |
endpointsDraggable = "…" | boolean | "true" "false" |
labelIsName = "…" | boolean | "true" "false" |
labelPosition = "…" | text | "upperright" "upperleft" "lowerright" "lowerleft" |
layer = "…" | integer | |
padZeros = "…" | boolean | "true" "false" |
showCoordsWhenDragging = "…" | boolean | "true" "false" |
Property | Type |
---|---|
$l.applyStyleToLabel | boolean |
$l.disabled | boolean |
$l.displayDecimals | integer |
$l.displayDigits | integer |
$l.displaySmallAsZero | number |
$l.draggable | boolean |
$l.endpoints | [ math ] |
$l.endpointsDraggable | boolean |
$l.fixed | boolean |
$l.fixLocation | boolean |
$l.hidden | boolean |
$l.label | label |
$l.labelIsName | boolean |
$l.labelPosition | text |
$l.layer | integer |
$l.length | math |
$l.numDimensions | number |
$l.padZeros | boolean |
$l.showCoordsWhenDragging | boolean |
$l.slope | number |
$l.styleDescription | text |
$l.styleDescriptionWithNoun | text |
Example: Default <lineSegment>
Without any attributes, the default <lineSegment>
has endpoints and .
Example: <lineSegment>
with rendered endpoints
The endpoints
property of a named <lineSegment>
can be
rendered on a <graph>
with the macro $name.property
.
Example: <lineSegment>
constrained to a grid
The endpoints of a <lineSegment>
are predefined as constrained points,
thereby constraining the segment to a grid as well.
Attribute Example: endpoints
The endpoints
attribute takes as an input a list of two points.
Attribute Example: draggable
The draggable
attribute determines whether the <lineSegment>
can be
dragged around the <graph>
. All graphical objects are draggable by default.
Attribute Example: endpointsDraggable
Endpoints are draggable by default. Use the endpointsDraggable
attribute set to
false to disable users from changing the shape and length of the <lineSegment>
. The segment
as a whole can still be repositioned on the <graph>
.
Attribute Example: showCoordsWhenDragging
By default, a light-grey set of coordinates is shown while the user drags the
endpoints of the line segment. To turn off this default behavior, set the showCoordsWhenDragging
attribute
to false.
Attribute Example: Standard graphical attributes
The uses of the following standard graphical attributes are
illustrated: hide
, fixLocation
, layer
, styleNumber
, applyStyleToLabel
and labelIsName
.
Property Example: numDimensions
The numDimensions
property returns the number of dimesions of the <lineSegment>
.
Property Example: length
The length
property returns the length of the <lineSegment>
.
Property Example: slope
The slope
property returns the slope of the <lineSegment>
.