graph_widget 0.1.18__tar.gz → 0.1.19__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.
Files changed (23) hide show
  1. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/pyproject.toml +1 -1
  2. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/src/graph_widget/static/widget.js +35 -8
  3. graph_widget-0.1.19/.gitignore +10 -0
  4. graph_widget-0.1.19/.python-version +1 -0
  5. {graph_widget-0.1.18 → graph_widget-0.1.19}/PKG-INFO +1 -1
  6. graph_widget-0.1.19/README.md +81 -0
  7. graph_widget-0.1.19/README_DEV.md +7 -0
  8. graph_widget-0.1.19/example_2.py +267 -0
  9. graph_widget-0.1.19/pyproject.toml +14 -0
  10. graph_widget-0.1.19/src/graph_widget/__init__.py +25 -0
  11. graph_widget-0.1.19/src/graph_widget/dev.py +137 -0
  12. graph_widget-0.1.19/src/graph_widget/static/widget.css +3 -0
  13. graph_widget-0.1.19/src/graph_widget/static/widget.js +328 -0
  14. graph_widget-0.1.19/uv.lock +669 -0
  15. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/.gitignore +0 -0
  16. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/.python-version +0 -0
  17. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/README.md +0 -0
  18. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/README_DEV.md +0 -0
  19. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/example_2.py +0 -0
  20. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/src/graph_widget/__init__.py +0 -0
  21. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/src/graph_widget/dev.py +0 -0
  22. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/src/graph_widget/static/widget.css +0 -0
  23. {graph_widget-0.1.18 → graph_widget-0.1.19/.claude/worktrees/graph-node-drag-region-255882}/uv.lock +0 -0
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "graph_widget"
7
- version = "0.1.18"
7
+ version = "0.1.15"
8
8
  dependencies = ["anywidget","marimo"]
9
9
  readme = "README.md"
10
10
 
@@ -48,6 +48,13 @@ const isMac = ua.includes('macintosh');
48
48
  const isWindows = ua.includes('windows');
49
49
  const isLinux = ua.includes('linux');
50
50
 
51
+ const node_radius = (node, node_scale, node_size_feature) => {
52
+ if ( node_size_feature == undefined || node_size_feature == "") {
53
+ return default_node_size * node_scale
54
+ }
55
+ return node[node_size_feature] * node_scale
56
+ };
57
+
51
58
  function render({ model, el }) {
52
59
  let local_selected_ids = []
53
60
  let colour_scale_type = "";
@@ -62,14 +69,18 @@ function render({ model, el }) {
62
69
  tree.load(data)
63
70
  }
64
71
  const create_node_canvas_object = (plot, node_scale, node_size_feature) => {
65
- return plot.nodeCanvasObject((node, ctx) => {
66
- let radius;
72
+ const get_radius = (node) => node_radius(node, node_scale, node_size_feature);
67
73
 
68
- if ( node_size_feature == undefined || node_size_feature == "") {
69
- radius = default_node_size * node_scale
70
- } else {
71
- radius = node[node_size_feature] * node_scale
72
- }
74
+ // Hit area (hover/drag) must match the drawn radius; force-graph's default is a fixed 4 units.
75
+ plot.nodePointerAreaPaint((node, color, ctx) => {
76
+ ctx.fillStyle = color;
77
+ ctx.beginPath();
78
+ ctx.arc(node.x, node.y, get_radius(node), 0, 2 * Math.PI, false);
79
+ ctx.fill();
80
+ });
81
+
82
+ return plot.nodeCanvasObject((node, ctx) => {
83
+ const radius = get_radius(node);
73
84
  const isLocalSelected = local_selected_ids.includes(node.id);
74
85
  const fillColour = colour_scale(node[colour_feature]);
75
86
  // const radius = node[node_size_feature] * node_scale;
@@ -93,6 +104,22 @@ function render({ model, el }) {
93
104
  });
94
105
  };
95
106
 
107
+ // force-graph's zoomToFit assumes radius 4 per node, so large nodes get clipped; fit using the real radii.
108
+ const zoom_to_fit = (data, transition_ms = 400, padding = 10) => {
109
+ const boxes = data["nodes"]
110
+ .map(n => ({ n, r: node_radius(n, node_scale, node_size_feature) * 1.05 })) // 1.05: outer half of stroke
111
+ .filter(({ n, r }) => Number.isFinite(n.x) && Number.isFinite(n.y) && Number.isFinite(r));
112
+ if (!boxes.length) return;
113
+ const x0 = min(boxes, ({ n, r }) => n.x - r), x1 = max(boxes, ({ n, r }) => n.x + r);
114
+ const y0 = min(boxes, ({ n, r }) => n.y - r), y1 = max(boxes, ({ n, r }) => n.y + r);
115
+ const k = Math.max(1e-12, Math.min(
116
+ (width - 2 * padding) / (x1 - x0 || 1),
117
+ (height - 2 * padding) / (y1 - y0 || 1)
118
+ ));
119
+ plot.centerAt((x0 + x1) / 2, (y0 + y1) / 2, transition_ms);
120
+ plot.zoom(k, transition_ms);
121
+ };
122
+
96
123
  const debouncedSaveChanges = debounce(() => model.save_changes(), 300);
97
124
 
98
125
  const create_plot = (data) => {
@@ -108,7 +135,7 @@ function render({ model, el }) {
108
135
  .minZoom(0.001)
109
136
  .nodeCanvasObjectMode(() => 'replace')
110
137
  .onEngineStop(() => {
111
- plot.zoomToFit(400);
138
+ zoom_to_fit(data);
112
139
  create_rtree(data["nodes"]);
113
140
  });
114
141
  }
@@ -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 @@
1
+ 3.11
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: graph_widget
3
- Version: 0.1.18
3
+ Version: 0.1.19
4
4
  Requires-Dist: anywidget
5
5
  Requires-Dist: marimo
6
6
  Description-Content-Type: text/markdown
@@ -0,0 +1,81 @@
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=-100, stop=500, step=10, value=1, debounce=False, label="Repulsion"
32
+ )
33
+ node_scale_slider = mo.ui.slider(
34
+ start=1, stop=20, step=1, value=3, debounce=True, label="Node scale"
35
+ )
36
+ colour_feature_dropdown = mo.ui.dropdown(
37
+ options=list(data["nodes"][3].keys()), value="kind", label="Colour by"
38
+ )
39
+ colour_scale_type_radio = mo.ui.radio(options=["diverging", "sequential"], value="diverging", label="Colour scale type")
40
+
41
+ data_graph = mo.ui.anywidget(
42
+ graph_widget.ForceGraphWidget(
43
+ data=data,
44
+ repulsion=2,
45
+ node_scale=2,
46
+ colour_feature="",
47
+ colour_scale_type=""
48
+ )
49
+ )
50
+
51
+ data_graph.repulsion = repulsion_slider.value
52
+ data_graph.node_scale = node_scale_slider.value
53
+ data_graph.colour_feature = colour_feature_dropdown.value
54
+ data_graph.colour_scale_type= colour_scale_type_radio.value
55
+
56
+ mo.hstack([data_graph,
57
+ mo.vstack([
58
+ repulsion_slider,
59
+ node_scale_slider,
60
+ colour_feature_dropdown,
61
+ colour_scale_type_radio])], justify="start")
62
+
63
+ selected = data_graph.selected_ids
64
+ ```
65
+
66
+ ### Arguments
67
+ - `repulsion`
68
+ - `node_scale`
69
+ - `colour_feature`
70
+ - `colour_scale_type`: can be empty string, or `"diverging"`
71
+
72
+ ## Development
73
+
74
+ We recommend using [uv](https://github.com/astral-sh/uv) for development.
75
+ It will automatically manage virtual environments and dependencies for you.
76
+
77
+ ```sh
78
+ uv run marimo edit example.py
79
+ ```
80
+
81
+ Changes made in `src/graph_widget/static/` will be reflected in the notebook.
@@ -0,0 +1,7 @@
1
+ # Development information
2
+ ## Pushing to pypi
3
+ - git commit and push
4
+ - empty the `dist` directory
5
+ - In `pyproject.toml` update version.
6
+ - `uv build`
7
+ - `uv publish`
@@ -0,0 +1,267 @@
1
+ import marimo
2
+
3
+ __generated_with = "0.11.6"
4
+ app = marimo.App(width="full")
5
+
6
+
7
+ @app.cell
8
+ def _():
9
+ import graph_widget
10
+ import marimo as mo
11
+ return graph_widget, mo
12
+
13
+
14
+ @app.cell
15
+ def _():
16
+ data = {'nodes':
17
+ [{"id": 1, "kind": "sample", "value": 15, "label": "node 1", "size_value": 4},
18
+ {"id": 2, "kind": "sample", "value": 1, "label": "node 2", "size_value": 6},
19
+ {"id": 3, "kind": "OTU", "degree": 3, "value": 23, "label": "node 3", "size_value": 2},
20
+ {"id": 4, "kind": "OTU", "degree": 2, "value": 1, "label": "node 4", "size_value": 8},
21
+ {"id": 5, "kind": "OTU", "degree": 3, "value": 17, "size_value": 6}],
22
+ "links": [
23
+ {"source": 1, "target": 3},
24
+ {"source": 1, "target": 4},
25
+ {"source": 1, "target": 5},
26
+ {"source": 2, "target": 3},
27
+ {"source": 1, "target": 4},
28
+ {"source": 1, "target": 5},
29
+ {"source": 2, "target": 3},
30
+ {"source": 2, "target": 5},
31
+ ]}
32
+ return (data,)
33
+
34
+
35
+ @app.cell
36
+ def _(data):
37
+ data["nodes"][3].keys()
38
+ return
39
+
40
+
41
+ @app.cell
42
+ def _(data, mo):
43
+ repulsion_slider = mo.ui.slider(
44
+ start=-100, stop=500, step=10, value=1, debounce=False, label="Repulsion"
45
+ )
46
+ node_scale_slider = mo.ui.slider(
47
+ start=0.1, stop=5, step=0.1, value=3, debounce=True, label="Node scale"
48
+ )
49
+ colour_feature_dropdown = mo.ui.dropdown(
50
+ options=list(data["nodes"][3].keys()), value="kind", label="Colour by"
51
+ )
52
+ node_size_feature_dropdown = mo.ui.dropdown(
53
+ options=["","value","size_value"], value="", label="Node size feature"
54
+ )
55
+ colour_scale_type_radio = mo.ui.radio(options=["diverging", "sequential"], value="diverging", label="Colour scale type")
56
+ return (
57
+ colour_feature_dropdown,
58
+ colour_scale_type_radio,
59
+ node_scale_slider,
60
+ node_size_feature_dropdown,
61
+ repulsion_slider,
62
+ )
63
+
64
+
65
+ @app.cell
66
+ def _(data, graph_widget, mo):
67
+ data_graph = mo.ui.anywidget(
68
+ graph_widget.ForceGraphWidget(
69
+ data=data,
70
+ repulsion=2,
71
+ node_scale=2,
72
+ # node_size_feature="size_value",
73
+ colour_feature="",
74
+ colour_scale_type="",
75
+ height=400,
76
+ width=600
77
+ )
78
+ )
79
+ return (data_graph,)
80
+
81
+
82
+ @app.cell
83
+ def _(
84
+ colour_feature_dropdown,
85
+ colour_scale_type_radio,
86
+ data_graph,
87
+ node_scale_slider,
88
+ node_size_feature_dropdown,
89
+ repulsion_slider,
90
+ ):
91
+ data_graph.widget.repulsion = repulsion_slider.value
92
+ data_graph.widget.node_scale = node_scale_slider.value
93
+ data_graph.widget.colour_feature = colour_feature_dropdown.value
94
+ data_graph.widget.colour_scale_type= colour_scale_type_radio.value
95
+ data_graph.widget.node_size_feature = node_size_feature_dropdown.value
96
+ return
97
+
98
+
99
+ @app.cell
100
+ def _(
101
+ colour_feature_dropdown,
102
+ colour_scale_type_radio,
103
+ data_graph,
104
+ mo,
105
+ node_scale_slider,
106
+ node_size_feature_dropdown,
107
+ repulsion_slider,
108
+ ):
109
+ plot = mo.hstack([data_graph,
110
+ mo.vstack([
111
+ repulsion_slider,
112
+ node_scale_slider,
113
+ colour_feature_dropdown,
114
+ colour_scale_type_radio,
115
+ node_size_feature_dropdown])], justify="start")
116
+ return (plot,)
117
+
118
+
119
+ @app.cell
120
+ def _(plot):
121
+ plot
122
+ return
123
+
124
+
125
+ @app.cell
126
+ def _(data_graph):
127
+ selected = data_graph.selected_ids
128
+ return (selected,)
129
+
130
+
131
+ @app.cell
132
+ def _(selected):
133
+ selected
134
+ return
135
+
136
+
137
+ @app.cell
138
+ def _(data, selected):
139
+ filtered_nodes = [node for node in data["nodes"] if node["id"] in selected]
140
+ filtered_nodes
141
+ return (filtered_nodes,)
142
+
143
+
144
+ @app.cell
145
+ def _(data):
146
+ type(data)
147
+ return
148
+
149
+
150
+ @app.cell
151
+ def _():
152
+ return
153
+
154
+
155
+ @app.cell
156
+ def _():
157
+ data2 = {'nodes':
158
+ [{"id": 1, "kind": "sample", "value": 15, "label": "node 1", "size_value": 4},
159
+ {"id": 2, "kind": "sample", "value": 1, "label": "node 2", "size_value": 6},
160
+ {"id": 3, "kind": "OTU", "degree": 3, "value": 23, "label": "node 3", "size_value": 2},
161
+ {"id": 4, "kind": "OTU", "degree": 2, "value": 1, "label": "node 4", "size_value": 8},
162
+ {"id": 5, "kind": "OTU", "degree": 3, "value": 17, "size_value": 6}],
163
+ "links": [
164
+ {"source": 1, "target": 3},
165
+ {"source": 1, "target": 4},
166
+ {"source": 1, "target": 5},
167
+ {"source": 2, "target": 3},
168
+ {"source": 1, "target": 4},
169
+ {"source": 1, "target": 5},
170
+ {"source": 2, "target": 3},
171
+ {"source": 2, "target": 5},
172
+ ]}
173
+ return (data2,)
174
+
175
+
176
+ @app.cell
177
+ def _(data2):
178
+ data2["nodes"][3].keys()
179
+ return
180
+
181
+
182
+ @app.cell
183
+ def _(data2, mo):
184
+ repulsion_slider2 = mo.ui.slider(
185
+ start=-100, stop=500, step=10, value=1, debounce=False, label="Repulsion"
186
+ )
187
+ node_scale_slider2 = mo.ui.slider(
188
+ start=0.1, stop=5, step=0.1, value=3, debounce=True, label="Node scale"
189
+ )
190
+ colour_feature_dropdown2 = mo.ui.dropdown(
191
+ options=list(data2["nodes"][3].keys()), value="kind", label="Colour by"
192
+ )
193
+ node_size_feature_dropdown2 = mo.ui.dropdown(
194
+ options=["","value","size_value"], value="", label="Node size feature"
195
+ )
196
+ colour_scale_type_radio2 = mo.ui.radio(options=["diverging", "sequential"], value="diverging", label="Colour scale type")
197
+ return (
198
+ colour_feature_dropdown2,
199
+ colour_scale_type_radio2,
200
+ node_scale_slider2,
201
+ node_size_feature_dropdown2,
202
+ repulsion_slider2,
203
+ )
204
+
205
+
206
+ @app.cell
207
+ def _(data2, graph_widget, mo):
208
+ data_graph2 = mo.ui.anywidget(
209
+ graph_widget.ForceGraphWidget(
210
+ data=data2,
211
+ repulsion=2,
212
+ node_scale=2,
213
+ # node_size_feature="size_value",
214
+ colour_feature="",
215
+ colour_scale_type="",
216
+ height=400,
217
+ width=600
218
+ )
219
+ )
220
+ return (data_graph2,)
221
+
222
+
223
+ @app.cell
224
+ def _(
225
+ colour_feature_dropdown2,
226
+ colour_scale_type_radio2,
227
+ data_graph2,
228
+ node_scale_slider2,
229
+ node_size_feature_dropdown2,
230
+ repulsion_slider2,
231
+ ):
232
+ data_graph2.widget.repulsion = repulsion_slider2.value
233
+ data_graph2.widget.node_scale = node_scale_slider2.value
234
+ data_graph2.widget.colour_feature = colour_feature_dropdown2.value
235
+ data_graph2.widget.colour_scale_type= colour_scale_type_radio2.value
236
+ data_graph2.widget.node_size_feature = node_size_feature_dropdown2.value
237
+ return
238
+
239
+
240
+ @app.cell
241
+ def _(
242
+ colour_feature_dropdown2,
243
+ colour_scale_type_radio2,
244
+ data_graph2,
245
+ mo,
246
+ node_scale_slider2,
247
+ node_size_feature_dropdown2,
248
+ repulsion_slider2,
249
+ ):
250
+ plot2 = mo.hstack([data_graph2,
251
+ mo.vstack([
252
+ repulsion_slider2,
253
+ node_scale_slider2,
254
+ colour_feature_dropdown2,
255
+ colour_scale_type_radio2,
256
+ node_size_feature_dropdown2])], justify="start")
257
+ return (plot2,)
258
+
259
+
260
+ @app.cell
261
+ def _(plot2):
262
+ plot2
263
+ return
264
+
265
+
266
+ if __name__ == "__main__":
267
+ app.run()
@@ -0,0 +1,14 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "graph_widget"
7
+ version = "0.1.19"
8
+ dependencies = ["anywidget","marimo"]
9
+ readme = "README.md"
10
+
11
+ # Dependency groups (recognized by `uv`). For more details, visit:
12
+ # https://peps.python.org/pep-0735/
13
+ [dependency-groups]
14
+ dev = ["watchfiles"]
@@ -0,0 +1,25 @@
1
+ import importlib.metadata
2
+ from importlib.resources import files
3
+
4
+ import anywidget
5
+ import traitlets
6
+
7
+ try:
8
+ __version__ = importlib.metadata.version("graph_widget")
9
+ except importlib.metadata.PackageNotFoundError:
10
+ __version__ = "unknown"
11
+
12
+ class ForceGraphWidget(anywidget.AnyWidget):
13
+ # _esm = pathlib.Path(__file__).parent / "static" / "widget.js"
14
+ # _css = pathlib.Path(__file__).parent / "static" / "widget.css"
15
+ _esm = files("graph_widget").joinpath("static/widget.js")
16
+ _css = files("graph_widget").joinpath("static/widget.css")
17
+ data = traitlets.Dict().tag(sync=True)
18
+ repulsion = traitlets.Int().tag(sync=True)
19
+ node_scale = traitlets.Float().tag(sync=True)
20
+ node_size_feature = traitlets.Unicode().tag(sync=True)
21
+ colour_feature = traitlets.Unicode().tag(sync=True)
22
+ colour_scale_type = traitlets.Unicode().tag(sync=True)
23
+ selected_ids = traitlets.List([]).tag(sync=True)
24
+ width = traitlets.Int().tag(sync=True)
25
+ height = traitlets.Int().tag(sync=True)
@@ -0,0 +1,137 @@
1
+ import marimo
2
+
3
+ __generated_with = "0.11.6"
4
+ app = marimo.App(width="medium")
5
+
6
+
7
+ @app.cell
8
+ def _():
9
+ import marimo as mo
10
+ import pandas as pd
11
+ return mo, pd
12
+
13
+
14
+ @app.cell
15
+ def _():
16
+ import anywidget
17
+ import traitlets
18
+
19
+ class ForceGraphWidget(anywidget.AnyWidget):
20
+ _esm = "graph.js"
21
+ _css = "graph.css"
22
+ data = traitlets.Dict().tag(sync=True)
23
+ repulsion = traitlets.Int().tag(sync=True)
24
+ node_scale = traitlets.Int().tag(sync=True)
25
+ colour_feature = traitlets.Unicode().tag(sync=True)
26
+ selected_ids = traitlets.List([]).tag(sync=True)
27
+ return ForceGraphWidget, anywidget, traitlets
28
+
29
+
30
+ @app.cell
31
+ def _():
32
+ import json
33
+ import requests
34
+
35
+ url = "https://raw.githubusercontent.com/observablehq/sample-datasets/refs/heads/main/miserables.json"
36
+ response = requests.get(url)
37
+ data = response.json()
38
+ return data, json, requests, response, url
39
+
40
+
41
+ @app.cell
42
+ def _(data, pd):
43
+ df = pd.DataFrame(data["nodes"])
44
+ return (df,)
45
+
46
+
47
+ @app.cell
48
+ def _(df):
49
+ df
50
+ return
51
+
52
+
53
+ @app.cell
54
+ def _(mo):
55
+ repulsion_slider = mo.ui.slider(
56
+ start=-200, stop=10000, step=10, value=1, debounce=False, label="Repulsion"
57
+ )
58
+ node_scale_slider = mo.ui.slider(
59
+ start=1, stop=500, step=1, value=20, debounce=True, label="Node scale"
60
+ )
61
+ return node_scale_slider, repulsion_slider
62
+
63
+
64
+ @app.cell
65
+ def _(data, mo):
66
+ colour_feature_selector = mo.ui.dropdown(
67
+ list(data["nodes"][0].keys()), value="id", label="Colour feature"
68
+ )
69
+ return (colour_feature_selector,)
70
+
71
+
72
+ @app.cell
73
+ def _(
74
+ ForceGraphWidget,
75
+ colour_feature_selector,
76
+ data,
77
+ mo,
78
+ node_scale_slider,
79
+ repulsion_slider,
80
+ ):
81
+ data_graph = mo.ui.anywidget(
82
+ ForceGraphWidget(
83
+ data=data,
84
+ repulsion=repulsion_slider.value,
85
+ node_scale=node_scale_slider.value,
86
+ colour_feature=colour_feature_selector.value,
87
+ )
88
+ )
89
+ return (data_graph,)
90
+
91
+
92
+ @app.cell
93
+ def _(
94
+ colour_feature_selector,
95
+ data_graph,
96
+ mo,
97
+ node_scale_slider,
98
+ repulsion_slider,
99
+ ):
100
+ plot = mo.hstack([ data_graph,
101
+ mo.vstack([
102
+ repulsion_slider,
103
+ node_scale_slider,
104
+ colour_feature_selector])])
105
+ return (plot,)
106
+
107
+
108
+ @app.cell
109
+ def _(plot):
110
+ plot
111
+ return
112
+
113
+
114
+ @app.cell
115
+ def _(data_graph):
116
+ selected = data_graph.selected_ids
117
+ return (selected,)
118
+
119
+
120
+ @app.cell
121
+ def _(selected):
122
+ selected
123
+ return
124
+
125
+
126
+ @app.cell
127
+ def _():
128
+ return
129
+
130
+
131
+ @app.cell
132
+ def _():
133
+ return
134
+
135
+
136
+ if __name__ == "__main__":
137
+ app.run()
@@ -0,0 +1,3 @@
1
+ canvas {
2
+ border: 1px solid black;
3
+ }