-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Labels
questionFurther information is requestedFurther information is requested
Description
When a chart doesn't have all necessary components, the error isn't seen until attempting to render the chart. When rendering with Deno, the errors are difficult to understand.
For instance, when trying to create a scatterplot without axis definitions and symbol size, I got this error:
Error: could not generate plot: JavaScript runtime error: TypeError: Cannot read properties of undefined (reading 'get')
at dx ([echarts.js]:45:242937)
at cartesian2d ([echarts.js]:45:241875)
at [echarts.js]:45:244376
at vx ([echarts.js]:45:244413)
at e.getInitialData ([echarts.js]:45:380659)
at e.init ([echarts.js]:45:158807)
at e.<anonymous> ([echarts.js]:45:113758)
at Array.forEach (<anonymous>)
at E ([echarts.js]:35:5056)
at e.<anonymous> ([echarts.js]:45:113391)
caused by: JavaScript runtime error: TypeError: Cannot read properties of undefined (reading 'get')
at dx ([echarts.js]:45:242937)
at cartesian2d ([echarts.js]:45:241875)
at [echarts.js]:45:244376
at vx ([echarts.js]:45:244413)
at e.getInitialData ([echarts.js]:45:380659)
at e.init ([echarts.js]:45:158807)
at e.<anonymous> ([echarts.js]:45:113758)
at Array.forEach (<anonymous>)
at E ([echarts.js]:35:5056)
at e.<anonymous> ([echarts.js]:45:113391)
I think it would be good for charming
to do some or all of these:
- Provide a simple way to validate a
Chart
. (In a typical builder pattern, there's abuild()
function that turns the builder into a final object, and performs validation on it.) - Document which elements of a chart are necessary for rendering
- Do something to improve the JavaScript errors themselves (in particular,
reading 'get'
doesn't say what is missing)
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested