<polygon>
<polygon>
is a Graphical
component that renders a general polygon when nested inside a <graph>
component. The <polygon>
tag is self-closing and the vertices
attribute is required.
(See also, <regularPolygon>
.)
Attributes and Properties
Attribute | Type | Values |
---|---|---|
allowDilation = "…" | boolean | "true" "false" |
allowRotation = "…" | boolean | "true" "false" |
allowTranslation = "…" | boolean | "true" "false" |
applyStyleToLabel = "…" | boolean | "true" "false" |
displayDecimals = "…" | integer | |
displayDigits = "…" | integer | |
displaySmallAsZero = "…" | number | |
draggable = "…" | boolean | "true" "false" |
filled = "…" | boolean | "true" "false" |
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" |
Property | Type |
---|---|
$p.allowDilation | boolean |
$p.allowRotation | boolean |
$p.allowTranslation | boolean |
$p.applyStyleToLabel | boolean |
$p.area | number |
$p.borderStyleDescription | text |
$p.disabled | boolean |
$p.displayDecimals | integer |
$p.displayDigits | integer |
$p.displaySmallAsZero | number |
$p.draggable | boolean |
$p.filled | boolean |
$p.fillStyleDescription | text |
$p.fixed | boolean |
$p.fixLocation | boolean |
$p.hidden | boolean |
$p.label | label |
$p.labelIsName | boolean |
$p.layer | integer |
$p.numDimensions | number |
$p.numSides | number |
$p.numVertices | number |
$p.padZeros | boolean |
$p.perimeter | number |
$p.preserveSimilarity | boolean |
$p.rigid | boolean |
$p.showCoordsWhenDragging | boolean |
$p.styleDescription | text |
$p.styleDescriptionWithNoun | text |
$p.vertices | [ math ] |
$p.verticesDraggable | boolean |
Example: Default <polygon>
from vertices
The default <polygon>
requires the vertices
attribute as a minimum.
Example: Repeat-generated <polygon>
In this example, the inputs to the vertices
attribute are generated by
a <repeatForSequence>
within the <graph>
.
Example: <polygon>
from added <points>
In this example, the inputs to the vertices
attribute are generated by a series of <callAction>
buttons that add a vertex at a time to the <graph>
.
Attribute Example: vertices
The vertices
attribute takes a list of points as its input.
Attribute Example: filled
The filled
attribute renders the polygon with default shading to match the styleNumber.
Attribute Example: draggable
The draggable
attribute determines whether the <polygon>
can be dragged around the <graph>
. All graphical objects are draggable by default.
Attribute Example: verticesDraggable
Vertices are draggable by default. Use the verticesDraggable
attribute set to false to
disable users from changing the proportions of the <polygon>
. The polygon 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
, fixLocation
, layer
, styleNumber
, applyStyleToLabel
and labelIsName
.
Attribute Example: Style properties
The styleDescription
, styleDescriptionWithNoun
, fillStyleDescription
, and borderStyleDescription
properties render a text description corresponding to the styleNumber
of the component.