trame.widgets.flow module
- class trame.widgets.flow.Background(**kwargs)
Bases:
AbstractElementBackground for NodeEditor.
- class trame.widgets.flow.Controls(**kwargs)
Bases:
AbstractElementControls for NodeEditor.
- class trame.widgets.flow.ControlsButton(**kwargs)
Bases:
AbstractElementControlsButton for Controls.
- class trame.widgets.flow.Handle(position: Literal['top', 'bottom', 'left', 'right'], type: Literal['source', 'target'], **kwargs)
Bases:
AbstractElement
- class trame.widgets.flow.MiniMap(**kwargs)
Bases:
AbstractElementMiniMap for NodeEditor.
- class trame.widgets.flow.MiniMapNode(id: str, position: Position, dimensions: Dimensions, **kwargs)
Bases:
AbstractElementMiniMapNode for MiniMap.
- class trame.widgets.flow.NodeEditor(**kwargs)
Bases:
AbstractElementNode Editor based on VueFlow.
- add_node(node: Node)
Add a Node to the graph.
- add_edge(edge: Edge)
Add an Edge to the graph.
- get_edge(source: str, target: str, source_handle: str | None = None, target_handle: str | None = None)
Get an Edge from its source and target. Returns None if not found.
- remove_edge(source: str, target: str, source_handle: str | None = None, target_handle: str | None = None)
Remove an Edge from the graph. Does nothing if there is no edge from source to target.
- deserialize_graph(graph_str: str) bool
Deserialize graph from a string representing a Graph object.
Returns False if deserialization produced any error, else True.
- fit_view()
Fit VueFlow’s view to show the entire graph (excluding hidden nodes)
- clear_graph()
Remove every edges and then every nodes.
- class trame.widgets.flow.NodeResizer(**kwargs)
Bases:
AbstractElementNodeResizer for CustomNode.
- class trame.widgets.flow.NodeToolbar(**kwargs)
Bases:
AbstractElementNodeToolbar for NodeEditor.