1- import "regenerator-runtime/runtime" ;
21import ChartsEmbedSDK from "@mongodb-js/charts-embed-dom" ;
32
43const sdk = new ChartsEmbedSDK ( {
5- baseUrl : "https://charts.mongodb.com/charts-embedding-examples-wgffp" // Optional: ~REPLACE~ with the Base URL from your Embed Chart dialog
4+ baseUrl : "https://charts.mongodb.com/charts-embedding-examples-wgffp" , // Optional: ~REPLACE~ with the Base URL from your Embed Chart dialog
65} ) ;
76
87const chart = sdk . createChart ( {
98 chartId : "735cfa75-15b8-483a-bc2e-7c6659511c7c" , // Optional: ~REPLACE~ with the Chart ID from your Embed Chart dialog
10- height : "700px"
9+ height : "700px" ,
1110} ) ;
1211
1312async function renderChart ( ) {
@@ -33,7 +32,7 @@ async function renderChart() {
3332 */
3433 document
3534 . getElementById ( "refresh-interval" )
36- . addEventListener ( "change" , async e => {
35+ . addEventListener ( "change" , async ( e ) => {
3736 var refreshInterval = e . target . value ;
3837 refreshInterval
3938 ? chart . setRefreshInterval ( Number ( refreshInterval ) )
@@ -58,7 +57,7 @@ async function renderChart() {
5857 */
5958 document
6059 . getElementById ( "country-filter" )
61- . addEventListener ( "change" , async e => {
60+ . addEventListener ( "change" , async ( e ) => {
6261 const country = e . target . value ;
6362 const currentFilterDOM = document . getElementById ( "currentFilter" ) ;
6463 if ( country ) {
@@ -84,7 +83,7 @@ async function renderChart() {
8483 */
8584 document
8685 . getElementById ( "themeSwitch" )
87- . addEventListener ( "change" , async function ( ) {
86+ . addEventListener ( "change" , async function ( ) {
8887 if ( this . checked ) {
8988 await chart . setTheme ( "dark" ) ;
9089 document . body . classList . toggle ( "dark-mode" , true ) ;
@@ -98,4 +97,4 @@ async function renderChart() {
9897 } ) ;
9998}
10099
101- renderChart ( ) . catch ( e => window . alert ( e . message ) ) ;
100+ renderChart ( ) . catch ( ( e ) => window . alert ( e . message ) ) ;
0 commit comments