Skip to content

Commit 645dd8f

Browse files
committed
🐛 (PropertyPriceChart) remove animations to fix weird drawing glitch
1 parent 013bfe0 commit 645dd8f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/PropertyPriceChart/PropertyPriceChart.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { ComputedDatum, CustomLayer, Datum } from '@nivo/line';
44
import { Crosshair } from '@nivo/tooltip';
55
import { area, curveMonotoneX } from 'd3-shape';
66
import moment from 'moment';
7-
import React, { useMemo, useState } from 'react';
7+
import React, { useContext, useEffect, useMemo, useState } from 'react';
88
import {
99
Checkbox,
1010
Dimmer,
@@ -182,6 +182,7 @@ const PropertyPriceChart: React.FC<PropertyPriceChartProps> = (props) => {
182182
</div>
183183
);
184184
}}
185+
animate={false}
185186
axisBottom={null}
186187
axisLeft={{
187188
format: (value) => `${value} €`,
@@ -218,6 +219,7 @@ const PropertyPriceChart: React.FC<PropertyPriceChartProps> = (props) => {
218219
tickValues: 2,
219220
}}
220221
gridYValues={4}
222+
animate={false}
221223
axisBottom={{
222224
format: (x) => {
223225
return moment(x).format(
@@ -370,11 +372,11 @@ const WarningLayer: CustomLayer = (props) => {
370372

371373
const CustomCrosshair: CustomLayer = (props) => {
372374
const [crosshairPosition, setCrosshairPosition] =
373-
React.useContext(CrosshairContext);
375+
useContext(CrosshairContext);
374376

375377
const { currentSlice } = props as unknown as { currentSlice: Datum };
376378

377-
React.useEffect(() => {
379+
useEffect(() => {
378380
const position = currentSlice
379381
? { x: currentSlice.x, y: currentSlice.y }
380382
: undefined;

0 commit comments

Comments
 (0)