You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to v3.0.0 Plotly.js throws an error when trying to plot some text in a scattergl plot e.g:
import * as Plotly from 'plotly.js-dist-min'
var element = document.getElementById('plot');
Plotly.newPlot(element, [{
type: 'scattergl',
x: [1],
y: [1],
text: 'some text',
mode: 'text'
},], {
margin: {t: 0}
}, {});
causes the following error to appear in the browser console and nothing is plotted. Axes do however still appear
plotly__js-dist-min.js?v=ea4ace4f:60842 Uncaught TypeError: POt.indexOf is not a function
at Object.bqe [as parse] (plotly__js-dist-min.js?v=ea4ace4f:60842:21)
at plotly__js-dist-min.js?v=ea4ace4f:64366:25
at Array.forEach (<anonymous>)
at Vu.update (plotly__js-dist-min.js?v=ea4ace4f:64362:71)
at new Vu (plotly__js-dist-min.js?v=ea4ace4f:64264:51)
at bOe.exports [as plot] (plotly__js-dist-min.js?v=ea4ace4f:64540:363)
at Kve (plotly__js-dist-min.js?v=ea4ace4f:21173:93)
at yv.plot (plotly__js-dist-min.js?v=ea4ace4f:21149:17)
at ld.drawData (plotly__js-dist-min.js?v=ea4ace4f:16265:77)
at li.syncOrAsync (plotly__js-dist-min.js?v=ea4ace4f:7233:63)
Other text modes, e.g. "mode:text+markers" have the same issue. This error does not occur if type is defined as "scatter"
This did work in previous versions
EDIT: The stacktrace of the non-minified version might be more useful:
Uncaught TypeError: systemFontKeywords.indexOf is not a function
at Object.parseFont [as parse] (plotly__js-dist.js?v=0135e98b:147358:38)
at plotly__js-dist.js?v=0135e98b:156925:36
at Array.forEach (<anonymous>)
at GlText2.update (plotly__js-dist.js?v=0135e98b:156920:61)
at new GlText2 (plotly__js-dist.js?v=0135e98b:156776:20)
at Object.plot (plotly__js-dist.js?v=0135e98b:157427:39)
at plotOne (plotly__js-dist.js?v=0135e98b:51169:25)
at exports2.plot (plotly__js-dist.js?v=0135e98b:51100:19)
at exports2.drawData (plotly__js-dist.js?v=0135e98b:38240:36)
at lib.syncOrAsync (plotly__js-dist.js?v=0135e98b:15221:23)
The text was updated successfully, but these errors were encountered:
var systemFontKeywords = require_css_system_font_keywords();
Which then uses indexOf to search systemFontKeywords.
That css-system-font-kewords/index.json is resolving as {}, not [...]like it should be, and {}.indexOf isn't a thing. It is clearly meant to resolve as [...] because it is defined that way and because its converted explicitly from [] to {} later.
So, a couple theories:
That json file didn't get bundled into 3.0.0 for some reason and it default as {}.
It hasn't been loading for a while and the default has changed from [] to {} (less likely).
After upgrading to v3.0.0 Plotly.js throws an error when trying to plot some text in a scattergl plot e.g:
causes the following error to appear in the browser console and nothing is plotted. Axes do however still appear
Other text modes, e.g. "mode:text+markers" have the same issue. This error does not occur if type is defined as "scatter"
This did work in previous versions
EDIT: The stacktrace of the non-minified version might be more useful:
The text was updated successfully, but these errors were encountered: