fix: move constant definition inside hook
This commit is contained in:
parent
f10f881e31
commit
3c79a44358
1 changed files with 1 additions and 2 deletions
|
|
@ -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 = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue