Documentation
¶
Overview ¶
Package flowui implements an interactive graph renderer.
Index ¶
- Variables
- type FlowchartView
- func (fcv *FlowchartView) AddNode(n flow.Node, x, y float64) error
- func (fcv *FlowchartView) AddOverlay(o Overlay)
- func (fcv *FlowchartView) ClearSelection()
- func (fcv *FlowchartView) DeleteNode(n flow.Node) error
- func (fcv *FlowchartView) GetAtPosition(x, y float64) interface{}
- func (fcv *FlowchartView) GetSelection() interface{}
- func (fcv *FlowchartView) Rebuild() error
- func (fcv *FlowchartView) SetDoubleClickCallback(cb func(interface{}, float64, float64))
- type Model
- func (m *Model) Draw(da *gtk.DrawingArea, cr *cairo.Context, animStep int64)
- func (m *Model) HitTest(p hit.Point) hit.TestableObj
- func (m *Model) MoveTarget(t hit.TestableObj, x, y float64)
- func (m *Model) OnUserLinksPads(startPad, endPad *circPad) error
- func (m *Model) SetTargetActive(target hit.TestableObj, a bool)
- func (m *Model) TargetPos(t hit.TestableObj) (x, y float64)
- type Overlay
- type UserLinkable
Constants ¶
This section is empty.
Variables ¶
var ErrNodeNotLinkable = errors.New("node cannot be linked by user")
Functions ¶
This section is empty.
Types ¶
type FlowchartView ¶
type FlowchartView struct {
// contains filtered or unexported fields
}
func NewFlowchartView ¶
func NewFlowchartView(l *flow.Layout) (*FlowchartView, *gtk.DrawingArea, error)
NewFlowchartView constructs a new flowchart display widget, reading nodes and position information from the provided layout.
func (*FlowchartView) AddNode ¶ added in v0.3.0
func (fcv *FlowchartView) AddNode(n flow.Node, x, y float64) error
AddNode inserts a new node into the layout and view.
func (*FlowchartView) AddOverlay ¶ added in v0.3.0
func (fcv *FlowchartView) AddOverlay(o Overlay)
AddOverlay installs the provided overlay.
func (*FlowchartView) ClearSelection ¶ added in v0.4.3
func (fcv *FlowchartView) ClearSelection()
func (*FlowchartView) DeleteNode ¶ added in v0.3.0
func (fcv *FlowchartView) DeleteNode(n flow.Node) error
DeleteNode removes a node from the flowchart, breaking all links.
func (*FlowchartView) GetAtPosition ¶ added in v0.3.0
func (fcv *FlowchartView) GetAtPosition(x, y float64) interface{}
GetAtPosition returns the pad or node at the given position, or nil if the provided position was empty space.
func (*FlowchartView) GetSelection ¶
func (fcv *FlowchartView) GetSelection() interface{}
GetSelection returns the currently selected node or pad.
func (*FlowchartView) Rebuild ¶ added in v0.4.8
func (fcv *FlowchartView) Rebuild() error
Rebuild discards all internal state, rebuilding the view internals from the layout.
func (*FlowchartView) SetDoubleClickCallback ¶ added in v0.4.5
func (fcv *FlowchartView) SetDoubleClickCallback(cb func(interface{}, float64, float64))
SetDoubleClickCallback sets a callback to be invoked when a\ double-click happens with mouse button one.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model encapsulates the state of the flowchart.
func (*Model) MoveTarget ¶
func (m *Model) MoveTarget(t hit.TestableObj, x, y float64)
func (*Model) OnUserLinksPads ¶
func (*Model) SetTargetActive ¶
func (m *Model) SetTargetActive(target hit.TestableObj, a bool)
type Overlay ¶ added in v0.3.0
type Overlay interface { // Configure is called when the width/height of the drawing area is updated. Configure(w, h int) // HandleMotionEvent is called on move movement. If the event should be // intercepted and not processed by the flowchart, HandleMotionEvent() should // return true. HandleMotionEvent(*gdk.EventMotion) bool // HandlePressEvent is called on move presses. If the event should be // intercepted and not processed by the flowchart, HandleMotionEvent() should // return true. HandlePressEvent(evt *gdk.Event, press bool) bool // Draw is called to draw the overlay. Draw(da *gtk.DrawingArea, cr *cairo.Context) }
Overlay visual elements drawn over the top of the flowchart.