CitiLogics / citilogics-geoloop-panel

Animated Maps in Grafana
MIT License
44 stars 6 forks source link

Cannot read property 'serialize' of undefined #11

Open arriflex opened 5 years ago

arriflex commented 5 years ago

I feel like I'm doing something wrong. The map is being rendered appropriately, and the polygon features I placed in a geoJSON file are being rendered on top properly. Each of the features has a property labeled "serial" and strings such as "MIBB018795" which are known values for the same tag I'm grouping on from InfluxDB metric. My metric query does not include any aliasing.

In the GeoLoop tab within Grafana I've defined the GeoJSON ID Path as properties.serial and typed serial into the Series GeoID Tag field.

I have another panel on the same dashboard with the same exact query to verify that data is being returned and using the legend to make sure the tag values are correct.

Nevertheless, the panel containing the GeoLoop is showing a red alert triangle in the top left corner that provides the following JS error with further information. Any ideas what I might be doing wrong?

This plugin looks so perfect for what I want to do I really want to get it working!

TypeError: Cannot read property 'serialize' of undefined at eval (http://site.com/public/plugins/citilogics-geoloop-panel/libs/mapbox-gl.js:305:12364) at Array.map (<anonymous>) at t.serialize (http://site.com/public/plugins/citilogics-geoloop-panel/libs/mapbox-gl.js:305:12328) at t._validate (http://site.com/public/plugins/citilogics-geoloop-panel/libs/mapbox-gl.js:305:14488) at t.addSource (http://site.com/public/plugins/citilogics-geoloop-panel/libs/mapbox-gl.js:305:7248) at e.addSource (http://site.com/public/plugins/citilogics-geoloop-panel/libs/mapbox-gl.js:391:10376) at GeoLoopCtrl.updateGeoDataFeatures (http://site.com/public/plugins/citilogics-geoloop-panel/geoloop_ctrl.js:432:28) at GeoLoopCtrl.onDataReceived (http://site.com/public/plugins/citilogics-geoloop-panel/geoloop_ctrl.js:340:18) at s.emit (http://site.com/public/build/vendor.d1f313cb0bbe86ea2d5f.js:85:14583) at t.emit (http://site.com/public/build/app.d1f313cb0bbe86ea2d5f.js:13:276422)

samhatchett commented 5 years ago

could you post a screen shot of this, so we can just check the returned data format?

I have another panel on the same dashboard with the same exact query to verify that data is being returned and using the legend to make sure the tag values are correct.

arriflex commented 5 years ago

I think I figured out what is happening, roughly. It seems to be fixed by a browser refresh assuming all of the pieces are appropriately configured. I've been able to reproduce the problem a couple of times where, if I misconfigure Series GeoID Tag, I get that error and it is unable to recover even when I reconfigure it properly and hit the Grafana refresh icon. Only a browser refresh or a duplication of the panel is able to reset the error as seen by the last screenshot which was post browser refresh.

The most recent thing to cause it was resizing my browser window. Here are a couple screenshots resulting. This was working before I resized the window and I was able to get it working again without resizing the window but with a couple browser refreshes.

screenshot 2018-11-14 09 17 59 screenshot 2018-11-14 09 18 23 screenshot 2018-11-14 09 24 29