splashblot / dronedb

Location Intelligence & Data Visualization tool
http://carto.com
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Enabling particular widget break the map #71

Closed ivanprado closed 6 years ago

ivanprado commented 6 years ago

Context

I was creating a map with just one vectorial layer with polygons. Each polygon has associated a radius. I wanted to create a widget with the radius. It breaks at tileo.co and in my local environment.

Steps to Reproduce

  1. Create a map with the following vectorial layer: [Uploading diameter_raster_big_processed.tif.circles.geojson.zip…]()
  2. Enable a widget for radius column. You'll see the following error:

image

  1. After data, if you go out of the map and you return, you'll see nothing: map is broken.

Current Result

Map gets broken after that.

Browser and version

Chrome

More information

I see the following error in browser console:

factory.js?348d:12 Uncaught Error: dataview type not supported
    at Object.get (eval at 577 (builder_vendor.js:384), <anonymous>:12:13)
    at child.activeAutoStyler (eval at 75 (builder_vendor.js:853), <anonymous>:37:43)
    at child.initialize (eval at 75 (builder_vendor.js:853), <anonymous>:31:10)
    at child.initialize (eval at 592 (builder_vendor.js:489), <anonymous>:21:38)
    at child.Backbone.Model (eval at <anonymous> (common.js:157), <anonymous>:405:21)
    at child [as constructor] (eval at <anonymous> (common.js:157), <anonymous>:1853:41)
    at child [as constructor] (eval at <anonymous> (common.js:157), <anonymous>:1853:41)
    at new child (eval at <anonymous> (common.js:157), <anonymous>:1853:41)
    at WidgetsService.createHistogramModel (eval at 574 (builder_vendor.js:363), <anonymous>:98:21)
    at Dashboard.createHistogramWidget (eval at 565 (builder_vendor.js:300), <anonymous>:136:36)

 toJSON should be defined for each dataview
ivanprado commented 6 years ago

Debugging I have found that the problem is at file https://github.com/splashblot/cartodb.js/blob/v4testing/src/dataviews/histogram-dataview-model.js#L317

It seems that rebase rebase v4 aug 31st replaced the proper toJSON method over there: https://github.com/splashblot/cartodb.js/commit/a499449ccc575d20f4252db8f850f6240b6b9cee#diff-0e596f1ff73f3cd2345f287e35e2501bL177

No sure how to act in that case. @apercas how would you attack that?

I have seen on development branch at Carto repo and src/dataviewsdon't even exists, so I suspect that is not the current version branch.

ivanprado commented 6 years ago

Ok, I have found the branch, probably is the one named v4. It has all the sense as our branch is named v4testing. The toJSON method looks right over there.

ivanprado commented 6 years ago

The problem was introduced at rebase v4 aug 31st commit. I have tried to use the v4testingprerebase branch that contains cartodb.js before any raster change. Histogram worked. Then I just tried to path the toJSON function. The error disappeared but the widget is not shown. So there should be other problems.

ivanprado commented 6 years ago

The problem was a wrong rebase. It has been solved by @apercas by doing a new cartodb.js branch: tileo/v4 where raster changes were applied.