Nodes
Module node
Tagged nodes making up a rendered view.
import ui.flow.node
| Module | node |
| Source | flow/node/nodes.zirr |
| Imports | colors — ColorLike |
A view renders into a tree of nodes. Node is the shared shape — a name plus children — and each concrete node carries a @Tag naming the element the host draws. Colors are accepted as ColorLike, so a hex Int, an RGB array or a Color all work.
Contents
- Attributes —
Node - Nodes —
Text,Foreground,Background
Attributes
Node
`flow/node/nodes.zirr:5`
attr Node {
name: String
children(self) -> [@Node]
}
An element in the rendered tree. name identifies the element, children yields the nodes below it, so a host walks the tree without knowing the concrete types.
Members
| Member | Signature | Description |
|---|---|---|
name |
String |
The element name. |
children |
(self) -> [@Node] |
The nodes nested inside this one. |
Text, Foreground and Background are declared with @Tag("…") rather than @Node, and Tag is not defined in this repository. As written, none of them implements this attribute.
Nodes
Text
`flow/node/nodes.zirr:11`
@Tag("text")
data Text { value: String }
A run of literal text. This is the leaf every other node ultimately wraps.
Fields
| Field | Type | Description |
|---|---|---|
value |
String |
The text to draw. |
Foreground
`flow/node/nodes.zirr:14`
@Tag("foreground")
data Foreground { color: ColorLike }
Sets the text color for the nodes it wraps.
Fields
| Field | Type | Description |
|---|---|---|
color |
ColorLike |
The color to draw wrapped text in. |
Background
`flow/node/nodes.zirr:17`
@Tag("background")
data Background { color: ColorLike }
Sets the background color for the nodes it wraps.
Fields
| Field | Type | Description |
|---|---|---|
color |
ColorLike |
The color to fill behind wrapped text. |
See also
- Flow — the loop that produces these nodes.