sphinx-doc / sphinx-doc/sphinx

Put graphviz objects into a zoom & pan box.

Open
#6,991 10 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

extensions:graphviz type:enhancement
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Feature Description

Diagrams generated with embedded Graphviz code or read dot files may be quite large. Zooming and panning will help to navigate in big diagrams. The sphinx.ext.graphviz extension generates diagrams as SVG graphics. SVG graphics are displayed with an object tag in HTML.

Describe the solution you'd like

Added a zoom and pan functionality is quite simple. E.g. the svg-pan-zoom framework could solve it with a few lines of Javascript code:

<object id="demo-tiger" type="image/svg+xml" data="tiger.svg" style="width: 500px; height: 500px; border:1px solid black; ">Your browser does not support SVG</object>

<script>
document.getElementById('my-embed').addEventListener('load', function(){
  // Will get called after embed element was loaded
  svgPanZoom(document.getElementById('my-embed'));
})
</script>

Describe alternatives you've considered
There are other Javascript based frameworks offering such a option.

Additional context

This could also be useful with:


/cc: @eine

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining how sphinx.ext.graphviz generates SVG diagrams in HTML, including the object tag, and compare that output with sphinx.ext.inheritance_diagram. Evaluate svg-pan-zoom or another JavaScript framework for the embedded diagrams. Done means generated diagrams support zooming and panning in HTML while preserving the existing SVG display behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
documentation, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.