data-for-change / anyway-newsflash-infographics

Development branch deployed automatically to website:
https://anyway-infographics-staging.web.app/
MIT License
12 stars 23 forks source link

[Bug] axis is partial in img download #1136

Open atalyaalon opened 2 days ago

atalyaalon commented 2 days ago

Describe the bug axis is partial in image download

To Reproduce See injured_count_by_accident_year widget in this newsflash Y axis numbers are "cut"

Expected behavior axis should be displayed as it does in the web.

Screenshots injured_count_by_accident_year (13)

Environment Browser: Chrome Environment: Local / Staging / etc.

atalyaalon commented 2 days ago

@shaked-hayek can you take a quick look on this one? I tried to play a little with height, width, margins, and other variables in html2canvas (see branch bug-1136-axis-partial) However, issue is not fixed (I reverted these changes and they are not in dev nor in prod)

atalyaalon commented 2 days ago

The branch: https://github.com/data-for-change/anyway-newsflash-infographics/tree/bug-1136-axis-partial

atalyaalon commented 2 days ago

@shaked-hayek perhaps using another package of html2canvas will solve the issue? Just wondering whether it can be as simple as that :)

atalyaalon commented 1 day ago

Perhaps https://github.com/tsayen/dom-to-image library can be a better fit, but needs testing

atalyaalon commented 1 day ago

Also https://github.com/bubkoo/html-to-image is another alternative to check