No error thrown if invalid type provided, silently falls back to `scatter`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
If you enter a type for a trace that is not supported in the package you have, Plotly simply falls back to scatter plot. This is incorrect, an error should be thrown to indicate the user entered an invalid type.
In my particular case, I had been using scattergl type with the full plotly.js-dist bundle, then when I switched our project over to plotly.js-finance (https://github.com/plotly/plotly.js/blob/master/dist/README.md#plotlyjs-finance) I thought everything was working correctly as all our test charts appeared correctly. However, I didn't notice plotly.js-finance did not include scattergl, so was in fact falling back to scatter, which had a significant performance penalty I did not notice while testing. I would have much appreciated an error indicating the type I was providing was not available in the partial bundle I was using.
I've made a code pen of the issue here, using a type "aninvalidtype": https://codepen.io/mofojed/pen/pojpVvP
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodePen reproduction using "aninvalidtype" and compare behavior between the full plotly.js-dist bundle and plotly.js-finance, especially for the unavailable scattergl type. Trace how the selected trace type is resolved in the package entry points. Done means unsupported types produce an error instead of silently rendering as scatter, with regression coverage for partial bundles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100