Release Notes¶
Version 0.5.1¶
A small enhancement release that lets the canvas accept files dragged in from the operating system.
Enhancements¶
- Drop files onto the canvas: add
"Files"todrop_typesto accept files dragged in from the operating system. Thedropevent'sdatalists each file'sname,type,sizeand textcontent, so a handler can, for example, load a graph saved as JSON. See React to Events (#79).
Version 0.5.0¶
This release adds port and edge value inspection, connection checks
and canvas drops for interactive graph editing. Node and Edge properties now sync to
the browser in place, batches of changes render as a single update, and
an error boundary keeps a malformed graph from blanking the canvas.
Highlights¶
-
Port and edge inspection: handle and edge click events can open a Panel popup with
flow.show_popup(content, position). Setpopup_trigger="hover"to use hover events instead; useflow.close_popup()to dismiss it. Applications supply the value to display, andexamples/port_value_inspection.pyshows both interactions (#74). -
Connection validation: opt-in browser policies reject connections with the wrong direction or handle type, full inputs, duplicate edges, and cycles. Register Python rules with
add_connection_validator()to show rejection reasons on candidate handles during a drag. Python validators check interactive drags only; they do not restrictflow.add_edge()or direct changes toflow.edges. See Validate Connections andexamples/connection_validation.py(#75). -
Error recovery: the canvas is now wrapped in an error boundary, controlled by the new
error_recoveryparameter ("auto"by default, or"manual"/"off"). In"auto"mode a React render error remounts the canvas, then remounts again in a view-only safe mode that repairs or hides elements it cannot render (invalid positions, unknown node/edge types, dangling edges, duplicate or missing ids) without mutating the server-side graph. If retries are exhausted a recovery panel offers Try again, Reload page and Copy details. Every error is logged to thepanel.reactflowlogger and emitted as aclient_errorevent, so browser-side failures are no longer invisible to the server (#70). -
Base property sync: the top-level React Flow fields on
NodeandEdge(label,type,style,className,draggable,connectable,deletable, ...) are now synced to the frontend, so assigningnode.label = "Start (running)"patches the browser in place instead of requiringflow.nodesto be replaced. Parameters declared on a subclass continue to sync intodata. Newpatch_node_props()andpatch_edge_props()methods do the same for dict-based nodes and edges, where passingNoneclears a field back to the CSS/theme default, and newon_props_changehooks fire onNode/Edgesubclasses when the frontend changes a property.positionandselectedremain browser-owned during drag and selection and are only pushed viapatch_node_props()(#71).
Enhancements¶
-
Batch removal:
remove_node()andremove_edge()now accept several ids, either as separate arguments (flow.remove_node("n1", "n2")) or as a sequence (flow.remove_node(["n1", "n2"])), and remove them in a single update. For any other batch of changes made from Python, wrap them inpn.io.hold()to render them at once (#72). -
Drop data onto the canvas:
drop_typeslists MIME types the canvas accepts, and each drop of one of them emits adropevent with the dropped data, its flow position, and the node or handle under the pointer, so a handler can add and wire what was dropped. Draggablepanel_material_ui.MenuListitems work as a source; see React to Events (#77).
Bug fixes¶
-
Nodes remounted when node types change: any change to
node_typesrebuilt the component for every node type, so React remounted every node and detached its embedded view, which could leave Bokeh plots blank. Each type's component is now reused until its own spec or the popup settings change (#77). -
Progressive re-render when deleting multiple elements: deleting a multi-node selection removed the nodes one at a time, syncing an intermediate graph to the browser per node so the nodes visibly disappeared one by one. Updates triggered by a frontend message are now held and combined into a single patch, and node/edge deletion assigns
nodesandedgesonce (#72). -
Serialization error when updating
node_types: assigningNodeTypeorEdgeTypedescriptors with aschemaclass after construction synced them to the browser before they were converted to JSON descriptors, so the server failed withcan't serialize ParameterizedMetaclass. They are now converted before syncing, and updatingnode_typesandedge_typestogether no longer raises aTypeError(#76).
Version 0.4.1¶
A small enhancement release adding viewport zoom controls.
Enhancements¶
- Zoom limits — new
min_zoom(default0.5) andmax_zoom(default2) parameters constrain how far the canvas can be zoomed out and in, and can be updated at runtime (#69).
Version 0.4.0¶
This release adds new interaction features, edge routing options, and handle customization capabilities.
Highlights¶
- Right-click context menu — nodes and the canvas now support a configurable context menu triggered on right-click, enabling custom actions like delete, duplicate, or copy without toolbar buttons (#65).
- Smart edge routing — new smart edge types (
smartBezier,smartStep,smartStraight) that automatically route around nodes instead of passing through them (#64). - Handle connectivity controls — per-type flags
(
input_connectable,input_connectable_start,input_connectable_end, and theiroutput_*counterparts) let you restrict which handles users can drag edges from or to (#63). - Handle tooltips — handles can now carry a
labelthat appears as an instant tooltip on hover, making port purpose discoverable without cluttering the canvas. Pass{"id": "port_name", "label": "Description"}in yourinputs/outputslists (#67). Node.flowandEdge.flowback-references — instance-based nodes and edges now hold a.flowreference to their parentReactFlow, simplifying imperative graph manipulation from callbacks (#56).- Delete key support — selected nodes and edges can now be removed with the Delete key, matching standard graph-editor UX expectations.
- Bundle cache-busting — the frontend bundle URL now includes a content hash, preventing stale cached bundles after upgrades (#68).
Bug fixes¶
- Fixed stale node views not updating and deletion causing flicker (#60).
- Fixed
flowattribute initialization on component creation (#59). - Edge/node add/remove events are now emitted exactly once (#58).
- Fixed removing a node when edges are defined as
Edgeinstances (#57).
Version 0.3.0¶
This release focuses on core graph-model capabilities, callback ergonomics, rendering/styling improvements, and major documentation expansion.
Highlights¶
- Parameterized
Node/Edgeinstances as first-class graph elements —ReactFlownow supports instance-based graph authoring with richer Python object workflows, including improved serialization/sync behavior and expanded API/core test coverage. - Event callback improvements —
.on(...)callbacks can now accept theReactFlowinstance as a second argument and support async callbacks, making app-level event handling significantly more flexible. - Rendering fixes for embedded views — improved scaling and interaction behavior when rendering figures inside nodes, including better handling of drag/pan/scroll conflicts within embedded content.
- Editor rendering robustness — fixed node and edge editor rendering paths
so editors can render reliably even when no node
viewis defined. - Color mode and default node styling support — added color-mode-aware styling capabilities and refined baseline node CSS for better defaults out of the box.
- Expanded how-to documentation — substantial updates to guides for declaring types, defining nodes/edges, editors, embedding views, reacting to events, and styling, with refreshed screenshots across the docs.
- Examples overhaul in docs — added an examples gallery with grid cards and dedicated pages/screenshots for each example app, plus docs navigation updates for easier discovery.
Version 0.2.0¶
This release focuses on stronger typed graph specs, better node-view handling, and improved docs and packaging.
Highlights¶
NodeSpecview support — added aviewparameter toNodeSpecand fixedadd_nodebehavior so embedded views are preserved when adding nodes programmatically.- Safer embedded view handling — fixed an
AttributeErrorwhen node views are PanelViewerobjects or other arbitrary view-like objects. EdgeSpechandle targeting — addedsourceHandleandtargetHandlefields to support explicit edge-to-port connections.- Spec auto-serialization — added automatic serialization for
NodeSpecandEdgeSpecobjects to reduce boilerplate when using dataclass-based graph definitions. - Handle rendering fix — corrected empty handle list behavior so
[]is treated distinctly from missing/undefined handles. - Styling hook for labels — added the
rf-node-labelCSS class on node labels for easier targeted styling. - Docs and onboarding updates — quickstart and index docs now explicitly
document the required
pn.extension("jsoneditor")setup; additional how-to docs were updated for new handle and serialization behavior. - Packaging reliability — ensured the frontend
distassets are included in distributions.
Version 0.1.0¶
Initial release
Panel-ReactFlow brings the power of React Flow to the Panel ecosystem, giving Python developers a fully interactive node-based graph editor with minimal boilerplate.
Highlights¶
- ReactFlow component — a Panel component that renders an interactive React Flow canvas with drag, select, connect, and delete support.
- Python-first graph state — define nodes and edges as plain Python dictionaries; all changes sync bidirectionally between the frontend and Python.
- Node & edge types — use
NodeTypeandEdgeTypedataclasses to declare typed nodes and edges with optional JSON Schema for theirdatapayloads. - Schema-driven editors — auto-generate editing forms from JSON Schema
(via
SchemaEditor) or fall back to a raw JSON tree view (JsonEditor). Custom editors can be any Python callable or class. - Editor display modes — show editors inline inside nodes
(
editor_mode="node"), in a toolbar popover ("toolbar"), or in a side panel ("side"). - Embedded views — pass any Panel
Viewableas a node'sviewto render rich content (charts, indicators, widgets) directly inside graph nodes. - Event system — subscribe to granular events (
node_added,edge_deleted,selection_changed, …) or use"*"to listen to everything. - Custom handles — configure named input and output ports per node type.
- Stylesheets — apply CSS stylesheets targeting
.react-flow__node-{type}and.react-flow__edge-{type}classes for full visual control. - Panel integration —
top_panel,bottom_panel,left_panel, andright_panelslots for surrounding the canvas with arbitrary Panel components. - Helper dataclasses —
NodeSpecandEdgeSpecfor validated node/edge construction; convenience methodsadd_node,remove_node,add_edge,remove_edge, andpatch_node_data/patch_edge_datafor live graph manipulation.