From 3c79a44358fded46a3dfb4c8f6518a3e1b80e45b Mon Sep 17 00:00:00 2001 From: Nikola Ubavic <53820106+ubavic@users.noreply.github.com> Date: Thu, 21 Oct 2021 21:01:32 +0200 Subject: [PATCH] fix: move constant definition inside hook --- .../pages/Dashboard/SystemPerformance/Graphs/RefScatterplot.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/Graphs/RefScatterplot.js b/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/Graphs/RefScatterplot.js index ab79552e..0c974854 100644 --- a/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/Graphs/RefScatterplot.js +++ b/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/Graphs/RefScatterplot.js @@ -6,13 +6,12 @@ import { backgroundColor, java, neon } from 'src/styling/variables' const RefScatterplot = ({ data: realData, timeFrame, timezone }) => { const svgRef = useRef() - const dstOffset = parseInt(timezone.split(':')[1]) const drawGraph = useCallback(() => { const svg = d3.select(svgRef.current) const margin = { top: 25, right: 0, bottom: 25, left: 15 } const width = 555 - margin.left - margin.right const height = 150 - margin.top - margin.bottom - + const dstOffset = parseInt(timezone.split(':')[1]) // finds maximum value for the Y axis. Minimum value is 100. If value is multiple of 1000, add 100 // (this is because the Y axis looks best with multiples of 100) const findMaxY = () => {