Open pstaubs opened 2 years ago
This appears to be a valid issue. Can we re-open?
Same for me. I reproduced it by using @nivo/express
and touching nivo/samples/bar.svg
.
Is there any update on this?
We have a very large data set and animate set to false, but when we switch data sets, it is still animating in, which is causing UI freeze and choppy display until the animation is finished, at which point everything works fine.
Describe/explain the bug
I am trying to render some (plain, non-responsive) nivo charts sever-side on a rails server using
react_component
withprerender:true
(to support wkhtmltopdf). This works fine for most charts I have come across, except for bar charts.For some reason the prerendered bar chart SVG contains bars with
width="0"
(specifically the SVG RECT element) and labels withfill-opacity="0"
(specifically the SVG TEXT element), resulting in a chart that looks empty, even if the correct svg elements are present and properly positioned.Here's an example bar generated by the above component if I pre-render it and look at the raw HTML
To Reproduce
Examine the first render of any bar chart, for example, e.g. if prerendering on a rails server
Expected behavior
I expect
animate={false}
means that the component renders for the first time without any unresolved animations.Additional context
In a browser, the pre-rendered component appears to be re-rendered (imperceptibly instantly) with the correct fill-opacity and bar width properties, but this is not the case if I am printing to wkhtmltopdf. Does
animate={false}
really turn off animations on a technical level, or does it just shorten the animation to be near instant, so it doesn't look animated, but in reality the initial chart is rendered in a pre-animated state? It's clear that the bar width is already known since the bars are correctly positioned. It's only stylistic properties awaiting update.My current workaround is to manually override the SVG's style, but this is a pain especially if the bar width is not fixed.