Skip to content

Commit 648eaa1

Browse files
lmeyerovclaude
andcommitted
docs: add graphviz examples across documentation
Add rich graphviz diagrams to documentation pages: - 10min.rst - intro visualization example - visualization/10min.rst - layout pipeline diagram - ecosystem.rst - ecosystem overview - gfql/overview.rst - GFQL flow diagram - gfql/quick.rst - quick start example - graphistry.layout.rst - layout options Builds on infrastructure from base PR #859. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 79ace9b commit 648eaa1

File tree

6 files changed

+101
-5
lines changed

6 files changed

+101
-5
lines changed

docs/source/10min.rst

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,38 @@ For example, GraphViz layouts is known for its high quality for laying out small
202202
.. code-block:: python
203203
204204
# pygraphistry handles format conversions behind-the-scenes
205-
g2 = g1.layout_graphviz('dot')
206-
g2.plot()
205+
g2 = g1.layout_graphviz('dot')
206+
g2.plot()
207+
208+
Static Graphviz render
209+
----------------------
210+
211+
When you need a quick static image (e.g., docs/notebooks), reuse the Graphviz layout. ``plot_static`` returns bytes you can embed or save:
212+
213+
.. code-block:: python
214+
215+
# Reuse bound x/y if present; otherwise Graphviz lays out the graph
216+
svg = g1.plot_static(format='svg', max_nodes=200, max_edges=400)
217+
from IPython.display import SVG
218+
SVG(svg)
219+
220+
.. graphviz::
221+
222+
digraph quickstart_static {
223+
rankdir=LR;
224+
0 -> 1 -> 2 -> 3 -> 4;
225+
0 [shape=box, style=filled, fillcolor=lightgray];
226+
}
227+
228+
DOT / Mermaid text (layout later)
229+
---------------------------------
230+
231+
If you only need the text form, emit DOT or Mermaid DSL:
232+
233+
.. code-block:: python
234+
235+
dot_text = g1.plot_static(engine='graphviz-dot', reuse_layout=True)
236+
mermaid_text = g1.plot_static(engine='mermaid-code', reuse_layout=False)
207237
208238
Using UMAP for Dimensionality Reduction
209239
---------------------------------------
@@ -304,4 +334,4 @@ External Resources
304334
- `Graphistry REST API <https://hub.graphistry.com/docs/api/>`_: Work from any language
305335
- `Graphistry URL settings <https://hub.graphistry.com/docs/api/1/rest/url/#urloptions>`_: Control visualizations via URL parameters`
306336

307-
Happy graphing!
337+
Happy graphing!

docs/source/ecosystem.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ Graphistry Ecosystem and Louie.AI
33

44
The Graphistry community of projects, open source, and partners has grown over the years:
55

6+
.. graphviz::
7+
8+
digraph graphistry_ecosystem_toy {
9+
rankdir=LR;
10+
data [label="Dataframes", shape=box, style=filled, fillcolor=lightgray];
11+
gfql [label="GFQL"];
12+
viz [label="Graphistry Viz"];
13+
ai [label="Louie.AI"];
14+
data -> gfql -> viz -> ai;
15+
}
16+
617
Graphistry Core
718
---------------
819

@@ -78,4 +89,3 @@ Graphistry works with a variety of partners and projects, some of which include:
7889
* `Pandas <https://pandas.pydata.org/>`_
7990
* `Dask <https://www.dask.org/>`_
8091

81-

docs/source/gfql/overview.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ Why GFQL?
1010

1111
GFQL addresses a critical gap in the data community by providing an in-process graph query language that operates at the compute tier. This means you can:
1212

13+
- **Tiny reachability map**:
14+
15+
.. graphviz::
16+
17+
digraph gfql_overview_toy {
18+
rankdir=LR;
19+
a -> b -> c -> d;
20+
a [shape=box, style=filled, fillcolor=lightblue];
21+
}
22+
1323
- **Graph search**: Easily and efficiently query and filter nodes and edges using a familiar syntax.
1424
- **Avoid External Infrastructure**: Avoid calls to external infrastructures and eliminate the need for extra databases.
1525
- **Leverage Existing Workflows**: Integrate with your current Python data science tools and libraries.
@@ -328,4 +338,3 @@ Access detailed documentation of GFQL's API:
328338
- **Predicates**: Apply advanced filtering using predicates.
329339

330340
- :doc:`../api/gfql/predicates`
331-

docs/source/gfql/quick.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ Basic Usage
1010

1111
**Chaining Operations**
1212

13+
.. graphviz::
14+
15+
digraph gfql_quick_toy {
16+
rankdir=LR;
17+
a -> b -> c -> d;
18+
a [shape=box, style=filled, fillcolor=lightblue];
19+
}
20+
1321
.. code-block:: python
1422
1523
g.gfql(ops=[...], engine=EngineAbstract.AUTO)

docs/source/graphistry.layout.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
graphistry.layout package
22
=========================
33

4+
.. graphviz::
5+
6+
digraph layout_toy {
7+
rankdir=LR;
8+
data [label="Data (nodes/edges)"];
9+
layout [label="Layout (x,y)"];
10+
render [label="Render (Graphviz/Graphistry)"];
11+
data -> layout -> render;
12+
}
13+
414
Subpackages
515
-----------
616

docs/source/visualization/10min.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,35 @@ PyGraphistry's :ref:`Layout catalog <layout-catalog>` provides many options, cov
113113
- :ref:`cuGraph <cugraph>` for GPU-accelerated FA2, a weaker version of Graphistry's live layout
114114
- :ref:`igraph <igraph>` for CPU-based layouts, similar to GraphViz and with layouts that focus more on medium-sized social networks
115115

116+
Static Graphviz render (for docs/notebooks)
117+
-------------------------------------------
118+
119+
When you need a quick static image without an interactive client, render directly with Graphviz. ``plot_static`` emits bytes that you can save or embed inline:
120+
121+
.. code-block:: python
122+
123+
svg = g.plot_static(format='svg', max_nodes=200, max_edges=400)
124+
from IPython.display import SVG
125+
SVG(svg)
126+
127+
.. graphviz::
128+
129+
digraph viz_static_demo {
130+
rankdir=LR;
131+
a -> b -> c -> d;
132+
a [shape=box, style=filled, fillcolor=lightyellow];
133+
}
134+
135+
Text-only outputs
136+
-----------------
137+
138+
Emit DOT or Mermaid DSL for downstream rendering or embedding:
139+
140+
.. code-block:: python
141+
142+
dot_text = g.plot_static(engine='graphviz-dot', reuse_layout=True)
143+
mermaid_text = g.plot_static(engine='mermaid-code', reuse_layout=False)
144+
116145
- **External Layouts**: Pass in `x`, `y` columns, such as from your own edits, external data, or external ML/AI packages:
117146

118147
.. code-block:: python

0 commit comments

Comments
 (0)