diff --git a/Layout.js b/Layout.js index d7a077d..a1d8e56 100644 --- a/Layout.js +++ b/Layout.js @@ -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; }