Uncaught TypeError: Cannot read property '_guiEditing' of undefined


#1

Hi there
I have a weird bug that doesn’t seem to affect anything but happens when I resize a plot. Just thought I should let you know.
Uncaught TypeError: Cannot read property ‘_guiEditing’ of undefined
at Z (plotly-latest.min.js:7)
at Object.q [as relayout] (plotly-latest.min.js:7)

switch (a pp.params.stations.length) { //this is how many separate plots I have on screen)
case 1:
graphHeight = 600;
break;
case 2:
graphHeight = 300;
break;
case 3:
graphHeight = 200;
break;
case 4:
graphHeight = 150;
break;
};
jQuery(’.graphDiv’).each(function (index, div) {
if (jQuery(div).has(‘div.plotly’)) {
jQuery(div).removeClass(‘h600’).removeClass(‘h300’).removeClass(‘h200’).removeClass(‘h150’).addClass(‘h’ + graphHeight);
Plotly.relayout(jQuery(div).attr(‘id’), {
height: graphHeight
});
}
});


#2

Thanks for the report!

This would help us immensely. Thanks!


#3

I’ve tried using the unminified version before and get an error:_Uncaught SyntaxError: Invalid or unexpected token_and then _Uncaught ReferenceError: Plotly is not defined_


#4

This one really is too complicated to put in a codepen, sorry.


#5

The error I get with using the unminified version is on line 19440. “Invalid or unexpected token”.
Somewhere after π on
var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;


#6

See https://github.com/plotly/plotly.js#non-ascii-characters

You might need to add charset="utf-8" to your script tag.


#7

Ah, I missed that! Thanks that works.
So here’s the error in the unminified version:
Uncaught TypeError: Cannot read property ‘_guiEditing’ of undefined
at _relayout (plotly.js:106278)
at Object.relayout (plotly.js:106176)
at HTMLDivElement. (app.js:1055)
at Function.each (jquery-3.3.1.min.js:2)
at w.fn.init.each (jquery-3.3.1.min.js:2)
at Object.app.resizePlots (app.js:1052)
at Object.app.drawGraphs (app.js:1034)
at NewClass. (app.js:560)
at NewClass.fire (Events.js:190)
at NewClass._fireDOMEvent (Map.js:1386)


#8

Looks like you’re calling Plotly.relayout before Plotly.newPlot. Could that be the case?


#9

Ah! You’ve found it, I forgot to wait for the Plotly promise to fulfil. Thank you so much.