mode / alamode

A community-maintained library of visualizations for Mode reports
MIT License
70 stars 67 forks source link

Report errors when called with bad table or chart id #4

Closed laughinghan closed 7 years ago

laughinghan commented 7 years ago

Fix #1, report errors when called with bad table or chart id by inserting a big warning error banner at the top:

screen shot 2016-12-16 at 02 11 29

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.

bstancil commented 7 years ago

Merged! Made a couple stylistic updates; here it is against the live version. https://modeanalytics.com/benn/reports/92c98be143d8

bstancil commented 7 years ago

Thanks @laughinghan !