diff --git a/subprojects/gst-devtools/dots-viewer/static/overlay.html b/subprojects/gst-devtools/dots-viewer/static/overlay.html index baec4550f4..72056e79d8 100644 --- a/subprojects/gst-devtools/dots-viewer/static/overlay.html +++ b/subprojects/gst-devtools/dots-viewer/static/overlay.html @@ -48,6 +48,10 @@ furnished to do so, subject to the following conditions: Click node to highlight
Shift-Ctrl-scroll or w/s to zoom
Esc to unhighlight +
+ +
+ @@ -82,11 +86,25 @@ furnished to do so, subject to the following conditions: } else if (evt.key == "s") { gv.scaleInView((gv.zoom.percentage - 100) || 100); } - }) + }); + + $("#save-svg").click(function() { + const svgElement = $("#graph svg")[0]; + const svgData = new XMLSerializer().serializeToString(svgElement); + const blob = new Blob([svgData], {type: "image/svg+xml;charset=utf-8"}); + const url = URL.createObjectURL(blob); + const title = document.getElementById("title").textContent.trim(); + const downloadLink = document.createElement("a"); + downloadLink.href = url; + downloadLink.download = title + ".svg"; + document.body.appendChild(downloadLink); + downloadLink.click(); + document.body.removeChild(downloadLink); + URL.revokeObjectURL(url); + }); } }); }); -