ITADN

Feature Request: Add Data Attributes to SVG Elements for Interactivity

#184OpenMrTomRod 创建于 2025-04-29
enhancement
M
MrTomRodcommented
### Feature Request: Add Data Attributes to SVG Elements for Interactivity Thanks for making BandageNG, I like it a lot! However, the current SVG output lacks identifiers for the graphical elements (e.g., lines, bars, and text) that represent contigs. This makes it challenging to create interactive web visualizations where users can click on or hover over elements to get more information. **Proposed Feature:** I propose adding data attributes to each SVG element that corresponds to the corresponding contig. For example, each element could have a `data-contig` attribute with the value set to the contig's identifier, like so: ```html <g data-contig="contig_1" fill="#4682b4" ...> // option 1: the group tag <path data-contig="contig_1" vector-effect="none" .../> // option 2: the path elements </g> ``` Maybe it's easier or makes more sense to follow the gfa entries instead? E.g. `data-gfa-type="L" data-gfa-id="edge_1"`? Thanks for considering my suggestion. I can't do it myself because I don't know QT or C++. **Alternative/Workaround:** A technically simpler solution could be an option to save labels as text and not convert them to paths. (I managed to implement this in [gfaviz](https://github.com/ggonnella/gfaviz/compare/master...MrTomRod:gfaviz:master#diff-5cc870ffe07c65da1f3f52054158b47dddc1d703da90a7a7d7c48c3e4b650f9e).)
1 条评论