Skip to content

Commit d435cb1

Browse files
authored
Make SVG viewBox adaptive to the actual model (#350)
1 parent f9de540 commit d435cb1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

frontend/src/graph/ui/Chart.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@
120120
}
121121
122122
render(d3.select("svg g"), g);
123+
124+
// adjust viewBox so that the whole graph can be shown, with scroll bar
125+
d3.select("svg")
126+
.attr('viewBox', '0 0 ' + g.graph().width + ' ' + g.graph().height);
123127
});
124128
},
125129

0 commit comments

Comments
 (0)