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
10 changes: 5 additions & 5 deletions .github/workflows/render-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ name: Render docs
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
paths:
- "python-wrapper/**" # python code
- "docs/**" # documentation
branches: [ "main" ]
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -26,10 +26,10 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
python-version: "3.11"
cache: "pip"
cache-dependency-path: pyproject.toml
- run: pip install "python-wrapper/[dev, pandas, gds, docs]"
- run: pip install "python-wrapper/[dev, pandas, gds, snowflake, docs]"

- name: Setup pandoc
uses: pandoc/actions/setup@v1
Expand Down
6 changes: 3 additions & 3 deletions docs/source/api-reference/render_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
.. autoenum:: neo4j_viz.Layout
:members:

.. autoclass:: neo4j_viz.Force-Directed
.. autoclass:: neo4j_viz.ForceDirectedLayoutOptions
:members:
:exclude-members: model_config

.. autoclass:: neo4j_viz.HierarchicalLayoutOptions
:members:
:exclude-members: model_config

.. autoenum:: neo4j_viz.options.Direction
.. autoenum:: neo4j_viz.Direction
:members:

.. autoenum:: neo4j_viz.options.Packing
.. autoenum:: neo4j_viz.Packing
:members:

.. autoenum:: neo4j_viz.Renderer
Expand Down
3 changes: 3 additions & 0 deletions python-wrapper/src/neo4j_viz/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class CaptionAlignment(str, Enum):
@enum_tools.documentation.document_enum
class Layout(str, Enum):
FORCE_DIRECTED = "forcedirected"
"""
The force-directed layout uses a physics simulation to position the nodes.
"""
HIERARCHICAL = "hierarchical"
"""
The nodes are then arranged by the directionality of their relationships
Expand Down
10 changes: 10 additions & 0 deletions python-wrapper/src/neo4j_viz/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,16 @@ def from_snowflake(
project_config: dict[str, Any],
node_radius_min_max: Optional[tuple[float, float]] = (3, 60),
) -> VisualizationGraph:
"""
Create a VisualizationGraph from Snowflake tables based on a project configuration.

Args:
session (Session): The Snowflake session to use for querying the tables.
project_config (dict[str, Any]): The project configuration dictionary defining node and relationship tables.
node_radius_min_max (Optional[tuple[float, float]], optional): Tuple defining the min and max radius for nodes. Defaults to (3, 60).
Returns:
VisualizationGraph: The constructed visualization graph.
"""
project_model = VizProjectConfig.model_validate(project_config, strict=False, context={"session": session})
node_dfs, rel_dfs, rel_table_names = _map_tables(session, project_model)

Expand Down