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

Đang mở
#381 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@markthomaschurch đang làm issue này rồi.

Từ ngày 9/11/2026.

  • #382 của @markthomaschurch — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
20/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
data-visualization

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
1.2k
Fork
237
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OWASP/pytm

Tất cả issue của OWASP/pytm

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.