panel-reactflow 0.4.0b1__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/PKG-INFO +1 -1
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/how-to/declare-types.md +157 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/releases.md +57 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/pixi.lock +5852 -4159
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/pixi.toml +2 -2
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/src/panel_reactflow/base.py +22 -14
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/src/panel_reactflow/dist/css/reactflow.css +27 -0
- panel_reactflow-0.4.1/src/panel_reactflow/dist/panel-reactflow.bundle.css +1 -0
- panel_reactflow-0.4.1/src/panel_reactflow/dist/panel-reactflow.bundle.js +88 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/src/panel_reactflow/models/reactflow.jsx +24 -11
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/tests/test_core.py +0 -3
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/tests/ui/test_ui.py +24 -0
- panel_reactflow-0.4.0b1/src/panel_reactflow/dist/panel-reactflow.bundle.css +0 -1
- panel_reactflow-0.4.0b1/src/panel_reactflow/dist/panel-reactflow.bundle.js +0 -88
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/.copier-answers.yml +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/.gitattributes +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/.github/CODEOWNERS +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/.github/dependabot.yml +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/.github/workflows/build.yml +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/.github/workflows/docs.yml +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/.github/workflows/test.yml +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/.gitignore +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/.pre-commit-config.yaml +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/.prettierrc +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/LICENSE.txt +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/MANIFEST.in +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/README.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/logo.svg +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/declare-types.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/define-editors-edge.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/define-editors-node.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/define-nodes-edges.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/embed-views-in-nodes.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/examples/advanced.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/examples/custom_editor.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/examples/edge_editors.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/examples/node_edge_instances.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/examples/schema_types.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/examples/simple.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/examples/threejs_viewer.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/examples/threejs_viewer_instances.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/quickstart.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/react-to-events.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/assets/screenshots/style-nodes-edges.png +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/examples/advanced.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/examples/custom-editor.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/examples/edge-editors.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/examples/index.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/examples/node-edge-instances.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/examples/schema-types.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/examples/simple.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/examples/threejs-viewer-instances.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/examples/threejs-viewer.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/how-to/context-menu.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/how-to/control-handle-connectivity.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/how-to/define-editors.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/how-to/define-nodes-edges.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/how-to/embed-views-in-nodes.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/how-to/react-to-events.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/how-to/style-nodes-edges.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/index.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/quickstart.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/docs/reference/panel_reactflow.md +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/advanced.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/context_menu.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/custom_editor.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/edge_editors.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/edge_types_comparison.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/node_edge_instances.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/schema_types.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/simple.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/smart_edges_example.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/threejs_viewer.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/examples/threejs_viewer_instances.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/hatch_build.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/pyproject.toml +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/src/panel_reactflow/__init__.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/src/panel_reactflow/__version.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/src/panel_reactflow/dist/icons/gear.svg +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/src/panel_reactflow/py.typed +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/src/panel_reactflow/schema.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/tests/__init__.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/tests/conftest.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/tests/test_api.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/tests/test_connectable_handles.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/tests/test_connectable_integration.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/tests/ui/__init__.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/tests/ui/test_context_menu.py +0 -0
- {panel_reactflow-0.4.0b1 → panel_reactflow-0.4.1}/zensical.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: panel-reactflow
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: A Panel wrapper for the Reactflow JS library.
|
|
5
5
|
Project-URL: Homepage, https://github.com/panel-extensions/panel-reactflow
|
|
6
6
|
Project-URL: Source, https://github.com/panel-extensions/panel-reactflow
|
|
@@ -6,6 +6,7 @@ kind of node/edge carries**. A type can provide:
|
|
|
6
6
|
- a type name (`type`)
|
|
7
7
|
- a display label (`label`)
|
|
8
8
|
- node handles (`inputs` / `outputs`)
|
|
9
|
+
- handle connectivity controls (`input_connectable*` / `output_connectable*`)
|
|
9
10
|
- a schema for the `data` payload (`schema`)
|
|
10
11
|
|
|
11
12
|
Types are separate from editors. A type defines structure; an editor defines
|
|
@@ -237,3 +238,159 @@ flow = ReactFlow(
|
|
|
237
238
|
|
|
238
239
|
Types without a schema still work; they just do not get schema-driven
|
|
239
240
|
validation or auto-generated forms.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Handle tooltips
|
|
245
|
+
|
|
246
|
+
By default, handles are plain connection points. You can add a tooltip (shown
|
|
247
|
+
on hover) by passing a dict with `"id"` and `"label"` instead of a plain string:
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
from panel_reactflow import NodeType
|
|
251
|
+
|
|
252
|
+
node_types = {
|
|
253
|
+
"transform": NodeType(
|
|
254
|
+
type="transform",
|
|
255
|
+
label="Transform",
|
|
256
|
+
inputs=[{"id": "in", "label": "Data Input"}],
|
|
257
|
+
outputs=[
|
|
258
|
+
{"id": "success", "label": "Successful results"},
|
|
259
|
+
{"id": "error", "label": "Failed records"},
|
|
260
|
+
],
|
|
261
|
+
),
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Plain strings and dicts can be mixed freely in the same list:
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
inputs=["simple_port", {"id": "documented_port", "label": "Hover to see this"}]
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Control handle connectivity
|
|
274
|
+
|
|
275
|
+
By default, all handles (inputs and outputs) are fully connectable — users can
|
|
276
|
+
drag edges from or to any handle. Use the `*_connectable*` flags to restrict
|
|
277
|
+
which connections are allowed.
|
|
278
|
+
|
|
279
|
+
### Common patterns
|
|
280
|
+
|
|
281
|
+
#### Data source (output only)
|
|
282
|
+
|
|
283
|
+
A node that produces data but cannot accept incoming connections to its output:
|
|
284
|
+
|
|
285
|
+
```python
|
|
286
|
+
from panel_reactflow import NodeType
|
|
287
|
+
|
|
288
|
+
source_type = NodeType(
|
|
289
|
+
type="data_source",
|
|
290
|
+
label="Data Source",
|
|
291
|
+
outputs=["data"],
|
|
292
|
+
output_connectable_start=True, # Can drag FROM output
|
|
293
|
+
output_connectable_end=False, # Cannot drag TO output
|
|
294
|
+
)
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
#### Data sink (input only)
|
|
298
|
+
|
|
299
|
+
A node that consumes data but cannot produce outgoing connections from its input:
|
|
300
|
+
|
|
301
|
+
```python
|
|
302
|
+
sink_type = NodeType(
|
|
303
|
+
type="data_sink",
|
|
304
|
+
label="Data Sink",
|
|
305
|
+
inputs=["data"],
|
|
306
|
+
input_connectable_start=False, # Cannot drag FROM input
|
|
307
|
+
input_connectable_end=True, # Can drag TO input
|
|
308
|
+
)
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
#### Monitor node
|
|
312
|
+
|
|
313
|
+
A node that accepts input but whose output is status-only (one direction):
|
|
314
|
+
|
|
315
|
+
```python
|
|
316
|
+
monitor_type = NodeType(
|
|
317
|
+
type="monitor",
|
|
318
|
+
label="Monitor",
|
|
319
|
+
inputs=["in"],
|
|
320
|
+
outputs=["status"],
|
|
321
|
+
input_connectable_start=False, # Cannot start edges from input
|
|
322
|
+
output_connectable_end=False, # Cannot end edges at output
|
|
323
|
+
)
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### All connectivity flags
|
|
327
|
+
|
|
328
|
+
| Flag | Default | Controls |
|
|
329
|
+
|------|---------|----------|
|
|
330
|
+
| `input_connectable` | `True` | Whether input handles are connectable at all |
|
|
331
|
+
| `input_connectable_start` | `True` | Whether edges can start from input handles |
|
|
332
|
+
| `input_connectable_end` | `True` | Whether edges can end at input handles |
|
|
333
|
+
| `output_connectable` | `True` | Whether output handles are connectable at all |
|
|
334
|
+
| `output_connectable_start` | `True` | Whether edges can start from output handles |
|
|
335
|
+
| `output_connectable_end` | `True` | Whether edges can end at output handles |
|
|
336
|
+
|
|
337
|
+
### Complete example
|
|
338
|
+
|
|
339
|
+
```python
|
|
340
|
+
import panel as pn
|
|
341
|
+
from panel_reactflow import NodeType, NodeSpec, EdgeSpec, ReactFlow
|
|
342
|
+
|
|
343
|
+
pn.extension("jsoneditor")
|
|
344
|
+
|
|
345
|
+
# Define node types with different connectivity patterns
|
|
346
|
+
node_types = {
|
|
347
|
+
"source": NodeType(
|
|
348
|
+
type="source",
|
|
349
|
+
label="Data Source",
|
|
350
|
+
outputs=["data"],
|
|
351
|
+
output_connectable_start=True,
|
|
352
|
+
output_connectable_end=False,
|
|
353
|
+
),
|
|
354
|
+
"transform": NodeType(
|
|
355
|
+
type="transform",
|
|
356
|
+
label="Transform",
|
|
357
|
+
inputs=["in"],
|
|
358
|
+
outputs=["out"],
|
|
359
|
+
# All connectable flags default to True
|
|
360
|
+
),
|
|
361
|
+
"sink": NodeType(
|
|
362
|
+
type="sink",
|
|
363
|
+
label="Data Sink",
|
|
364
|
+
inputs=["data"],
|
|
365
|
+
input_connectable_start=False,
|
|
366
|
+
input_connectable_end=True,
|
|
367
|
+
),
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
# Create a data pipeline
|
|
371
|
+
flow = ReactFlow(
|
|
372
|
+
nodes=[
|
|
373
|
+
NodeSpec(id="src", type="source", position={"x": 0, "y": 100}, data={}).to_dict(),
|
|
374
|
+
NodeSpec(id="tx", type="transform", position={"x": 250, "y": 100}, data={}).to_dict(),
|
|
375
|
+
NodeSpec(id="snk", type="sink", position={"x": 500, "y": 100}, data={}).to_dict(),
|
|
376
|
+
],
|
|
377
|
+
edges=[
|
|
378
|
+
EdgeSpec(id="e1", source="src", target="tx").to_dict(),
|
|
379
|
+
EdgeSpec(id="e2", source="tx", target="snk").to_dict(),
|
|
380
|
+
],
|
|
381
|
+
node_types=node_types,
|
|
382
|
+
sizing_mode="stretch_both",
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
flow.servable()
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
In this example:
|
|
389
|
+
|
|
390
|
+
- Users can drag from the **source** output to the **transform** input ✓
|
|
391
|
+
- Users cannot drag to the **source** output ✗
|
|
392
|
+
- Users can drag from the **transform** output to the **sink** input ✓
|
|
393
|
+
- Users cannot drag from the **sink** input ✗
|
|
394
|
+
|
|
395
|
+
The UI prevents invalid connections automatically — non-connectable handles
|
|
396
|
+
show different cursor behavior and won't accept drag operations.
|
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# Release Notes
|
|
2
2
|
|
|
3
|
+
## Version 0.4.1
|
|
4
|
+
|
|
5
|
+
A small enhancement release adding viewport zoom controls.
|
|
6
|
+
|
|
7
|
+
### Enhancements
|
|
8
|
+
|
|
9
|
+
- **Zoom limits** — new `min_zoom` (default `0.5`) and `max_zoom`
|
|
10
|
+
(default `2`) parameters constrain how far the canvas can be zoomed
|
|
11
|
+
out and in, and can be updated at runtime
|
|
12
|
+
([#69](https://github.com/panel-extensions/panel-reactflow/pull/69)).
|
|
13
|
+
|
|
14
|
+
## Version 0.4.0
|
|
15
|
+
|
|
16
|
+
This release adds new interaction features, edge routing options, and
|
|
17
|
+
handle customization capabilities.
|
|
18
|
+
|
|
19
|
+
### Highlights
|
|
20
|
+
|
|
21
|
+
- **Right-click context menu** — nodes and the canvas now support a
|
|
22
|
+
configurable context menu triggered on right-click, enabling custom
|
|
23
|
+
actions like delete, duplicate, or copy without toolbar buttons
|
|
24
|
+
([#65](https://github.com/panel-extensions/panel-reactflow/pull/65)).
|
|
25
|
+
- **Smart edge routing** — new smart edge types (`smartBezier`,
|
|
26
|
+
`smartStep`, `smartStraight`) that automatically route around nodes
|
|
27
|
+
instead of passing through them
|
|
28
|
+
([#64](https://github.com/panel-extensions/panel-reactflow/pull/64)).
|
|
29
|
+
- **Handle connectivity controls** — per-type flags
|
|
30
|
+
(`input_connectable`, `input_connectable_start`,
|
|
31
|
+
`input_connectable_end`, and their `output_*` counterparts) let you
|
|
32
|
+
restrict which handles users can drag edges from or to
|
|
33
|
+
([#63](https://github.com/panel-extensions/panel-reactflow/pull/63)).
|
|
34
|
+
- **Handle tooltips** — handles can now carry a `label` that appears as
|
|
35
|
+
an instant tooltip on hover, making port purpose discoverable without
|
|
36
|
+
cluttering the canvas. Pass `{"id": "port_name", "label": "Description"}`
|
|
37
|
+
in your `inputs`/`outputs` lists
|
|
38
|
+
([#67](https://github.com/panel-extensions/panel-reactflow/pull/67)).
|
|
39
|
+
- **`Node.flow` and `Edge.flow` back-references** — instance-based nodes
|
|
40
|
+
and edges now hold a `.flow` reference to their parent `ReactFlow`,
|
|
41
|
+
simplifying imperative graph manipulation from callbacks
|
|
42
|
+
([#56](https://github.com/panel-extensions/panel-reactflow/pull/56)).
|
|
43
|
+
- **Delete key support** — selected nodes and edges can now be removed
|
|
44
|
+
with the Delete key, matching standard graph-editor UX expectations.
|
|
45
|
+
- **Bundle cache-busting** — the frontend bundle URL now includes a
|
|
46
|
+
content hash, preventing stale cached bundles after upgrades
|
|
47
|
+
([#68](https://github.com/panel-extensions/panel-reactflow/pull/68)).
|
|
48
|
+
|
|
49
|
+
### Bug fixes
|
|
50
|
+
|
|
51
|
+
- Fixed stale node views not updating and deletion causing flicker
|
|
52
|
+
([#60](https://github.com/panel-extensions/panel-reactflow/pull/60)).
|
|
53
|
+
- Fixed `flow` attribute initialization on component creation
|
|
54
|
+
([#59](https://github.com/panel-extensions/panel-reactflow/pull/59)).
|
|
55
|
+
- Edge/node add/remove events are now emitted exactly once
|
|
56
|
+
([#58](https://github.com/panel-extensions/panel-reactflow/pull/58)).
|
|
57
|
+
- Fixed removing a node when edges are defined as `Edge` instances
|
|
58
|
+
([#57](https://github.com/panel-extensions/panel-reactflow/pull/57)).
|
|
59
|
+
|
|
3
60
|
## Version 0.3.0
|
|
4
61
|
|
|
5
62
|
This release focuses on core graph-model capabilities, callback ergonomics,
|