panel-reactflow 0.0.1a1__py3-none-any.whl
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/__init__.py +12 -0
- panel_reactflow/__version.py +44 -0
- panel_reactflow/base.py +706 -0
- panel_reactflow/models/reactflow.jsx +561 -0
- panel_reactflow/py.typed +0 -0
- panel_reactflow-0.0.1a1.dist-info/METADATA +158 -0
- panel_reactflow-0.0.1a1.dist-info/RECORD +9 -0
- panel_reactflow-0.0.1a1.dist-info/WHEEL +4 -0
- panel_reactflow-0.0.1a1.dist-info/licenses/LICENSE.txt +30 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: panel-reactflow
|
|
3
|
+
Version: 0.0.1a1
|
|
4
|
+
Summary: A Panel wrapper for the Reactflow JS library.
|
|
5
|
+
Project-URL: Homepage, https://github.com/panel-extensions/panel-reactflow
|
|
6
|
+
Project-URL: Source, https://github.com/panel-extensions/panel-reactflow
|
|
7
|
+
Author-email: Philipp Rudiger <philipp@holoviz.org>
|
|
8
|
+
Maintainer-email: Philipp Rudiger <philipp@holoviz.org>
|
|
9
|
+
License: BSD
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
15
|
+
Classifier: Natural Language :: English
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Requires-Dist: packaging
|
|
26
|
+
Requires-Dist: panel>=1.5.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: mkdocs; extra == 'dev'
|
|
29
|
+
Requires-Dist: mkdocs-material; extra == 'dev'
|
|
30
|
+
Requires-Dist: mkdocs-pycafe; extra == 'dev'
|
|
31
|
+
Requires-Dist: mkdocstrings[python]; extra == 'dev'
|
|
32
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest-rerunfailures; extra == 'dev'
|
|
36
|
+
Requires-Dist: pytest-xdist; extra == 'dev'
|
|
37
|
+
Requires-Dist: watchfiles; extra == 'dev'
|
|
38
|
+
Provides-Extra: mypy
|
|
39
|
+
Requires-Dist: mypy; extra == 'mypy'
|
|
40
|
+
Requires-Dist: types-requests; extra == 'mypy'
|
|
41
|
+
Requires-Dist: typing-extensions; extra == 'mypy'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# ✨ panel-reactflow
|
|
45
|
+
|
|
46
|
+
[](https://github.com/panel-extensions/panel-reactflow/actions/workflows/ci.yml)
|
|
47
|
+
[](https://prefix.dev/channels/conda-forge/packages/panel-reactflow)
|
|
48
|
+
[](https://pypi.org/project/panel-reactflow)
|
|
49
|
+
[](https://pypi.org/project/panel-reactflow)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
A Panel wrapper for the React Flow JS library.
|
|
53
|
+
|
|
54
|
+
## Features
|
|
55
|
+
|
|
56
|
+
- Python-first, JSON-serializable graph state
|
|
57
|
+
- Panel viewables inside nodes via node ``view`` entries
|
|
58
|
+
- Interactive editing (drag/select/connect/delete) with sync back to Python
|
|
59
|
+
- Optional schema definitions for node/edge properties
|
|
60
|
+
- Event callbacks via `ReactFlow.on(...)` for app-level handling
|
|
61
|
+
|
|
62
|
+
## Pin your version!
|
|
63
|
+
|
|
64
|
+
This project is **in its early stages**, so if you find a version that suits your needs, it’s recommended to **pin your version**, as updates may introduce changes.
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
Install it via `pip`:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install panel-reactflow
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
import panel as pn
|
|
78
|
+
|
|
79
|
+
from panel_reactflow import ReactFlow
|
|
80
|
+
|
|
81
|
+
pn.extension()
|
|
82
|
+
|
|
83
|
+
nodes = [
|
|
84
|
+
{
|
|
85
|
+
"id": "n1",
|
|
86
|
+
"position": {"x": 0, "y": 0},
|
|
87
|
+
"type": "panel",
|
|
88
|
+
"data": {"label": "Start"},
|
|
89
|
+
"view": pn.pane.Markdown("Node 1 content"),
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "n2",
|
|
93
|
+
"position": {"x": 260, "y": 60},
|
|
94
|
+
"type": "panel",
|
|
95
|
+
"data": {"label": "End"},
|
|
96
|
+
"view": pn.pane.Markdown("Node 2 content"),
|
|
97
|
+
},
|
|
98
|
+
]
|
|
99
|
+
edges = [
|
|
100
|
+
{"id": "e1", "source": "n1", "target": "n2"},
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
flow = ReactFlow(
|
|
104
|
+
nodes=nodes,
|
|
105
|
+
edges=edges,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
flow
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
For property schemas and richer editors, provide `node_types`/`edge_types` with `PropertySpec` and handle changes via `ReactFlow.on(...)`.
|
|
112
|
+
|
|
113
|
+
## Development
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
git clone https://github.com/panel-extensions/panel-reactflow
|
|
117
|
+
cd panel-reactflow
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
For a simple setup use [`uv`](https://docs.astral.sh/uv/):
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
uv venv
|
|
124
|
+
source .venv/bin/activate # on linux. Similar commands for windows and osx
|
|
125
|
+
uv pip install -e .[dev]
|
|
126
|
+
pre-commit run install
|
|
127
|
+
pytest tests
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
For the full Github Actions setup use [pixi](https://pixi.sh):
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pixi run pre-commit-install
|
|
134
|
+
pixi run postinstall
|
|
135
|
+
pixi run test
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
This repository is based on [copier-template-panel-extension](https://github.com/panel-extensions/copier-template-panel-extension) (you can create your own Panel extension with it)!
|
|
139
|
+
|
|
140
|
+
To update to the latest template version run:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
pixi exec --spec copier --spec ruamel.yaml -- copier update --defaults --trust
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Note: `copier` will show `Conflict` for files with manual changes during an update. This is normal. As long as there are no merge conflict markers, all patches applied cleanly.
|
|
147
|
+
|
|
148
|
+
## ❤️ Contributing
|
|
149
|
+
|
|
150
|
+
Contributions are welcome! Please follow these steps to contribute:
|
|
151
|
+
|
|
152
|
+
1. Fork the repository.
|
|
153
|
+
2. Create a new branch: `git checkout -b feature/YourFeature`.
|
|
154
|
+
3. Make your changes and commit them: `git commit -m 'Add some feature'`.
|
|
155
|
+
4. Push to the branch: `git push origin feature/YourFeature`.
|
|
156
|
+
5. Open a pull request.
|
|
157
|
+
|
|
158
|
+
Please ensure your code adheres to the project's coding standards and passes all tests.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
panel_reactflow/__init__.py,sha256=5D8t-MHgxQMO-D3Mj3DX_zSF0wzC7CXJl3ADxM26aRE,272
|
|
2
|
+
panel_reactflow/__version.py,sha256=BQF5KtL1I4iZ7yOQAVekWkrt2klrskNev4Fq2dULwBI,1758
|
|
3
|
+
panel_reactflow/base.py,sha256=cTegvTJfXuNAe-TOHqoRNFDWxOxHT7xbtp8xBKhAV5c,26956
|
|
4
|
+
panel_reactflow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
panel_reactflow/models/reactflow.jsx,sha256=Q76l5MTFAs0xqVfqW7sSn-OfUXPZ4klWCAOD-vPRRtY,16101
|
|
6
|
+
panel_reactflow-0.0.1a1.dist-info/METADATA,sha256=s2etkjpxo_QisrD-xQ1s7R7U2MY0gnheKjt5aUYtKnE,5313
|
|
7
|
+
panel_reactflow-0.0.1a1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
8
|
+
panel_reactflow-0.0.1a1.dist-info/licenses/LICENSE.txt,sha256=Jqbh7noYJKpAY0CUXf5UeMNtew5vLlLHmRbBrIo6XrE,1515
|
|
9
|
+
panel_reactflow-0.0.1a1.dist-info/RECORD,,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Copyright (c) 2018, HoloViz team (holoviz.org).
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are
|
|
6
|
+
met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
12
|
+
notice, this list of conditions and the following disclaimer in the
|
|
13
|
+
documentation and/or other materials provided with the
|
|
14
|
+
distribution.
|
|
15
|
+
|
|
16
|
+
* Neither the name of the copyright holder nor the names of any
|
|
17
|
+
contributors may be used to endorse or promote products derived
|
|
18
|
+
from this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
21
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
22
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
23
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
24
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
25
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
26
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
27
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
28
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
29
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
30
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|