Skip to content

Conversation

@lmeyerov
Copy link
Contributor

@lmeyerov lmeyerov commented Dec 1, 2025

Summary

  • add plot_static engines for graphviz svg/png, graphviz-dot, and mermaid-code with position reuse support
  • enable sphinx graphviz directive, refresh docs/notebook examples, and build docs image with graphviz/pygraphviz
  • expand graphviz tests for new engines and doc snippets (rst/myst)

Testing

  • PYTHONPATH=. uv run --python /usr/bin/python3 --with numpy --with palettable --with pandas --with pyarrow --with requests --with squarify --with typing-extensions --with packaging --with setuptools --with pygraphviz --with pytest python -m pytest graphistry/tests/plugins/test_graphviz.py -q
  • DOCS_FORMAT=html VALIDATE_NOTEBOOK_EXECUTION=0 ./docs/ci.sh
  • ./docs/validate-docs.sh docs/source/10min.rst docs/source/visualization/10min.rst docs/source/api/plugins/compute/graphviz.rst docs/source/gfql/spec/index.md

@lmeyerov lmeyerov force-pushed the feat/graphviz-docs-rendering branch 3 times, most recently from be41870 to 3c70241 Compare December 4, 2025 07:46
lmeyerov added a commit that referenced this pull request Dec 4, 2025
Phase 4 documents how to split PR #859 into:
- Base PR: infrastructure + minimal proof-of-work (1 RST, 1 MyST, 1 notebook)
- Stacked PR: rich graphviz examples across all docs

Includes safe workflow with backup tag before trimming.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
lmeyerov and others added 13 commits December 4, 2025 19:13
The RTD build.commands option is incompatible with apt_packages,
causing graphviz to not be installed despite being listed. This
results in 'dot command cannot be run' warnings and placeholder
images instead of real Graphviz diagrams.

Switching to build.jobs allows apt_packages to work properly:
- post_install: copy demos and markdown files
- build.html/epub/pdf: format-specific sphinx builds

This should make Graphviz diagrams render correctly on RTD.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The sphinx.configuration key is needed to trigger RTD's Sphinx
support which ensures pip install runs before the build jobs.
Without it, sphinx-build is not available when build.jobs run.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Now that RTD properly installs graphviz via build.jobs + apt_packages,
the placeholder shim should rarely be needed. Add a one-time warning
when it does trigger to make it visible that diagrams are missing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Remove the placeholder shim that silently masked missing graphviz.
Now if dot is unavailable, the build will fail loudly instead of
producing invisible 1x1 pixel placeholder images.

RTD now properly installs graphviz via build.jobs + apt_packages,
so the shim is no longer needed. Local builds without graphviz
will fail fast with a clear error message from Sphinx.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The <object> tag used by default for SVG graphviz output doesn't
render reliably in all browsers. Switch to svg:img format which
embeds as <img> tag for more consistent display.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sphinx 8.0.2 on RTD doesn't support svg:img format, causing graphviz
diagrams to be silently dropped. Revert to plain svg which uses
<object> tags - they render correctly, just need the file to exist.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Phase 4 documents how to split PR #859 into:
- Base PR: infrastructure + minimal proof-of-work (1 RST, 1 MyST, 1 notebook)
- Stacked PR: rich graphviz examples across all docs

Includes safe workflow with backup tag before trimming.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Keep infrastructure + 1 example each for RST/MyST/notebook:
- RST: gfql/about.rst (1 graphviz directive)
- MyST: gfql/spec/index.md (1 graphviz example)
- Notebook: graphviz/graphviz.ipynb (plot_static example)

Reverted graphviz additions from:
- 10min.rst
- visualization/10min.rst
- ecosystem.rst
- gfql/overview.rst
- gfql/quick.rst
- graphistry.layout.rst

These will be added in stacked PR feat/graphviz-docs-usage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Phase 4.A done: base branch trimmed to minimal examples
- Stacked branch feat/graphviz-docs-usage preserves full work
- Added lesson: backup tags break setuptools_scm, use branches instead
- CI/RTD green on trimmed base

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@lmeyerov lmeyerov force-pushed the feat/graphviz-docs-rendering branch from e0b3eb8 to 7f26afb Compare December 5, 2025 03:13
lmeyerov added a commit that referenced this pull request Dec 5, 2025
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>
- Add _auto_display_static() helper with IPython environment detection
- Automatically display SVG/PNG output inline in Jupyter notebooks
- Still returns bytes for programmatic use (saving to disk)
- Update graphviz docs with simplified usage examples
- Update graphviz demo notebook with cleaner syntax

Users no longer need to manually wrap output with SVG() or Image():

  # Before: required explicit display wrapper
  from IPython.display import SVG
  svg = g.plot_static(format='svg')
  SVG(svg)

  # After: just works
  g.plot_static()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
lmeyerov added a commit that referenced this pull request Dec 5, 2025
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>
Creates a minimal notebook that:
- Uses nbsphinx execute=always metadata
- Only requires local operations (no server registration)
- Demonstrates plot_static() SVG rendering, DOT output, and file saving
- RTD will execute this notebook fresh each build

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
lmeyerov added a commit that referenced this pull request Dec 5, 2025
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>
Add HAS_PYGRAPHVIZ check so notebook executes cleanly on RTD
where pygraphviz is not installed in the Python environment.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
lmeyerov added a commit that referenced this pull request Dec 5, 2025
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>
- Add graphviz-dev to apt_packages (headers for compilation)
- Add pygraphviz extra to pip install

This enables plot_static_demo.ipynb to render actual SVG graphs on RTD.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
lmeyerov added a commit that referenced this pull request Dec 5, 2025
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>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
lmeyerov added a commit that referenced this pull request Dec 7, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants