mongodb-js / charts-embed-sdk

The easiest way to embed MongoDB Charts visualisations into your web app
https://docs.mongodb.com/charts/master/embedding-charts-sdk/
Apache License 2.0
43 stars 31 forks source link

fix: CHARTS-6412 Update timeline example to wait for rendering #58

Closed khanguslee closed 2 years ago

khanguslee commented 2 years ago

Given the v1.30 update of Charts, the promise return from embedded chart's render and refresh methods will now wait for data to fetch.

With the timeline example, if you were to interact with the example whilst the chart is still loading, an error will be shown. This PR disables the interactive controls on the timeline example and enables them once all Charts have been rendered.

I have checked all other examples in this repo and believe that this does not occur anywhere else.

Before

Interact with the interactive controls before charts have been rendered.

https://user-images.githubusercontent.com/18709969/153798952-391f1608-9ab7-4528-91ec-15d6c5c4838b.mp4

After

Interactive controls have been disabled.

https://user-images.githubusercontent.com/18709969/153799045-72eeb85b-ee8d-4409-aa7f-1fc6ec8a9bb8.mp4