Skip to content

"TypeError: POt.indexOf is not a function" with mode: text and type: scattergl #7353

Open
@WeisSeb

Description

@WeisSeb

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)

Metadata

Metadata

Assignees

Labels

P1needed for current cyclebugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions