Skip to content

Commit 66d0cb0

Browse files
authored
Merge pull request #307 from neo4j/update-examples
Update examples
2 parents c1f46f1 + faecf07 commit 66d0cb0

File tree

13 files changed

+968
-5729
lines changed

13 files changed

+968
-5729
lines changed

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- Allow setting the theme manually in `VG.render(theme="light")` and `VG.render_widget(theme="dark")`.
1919
- Use typed nodes and relationship traitlets in GraphWidget, i.e., list of Node and Relationship instead of dictionaries.
2020
- `render` now allows to pass `layout` as a string as well. Previously expected to be a typed `neo4j_viz.Layout`.
21-
- Fixed rendering in Marimo notebooks. Note, you still have to manually pass the marimo theme `VG.render_widget(theme=marimo.app_meta().theme)`
21+
- Fixed rendering in Marimo notebooks
2222

2323

2424
## Other changes

examples/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.ipynb_checkpoints
2-
2+
__marimo__
33
out/*
4-
/__marimo__/session/*
4+

examples/gds-example.ipynb

Lines changed: 615 additions & 5370 deletions
Large diffs are not rendered by default.

examples/getting-started.ipynb

Lines changed: 336 additions & 334 deletions
Large diffs are not rendered by default.

examples/marimo-example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ def _(mo):
6666

6767

6868
@app.cell
69-
def _(VisualizationGraph, mo, nodes, relationships):
69+
def _(VisualizationGraph, nodes, relationships):
7070
# Create and render the visualization
7171
VG = VisualizationGraph(nodes=nodes, relationships=relationships)
7272
# Note, we need to pass the theme explicitly in Marimo.
73-
widget = VG.render_widget(theme=mo.app_meta().theme, renderer="canvas")
73+
widget = VG.render_widget(renderer="canvas")
7474
widget
7575
return VG, widget
7676

js-applet/src/graph-widget.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export type WidgetData = {
3737
};
3838

3939
function detectTheme(): "light" | "dark" {
40-
if (document.body.classList.contains("vscode-light")) {
40+
if (document.body.classList.contains("vscode-light") || document.body.classList.contains("light-theme")) {
4141
return "light";
4242
}
43-
if (document.body.classList.contains("vscode-dark")) {
43+
if (document.body.classList.contains("vscode-dark") || document.body.classList.contains("dark-theme")) {
4444
return "dark";
4545
}
4646

python-wrapper/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ src/neo4j_viz/resources/nvl_entrypoint/*
99
!src/neo4j_viz/resources/nvl_entrypoint/style.css
1010
!src/neo4j_viz/resources/nvl_entrypoint/index.html
1111
!src/neo4j_viz/resources/nvl_entrypoint/__init__.py
12+
out/*

python-wrapper/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ notebook = [
7676
"palettable>=3.3.3",
7777
"matplotlib>=3.9.4",
7878
"snowflake-snowpark-python==1.42.0",
79-
"dotenv",
79+
"python-dotenv",
8080
"requests",
8181
"marimo",
8282
]

python-wrapper/src/neo4j_viz/resources/nvl_entrypoint/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

python-wrapper/src/neo4j_viz/resources/nvl_entrypoint/widget.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82204,9 +82204,9 @@ class Hdr extends kr.Component {
8220482204
}
8220582205
}
8220682206
function Vdr() {
82207-
if (document.body.classList.contains("vscode-light"))
82207+
if (document.body.classList.contains("vscode-light") || document.body.classList.contains("light-theme"))
8220882208
return "light";
82209-
if (document.body.classList.contains("vscode-dark"))
82209+
if (document.body.classList.contains("vscode-dark") || document.body.classList.contains("dark-theme"))
8221082210
return "dark";
8221182211
const r = window.getComputedStyle(document.body, null).getPropertyValue("background-color").match(/\d+/g);
8221282212
if (!r || r.length < 3)

0 commit comments

Comments
 (0)