From ee2b7fc13fe7fed181788bba4a4730627b7e4acd Mon Sep 17 00:00:00 2001 From: Colin Megill Date: Tue, 31 Jul 2018 11:07:53 -0400 Subject: [PATCH] stub getDerivedStateFromProps --- client/src/components/graph/graph.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/src/components/graph/graph.js b/client/src/components/graph/graph.js index c6cf9dd2..a261b5a1 100644 --- a/client/src/components/graph/graph.js +++ b/client/src/components/graph/graph.js @@ -117,6 +117,12 @@ class Graph extends React.Component { reglRender }); } + // static getDerivedStateFromProps(props, state) { + // console.log("getDerivedStateFromProps in graph.js"); + // console.log("props", props); + // console.log("state", state); + // // console.log("this.props", this.props); + // } componentWillReceiveProps(nextProps) { if (this.state.regl && nextProps.crossfilter) { /* update the regl state */ @@ -204,8 +210,7 @@ class Graph extends React.Component { nextProps.responsive.width !== this.props.responsive.width ) { /* clear out whatever was on the div, even if nothing, but usually the brushes etc */ - d3 - .select("#graphAttachPoint") + d3.select("#graphAttachPoint") .selectAll("svg") .remove(); const { svg, brush, brushContainer } = setupSVGandBrushElements( @@ -251,7 +256,7 @@ class Graph extends React.Component { // transform screen coordinates -> cell coordinates const invert = pin => { const x = - 2 * pin[0] / (this.props.responsive.height - this.graphPaddingTop) - + (2 * pin[0]) / (this.props.responsive.height - this.graphPaddingTop) - 1; const y = 2 *