Plotly.js Cannot read property 'length' of undefined when clearing filter transforms


#1

Hi,

I have implemented plotly.js filter transform for some data. I am trying to reset the filter, and restore data. But when I hover on some of the restored data, getting an error:

Uncaught TypeError: Cannot read property ‘length’ of undefined
at Object.makeEventData (plotly-latest.min.js:7)
at plotly-latest.min.js:7
at plotly-latest.min.js:7
at o (plotly-latest.min.js:7)
at Object.$t.throttle (plotly-latest.min.js:7)
at Object.to.hover (plotly-latest.min.js:7)
at SVGRectElement.s.onmousemove (plotly-latest.min.js:7)

var update = {
transforms: [{}]
}

Plotly.update(‘chartdiv’, update);

This is how I’m clearing the transform. Is it not the right way? Any help appreciated. Thank you.


#2

Thanks for the report.

Here’s a workaround: https://codepen.io/etpinard/pen/WzQbvv?editors=0010


#3

Hey,

Thanks for the response. But in my case, I have two filter transforms applied on the same data.

Please check:
(https://codepen.io/anon/pen/wmKLKm?editors=0010)


#4

https://codepen.io/anon/pen/wmKLKm?editors=0010 appears to be working fine. Am I missing something?


#5

I am not able to click or hover on some points, after the filter is cleared.

It’s throwing error:
Uncaught TypeError: Cannot read property ‘length’ of undefined
at Object.makeEventData (plotly-latest.min.js:7)
at plotly-latest.min.js:7
at plotly-latest.min.js:7
at o (plotly-latest.min.js:7)
at Object.$t.throttle (plotly-latest.min.js:7)
at Object.to.hover (plotly-latest.min.js:7)
at SVGRectElement.s.onmousemove (plotly-latest.min.js:7)


#6

Hey @etienne, something can be done about this?


#7

wait until we fix https://github.com/plotly/plotly.js/issues/2470