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

Load necessary google charts packages in Gutenberg #1081

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

Soare-Robert-Daniel
Copy link
Contributor

Summary

I added the necessary packages as parameters for the Charts component from React Google Chart lib.

Notes

This took some time to debug. At first, it might be a problem with the given data to the component since it throws an undefined error. After some extensive testing, it was not the case.

After reviewing the documents, I found that packages might not be loaded (like geochart). After trying a bunch of things, I looked more deeply at the lib source code and found this default:

https://github.com/rakannimer/react-google-charts/blob/418ebc924f36ba32eea48d79034a418042139c9e/src/hooks/useLoadGoogleCharts.ts#L23

By default, the lib does not load all necessary packages for us (like here )

Screenshots

image

Testing

  1. Make a default Geo Chart
  2. Insert in the Gutenberg Editor via block
  3. It should display

@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review February 13, 2024 12:55
@Soare-Robert-Daniel Soare-Robert-Daniel linked an issue Feb 13, 2024 that may be closed by this pull request
@pirate-bot
Copy link
Contributor

Plugin build for d31a486 is ready 🛎️!

@irinelenache
Copy link

@Soare-Robert-Daniel Tested and the issue is fixed ✅

@Soare-Robert-Daniel Soare-Robert-Daniel merged commit 7d6225c into development Feb 20, 2024
10 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the fix/geo-chart branch February 20, 2024 15:40
@pirate-bot
Copy link
Contributor

🎉 This PR is included in version 3.10.8 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Geo chart throws error only in Gutenberg Editor
4 participants