Skip to content

Commit 0288bf7

Browse files
authored
Merge pull request #127 from neo4j/mention-snowflake
Docs fixes
2 parents bb47cf7 + 9550e70 commit 0288bf7

File tree

6 files changed

+22
-10
lines changed

6 files changed

+22
-10
lines changed

docs/source/adjusting.rst renamed to docs/source/customizing.rst

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Adjusting the visualization
2-
===========================
1+
Customizing the visualization
2+
=============================
33

44
Once created, a :doc:`VisualizationGraph object <./api-reference/visualization-graph>` can be modified in various ways
55
to adjust what the visualization looks like the next time you render it.
@@ -37,8 +37,18 @@ the first positional argument.
3737
By default the Neo4j color palette that works for both light and dark mode will be used.
3838
If you want to use a different color palette, you can pass a dictionary or iterable of colors as the ``colors``
3939
parameter.
40-
You can for example use the color palettes from the `palettable library <https://jiffyclub.github.io/palettable/>`_ as in
41-
the following example:
40+
A color value can for example be either strings like "blue", or hexadecimal color codes like "#FF0000", or even a tuple of RGB values like (255, 0, 255).
41+
Here is an example of providing a list of custom colors to the ``color_nodes`` method:
42+
43+
.. code-block:: python
44+
45+
# VG is a VisualizationGraph object
46+
VG.color_nodes("caption", ["red", "#7fffd4", (255, 255, 255, 0.5), "hsl(270, 60%, 70%)"])
47+
48+
The full set of allowed values for colors are listed `here <https://docs.pydantic.dev/2.0/usage/types/extra_types/color_types/>`_.
49+
50+
Instead of defining your own colors, you could also for example use the color palettes from the `palettable library <https://jiffyclub.github.io/palettable/>`_ as in
51+
this snippet:
4252

4353
.. code-block:: python
4454

docs/source/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ The library allows you to visualize graph data interactively in Python using a s
1212
The library wraps the `Neo4j Visualization JavaScript library (NVL) <https://neo4j.com/docs/nvl/current/>`_, and
1313
provides additional features for working with graph data in Python.
1414
Notably, there are convenience methods for importing data from `Pandas DataFrames <https://pandas.pydata.org/>`_,
15-
`Neo4j Graph Data Science <https://neo4j.com/docs/graph-data-science/current/>`_ and `Neo4j Database <https://neo4j.com/docs/python-manual/current/>`.
15+
`Neo4j Graph Data Science <https://neo4j.com/docs/graph-data-science/current/>`_ and `Neo4j Database <https://neo4j.com/docs/python-manual/current/>`_.
1616

17-
The source code is available on https://github.com/neo4j/python-graph-visualization[GitHub].
18-
If you have a suggestion on how we can improve the library or want to report a problem, you can create a https://github.com/neo4j/python-graph-visualization/issues/new[new issue].
17+
The source code is available on `GitHub <https://github.com/neo4j/python-graph-visualization>`_.
18+
If you have a suggestion on how we can improve the library or want to report a problem, you can create a `new issue <https://github.com/neo4j/python-graph-visualization/issues/new>`_.
1919

2020

2121
.. toctree::
@@ -26,6 +26,6 @@ If you have a suggestion on how we can improve the library or want to report a p
2626
getting-started.nblink
2727
integration.rst
2828
rendering.rst
29-
adjusting.rst
29+
customizing.rst
3030
api-reference/index.rst
3131
tutorials/index.rst

docs/source/integration.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Pandas DataFrames
1111
-----------------
1212

1313
The ``neo4j-viz`` library provides a convenience method for importing data from Pandas DataFrames.
14+
These DataFrames can be created from many sources, such as CSV files or :doc:`Snowflake tables<./tutorials/snowpark-example>`.
1415
It requires and additional dependency to be installed, which you can do by running:
1516

1617
.. code-block:: bash

python-wrapper/src/neo4j_viz/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Node(BaseModel, extra="allow"):
3737
)
3838
#: The size of the node as radius in pixel
3939
size: Optional[RealNumber] = Field(None, ge=0, description="The size of the node as radius in pixel")
40-
#: The color of the node
40+
#: The color of the node. Allowed input is for example "#FF0000", "red" or (255, 0, 0)
4141
color: Optional[ColorType] = Field(None, description="The color of the node")
4242
#: Whether the node is pinned in the visualization
4343
pinned: Optional[bool] = Field(None, description="Whether the node is pinned in the visualization")

python-wrapper/src/neo4j_viz/relationship.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Relationship(BaseModel, extra="allow"):
4141
caption_size: Optional[Union[int, float]] = Field(
4242
None, gt=0.0, serialization_alias="captionSize", description="The size of the caption text"
4343
)
44-
#: The color of the relationship
44+
#: The color of the relationship. Allowed input is for example "#FF0000", "red" or (255, 0, 0)
4545
color: Optional[ColorType] = Field(None, description="The color of the relationship")
4646

4747
@field_serializer("color")

python-wrapper/src/neo4j_viz/visualization_graph.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ def color_nodes(self, property: str, colors: Optional[ColorsType] = None, overri
205205
colors:
206206
The colors to use for the nodes. If a dictionary is given, it should map from property to color.
207207
If an iterable is given, the colors are used in order.
208+
Allowed color values are for example “#FF0000”, “red” or (255, 0, 0) (full list: https://docs.pydantic.dev/2.0/usage/types/extra_types/color_types/).
208209
The default colors are the Neo4j graph colors.
209210
override:
210211
Whether to override existing colors of the nodes, if they have any.

0 commit comments

Comments
 (0)