Documentation
¶
Overview ¶
Package flow is base/flow's styled form: a directed diagram in ui's look, its lines in the muted text's color, the hovered and selected node's in the accent, and Card, a node's default face. Diagram is the diagram alone, for an app's own camera.View; View puts it on a camera of its own.
Index ¶
Constants ¶
const ( TopToBottom = baseflow.TopToBottom LeftToRight = baseflow.LeftToRight )
const CardRadius core.Points = 14
CardRadius rounds Card's corners; the selection ring follows it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct {
Width core.Points
Title, Description string
Header, Leading core.Node
Body, Trailing core.Node
Variant CardVariant
}
Card is a node's default face: a softly shadowed, rounded surface 240 points wide unless Width says otherwise, every region a slot. Header is a small row at the top, such as a status; Leading comes before the body, such as an icon tile; Body is the main content, else Title and Description show, each on one line; Trailing comes after the body, such as a badge; Footer is a small muted row at the bottom, such as counts.
type CardVariant ¶
type CardVariant uint8
CardVariant is a card's border.
const ( // CardDefault is the theme's soft border. It is the default. CardDefault CardVariant = iota // CardAccent is a border of the accent, as for a step under way. CardAccent )
type Diagram ¶
type Diagram struct {
Data func() Data
Direction func() Direction
NodeGap, RankGap core.Points
Selected func() string
OnSelect func(id string)
OnOpen func(id string)
State *State
Camera *camera.State
Origin func() core.Point
Empty core.Node
EmptyText string
Label string
LabelFunc func() string
Style core.Style
TestID string
}
Diagram is base/flow's View in ui's look, laid out at its size; its fields are base's. While there are no nodes Empty shows, else EmptyText, an em dash when empty, in the muted text's color.
type View ¶
type View struct {
Data func() Data
Direction func() Direction
NodeGap, RankGap core.Points
Selected func() string
OnSelect func(id string)
OnOpen func(id string)
State *State
Camera *camera.State
Empty, Overlay core.Node
EmptyText string
Label string
LabelFunc func() string
Style core.Style
TestID string
}
View is the Diagram on a camera.View of its own, which fills what the app sizes: it pans and zooms, presses and hovers reach the nodes, and Overlay sits in its top trailing corner, such as zoom controls. Camera holds the camera between mounts and moves it; nil keeps one of the view's own.