From d550b5503d9be2c1fc6f577fadacb886c714c0de Mon Sep 17 00:00:00 2001 From: Colin Megill Date: Sun, 19 Aug 2018 19:57:11 -0400 Subject: [PATCH] graph needs to know about first time rendering --- client/src/components/graph/graph.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/components/graph/graph.js b/client/src/components/graph/graph.js index 95917c6a..4d6778ba 100644 --- a/client/src/components/graph/graph.js +++ b/client/src/components/graph/graph.js @@ -211,9 +211,12 @@ class Graph extends React.Component { } if ( - /* invisibly handles the initial null vs integer case as well as resize events */ prevProps.responsive.height !== this.props.responsive.height || - prevProps.responsive.width !== this.props.responsive.width + prevProps.responsive.width !== this.props.responsive.width || + /* first time */ + (this.props.responsive.height && + this.props.responsive.width && + !this.state.svg) ) { /* clear out whatever was on the div, even if nothing, but usually the brushes etc */ d3.select("#graphAttachPoint")