Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "trame-flow"
version = "2.2.0"
description = "A node editor for trame using VueFlow"
authors = [
{name = "Trame Developer"},
{name = "Kitware Inc."},
]
dependencies = [
"trame_client>=3.10",
Expand Down
13 changes: 11 additions & 2 deletions src/trame_flow/widgets/flow/node_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ def __init__(
:param type: Type of the handle.
:param connectable: (Optional) Boolean, integer for maximum connection number or function that returns a boolean.
:param id: (Optional) ID of the handle. Useful when using multiple source handles or target handles.
:param connection_mode: (Optional) Defines if a handle can be connected to another handle with the same type. "loose" (default) or "strict".
:param is_valid_connection: (Optional) Must be a JS function expression that takes a connection object and returns a bool indicating if it is valid.
"""
super().__init__("Handle", position=position, type=type, **kwargs)

self._attr_names += [
"connectable",
("connection_mode", "connection-mode"),
"id",
("is_valid_connection", "isValidConnection"),
"position",
"type",
]
Expand All @@ -64,11 +64,20 @@ class NodeEditor(HtmlElement):
_next_id = 0

def __init__(self, **kwargs):
"""
:param connection_mode: (Optional) Defines if a handle can be connected to another handle with the same type. "loose" (default) or "strict".
Comment thread
munozco marked this conversation as resolved.
:param is_valid_connection: (Optional) Must be a JS function expression that takes a connection object and returns a bool indicating if it is valid.
"""
super().__init__(
"node-editor",
**kwargs,
)

self._attr_names += [
("connection_mode", "connectionMode"),
("is_valid_connection", "isValidConnection"),
]

self._event_names += [
("click_connect_end", "clickConnectEnd"),
("click_connect_start", "clickConnectStart"),
Expand Down
Loading