<rectangle>
<rectangle>
is a Graphical
component that renders a rectangle when nested inside a <graph>
component.
Attributes and Properties
Attribute | Type | Values |
---|---|---|
allowDilation = "…" | boolean | "true" "false" |
allowRotation = "…" | boolean | "true" "false" |
allowTranslation = "…" | boolean | "true" "false" |
applyStyleToLabel = "…" | boolean | "true" "false" |
center = "…" | [ math ] | |
displayDecimals = "…" | integer | |
displayDigits = "…" | integer | |
displaySmallAsZero = "…" | number | |
draggable = "…" | boolean | "true" "false" |
filled = "…" | boolean | "true" "false" |
height = "…" | number | |
labelIsName = "…" | boolean | "true" "false" |
layer = "…" | integer | |
minShrink = "…" | ||
padZeros = "…" | boolean | "true" "false" |
preserveSimilarity = "…" | boolean | "true" "false" |
rigid = "…" | boolean | "true" "false" |
rotateAround = "…" | "centroid" "vertex" "point" | |
rotationCenter = "…" | ||
rotationHandleVertices = "…" | ||
rotationVertex = "…" | ||
showCoordsWhenDragging = "…" | boolean | "true" "false" |
vertices = "…" | [ math ] | |
verticesDraggable = "…" | boolean | "true" "false" |
width = "…" | number |
Property | Type |
---|---|
$r.allowDilation | boolean |
$r.allowRotation | boolean |
$r.allowTranslation | boolean |
$r.applyStyleToLabel | boolean |
$r.area | number |
$r.borderStyleDescription | text |
$r.center | [ math ] |
$r.disabled | boolean |
$r.displayDecimals | integer |
$r.displayDigits | integer |
$r.displaySmallAsZero | number |
$r.draggable | boolean |
$r.filled | boolean |
$r.fillStyleDescription | text |
$r.fixed | boolean |
$r.fixLocation | boolean |
$r.height | number |
$r.hidden | boolean |
$r.label | label |
$r.labelIsName | boolean |
$r.layer | integer |
$r.numDimensions | number |
$r.numSides | number |
$r.numVertices | number |
$r.padZeros | boolean |
$r.perimeter | number |
$r.preserveSimilarity | boolean |
$r.rigid | boolean |
$r.showCoordsWhenDragging | boolean |
$r.styleDescription | text |
$r.styleDescriptionWithNoun | text |
$r.vertices | [ math ] |
$r.verticesDraggable | boolean |
$r.width | number |
Example: Default <rectangle>
This is a default <rectangle>
without additional attributes. The vertices
can be dragged to change its shape, and the rectangle itself can be repositioned by
clicking and dragging on any side.
Example: <rectangle>
with center, width and height
A <rectangle>
can be described by specifying its center
, width
and height
with attributes. The vertices can be dragged to change its shape, and the rectangle
itself can be repositioned by clicking and dragging on any side.
Example: Filled colored <rectangle>
The filled
attribute renders the rectangle with default shading to match the styleNumber.
Example: <rectangle>
from vertices
Use the vertices
attribute to specify a list of the two opposite corner
points of the rectangle (lower left and upper right); default: vertices=“(0,0) (1,1)“
Example: <rectangle>
constrained to a grid
A rectangle is effectively constrained to an integer grid by referencing two
constrained points in the vertices
attribute.
Attribute Example: center
Use the center
attribute to specify the center point of the rectangle. If not specified,
the default center position is .
Attribute Example: width, height
Use the width
and height
attributes to specify the proportions of the <rectangle>
directly.
If not specified, the default values for width
and height
are both .
Attribute Example: vertices
Use the vertices
attribute to specify a list of the two opposite corner points of the rectangle (lower left and upper right); default: vertices=“(0,0) (1,1)“
Attribute Example: verticesDraggable
Vertices are draggable by default. Use the verticesDraggable
attribute set to false
to
disable users from changing the proportions of the <rectangle>
. The rectangle as a
whole can still be repositioned on the <graph>
.
Attribute Example: Standard graphical attributes
The uses of the following standard graphical attributes are illustrated: hide
, draggable
, layer
, styleNumber
, applyStyleToLabel
and labelIsName
.
Property Example: Attributes as properties
The above listed attributes of a named <rectangle>
are also available as properties.