anywidget-graph 0.5.2__tar.gz → 0.5.3__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.
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/.github/workflows/ci.yml +30 -2
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/CHANGELOG.md +58 -23
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/PKG-INFO +59 -4
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/README.md +56 -2
- anywidget_graph-0.5.3/assets/demo-3d-dark.png +0 -0
- anywidget_graph-0.5.3/assets/demo-3d-light.png +0 -0
- anywidget_graph-0.5.3/examples/demo_3d.py +143 -0
- anywidget_graph-0.5.3/package-lock.json +637 -0
- anywidget_graph-0.5.3/package.json +24 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/pyproject.toml +4 -2
- anywidget_graph-0.5.3/scripts/vendor/build-esm.mjs +62 -0
- anywidget_graph-0.5.3/scripts/vendor/build.mjs +47 -0
- anywidget_graph-0.5.3/scripts/vendor/entry-3d.mjs +68 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/scripts/vendor/package-lock.json +8 -1
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/scripts/vendor/package.json +2 -1
- anywidget_graph-0.5.3/src/anywidget_graph/__init__.py +6 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/backends/grafeo.py +8 -3
- anywidget_graph-0.5.3/src/anywidget_graph/ui/__init__.py +60 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/canvas3d.ts +1187 -0
- anywidget_graph-0.5.2/src/anywidget_graph/ui/defaults.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/defaults.ts +61 -27
- anywidget_graph-0.5.3/src/anywidget_graph/ui/dist/export.js +339 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/dist/export3d.js +1621 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/ui/dist/widget.js +1903 -203
- anywidget_graph-0.5.3/src/anywidget_graph/ui/export.html +37 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/export.ts +200 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/export3d.html +31 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/export3d.ts +41 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/force3d.ts +406 -0
- anywidget_graph-0.5.2/src/anywidget_graph/ui/grafeo-embed.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/grafeo-embed.ts +33 -27
- anywidget_graph-0.5.2/src/anywidget_graph/ui/grafeo-result.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/grafeo-result.ts +47 -35
- anywidget_graph-0.5.2/src/anywidget_graph/ui/grafeo.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/grafeo.ts +20 -17
- anywidget_graph-0.5.2/src/anywidget_graph/ui/icons.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/icons.ts +3 -0
- anywidget_graph-0.5.2/src/anywidget_graph/ui/index.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/index.ts +248 -439
- anywidget_graph-0.5.3/src/anywidget_graph/ui/index3d.ts +142 -0
- anywidget_graph-0.5.2/src/anywidget_graph/ui/lanes.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/lanes.ts +150 -105
- anywidget_graph-0.5.2/src/anywidget_graph/ui/neo4j.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/neo4j.ts +50 -30
- anywidget_graph-0.5.2/src/anywidget_graph/ui/properties.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/properties.ts +10 -9
- anywidget_graph-0.5.3/src/anywidget_graph/ui/query.ts +87 -0
- anywidget_graph-0.5.2/src/anywidget_graph/ui/results.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/results.ts +19 -12
- anywidget_graph-0.5.2/src/anywidget_graph/ui/schema.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/schema.ts +67 -45
- anywidget_graph-0.5.2/src/anywidget_graph/ui/settings.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/settings.ts +134 -23
- anywidget_graph-0.5.3/src/anywidget_graph/ui/spring.ts +37 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/ui/styles.css +125 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/styling.ts +207 -0
- anywidget_graph-0.5.2/src/anywidget_graph/ui/toolbar.js → anywidget_graph-0.5.3/src/anywidget_graph/ui/toolbar.ts +34 -10
- anywidget_graph-0.5.3/src/anywidget_graph/ui/types.ts +76 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/vendor/three.LICENSES.txt +25 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/vendor/three.min.js +4220 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/vendor-globals.ts +22 -0
- anywidget_graph-0.5.3/src/anywidget_graph/ui/vendor-globals3d.ts +11 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/widget.py +120 -2
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/tests/conftest.py +7 -1
- anywidget_graph-0.5.3/tests/e2e/test_browser.py +500 -0
- anywidget_graph-0.5.3/tests/js/copies.d.ts +6 -0
- anywidget_graph-0.5.2/tests/js/defaults.test.mjs → anywidget_graph-0.5.3/tests/js/defaults.test.ts +22 -22
- anywidget_graph-0.5.3/tests/js/force3d.test.ts +255 -0
- anywidget_graph-0.5.2/tests/js/grafeo-embed.test.mjs → anywidget_graph-0.5.3/tests/js/grafeo-embed.test.ts +18 -13
- anywidget_graph-0.5.2/tests/js/grafeo-result.test.mjs → anywidget_graph-0.5.3/tests/js/grafeo-result.test.ts +27 -24
- anywidget_graph-0.5.2/tests/js/grafeo-server.test.mjs → anywidget_graph-0.5.3/tests/js/grafeo-server.test.ts +18 -21
- anywidget_graph-0.5.3/tests/js/helpers.ts +32 -0
- anywidget_graph-0.5.2/tests/js/lanes.test.mjs → anywidget_graph-0.5.3/tests/js/lanes.test.ts +8 -7
- anywidget_graph-0.5.2/tests/js/panels.test.mjs → anywidget_graph-0.5.3/tests/js/panels.test.ts +41 -38
- anywidget_graph-0.5.3/tests/js/styling.test.ts +46 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/tests/test_grafeo_contract.py +6 -4
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/tests/test_graph.py +96 -1
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/tests/test_ui.py +21 -11
- anywidget_graph-0.5.3/tsconfig.json +29 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/uv.lock +318 -322
- anywidget_graph-0.5.2/scripts/vendor/build-esm.mjs +0 -46
- anywidget_graph-0.5.2/scripts/vendor/build.mjs +0 -40
- anywidget_graph-0.5.2/src/anywidget_graph/__init__.py +0 -6
- anywidget_graph-0.5.2/src/anywidget_graph/ui/__init__.py +0 -39
- anywidget_graph-0.5.2/src/anywidget_graph/ui/export.html +0 -319
- anywidget_graph-0.5.2/src/anywidget_graph/ui/vendor-globals.js +0 -3
- anywidget_graph-0.5.2/tests/e2e/test_browser.py +0 -217
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/.gitattributes +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/.github/workflows/grafeo-latest.yml +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/.github/workflows/pypi.yml +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/.gitignore +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/.python-version +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/LICENSE +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/assets/demo.png +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/examples/demo.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/examples/test_hierarchy.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/examples/test_large_graph.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/scripts/vendor/entry.mjs +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/backends/__init__.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/backends/arango.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/backends/cosmosdb.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/backends/ladybug.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/backends/neo4j.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/converters/__init__.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/converters/base.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/converters/common.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/converters/cypher.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/converters/gql.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/converters/graphql.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/converters/gremlin.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/converters/sparql.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/demo.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/py.typed +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/ui/vendor/graph-libs.LICENSES.txt +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/src/anywidget_graph/ui/vendor/graph-libs.min.js +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/tests/__init__.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/tests/e2e/__init__.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/tests/e2e/conftest.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/tests/test_backends.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/tests/test_backends_grafeo.py +0 -0
- {anywidget_graph-0.5.2 → anywidget_graph-0.5.3}/tests/test_demo.py +0 -0
|
@@ -35,7 +35,7 @@ jobs:
|
|
|
35
35
|
- name: Install dependencies
|
|
36
36
|
run: uv sync --dev
|
|
37
37
|
|
|
38
|
-
# esbuild, so the tests can check that ui/dist/
|
|
38
|
+
# esbuild, so the tests can check that the bundles in ui/dist/ are built from the current sources
|
|
39
39
|
- name: Install the bundler
|
|
40
40
|
run: npm ci --prefix scripts/vendor
|
|
41
41
|
|
|
@@ -49,8 +49,36 @@ jobs:
|
|
|
49
49
|
- name: Run ty check
|
|
50
50
|
run: uv run --all-extras ty check
|
|
51
51
|
|
|
52
|
+
# The JavaScript tests do not depend on the Python version: the frontend job runs them once
|
|
52
53
|
- name: Run tests
|
|
53
|
-
run: uv run pytest -v
|
|
54
|
+
run: uv run pytest -v --deselect tests/test_ui.py::test_js_unit_tests
|
|
55
|
+
|
|
56
|
+
# The front end once: tsc over every module in src/ and tests/js/, the JavaScript tests, and the bundles
|
|
57
|
+
frontend:
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
steps:
|
|
60
|
+
- uses: actions/checkout@v7
|
|
61
|
+
|
|
62
|
+
- name: Set up Node.js
|
|
63
|
+
uses: actions/setup-node@v7
|
|
64
|
+
with:
|
|
65
|
+
node-version: "22"
|
|
66
|
+
|
|
67
|
+
- name: Install the bundler
|
|
68
|
+
run: npm ci --prefix scripts/vendor
|
|
69
|
+
|
|
70
|
+
# TypeScript and the type packages
|
|
71
|
+
- name: Install the front-end dependencies
|
|
72
|
+
run: npm ci --ignore-scripts
|
|
73
|
+
|
|
74
|
+
- name: Type-check the front end
|
|
75
|
+
run: npm run typecheck
|
|
76
|
+
|
|
77
|
+
- name: Run the JavaScript tests
|
|
78
|
+
run: npm test
|
|
79
|
+
|
|
80
|
+
- name: Check the bundles are built from the current sources
|
|
81
|
+
run: npm run check
|
|
54
82
|
|
|
55
83
|
# The front end in Chromium, mounted through a plain model as an app hosts it (tests/e2e)
|
|
56
84
|
browser:
|
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to anywidget-graph, an interactive graph widget for Python notebooks built on anywidget.
|
|
4
|
+
|
|
5
|
+
## [0.5.3] - 2026-11-12
|
|
6
|
+
|
|
7
|
+
3D release: a graph can be drawn as a Three.js scene with a force layout in three dimensions, and the Grafeo backend moves to grafeo 0.6.2 in Python and in the browser. An environment with the `grafeo` extra upgrades grafeo to 0.6.2 or later, below 0.7; stay on 0.5.2 to keep an older 0.6.x.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **3D view**: `Graph3D`, or `Graph(view="3d")`, draws the graph with the bundled Three.js 0.186.1 in a scene to orbit, pan and zoom, with hover tooltips, click and box or lasso selection; the toolbar's cube button and the settings panel switch views at runtime. The layout is a force layout in three dimensions, set with `force3d_repulsion` (the "bloom") and `force3d_link_distance` (the "spread", a positive number or `None` for automatic), with optional axes, grid and labels (`show_axes`, `show_grid`, `grid_divisions`, `axis_labels`, `camera_position`, `camera_target`).
|
|
12
|
+
- **The 3D view keeps its layout on change**: `Graph.append()`, `remove()` and a restyle leave the drawn nodes and the camera where they are, and a new node is placed next to the nodes it links to. Setting `nodes` or `edges` to other data lays the graph out again, as in the 2D view.
|
|
13
|
+
- **3D export**: `to_html()` and `save_html()` on a graph in the 3D view write a page that draws the Three.js scene with its layout, camera, axes and styling, to orbit, hover and select offline. A graph in the 2D view exports the Sigma page as before.
|
|
14
|
+
- **`3d` extra**: `anywidget-graph[3d]` is a marker extra; Three.js ships in the wheel (`ui/vendor/three.min.js`, licenses in `ui/vendor/three.LICENSES.txt`), so the 3D view needs no further Python packages and loads nothing from a CDN.
|
|
15
|
+
- **3D example**: `examples/demo_3d.py` shows a citation network in the 3D view.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Schema properties from grafeo 0.6.2**: The schema panel lists each label's and edge type's property names; grafeo 0.6.2's `schema()` entries carry `properties` as `{name, types}`, which `GrafeoBackend.fetch_schema` reduces to the names.
|
|
20
|
+
- **Front end in TypeScript**: The modules in `ui/` are TypeScript, bundled by esbuild into `ui/dist/` (`npm run build`), and CI type-checks them with `tsc` and runs the JavaScript tests in a `frontend` job. Running the JavaScript checks locally needs Node 22.18 or later.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **The HTML export draws what the widget draws**: a `to_html()` page draws parallel edges and numeric ids, applies the default `spring` layout, `type_colors` and degree-based sizes, and skips an edge to a node that is not in the data. Parallel edges or such an edge left the page blank.
|
|
25
|
+
- **An edge's own `color` wins**: an edge with a `color` keeps it when `edge_color_field` is set, as the per-item style rule says; the field mapping replaced it.
|
|
26
|
+
- **Large numeric styling fields render**: `color_field`, `size_field` and the edge fields compute their range over any number of values; a few hundred thousand values stopped the render with a `RangeError`.
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
|
|
30
|
+
- **grafeo 0.6.2** (requires `>=0.6.2,<0.7`): The `grafeo` extra needs grafeo 0.6.2 (it was `>=0.6.0` with no upper bound), and the WASM mode loads `@grafeo-db/wasm` 0.6.2 (`GRAFEO_WASM_VERSION` in `ui/grafeo-embed.ts`).
|
|
31
|
+
- **Locked versions refreshed**: ty 0.0.100, pandas 3.1.1, ruff 0.17.4, prek 0.5.10, websockets 17.4 and python-dateutil 4.0.0, among others. Front-end build tools: esbuild 0.28.2, TypeScript 7.0.2, three 0.186.1 and `@types/three` 0.186.0.
|
|
32
|
+
|
|
33
|
+
## [0.5.2] - 2026-10-28
|
|
4
34
|
|
|
5
35
|
### Features
|
|
6
36
|
|
|
@@ -14,7 +44,7 @@
|
|
|
14
44
|
|
|
15
45
|
- Node and Python tests for the cut: off by default, the best-connected nodes kept with their edges, the note
|
|
16
46
|
|
|
17
|
-
## 0.5.1 2026-10-28
|
|
47
|
+
## [0.5.1] - 2026-10-28
|
|
18
48
|
|
|
19
49
|
### Features
|
|
20
50
|
|
|
@@ -48,7 +78,7 @@
|
|
|
48
78
|
- The grafeo-server client against a fake `fetch` answering grafeo-server's endpoints with pinned responses (health, schema, query, paths, tagged values, an error, two widgets with two servers); per-widget WASM databases; the notes; level, colour and dash rules; the frame with room for the controls; filter paging; the cut at `max_nodes`; every backend taking the language; the Neo4j schema quoting
|
|
49
79
|
- Browser tests (`tests/e2e`, Playwright and Chromium, their own CI job): the widget mounted through a plain model with no network, hostile values as text in the tooltip and the properties panel, no listener left after destroy and redraw, the theme following the page in two views and kept when chosen, level chips, the server-mode query box (connect on the first query, a note for a write, an error), a narrow pane's toolbar, per-item marks, and an HTML export that runs no markup from the data
|
|
50
80
|
|
|
51
|
-
## 0.5.0 2026-10-28
|
|
81
|
+
## [0.5.0] - 2026-10-28
|
|
52
82
|
|
|
53
83
|
Grafeo 0.6 release: the Grafeo backends move to grafeo 0.6 (embedded, grafeo-server and WASM). Stay on 0.4.x for grafeo 0.5.
|
|
54
84
|
|
|
@@ -91,13 +121,13 @@ Grafeo 0.6 release: the Grafeo backends move to grafeo 0.6 (embedded, grafeo-ser
|
|
|
91
121
|
- Node tests for the WASM client with a fake engine: two copies of the module share one loaded engine, the same statements load into a database once, and rows with nothing to draw say so; Python tests that the export's background and label colours follow the mode, an explicit `background` and the host `theme`, and that a colour or size that is not a plain CSS value is dropped
|
|
92
122
|
- pytest runs every `tests/js/*.test.mjs` file, so a new Node test file cannot be left out
|
|
93
123
|
|
|
94
|
-
## 0.4.6 2026-10-20
|
|
124
|
+
## [0.4.6] - 2026-10-20
|
|
95
125
|
|
|
96
126
|
### Bug Fixes
|
|
97
127
|
|
|
98
128
|
- **Dimmed items read the same on a light and a dark canvas**: a selection dims the other nodes and edges by mixing their colour towards the canvas colour (opaque) instead of making it translucent. Sigma's blending does not treat a colour's alpha as transparency, so the old translucent dimming barely dimmed on a dark canvas and all but vanished on a light one
|
|
99
129
|
|
|
100
|
-
## 0.4.5 2026-10-20
|
|
130
|
+
## [0.4.5] - 2026-10-20
|
|
101
131
|
|
|
102
132
|
### Features
|
|
103
133
|
|
|
@@ -111,21 +141,21 @@ Grafeo 0.6 release: the Grafeo backends move to grafeo 0.6 (embedded, grafeo-ser
|
|
|
111
141
|
- **Settings follow the model**: `show_edge_labels` and the new `edge_arrows` and `highlight_neighbors` apply when they change after the widget is drawn
|
|
112
142
|
- **`to_html()` and `save_html()` need no CDN**: the exported page carries the bundled graph libraries itself instead of loading graphology and sigma from esm.sh, so it opens offline and behind a network filter
|
|
113
143
|
|
|
114
|
-
## 0.4.4 2026-10-19
|
|
144
|
+
## [0.4.4] - 2026-10-19
|
|
115
145
|
|
|
116
146
|
### Bug Fixes
|
|
117
147
|
|
|
118
148
|
- **The widget loads without a CDN**: graphology, sigma, graphology-layout, graphology-layout-forceatlas2 and d3-force are bundled with the widget (`ui/vendor/graph-libs.min.js`, built from pinned npm versions by `scripts/vendor`, licenses in `ui/vendor/graph-libs.LICENSES.txt`) instead of loaded from esm.sh on every render. A page that could not reach esm.sh or cdn.jsdelivr.net (offline, a network filter, a blocker, a CDN outage) showed "Failed to fetch dynamically imported module" instead of the graph
|
|
119
149
|
- **neo4j-driver loads when a Neo4j connection is made**: it was imported from cdn.jsdelivr.net with the widget, so every host needed the CDN even without Neo4j. The Neo4j backend and the Grafeo WASM backend are now the only parts that load code from the network, and only when they connect
|
|
120
150
|
|
|
121
|
-
## 0.4.3 2026-10-12
|
|
151
|
+
## [0.4.3] - 2026-10-12
|
|
122
152
|
|
|
123
153
|
### Improvements
|
|
124
154
|
|
|
125
155
|
- **Python 3.15**: supported, and tested in CI on 3.12 to 3.15. marimo, which the widget does not import, installs on 3.12 to 3.14 only for now: its dependency loro has no 3.15 wheels yet (the widget works in marimo as soon as marimo installs on 3.15)
|
|
126
156
|
- **marimo moved to the `examples` extra**: the widget does not import marimo, so it is no longer a dependency; `pip install anywidget-graph[examples]` adds marimo to run the apps in `examples/`
|
|
127
157
|
|
|
128
|
-
## 0.4.2 2026-10-09
|
|
158
|
+
## [0.4.2] - 2026-10-09
|
|
129
159
|
|
|
130
160
|
### Features
|
|
131
161
|
|
|
@@ -148,7 +178,7 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
148
178
|
- Fixed the zoom controls covering the caption of an action lane at the right edge on a narrow canvas: when the rightmost lane is an action lane, the framing leaves room for the controls
|
|
149
179
|
- Fixed the empty canvas mapping lanes with the y axis pointing down while sigma points it up (nothing visible depended on it before rows)
|
|
150
180
|
|
|
151
|
-
## 0.4.1 2026-10-09
|
|
181
|
+
## [0.4.1] - 2026-10-09
|
|
152
182
|
|
|
153
183
|
### Features
|
|
154
184
|
|
|
@@ -180,7 +210,7 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
180
210
|
- Fixed appended nodes and their labels landing on top of each other: ids that differ only at the end (`n1`, `n2`, ...) got nearly the same spot, and nodes next to the same neighbour could share one. Nodes of the same neighbours now stack as rows at its height, one label line apart (then in the next column), clear of the labels already drawn, and their labels show at the default zoom (sigma's label grid dropped all but two of a stack)
|
|
181
211
|
- Fixed lane titles sitting at the top edge of an empty canvas, and the lanes jumping when the first node arrived (for example at the start of a live append): an empty canvas is now framed with sigma's stage padding, like a canvas with nodes
|
|
182
212
|
|
|
183
|
-
## 0.4.0 2026-10-09
|
|
213
|
+
## [0.4.0] - 2026-10-09
|
|
184
214
|
|
|
185
215
|
### Features
|
|
186
216
|
|
|
@@ -217,7 +247,7 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
217
247
|
- Demo mode loads its statements one at a time and refreshes the schema panel afterwards
|
|
218
248
|
- Fixed `Sigma: Container has no width` when the widget is mounted in a hidden or not yet sized container (a closed panel, a tab); it now renders once the container has a size
|
|
219
249
|
|
|
220
|
-
## 0.3.1 2026-03-16
|
|
250
|
+
## [0.3.1] - 2026-03-16
|
|
221
251
|
|
|
222
252
|
### New Features
|
|
223
253
|
|
|
@@ -228,7 +258,7 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
228
258
|
- Fixed missing ICONS import causing zoom and lasso buttons to fail
|
|
229
259
|
- Fixed `lassoSvg` referenced before declaration, crashing widget on load
|
|
230
260
|
|
|
231
|
-
## 0.3.0
|
|
261
|
+
## [0.3.0] - 2026-03-16
|
|
232
262
|
|
|
233
263
|
### New Features
|
|
234
264
|
|
|
@@ -242,7 +272,7 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
242
272
|
- Theme toggle auto-hidden when running inside a themed host (e.g. marimo)
|
|
243
273
|
- Dark mode label colors update dynamically with theme changes
|
|
244
274
|
|
|
245
|
-
## 0.2.10
|
|
275
|
+
## [0.2.10] - 2026-03-15
|
|
246
276
|
|
|
247
277
|
### New Features
|
|
248
278
|
|
|
@@ -257,7 +287,7 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
257
287
|
- Cluster layout filters out hidden node types before packing
|
|
258
288
|
- Filter panel refresh button triggers a layout refresh
|
|
259
289
|
|
|
260
|
-
## 0.2.9
|
|
290
|
+
## [0.2.9] - 2026-03-15
|
|
261
291
|
|
|
262
292
|
### New Features
|
|
263
293
|
|
|
@@ -282,7 +312,7 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
282
312
|
- Edge type shown in properties panel on click
|
|
283
313
|
- Internal attributes (`nodeType`, `edgeType`) hidden from properties panel
|
|
284
314
|
|
|
285
|
-
## 0.2.8
|
|
315
|
+
## [0.2.8] - 2026-03-14
|
|
286
316
|
|
|
287
317
|
### New Features
|
|
288
318
|
|
|
@@ -294,7 +324,7 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
294
324
|
|
|
295
325
|
- Added playground link at grafeo.ai to README
|
|
296
326
|
|
|
297
|
-
## 0.2.7
|
|
327
|
+
## [0.2.7] - 2026-03-04
|
|
298
328
|
|
|
299
329
|
### Bug Fixes
|
|
300
330
|
|
|
@@ -304,7 +334,7 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
304
334
|
|
|
305
335
|
- Quality-of-life improvements to search and toolbar
|
|
306
336
|
|
|
307
|
-
## 0.2.6
|
|
337
|
+
## [0.2.6] - 2026-03-02
|
|
308
338
|
|
|
309
339
|
### New Features
|
|
310
340
|
|
|
@@ -322,7 +352,7 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
322
352
|
- HTML export template fix
|
|
323
353
|
- Zoom controls added to graph container
|
|
324
354
|
|
|
325
|
-
## 0.2.5
|
|
355
|
+
## [0.2.5] - 2026-02-12
|
|
326
356
|
|
|
327
357
|
### New Features
|
|
328
358
|
|
|
@@ -337,33 +367,38 @@ All opt-in per lane: a lane without these options is laid out exactly as in 0.4.
|
|
|
337
367
|
|
|
338
368
|
- Consistent code formatting with ruff
|
|
339
369
|
|
|
340
|
-
## 0.2.4
|
|
370
|
+
## [0.2.4] - 2026-02-09
|
|
341
371
|
|
|
342
372
|
### Bug Fixes
|
|
343
373
|
|
|
344
374
|
- Fixed ESM bundling issue in UI init
|
|
345
375
|
|
|
346
|
-
## 0.2.3
|
|
376
|
+
## [0.2.3] - 2026-02-07
|
|
347
377
|
|
|
348
378
|
### Bug Fixes
|
|
349
379
|
|
|
350
380
|
- Fixed rendering issue in graph container
|
|
351
381
|
- Updated dependencies
|
|
352
382
|
|
|
353
|
-
## 0.2.2
|
|
383
|
+
## [0.2.2] - 2026-02-07
|
|
354
384
|
|
|
355
385
|
### Improvements
|
|
356
386
|
|
|
357
387
|
- Added Apache 2.0 license
|
|
358
388
|
- ESM bundle aggregation for widget JS
|
|
359
389
|
|
|
360
|
-
## 0.2.1
|
|
390
|
+
## [0.2.1] - 2026-02-03
|
|
361
391
|
|
|
362
392
|
### Improvements
|
|
363
393
|
|
|
364
394
|
- Updated README with usage examples
|
|
365
395
|
- Code formatting pass
|
|
366
396
|
|
|
367
|
-
## 0.1.0
|
|
397
|
+
## [0.1.0] - 2026-02-02
|
|
368
398
|
|
|
369
399
|
- Initial release of anywidget-graph
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
404
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: anywidget-graph
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: Interactive graph visualization for Python notebooks using anywidget
|
|
5
5
|
Project-URL: Homepage, https://grafeo.dev/
|
|
6
6
|
Project-URL: Repository, https://github.com/GrafeoDB/anywidget-graph
|
|
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3.15
|
|
|
21
21
|
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
22
22
|
Requires-Python: >=3.12
|
|
23
23
|
Requires-Dist: anywidget>=0.11.0
|
|
24
|
+
Provides-Extra: 3d
|
|
24
25
|
Provides-Extra: arango
|
|
25
26
|
Requires-Dist: python-arango>=8; extra == 'arango'
|
|
26
27
|
Provides-Extra: cosmosdb
|
|
@@ -36,7 +37,7 @@ Provides-Extra: embed
|
|
|
36
37
|
Provides-Extra: examples
|
|
37
38
|
Requires-Dist: marimo>=0.19.9; (python_version < '3.15') and extra == 'examples'
|
|
38
39
|
Provides-Extra: grafeo
|
|
39
|
-
Requires-Dist: grafeo
|
|
40
|
+
Requires-Dist: grafeo<0.7,>=0.6.2; extra == 'grafeo'
|
|
40
41
|
Provides-Extra: neo4j
|
|
41
42
|
Requires-Dist: neo4j>=5; extra == 'neo4j'
|
|
42
43
|
Provides-Extra: networkx
|
|
@@ -58,6 +59,7 @@ Works with Marimo, Jupyter, VS Code, Colab, anywhere [anywidget](https://anywidg
|
|
|
58
59
|
- **Universal**: One widget, every notebook environment
|
|
59
60
|
- **Backend-agnostic**: Grafeo, Neo4j, NetworkX, pandas, or raw dicts
|
|
60
61
|
- **Interactive**: Pan, zoom, click, drag, pin, expand neighbors, box select
|
|
62
|
+
- **2D and 3D**: the Sigma canvas, or a Three.js scene you fly through where the layout blooms in 3D (`Graph3D` / `view="3d"`)
|
|
61
63
|
- **Customizable**: Colors, sizes, layouts, dark mode
|
|
62
64
|
- **Exportable**: HTML, JSON
|
|
63
65
|
|
|
@@ -76,6 +78,7 @@ uv add "anywidget-graph[grafeo]" # Grafeo backend (grafeo 0.6)
|
|
|
76
78
|
uv add "anywidget-graph[cosmosdb]" # CosmosDB / Gremlin support
|
|
77
79
|
uv add "anywidget-graph[neo4j]" # Neo4j Python driver (Neo4jBackend)
|
|
78
80
|
uv add "anywidget-graph[arango]" # ArangoDB (ArangoBackend)
|
|
81
|
+
uv add "anywidget-graph[3d]" # 3D view (Graph3D / view="3d"); Three.js is bundled, no extra deps
|
|
79
82
|
uv add "anywidget-graph[examples]" # marimo, to run the apps in examples/
|
|
80
83
|
```
|
|
81
84
|
|
|
@@ -349,6 +352,52 @@ Graph.from_dict(data, layout="random")
|
|
|
349
352
|
Graph(nodes=[{"id": "a", "x": 0, "y": 0}, {"id": "b", "x": 10, "y": 5}], layout="preset") # The nodes' own x and y
|
|
350
353
|
```
|
|
351
354
|
|
|
355
|
+
## 3D view
|
|
356
|
+
|
|
357
|
+
`Graph3D` is the same widget with the 3D view as its default; any `Graph` can switch with `view="3d"` (or the
|
|
358
|
+
cube button in the toolbar, or the View select in the settings panel; it switches at runtime, both ways).
|
|
359
|
+
A citation network of scientific papers (topic-coloured clusters, hub papers sized by citations, no author
|
|
360
|
+
roster), laid out and rendered in three dimensions:
|
|
361
|
+
|
|
362
|
+
<picture>
|
|
363
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/demo-3d-dark.png">
|
|
364
|
+
<img src="assets/demo-3d-light.png" alt="3D view of a papers citation network">
|
|
365
|
+
</picture>
|
|
366
|
+
|
|
367
|
+
```python
|
|
368
|
+
from anywidget_graph import Graph3D
|
|
369
|
+
|
|
370
|
+
graph = Graph3D(nodes=nodes, edges=edges, width=800, height=600)
|
|
371
|
+
# or: graph = Graph(nodes=nodes, edges=edges, view="3d")
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
The graph is rendered with the bundled Three.js (no CDN) in a scene you can go through: drag to orbit,
|
|
375
|
+
right-drag to pan, wheel to zoom, `f` to fit. Nodes are spheres, edges are lines (cone arrowheads with
|
|
376
|
+
`edge_arrows=True`), labels are camera-facing sprites. Hover shows a tooltip, click selects, box/lasso select
|
|
377
|
+
work, and the query box, backends, styling (`color_field`, `size_field`, `type_colors`, ...), visibility levels
|
|
378
|
+
and the panels behave as in the 2D view.
|
|
379
|
+
|
|
380
|
+
The layout is a force layout **in three dimensions**: every pair of nodes pushes apart ("bloom") and every edge
|
|
381
|
+
pulls its ends towards a rest length ("spread"), so the graph spreads through the volume instead of a plane:
|
|
382
|
+
|
|
383
|
+
```python
|
|
384
|
+
graph = Graph3D(
|
|
385
|
+
nodes=nodes,
|
|
386
|
+
edges=edges,
|
|
387
|
+
force3d_repulsion=1.0, # bloom: repulsion strength between nodes (try 0.2 ... 3)
|
|
388
|
+
force3d_link_distance=None, # spread: edge rest length; None picks one from the node count
|
|
389
|
+
layout="spring", # "spring"/"force" run the 3D layout; "circular" packs a sphere, "random" a ball, "preset" uses the nodes' own x/y/z
|
|
390
|
+
show_axes=True, # axes and grid of the 3D scene
|
|
391
|
+
show_grid=True,
|
|
392
|
+
grid_divisions=10,
|
|
393
|
+
axis_labels={"x": "X", "y": "Y", "z": "Z"},
|
|
394
|
+
camera_position=[2, 2, 2], # initial camera; camera_target the point it looks at
|
|
395
|
+
camera_target=[0, 0, 0],
|
|
396
|
+
)
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
`append()`, `remove()` and a restyle keep the drawn nodes and the camera in place, as in the 2D view; `to_html()` exports the 3D scene. See `examples/demo_3d.py`.
|
|
400
|
+
|
|
352
401
|
## Options
|
|
353
402
|
|
|
354
403
|
```python
|
|
@@ -366,6 +415,9 @@ graph = Graph(
|
|
|
366
415
|
show_toolbar=True, # Toolbar visibility
|
|
367
416
|
show_settings=True, # Settings panel
|
|
368
417
|
show_query_input=True, # Query input box
|
|
418
|
+
view="2d", # "2d" (Sigma) or "3d" (Three.js scene; the default of Graph3D)
|
|
419
|
+
force3d_repulsion=1.0, # 3D layout bloom (node repulsion)
|
|
420
|
+
force3d_link_distance=None, # 3D layout spread (edge rest length); None is automatic
|
|
369
421
|
dark_mode=None, # None follows the page's light or dark theme; True or False keeps that theme
|
|
370
422
|
show_tooltip=True, # Hover tooltips
|
|
371
423
|
tooltip_fields=["label", "id"],
|
|
@@ -380,7 +432,7 @@ graph = Graph(
|
|
|
380
432
|
|
|
381
433
|
Grafeo runs in one of three modes, picked with `grafeo_connection_mode` or in the settings panel.
|
|
382
434
|
|
|
383
|
-
**Embedded** (Python, the default): queries run in the notebook kernel. Requires the `grafeo` extra (`grafeo
|
|
435
|
+
**Embedded** (Python, the default): queries run in the notebook kernel. Requires the `grafeo` extra (`grafeo>=0.6.2,<0.7`).
|
|
384
436
|
|
|
385
437
|
```python
|
|
386
438
|
import grafeo
|
|
@@ -395,7 +447,7 @@ graph = Graph(database_backend="grafeo", grafeo_db=db, query_language="gql")
|
|
|
395
447
|
graph = Graph(database_backend="grafeo", grafeo_connection_mode="server", grafeo_server_url="http://localhost:7474")
|
|
396
448
|
```
|
|
397
449
|
|
|
398
|
-
**WASM**: the engine runs in the browser. `@grafeo-db/wasm` (0.6.
|
|
450
|
+
**WASM**: the engine runs in the browser. `@grafeo-db/wasm` (0.6.2) is downloaded from jsDelivr when you click "Initialize WASM", so nothing extra is installed in Python.
|
|
399
451
|
|
|
400
452
|
```python
|
|
401
453
|
graph = Graph(database_backend="grafeo", grafeo_connection_mode="wasm", query_language="gql")
|
|
@@ -466,6 +518,8 @@ graph.to_html(title="My Graph") # Custom title
|
|
|
466
518
|
graph.save_html("graph.html") # Write HTML to file
|
|
467
519
|
```
|
|
468
520
|
|
|
521
|
+
The page carries its libraries, so it opens offline. A graph in the 3D view (`Graph3D`, or `view="3d"`) exports the Three.js scene with its layout, camera and styling; one in the 2D view exports the Sigma canvas.
|
|
522
|
+
|
|
469
523
|
## Environment Support
|
|
470
524
|
|
|
471
525
|
| Environment | Supported |
|
|
@@ -502,6 +556,7 @@ uv run --with playwright pytest tests/e2e
|
|
|
502
556
|
## Related
|
|
503
557
|
|
|
504
558
|
- [anywidget](https://anywidget.dev/), custom Jupyter widgets made easy
|
|
559
|
+
- [anywidget-vector](https://github.com/GrafeoDB/anywidget-vector), the sibling widget this 3D view follows: 3D vector clouds with Three.js
|
|
505
560
|
- [Grafeo](https://github.com/GrafeoDB/grafeo), embeddable graph database
|
|
506
561
|
- [grafeo-web](https://github.com/GrafeoDB/grafeo-web), Grafeo in the browser
|
|
507
562
|
- [Playground](https://grafeo.ai), interactive browser playground for Grafeo
|
|
@@ -11,6 +11,7 @@ Works with Marimo, Jupyter, VS Code, Colab, anywhere [anywidget](https://anywidg
|
|
|
11
11
|
- **Universal**: One widget, every notebook environment
|
|
12
12
|
- **Backend-agnostic**: Grafeo, Neo4j, NetworkX, pandas, or raw dicts
|
|
13
13
|
- **Interactive**: Pan, zoom, click, drag, pin, expand neighbors, box select
|
|
14
|
+
- **2D and 3D**: the Sigma canvas, or a Three.js scene you fly through where the layout blooms in 3D (`Graph3D` / `view="3d"`)
|
|
14
15
|
- **Customizable**: Colors, sizes, layouts, dark mode
|
|
15
16
|
- **Exportable**: HTML, JSON
|
|
16
17
|
|
|
@@ -29,6 +30,7 @@ uv add "anywidget-graph[grafeo]" # Grafeo backend (grafeo 0.6)
|
|
|
29
30
|
uv add "anywidget-graph[cosmosdb]" # CosmosDB / Gremlin support
|
|
30
31
|
uv add "anywidget-graph[neo4j]" # Neo4j Python driver (Neo4jBackend)
|
|
31
32
|
uv add "anywidget-graph[arango]" # ArangoDB (ArangoBackend)
|
|
33
|
+
uv add "anywidget-graph[3d]" # 3D view (Graph3D / view="3d"); Three.js is bundled, no extra deps
|
|
32
34
|
uv add "anywidget-graph[examples]" # marimo, to run the apps in examples/
|
|
33
35
|
```
|
|
34
36
|
|
|
@@ -302,6 +304,52 @@ Graph.from_dict(data, layout="random")
|
|
|
302
304
|
Graph(nodes=[{"id": "a", "x": 0, "y": 0}, {"id": "b", "x": 10, "y": 5}], layout="preset") # The nodes' own x and y
|
|
303
305
|
```
|
|
304
306
|
|
|
307
|
+
## 3D view
|
|
308
|
+
|
|
309
|
+
`Graph3D` is the same widget with the 3D view as its default; any `Graph` can switch with `view="3d"` (or the
|
|
310
|
+
cube button in the toolbar, or the View select in the settings panel; it switches at runtime, both ways).
|
|
311
|
+
A citation network of scientific papers (topic-coloured clusters, hub papers sized by citations, no author
|
|
312
|
+
roster), laid out and rendered in three dimensions:
|
|
313
|
+
|
|
314
|
+
<picture>
|
|
315
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/demo-3d-dark.png">
|
|
316
|
+
<img src="assets/demo-3d-light.png" alt="3D view of a papers citation network">
|
|
317
|
+
</picture>
|
|
318
|
+
|
|
319
|
+
```python
|
|
320
|
+
from anywidget_graph import Graph3D
|
|
321
|
+
|
|
322
|
+
graph = Graph3D(nodes=nodes, edges=edges, width=800, height=600)
|
|
323
|
+
# or: graph = Graph(nodes=nodes, edges=edges, view="3d")
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
The graph is rendered with the bundled Three.js (no CDN) in a scene you can go through: drag to orbit,
|
|
327
|
+
right-drag to pan, wheel to zoom, `f` to fit. Nodes are spheres, edges are lines (cone arrowheads with
|
|
328
|
+
`edge_arrows=True`), labels are camera-facing sprites. Hover shows a tooltip, click selects, box/lasso select
|
|
329
|
+
work, and the query box, backends, styling (`color_field`, `size_field`, `type_colors`, ...), visibility levels
|
|
330
|
+
and the panels behave as in the 2D view.
|
|
331
|
+
|
|
332
|
+
The layout is a force layout **in three dimensions**: every pair of nodes pushes apart ("bloom") and every edge
|
|
333
|
+
pulls its ends towards a rest length ("spread"), so the graph spreads through the volume instead of a plane:
|
|
334
|
+
|
|
335
|
+
```python
|
|
336
|
+
graph = Graph3D(
|
|
337
|
+
nodes=nodes,
|
|
338
|
+
edges=edges,
|
|
339
|
+
force3d_repulsion=1.0, # bloom: repulsion strength between nodes (try 0.2 ... 3)
|
|
340
|
+
force3d_link_distance=None, # spread: edge rest length; None picks one from the node count
|
|
341
|
+
layout="spring", # "spring"/"force" run the 3D layout; "circular" packs a sphere, "random" a ball, "preset" uses the nodes' own x/y/z
|
|
342
|
+
show_axes=True, # axes and grid of the 3D scene
|
|
343
|
+
show_grid=True,
|
|
344
|
+
grid_divisions=10,
|
|
345
|
+
axis_labels={"x": "X", "y": "Y", "z": "Z"},
|
|
346
|
+
camera_position=[2, 2, 2], # initial camera; camera_target the point it looks at
|
|
347
|
+
camera_target=[0, 0, 0],
|
|
348
|
+
)
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
`append()`, `remove()` and a restyle keep the drawn nodes and the camera in place, as in the 2D view; `to_html()` exports the 3D scene. See `examples/demo_3d.py`.
|
|
352
|
+
|
|
305
353
|
## Options
|
|
306
354
|
|
|
307
355
|
```python
|
|
@@ -319,6 +367,9 @@ graph = Graph(
|
|
|
319
367
|
show_toolbar=True, # Toolbar visibility
|
|
320
368
|
show_settings=True, # Settings panel
|
|
321
369
|
show_query_input=True, # Query input box
|
|
370
|
+
view="2d", # "2d" (Sigma) or "3d" (Three.js scene; the default of Graph3D)
|
|
371
|
+
force3d_repulsion=1.0, # 3D layout bloom (node repulsion)
|
|
372
|
+
force3d_link_distance=None, # 3D layout spread (edge rest length); None is automatic
|
|
322
373
|
dark_mode=None, # None follows the page's light or dark theme; True or False keeps that theme
|
|
323
374
|
show_tooltip=True, # Hover tooltips
|
|
324
375
|
tooltip_fields=["label", "id"],
|
|
@@ -333,7 +384,7 @@ graph = Graph(
|
|
|
333
384
|
|
|
334
385
|
Grafeo runs in one of three modes, picked with `grafeo_connection_mode` or in the settings panel.
|
|
335
386
|
|
|
336
|
-
**Embedded** (Python, the default): queries run in the notebook kernel. Requires the `grafeo` extra (`grafeo
|
|
387
|
+
**Embedded** (Python, the default): queries run in the notebook kernel. Requires the `grafeo` extra (`grafeo>=0.6.2,<0.7`).
|
|
337
388
|
|
|
338
389
|
```python
|
|
339
390
|
import grafeo
|
|
@@ -348,7 +399,7 @@ graph = Graph(database_backend="grafeo", grafeo_db=db, query_language="gql")
|
|
|
348
399
|
graph = Graph(database_backend="grafeo", grafeo_connection_mode="server", grafeo_server_url="http://localhost:7474")
|
|
349
400
|
```
|
|
350
401
|
|
|
351
|
-
**WASM**: the engine runs in the browser. `@grafeo-db/wasm` (0.6.
|
|
402
|
+
**WASM**: the engine runs in the browser. `@grafeo-db/wasm` (0.6.2) is downloaded from jsDelivr when you click "Initialize WASM", so nothing extra is installed in Python.
|
|
352
403
|
|
|
353
404
|
```python
|
|
354
405
|
graph = Graph(database_backend="grafeo", grafeo_connection_mode="wasm", query_language="gql")
|
|
@@ -419,6 +470,8 @@ graph.to_html(title="My Graph") # Custom title
|
|
|
419
470
|
graph.save_html("graph.html") # Write HTML to file
|
|
420
471
|
```
|
|
421
472
|
|
|
473
|
+
The page carries its libraries, so it opens offline. A graph in the 3D view (`Graph3D`, or `view="3d"`) exports the Three.js scene with its layout, camera and styling; one in the 2D view exports the Sigma canvas.
|
|
474
|
+
|
|
422
475
|
## Environment Support
|
|
423
476
|
|
|
424
477
|
| Environment | Supported |
|
|
@@ -455,6 +508,7 @@ uv run --with playwright pytest tests/e2e
|
|
|
455
508
|
## Related
|
|
456
509
|
|
|
457
510
|
- [anywidget](https://anywidget.dev/), custom Jupyter widgets made easy
|
|
511
|
+
- [anywidget-vector](https://github.com/GrafeoDB/anywidget-vector), the sibling widget this 3D view follows: 3D vector clouds with Three.js
|
|
458
512
|
- [Grafeo](https://github.com/GrafeoDB/grafeo), embeddable graph database
|
|
459
513
|
- [grafeo-web](https://github.com/GrafeoDB/grafeo-web), Grafeo in the browser
|
|
460
514
|
- [Playground](https://grafeo.ai), interactive browser playground for Grafeo
|
|
Binary file
|
|
Binary file
|