diff --git a/.github/workflows/render-docs.yml b/.github/workflows/render-docs.yml index 3d8b5fc3..5241489d 100644 --- a/.github/workflows/render-docs.yml +++ b/.github/workflows/render-docs.yml @@ -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: @@ -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 diff --git a/docs/source/api-reference/render_options.rst b/docs/source/api-reference/render_options.rst index 0c1dd13b..c49e98fe 100644 --- a/docs/source/api-reference/render_options.rst +++ b/docs/source/api-reference/render_options.rst @@ -4,7 +4,7 @@ .. autoenum:: neo4j_viz.Layout :members: -.. autoclass:: neo4j_viz.Force-Directed +.. autoclass:: neo4j_viz.ForceDirectedLayoutOptions :members: :exclude-members: model_config @@ -12,10 +12,10 @@ :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 diff --git a/python-wrapper/src/neo4j_viz/options.py b/python-wrapper/src/neo4j_viz/options.py index cb67bc62..f6f7eca9 100644 --- a/python-wrapper/src/neo4j_viz/options.py +++ b/python-wrapper/src/neo4j_viz/options.py @@ -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 diff --git a/python-wrapper/src/neo4j_viz/snowflake.py b/python-wrapper/src/neo4j_viz/snowflake.py index ac237921..8e5e1815 100644 --- a/python-wrapper/src/neo4j_viz/snowflake.py +++ b/python-wrapper/src/neo4j_viz/snowflake.py @@ -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)