Also, don't throw an exception if e.g. a bad query name (chart id?) is supplied, so the script can carry on and potentially render any subsequent valid charts.
Given the way I expect Mode Analytics users typically create and edit these dashboards, I'm assuming they don't usually have the Console open to see errors, and they're probably editing and re-running their code lots of times, so this seems like a reasonable way to report errors out-of-band. (Did you have something else in mind in #1?)
Potential future enhancement would be an option to be a little quieter about errors for more production-y dashboards, but unless people are using JS to dynamically generate these charts, it seems unlikely for these errors to happen except while editing your own dashboard.
Fix #1, report errors when called with bad table or chart id by inserting a big warning error banner at the top:
See it in action: https://modeanalytics.com/editor/laughinghan/reports/b296289a24a3
Also, don't throw an exception if e.g. a bad query name (chart id?) is supplied, so the script can carry on and potentially render any subsequent valid charts.
Given the way I expect Mode Analytics users typically create and edit these dashboards, I'm assuming they don't usually have the Console open to see errors, and they're probably editing and re-running their code lots of times, so this seems like a reasonable way to report errors out-of-band. (Did you have something else in mind in #1?)
Potential future enhancement would be an option to be a little quieter about errors for more production-y dashboards, but unless people are using JS to dynamically generate these charts, it seems unlikely for these errors to happen except while editing your own dashboard.