Versions in this module Expand all Collapse all v0 v0.2.0 Nov 29, 2026 Changes in this version + var DashDashed = [2]float32 + var DashDotted = [2]float32 + type Card struct + func (k *Card) Body(c *ui.Context, fn func()) + func (k *Card) Content(c *ui.Context) + func (k *Card) Drag(el ui.Element) ui.Element + func (k *Card) Header(c *ui.Context) + func (k *Card) PortRows(c *ui.Context) + func (k *Card) Selected() bool type Edge + Animated bool + Dash [2]float32 + EndMarker MarkerKind + Path EdgeType + Radius float32 + StartMarker MarkerKind + type EdgeType uint8 + const EdgeBezier + const EdgeDefault + const EdgeSmoothStep + const EdgeStep + const EdgeStraight type Editor + AnimationFPS float32 + AnimationSpeed float32 + BodyGap float32 + BodyPadding float32 + CornerRadius float32 + EdgeType EdgeType + NodeStyle NodeStyle + NodeTypes map[string]NodeRenderer + ReadOnly bool + SideHysteresis float32 + func (e *Editor) EdgeEndpoints(id ID) (x0, y0, x1, y1 float32, ok bool) + func (e *Editor) SetEdgeAnimated(id ID, on bool) bool + func (e *Editor) SetEdgeDash(id ID, dash [2]float32) bool + func (e *Editor) SetEdgeMarkers(id ID, start, end MarkerKind) bool + func (e *Editor) SetEdgePath(id ID, t EdgeType) bool + type HeaderMode uint8 + const HeaderColored + const HeaderInherit + const HeaderNone + const HeaderPlain + type MarkerKind uint8 + const MarkerArrow + const MarkerMany + const MarkerNone + const MarkerOne + const MarkerZeroOrMany + const MarkerZeroOrOne type Node + Style *NodeStyle + Type string + type NodeRenderer func(c *ui.Context, n *Node, card *Card) + type NodeStyle struct + Background ui.Color + Border ui.Color + BorderWidth float32 + Header HeaderMode + HeaderColor ui.Color + Hover ui.Color + NoShadow bool + Radius float32 + Selected ui.Color + SelectedGlow bool + SelectedWidth float32 + Shadow ui.Color + TitleColor ui.Color type Port + Hidden bool + Side PortSide + Y float32 + type PortSide uint8 + const SideAuto + const SideBoth + const SideLeft + const SideRight type Style + func DarkStyle() Style + func LightStyle() Style v0.1.0 Nov 29, 2026 Changes in this version + type ArrowKind uint8 + const ArrowBoth + const ArrowEnd + const ArrowNone + const ArrowStart + type Change struct + Batch []Change + Edge Edge + Index int + Kind ChangeKind + Moves []Move + Node *Node + Old Edge + func (c Change) Inverse() Change + type ChangeKind uint8 + const ChangeAddEdge + const ChangeAddNode + const ChangeBatch + const ChangeEditEdge + const ChangeMove + const ChangeReconnect + const ChangeRemoveEdge + const ChangeRemoveNode + type Edge struct + Arrow ArrowKind + Color ui.Color + From PortRef + ID ID + Label string + To PortRef + type Editor struct + ArrowSize float32 + CanConnect func(from, to PortRef) bool + Content func(c *ui.Context, n *Node) + DefaultHeight float32 + DefaultWidth float32 + DisableCull bool + DisableGrid bool + EdgeLabelMinZoom float32 + EdgeLabelSize float32 + EdgeWidth float32 + Graph *Graph + GridCache bool + GridDots bool + HeaderHeight float32 + History *History + HitTolerance float32 + InitEdge func(e *Edge) + MaxZoom float32 + MinNodeWidth float32 + MinZoom float32 + Minimap bool + MinimapCache bool + MinimapSize [2]float32 + NodeRadius float32 + OnChange func(c Change) + OnConnect func(e *Edge) + OnEdgeDropped func(e *Edge) (remove bool) + OnEdgeReconnected func(e *Edge, old Edge) + OnEdgeRemoved func(e *Edge) + OnNodeMoved func(n *Node) + OnNodeRemoved func(n *Node) + OnSelectionChange func(s Selection) + OnViewportChange func(v Viewport) + PortLabelSize float32 + PortRadius float32 + PortRowHeight float32 + PortSnap float32 + SnapGrid float32 + Style Style + Viewport *Viewport + ZoomSpeed float32 + func NewEditor(g *Graph, vp *Viewport) *Editor + func (e *Editor) ApplyChange(c Change) + func (e *Editor) BuiltNodes() int + func (e *Editor) CanvasSize() (w, h float32) + func (e *Editor) ClearSelection() + func (e *Editor) DeleteSelection() bool + func (e *Editor) FitView(pad float32) + func (e *Editor) GraphToScreen(gx, gy float32) (float32, float32) + func (e *Editor) NodeSize(n *Node) (w, h float32) + func (e *Editor) Origin() (x, y float32) + func (e *Editor) Redo() bool + func (e *Editor) ScreenToGraph(sx, sy float32) (float32, float32) + func (e *Editor) SelectEdge(id ID) + func (e *Editor) SelectNode(id ID) + func (e *Editor) SelectNodes(ids ...ID) + func (e *Editor) Selection() Selection + func (e *Editor) SetEdgeArrow(id ID, k ArrowKind) bool + func (e *Editor) SetEdgeLabel(id ID, label string) bool + func (e *Editor) ToggleEdge(id ID) + func (e *Editor) ToggleNode(id ID) + func (e *Editor) Undo() bool + func (e *Editor) View(c *ui.Context) + func (e *Editor) ZoomBy(factor float32) + type Graph struct + Edges []*Edge + Nodes []*Node + func (g *Graph) AddEdge(e *Edge) + func (g *Graph) AddNode(n *Node) + func (g *Graph) Apply(c Change) + func (g *Graph) Edge(id ID) *Edge + func (g *Graph) NextEdgeID() ID + func (g *Graph) Node(id ID) *Node + type History struct + Limit int + func (h *History) CanRedo() bool + func (h *History) CanUndo() bool + func (h *History) Clear() + func (h *History) Push(c Change) + type ID string + type Move struct + From [2]float32 + ID ID + To [2]float32 + type Node struct + Color ui.Color + Data any + H float32 + ID ID + Inputs []Port + Outputs []Port + Title string + W float32 + X float32 + Y float32 + type Port struct + Color ui.Color + ID string + Label string + type PortRef struct + Node ID + Port string + type Selection struct + Edges []ID + Nodes []ID + func (s Selection) Empty() bool + func (s Selection) HasEdge(id ID) bool + func (s Selection) HasNode(id ID) bool + type Style struct + Background ui.Color + Edge ui.Color + EdgeLabel ui.Color + EdgeLabelBackground ui.Color + EdgeSelected ui.Color + Grid ui.Color + Header ui.Color + HeaderText ui.Color + MinimapBackground ui.Color + MinimapBorder ui.Color + MinimapNode ui.Color + MinimapView ui.Color + NodeBackground ui.Color + NodeBorder ui.Color + NodeShadow ui.Color + Port ui.Color + PortLabel ui.Color + Selection ui.Color + type Viewport struct + PanX float32 + PanY float32 + Zoom float32