graph_widget 0.1.0__tar.gz → 0.1.2__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.
@@ -0,0 +1,10 @@
1
+ node_modules
2
+ .venv
3
+ dist
4
+ .DS_Store
5
+
6
+ # Python
7
+ __pycache__
8
+ .ipynb_checkpoints
9
+
10
+
@@ -0,0 +1,69 @@
1
+ Metadata-Version: 2.4
2
+ Name: graph_widget
3
+ Version: 0.1.2
4
+ Requires-Dist: anywidget
5
+ Requires-Dist: marimo
6
+ Description-Content-Type: text/markdown
7
+
8
+ # graph_widget
9
+ An anywidget implementation of force-graph (https://github.com/vasturiano/force-graph). It includes a brush (Cmd-drag).
10
+
11
+
12
+ ## Installation
13
+
14
+ ```sh
15
+ pip install graph_widget
16
+ ```
17
+
18
+ or with [uv](https://github.com/astral-sh/uv):
19
+
20
+ ```sh
21
+ uv add graph_widget
22
+ ```
23
+
24
+ ## Example
25
+ An example marimo script (available as `example.py` => run with `uv run marimo edit example.py`):
26
+
27
+ ```python
28
+ import graph_widget
29
+ import pandas as pd
30
+ import json
31
+ import requests
32
+
33
+ url = "https://raw.githubusercontent.com/observablehq/sample-datasets/refs/heads/main/miserables.json"
34
+ response = requests.get(url)
35
+ data = response.json()
36
+
37
+ repulsion_slider = mo.ui.slider(
38
+ start=-200, stop=10000, step=10, value=1, debounce=False, label="Repulsion"
39
+ )
40
+ node_scale_slider = mo.ui.slider(
41
+ start=1, stop=500, step=1, value=20, debounce=True, label="Node scale"
42
+ )
43
+
44
+ data_graph = mo.ui.anywidget(
45
+ graph_widget.ForceGraphWidget(
46
+ data=data,
47
+ repulsion=repulsion_slider.value,
48
+ node_scale=node_scale_slider.value
49
+ )
50
+ )
51
+
52
+ mo.hstack([ data_graph,
53
+ mo.vstack([
54
+ repulsion_slider,
55
+ node_scale_slider])])
56
+
57
+ selected = data_graph.selected_ids
58
+ ```
59
+
60
+ ## Development
61
+
62
+ We recommend using [uv](https://github.com/astral-sh/uv) for development.
63
+ It will automatically manage virtual environments and dependencies for you.
64
+
65
+ ```sh
66
+ uv run marimo edit example.py
67
+ ```
68
+
69
+ Changes made in `src/graph_widget/static/` will be reflected in the notebook.
@@ -0,0 +1,62 @@
1
+ # graph_widget
2
+ An anywidget implementation of force-graph (https://github.com/vasturiano/force-graph). It includes a brush (Cmd-drag).
3
+
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ pip install graph_widget
9
+ ```
10
+
11
+ or with [uv](https://github.com/astral-sh/uv):
12
+
13
+ ```sh
14
+ uv add graph_widget
15
+ ```
16
+
17
+ ## Example
18
+ An example marimo script (available as `example.py` => run with `uv run marimo edit example.py`):
19
+
20
+ ```python
21
+ import graph_widget
22
+ import pandas as pd
23
+ import json
24
+ import requests
25
+
26
+ url = "https://raw.githubusercontent.com/observablehq/sample-datasets/refs/heads/main/miserables.json"
27
+ response = requests.get(url)
28
+ data = response.json()
29
+
30
+ repulsion_slider = mo.ui.slider(
31
+ start=-200, stop=10000, step=10, value=1, debounce=False, label="Repulsion"
32
+ )
33
+ node_scale_slider = mo.ui.slider(
34
+ start=1, stop=500, step=1, value=20, debounce=True, label="Node scale"
35
+ )
36
+
37
+ data_graph = mo.ui.anywidget(
38
+ graph_widget.ForceGraphWidget(
39
+ data=data,
40
+ repulsion=repulsion_slider.value,
41
+ node_scale=node_scale_slider.value
42
+ )
43
+ )
44
+
45
+ mo.hstack([ data_graph,
46
+ mo.vstack([
47
+ repulsion_slider,
48
+ node_scale_slider])])
49
+
50
+ selected = data_graph.selected_ids
51
+ ```
52
+
53
+ ## Development
54
+
55
+ We recommend using [uv](https://github.com/astral-sh/uv) for development.
56
+ It will automatically manage virtual environments and dependencies for you.
57
+
58
+ ```sh
59
+ uv run marimo edit example.py
60
+ ```
61
+
62
+ Changes made in `src/graph_widget/static/` will be reflected in the notebook.
@@ -0,0 +1,6 @@
1
+ # Development information
2
+ ## Pushing to pypi
3
+ - git commit and push
4
+ - In `pyproject.toml` update version.
5
+ - `uv build`
6
+ - `uv publish`