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.

Endless scaling animation when a ResponsiveChart is placed in CSS grid?

See original GitHub issue

What i’m trying to do is to have a an arbitrary sized dashboard tile layouted with CSS grid. I’m not sure why the ResponsiveBar shown in my Codesandbox example is infinitely scaled up?

https://codesandbox.io/s/4z8z15mp4w

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:15
  • Comments:15

github_iconTop GitHub Comments

37reactions
sheacommented, Feb 16, 2019

I just ran across this issue using css grid and found a workaround that’s working for me. Placing the chart inside a position: absolute container inside a position: relative container seems to let it resize properly. Maybe this will be helpful for someone.

https://codesandbox.io/s/1rzl826krj

<div style={{position: 'relative'}}>
  <div style={{ position: 'absolute', width: '100%', height: '100%' }}>
    <ResponsiveBar />
  </div>
</div>
8reactions
roz0ncommented, Dec 14, 2019

Is there any update regarding this issue, or is the absolute-positioning workaround the recommended approach?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scaling Responsive Animations - CSS-Tricks
Guidelines for scaling responsive animations ... circumstance the element is going to be positioned and sized relative to the viewport.
Read more >
css grid children scale transition/animation - Stack Overflow
We define a grid area for each element, This way the grid items will be relative to their grid area instead of the...
Read more >
Animating CSS Grid Rows and Columns | by Chen Hui Jing
It says we can animate grid rows and columns which are a simple list of length, percentage or calc values. Animations with CSS...
Read more >
A Fully Responsive Chart.js Chart | by Nora Brown - ITNEXT
A little CSS grid knowledge lets us build a chart that fills the ... Animation showing chart resizing with consistent aspect ratio as...
Read more >
CSS Animated Grid Layouts - web.dev
With the transition property in place, the grid smoothly interpolates between values. HTML; CSS; JS. Result; Skip Results Iframe.
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