File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export function getHtmlContent(dot?:string){
1717 <button id="downloadDot">save dot file</button>
1818 <button id="downloadSvg">save as svg</button>
1919 </div>
20+ <div id="hide" style="display: none;"><div/>
2021 </body>
2122 <script>
2223 (async function () {
@@ -25,12 +26,12 @@ export function getHtmlContent(dot?:string){
2526 vscode.setState(dot)
2627 const res =await (await fetch(dot)).text()
2728 d3.select('#app').graphviz().renderDot(res)
28-
29-
29+ d3.select('#hide').graphviz({zoom:false}).renderDot(res)
3030
3131 d3.select('#downloadSvg').on('click',()=>{
3232 const serializer = new XMLSerializer()
33- const svg = serializer.serializeToString(d3.select('svg').node())
33+ // The svg in #app may have been scaled or moved, use #hide
34+ const svg = serializer.serializeToString(d3.select('#hide>svg').node())
3435
3536 vscode.postMessage({
3637 command: 'download',
You can’t perform that action at this time.
0 commit comments