Datastore icon is missing from SVG diagrams (absolute PNG path)

Abierto
#381 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

@markthomaschurch ya está trabajando en esto.

Desde el 9/11/2026.

  • #382 de @markthomaschurch — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
20/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

Start with Datastore.dfd() and inspect how it sets Graphviz node attributes for PNG and SVG output. Check the existing DFD rendering examples or tests across output formats; done means datastore nodes render without an external image path and retain the intended label and colormap behavior. An open linked pull request (#382) already addresses this issue.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Description

In SVG diagrams, the datastore icon is missing as soon as the SVG is opened anywhere other than the machine and checkout that generated it (another computer, a CI artifact, a web page or report). PNG output is fine.

Reproduction

./tm.py --dfd | dot -Tsvg -o dfd.svg
grep '<image' dfd.svg
<image xlink:href="/home/me/src/pytm/pytm/images/datastore_black.png" width="49.6px" height="36px" .../>

Cause

Datastore.dfd() draws the datastore by pointing Graphviz at a PNG with an absolute path (shape = none; image = ".../pytm/images/datastore_<color>.png"). With -Tpng Graphviz draws the pixels into the output; with -Tsvg it only writes a link to that file. Graphviz has no option to embed the image in SVG, and DOT image attributes can't be data: URIs.

Proposed fix

Draw datastores with Graphviz's built-in shape = cylinder, which is what the icon depicts. Graphviz draws it natively, so it renders the same in PNG, SVG, PDF and every other format, and --colormap can colour it like any other element. The PNG icons are no longer needed.

This changes the look slightly: the label moves from beside the icon (xlabel) to inside the cylinder, like other assets.

Lenguaje dominante
Python
Estrellas
1.2k
Forks
237
Merge medio
4 d 2 h
PR fusionados (30 d)
9

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OWASP/pytm

Todos los issues de OWASP/pytm

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.