ironflow.gui.workflows.canvas_widgets.flow module

The parent canvas for the whole flow representation.

class ironflow.gui.workflows.canvas_widgets.flow.FlowCanvas(screen: WorkflowsGUI, flow: Flow)[source]

Bases: object

A canvas for representing a particular Ryven script, which is determined at instantiation by the currently active gui script.

Mouse behaviour:
  • Mouse click (down and release) on a node element or any child element selects that element

  • Mouse down, hold, and move on a node element or any child element selects the (parent) node and moves it

  • Mouse click on nothing clears selection

  • Mouse double-click on nothing creates a new node of the type currently selected in the node menu

  • Mouse click on a selected (pressed) port (button) deselects (unpresses) that port (button)

  • Todo: Mouse down, hold, and move on nothing draws a rectangle, everything inside is selected on release

Keyboard behaviour: Todo
  • ESC: Deselect all.

  • Backspace/Delete:
    • If a node is selected, deletes it

    • If a port is selected, deletes all connections it is part of

add_node(x: Number, y: Number, node: Node)[source]
property canvas
canvas_restart() None[source]
clear_port_highlighting()[source]
delete_selected() None[source]
deselect_all() None[source]
display()[source]
draw_connection(port_1: int, port_2: int) None[source]
property flow_canvas: FlowCanvas
get_element_at_xy(x_in: Number, y_in: Number) CanvasWidget | None[source]
get_selected_objects() list[CanvasWidget][source]
property gui: GUI
handle_keyboard_event(key: str, shift_key, ctrl_key, meta_key) None[source]
handle_mouse_down(x: Number, y: Number)[source]
handle_mouse_move(x: Number, y: Number) None[source]
handle_mouse_up(x: Number, y: Number)[source]
highlight_compatible_ports(selected: PortWidget)[source]
load_node(x: Number, y: Number, node: Node) NodeWidget[source]
redraw() None[source]
property title: str
zoom_in() None[source]
zoom_out() None[source]