Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation when changing pie data #39

Closed
Kerumen opened this issue Aug 28, 2017 · 19 comments
Closed

Animation when changing pie data #39

Kerumen opened this issue Aug 28, 2017 · 19 comments
Labels
🍰 pie @nivo/pie package enhancement

Comments

@Kerumen
Copy link

Kerumen commented Aug 28, 2017

Great lib!

I was wondering why there were no animation when pie datas are updated?
It works for the line component for example and its nice.

@plouc
Copy link
Owner

plouc commented Aug 28, 2017

It's a little bit more complicated for Pie component, as you have to animate the angle/radius instead of the shape, whereas you can just animate the shape for the line component, I'll probably add support for this, but it requires a little bit of work (and for optimal transitions, you should search closest previous angle).

@Kerumen
Copy link
Author

Kerumen commented Aug 28, 2017

It would be a really great addition!

@plouc plouc added the 🍰 pie @nivo/pie package label May 18, 2018
@namesphill
Copy link

is there any progress on this?

@BenJenkinson
Copy link

Also, the ResponsivePie example code (code tab, not the adjustable props) and the CommonPieProps TypeScript props both include the MotionProps props that imply the Pie does animate; except it doesn't.

@antonstjernquist
Copy link

I like pie.

Animation would be cool! 🥇

@Roeefl
Copy link

Roeefl commented May 16, 2020

We demand animated pie charts! OR!
OR!
I'm just kidding I do not demand anything but it would be amazing to have it able to animate when it shows up.

Thank you for this great library it is just superb

@omarathon
Copy link

pretty plz

@nemethricsi
Copy link

I also found this thread :(

@stale
Copy link

stale bot commented Nov 22, 2020

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added stale and removed stale labels Nov 22, 2020
@plouc
Copy link
Owner

plouc commented Dec 18, 2020

This has been implemented and should be available in the upcoming release (no ETA yet), if you want to play with it you can already have a look at the codesandbox, just realized this issue is 3 years old, wow...

@plouc plouc closed this as completed Dec 18, 2020
@nemethricsi
Copy link

This has been implemented and should be available in the upcoming release (no ETA yet), if you want to play with it you can already have a look at the codesandbox, just realized this issue is 3 years old, wow...

amazing news thanks!

@raman-natarajan
Copy link

Any word on a possible release date for the new version with animation?

@marcelojrfarias
Copy link

Waiting for the release !!

@MShodmonov
Copy link

Waiting in 2022 too. However, thanks for the great job you have done so far !!!

@rtman
Copy link

rtman commented Sep 14, 2022

@plouc is this not available in the current release? The docs indicate that it's on by default and I see it animating in the docs, but when I setup a pie chart in my repo I don't have any animations.

@plouc
Copy link
Owner

plouc commented Sep 14, 2022

@rtman, it's been released for some time now, and you can see it on https://nivo.rocks/pie/.

@rtman
Copy link

rtman commented Sep 14, 2022

@plouc Yea that is where I was seeing it animate correctly, maybe it's something to do with my setup. I'll try and create a codesandbox to repro.

Below is how I'm using it right now.

            <ResponsivePie
              colors={{ datum: 'data.color' }}
              data={mockPieChartData}
              enableArcLabels={false}
              enableArcLinkLabels={false}
              valueFormat={(value) => `$${value}`}
            />

@rtman
Copy link

rtman commented Sep 19, 2022

@plouc Here's the codesandbox, I was able to get on hover animations working but not the initial mount one. Can you take a look?

@yumcoding
Copy link

yumcoding commented Oct 4, 2022

have same issue.
Hovering animations are working but the initial mount animation isn't.

Below is my setup.

        <ResponsivePie
          data={data}
          margin={{ top: 8, right: 8, bottom: 8, left: 8 }}
          padAngle={0}
          innerRadius={0.6}
          cornerRadius={0}
          enableArcLabels={false}
          enableArcLinkLabels={false}
          activeOuterRadiusOffset={8}
          isInteractive={true}
          colors={["#5A7CF8", "#70BECD", "#F6DD66", "#E2814A", "#CE5E41"]}
          tooltip={({ datum: { id, value, color } }) => <PieCustomTooltip value={value} color={color} />}
          motionConfig={{
            mass: 1,
            tension: 170,
            friction: 26,
            clamp: false,
            precision: 0.01,
            velocity: 0,
          }}
          transitionMode="outerRadius"
          onMouseEnter={(props) => {
            console.log(props);
          }}
        />

I got this warning on my console.

 Failed prop type: Invalid prop `motionConfig` of type `object` supplied to `Zt`, expected `string`.

I also tried the line chart with the default motionConfig.
The line chart animation didn't work either and got the same warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 pie @nivo/pie package enhancement
Projects
None yet
Development

No branches or pull requests