plouc / nivo

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries
https://nivo.rocks
MIT License
13.23k stars 1.03k forks source link

animations cannot be disabled for pie chart tooltips #2656

Open ImLunaHey opened 1 month ago

ImLunaHey commented 1 month ago

Describe/explain the bug Tooltips within pie charts (others too maybe?) will always have an animation as the tooltip's wrapper is animated.

demo with default tooltip:

Screenshot 2024-09-30 at 12 29 26 PM

custom tooltip:

Screenshot 2024-09-30 at 12 26 25 PM

To Reproduce https://nivo.rocks/pie/canvas

Steps to reproduce the behavior:

  1. Hover a piece of a pie chart
  2. Move your cursor really fast to another piece and notice the way the tooltip lags behind

Expected behavior Either animate={false} needs to be added to PieChart or tooltips need a way to opt out of having a wrapper.

ImLunaHey commented 1 month ago

for anyone looking for a workaround, if you dont use react-spring for anything else you can globally disable animations.

import { Globals } from 'react-spring';

Globals.assign({
  skipAnimation: true,
});