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
3 changes: 2 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

version: 2
updates:
- package-ecosystem: "pip"
- package-ecosystem: "uv"
directory: "/python-wrapper"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
groups:
python-patch-and-minor:
update-types:
Comment on lines +8 to 15

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semgrep identified an issue in your code:
This Dependabot configuration does not set a cooldown period. Newly published packages can be malicious or unstable. Add a cooldown block with default-days: 3 to each package-ecosystem entry under updates to wait 3 days before proposing updates to newly published package versions. Reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#cooldown

To resolve this comment:

✨ Commit fix suggestion
  1. Add a cooldown block to this uv entry under package-ecosystem.
  2. Set the cooldown to at least 3 days by adding default-days: 3.
  3. Place it alongside the other top-level keys for that update entry, for example after package-ecosystem:
    cooldown:
    default-days: 3
  4. Keep the value numeric, not quoted, so Dependabot reads it correctly as 3.
💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by dependabot-missing-cooldown-copy.

To get more information about secure coding and some most popular vulnerabilities, check our secure coding guidelines

You can view more details about this finding in the Semgrep AppSec Platform.

Expand Down
9 changes: 3 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import pathlib


project = "Graph Visualization for Python"
copyright = "2025, Neo4j, Inc."
author = "Neo4j, Inc."
Expand Down Expand Up @@ -57,8 +56,6 @@ def setup(app): # type: ignore
app.add_js_file("js/deprecated.js", loading_method="defer")


rst_epilog = """
.. |api-version| replace:: {versionnum}
""".format(
versionnum=release,
)
rst_epilog = f"""
.. |api-version| replace:: {release}
"""
8 changes: 4 additions & 4 deletions examples/gds-example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
"source": [
"import os\n",
"\n",
"from graphdatascience import GraphDataScience\n",
"from graphdatascience.session import (\n",
" GdsSessions,\n",
" DbmsConnectionInfo,\n",
" AuraAPICredentials,\n",
" DbmsConnectionInfo,\n",
" GdsSessions,\n",
" SessionMemory,\n",
")\n",
"from graphdatascience import GraphDataScience\n",
"\n",
"# Get Neo4j DB URI, credentials and name from environment if applicable\n",
"db_connection = DbmsConnectionInfo(\n",
Expand Down Expand Up @@ -298,8 +298,8 @@
"metadata": {},
"outputs": [],
"source": [
"from palettable.colorbrewer.qualitative import Dark2_7\n",
"import matplotlib.colors as mcolors\n",
"from palettable.colorbrewer.qualitative import Dark2_7\n",
"\n",
"number_of_components = len({n.properties[\"componentId\"] for n in VG.nodes})\n",
"print(f\"Number of components: {number_of_components}\")\n",
Expand Down
8 changes: 0 additions & 8 deletions examples/marimo-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def _(mo):
This example demonstrates how to use `neo4j-viz` to visualize graphs in Marimo notebooks.
We'll create a simple graph representing a social network with people and their relationships.
""")
return


@app.cell
Expand All @@ -36,7 +35,6 @@ def _(mo):
mo.md(r"""
## Create Nodes and Relationships
""")
return


@app.cell
Expand All @@ -62,7 +60,6 @@ def _(mo):
mo.md(r"""
## Visualize the Graph as a Widget
""")
return


@app.cell
Expand All @@ -71,15 +68,13 @@ def _(VisualizationGraph, nodes, relationships):
VG = VisualizationGraph(nodes=nodes, relationships=relationships)
# Note, we need to pass the theme explicitly in Marimo.
widget = VG.render_widget(renderer="canvas")
widget
return VG, widget


@app.cell
def _(widget):
print(widget.theme)
print(widget.options)
return


@app.cell
Expand All @@ -94,15 +89,13 @@ def _(Node, Relationship, widget):
new_rel = Relationship(source=new_id, target=target_id, caption="KNOWS")

widget.add_data(nodes=[new_node], relationships=[new_rel])
return


@app.cell(hide_code=True)
def _(mo):
mo.md(r"""
## Standalone Visualization the Graph
""")
return


@app.cell
Expand All @@ -111,7 +104,6 @@ def _(VG):
with open("out/marimo_output.html", "w") as f:
print(f"{f}")
f.write(VG.render(renderer="canvas").data)
return


if __name__ == "__main__":
Expand Down
3 changes: 1 addition & 2 deletions examples/neo4j-example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"outputs": [],
"source": [
"import os\n",
"\n",
"import dotenv\n",
"\n",
"dotenv.load_dotenv()\n",
Expand Down Expand Up @@ -144,8 +145,6 @@
" result_transformer_=Result.graph,\n",
" )\n",
"\n",
" result\n",
"\n",
"print(\n",
" f\"Result graph has: {len(result.nodes)} nodes, {len(result.relationships)} relationships\"\n",
")"
Expand Down
2 changes: 2 additions & 0 deletions examples/nodes_2025_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"outputs": [],
"source": [
"import os\n",
"\n",
"import neo4j\n",
"from neo4j_viz.neo4j import from_neo4j\n",
"\n",
Expand Down Expand Up @@ -369,6 +370,7 @@
"# Save the raw HTML output to a file. This allows to share the interactive visualization.\n",
"\n",
"import os\n",
"\n",
"from neo4j_viz.options import Renderer\n",
"\n",
"os.makedirs(\"./out\", exist_ok=True)\n",
Expand Down
1 change: 0 additions & 1 deletion examples/streamlit-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import random

import streamlit as st

from neo4j_viz import Node, Relationship, VisualizationGraph
from neo4j_viz.streamlit import display_widget

Expand Down
8 changes: 4 additions & 4 deletions python-wrapper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ streamlit = ["streamlit>=1.58, <2"]

[dependency-groups]
dev = [
"ruff==0.15.17",
"mypy==2.1.0",
"pytest==9.0.3",
"selenium==4.44.0",
"ruff==0.16.3",
"mypy==2.3.0",
"pytest==9.1.1",
"selenium==4.47.0",
"ipykernel==7.3.0",
"palettable==3.3.3",
"pytest-mock==3.15.1",
Expand Down
3,314 changes: 1,885 additions & 1,429 deletions python-wrapper/uv.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions scripts/generate_linear_colormap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from matplotlib.colors import LinearSegmentedColormap as lsc
import numpy as np

from matplotlib.colors import LinearSegmentedColormap as lsc
from neo4j_viz.colors import _NEO4J_COLORS_CONTINUOUS_BASE

color_map = lsc.from_list("neo4j", _NEO4J_COLORS_CONTINUOUS_BASE, N=256)
Expand Down
1 change: 0 additions & 1 deletion scripts/release/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import tomllib # Python 3.11+


PACKAGE = "neo4j-viz"
MAIN_BRANCH = "main"

Expand Down
2 changes: 1 addition & 1 deletion scripts/release/postrelease.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import sys
from pathlib import Path

from _common import PACKAGE, bold, green, git_root, pyproject_path, read_version
from _common import PACKAGE, bold, git_root, green, pyproject_path, read_version

CHANGELOG_TEMPLATE = """# Changes

Expand Down