From 14108c0164562d99398b15c8b8b50e9314c8fdcb Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Wed, 10 Jul 2019 22:31:51 +0000 Subject: [PATCH] Handle an empty graph --- Layout.js | 5 +++++ 1 file changed, 5 insertions(+) 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; }