flow

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	TopToBottom = baseflow.TopToBottom
	LeftToRight = baseflow.LeftToRight
)
View Source
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
	Footer             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.

func (Card) Render

func (c Card) Render(cx *core.Scope) core.Node

Render implements core.Node.

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 Data

type Data = baseflow.Data

The diagram's data and state are base/flow's.

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.

func (Diagram) Render

func (d Diagram) Render(cx *core.Scope) core.Node

Render implements core.Node.

type Direction

type Direction = baseflow.Direction

The diagram's data and state are base/flow's.

type Edge

type Edge = baseflow.Edge

The diagram's data and state are base/flow's.

type Node

type Node = baseflow.Node

The diagram's data and state are base/flow's.

type State

type State = baseflow.State

The diagram's data and state are base/flow's.

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.

func (View) Render

func (v View) Render(cx *core.Scope) core.Node

Render implements core.Node.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL