Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- Allow setting the theme manually in `VG.render(theme="light")` and `VG.render_widget(theme="dark")`.
- Use typed nodes and relationship traitlets in GraphWidget, i.e., list of Node and Relationship instead of dictionaries.
- `render` now allows to pass `layout` as a string as well. Previously expected to be a typed `neo4j_viz.Layout`.
- Fixed rendering in Marimo notebooks. Note, you still have to manually pass the marimo theme `VG.render_widget(theme=marimo.app_meta().theme)`
- Fixed rendering in Marimo notebooks


## Other changes
4 changes: 2 additions & 2 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.ipynb_checkpoints

__marimo__
out/*
/__marimo__/session/*

5,985 changes: 615 additions & 5,370 deletions examples/gds-example.ipynb

Large diffs are not rendered by default.

670 changes: 336 additions & 334 deletions examples/getting-started.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/marimo-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def _(mo):


@app.cell
def _(VisualizationGraph, mo, nodes, relationships):
def _(VisualizationGraph, nodes, relationships):
# Create and render the visualization
VG = VisualizationGraph(nodes=nodes, relationships=relationships)
# Note, we need to pass the theme explicitly in Marimo.
widget = VG.render_widget(theme=mo.app_meta().theme, renderer="canvas")
widget = VG.render_widget(renderer="canvas")
widget
return VG, widget

Expand Down
4 changes: 2 additions & 2 deletions js-applet/src/graph-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ export type WidgetData = {
};

function detectTheme(): "light" | "dark" {
if (document.body.classList.contains("vscode-light")) {
if (document.body.classList.contains("vscode-light") || document.body.classList.contains("light-theme")) {
return "light";
}
if (document.body.classList.contains("vscode-dark")) {
if (document.body.classList.contains("vscode-dark") || document.body.classList.contains("dark-theme")) {
return "dark";
}

Expand Down
1 change: 1 addition & 0 deletions python-wrapper/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ src/neo4j_viz/resources/nvl_entrypoint/*
!src/neo4j_viz/resources/nvl_entrypoint/style.css
!src/neo4j_viz/resources/nvl_entrypoint/index.html
!src/neo4j_viz/resources/nvl_entrypoint/__init__.py
out/*
2 changes: 1 addition & 1 deletion python-wrapper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ notebook = [
"palettable>=3.3.3",
"matplotlib>=3.9.4",
"snowflake-snowpark-python==1.42.0",
"dotenv",
"python-dotenv",
"requests",
"marimo",
]
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -82204,9 +82204,9 @@ class Hdr extends kr.Component {
}
}
function Vdr() {
if (document.body.classList.contains("vscode-light"))
if (document.body.classList.contains("vscode-light") || document.body.classList.contains("light-theme"))
return "light";
if (document.body.classList.contains("vscode-dark"))
if (document.body.classList.contains("vscode-dark") || document.body.classList.contains("dark-theme"))
return "dark";
const r = window.getComputedStyle(document.body, null).getPropertyValue("background-color").match(/\d+/g);
if (!r || r.length < 3)
Expand Down
3 changes: 3 additions & 0 deletions python-wrapper/src/neo4j_viz/visualization_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def __init__(self, nodes: list[Node], relationships: list[Relationship]) -> None
self.nodes = nodes
self.relationships = relationships

def __str__(self) -> str:
return f"VisualizationGraph(nodes={len(self.nodes)}, relationships={len(self.relationships)})"

def _build_render_options(
self,
layout: Layout | str | None,
Expand Down
15 changes: 2 additions & 13 deletions python-wrapper/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion scripts/clean_js_applet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ set -o pipefail
(
cd "${GIT_ROOT}/js-applet"
rm -rf node_modules
rm -f yarn.lock
)
Loading