question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chart plays animations when first mounted

See original GitHub issue

Describe the solution you’d like Charts will play an animation (e.g. fade in) when first mounted. Similar to how recharts (sorry for mentioned another similar library here) behave. Currently, only a limited amount of charts (e.g. Network. Yet, most of them are uncommon) support that.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:31
  • Comments:25

github_iconTop GitHub Comments

4reactions
mfenejcommented, Nov 12, 2021

bump!

3reactions
chrislicodescommented, Jun 10, 2021

Is there any hacky way to do this for the time being?

This worked for me:

const BarChart = ({ data }) => {
    // Workaround for initial animation
    const [chartData, setChartData] = useState([]);
    useEffect(() => {
      let animation = setTimeout(() => setChartData(data), 1);
  
      return () => {
        clearTimeout(animation);
      };
    }, [data]);
  
    return (/* Something */);
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

React - animate mount and unmount of a single component
All I want to do is animate the mounting & unmounting of a React component, that's it. Here's what I've tried so far...
Read more >
Guide to Python Animations: Animating Line Charts
In this animation tutorial we will use Python and Matplotlib to animate line charts. We will also try to explain every step so...
Read more >
Strider for UE4: Tutorial - Example Animation Graph Setup
In this tutorial, I improve the 'Third Person Template' project animation blueprint using Strider nodes. With very few animations, ...
Read more >
Video: Animate charts and SmartArt - Microsoft Support
Next, open the Animation Pane. Select Animation 1, which brings in the bar, and delete it. Click Play from. So now we know...
Read more >
AnimatePresence | Framer for Developers
Mount animations are already handled by motion components via the initial and animate props. If a motion component is set to initial={false} ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found