<collect>
<collect> is a General Operator
component that gathers discrete component data from a graph or
sectional component and stores it in an array.
Attributes and Properties
| Attribute | Type | Values |
|---|---|---|
asList = "…" | "true" "false" | |
componentType = "…" | ||
from = "…" | ||
maxNumber = "…" | number |
| Property | Type |
|---|---|
$c.maxNumber | number |
Example: Collect <point> children from a <graph>
The <collect/> component is used to gather <point>
children from a named <graph>.
Example: Collect <textInput> children from a <repeat>
The <collect/> component is used to gather <textInput>
components generated by a <repeat>.
Example: Collect user-added <point> children to draw a <polygon>
The <collect/> component is used to gather <point>
components generated by two <callAction> components
within a <graph>. The named <collect/> is then referenced
in the vertices attribute of a <polygon>.
Example: <collect> function data
The <collect> can be used for function components as well
as graphical components and that the set of data collected need not
be contained in a graph. Any sectional component or module can
be used with the from attribute inside the <collect> component.
Example: Collecting a property of a component
To access an individual property of a group of
collected components, refer to the name of the <collect>
followed by the property name, such as radius in this example.
In order to access a specific component’s property,
use the index of the component in square brackets,
such as $collectRadii[2].radius.
Attribute Example: from
The from attribute specifies which named component the <collect>
is gathering information from.
Attribute Example: componentType
The componentType attribute specifies the type of component
that is being collected from the reference listed in from.
Attribute Example: maxNumber
The maxNumber attribute sets a limit on the number of components to collect.