-
Notifications
You must be signed in to change notification settings - Fork 348
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
Introduce new prop onLoad
#451
Conversation
# Conflicts: # src/ReactGoogleCharts.tsx # src/components/GoogleChartLoader.tsx
@rakannimer hi. any chance for this PR to be reviewed/merged? |
Codecov Report
@@ Coverage Diff @@
## master #451 +/- ##
==========================================
- Coverage 49.02% 48.74% -0.29%
==========================================
Files 15 15
Lines 514 517 +3
Branches 117 119 +2
==========================================
Hits 252 252
- Misses 193 194 +1
- Partials 69 71 +2
Continue to review full report at Codecov.
|
Looks like some checks are failing, @dangreen will follow up, he's been helping maintain this library. |
@newsiberian Hi. Thank you for contribution. Please add test case for |
chore: add test
@newsiberian Thank you |
Hi. I need to load custom map source for Geo Chart (call
google.visualization.GeoChart.setMapSource()
). This must be done before the firstdraw()
in order to load my custom maps, not default.I found tree ways to do that.
windowGoogleCharts.charts.setOnLoadCallback
=>this.onLoad
=>this.onSuccess
=>this.props.onLoad
windowGoogleCharts.charts.setOnLoadCallback
=>this.props.onLoad
componentDidMount
(table) =>this.props.onLoad
The 1st - in fact is not working for my case because my callback is called after first
draw()
incomponentDidMount
(table).The 3rd is working, but it looks ugly, so I think the second is the best option. It looks clean and it is guaranteed to be called before first
draw()
.