Handle an empty graph

This commit is contained in:
Ian Gulliver
2019-07-10 22:31:51 +00:00
parent d22fb20da5
commit 14108c0164

View File

@@ -164,6 +164,11 @@ class Layout {
}
}
// handle empty graph
if (min[0] == Number.POSITIVE_INFINITY) {
min[0] = min[1] = max[0] = max[1] = 0;
}
if (this.graph_.label) {
min[1] -= 1;
}