No error thrown if invalid type provided, silently falls back to `scatter`
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.3k
- Forks
- 2k
- Ø Merge
- 2 T. 12 Std.
- Gemergte PRs (30 T.)
- 28
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der verlinkten CodePen-Reproduktion mit "aninvalidtype" und vergleiche das Verhalten zwischen dem vollständigen plotly.js-dist-Bundle und plotly.js-finance, insbesondere für den nicht verfügbaren scattergl-Typ. Verfolge nach, wie der ausgewählte Trace-Typ in den Package-Einstiegspunkten aufgelöst wird. Als abgeschlossen gilt die Aufgabe, wenn nicht unterstützte Typen einen Fehler erzeugen, statt stillschweigend als scatter gerendert zu werden, mit Regressionstests für partielle Bundles.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100