Referencepolygon

<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

Attributes for <polygon>
AttributeTypeValues
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"
Props for <polygon name="p">
PropertyType
$p.allowDilationboolean
$p.allowRotationboolean
$p.allowTranslationboolean
$p.applyStyleToLabelboolean
$p.areanumber
$p.borderStyleDescriptiontext
$p.disabledboolean
$p.displayDecimalsinteger
$p.displayDigitsinteger
$p.displaySmallAsZeronumber
$p.draggableboolean
$p.filledboolean
$p.fillStyleDescriptiontext
$p.fixedboolean
$p.fixLocationboolean
$p.hiddenboolean
$p.labellabel
$p.labelIsNameboolean
$p.layerinteger
$p.numDimensionsnumber
$p.numSidesnumber
$p.numVerticesnumber
$p.padZerosboolean
$p.perimeternumber
$p.preserveSimilarityboolean
$p.rigidboolean
$p.showCoordsWhenDraggingboolean
$p.styleDescriptiontext
$p.styleDescriptionWithNountext
$p.vertices[ math ]
$p.verticesDraggableboolean

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.