Skip to content

Commit

Permalink
🐛 (PropertyPriceChart) remove animations to fix weird drawing glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
MatissJanis committed May 8, 2022
1 parent 013bfe0 commit 645dd8f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/PropertyPriceChart/PropertyPriceChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { ComputedDatum, CustomLayer, Datum } from '@nivo/line';
import { Crosshair } from '@nivo/tooltip';
import { area, curveMonotoneX } from 'd3-shape';
import moment from 'moment';
import React, { useMemo, useState } from 'react';
import React, { useContext, useEffect, useMemo, useState } from 'react';
import {
Checkbox,
Dimmer,
Expand Down Expand Up @@ -182,6 +182,7 @@ const PropertyPriceChart: React.FC<PropertyPriceChartProps> = (props) => {
</div>
);
}}
animate={false}
axisBottom={null}
axisLeft={{
format: (value) => `${value} €`,
Expand Down Expand Up @@ -218,6 +219,7 @@ const PropertyPriceChart: React.FC<PropertyPriceChartProps> = (props) => {
tickValues: 2,
}}
gridYValues={4}
animate={false}
axisBottom={{
format: (x) => {
return moment(x).format(
Expand Down Expand Up @@ -370,11 +372,11 @@ const WarningLayer: CustomLayer = (props) => {

const CustomCrosshair: CustomLayer = (props) => {
const [crosshairPosition, setCrosshairPosition] =
React.useContext(CrosshairContext);
useContext(CrosshairContext);

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

React.useEffect(() => {
useEffect(() => {
const position = currentSlice
? { x: currentSlice.x, y: currentSlice.y }
: undefined;
Expand Down

0 comments on commit 645dd8f

Please sign in to comment.