ryanbaumann / mapboxgl-powerBI

Mapbox GL location and map custom visual for Microsoft PowerBI
MIT License
23 stars 8 forks source link

Chroma.limits type error #1

Closed ryanbaumann closed 7 years ago

ryanbaumann commented 7 years ago

chroma.limits throws this unexpected exception:

    at eval (eval at chroma.limits (:2995:9), <anonymous>:1:19)
    at Function.chroma.limits (<anonymous>:2995:9)
    at Function.converter (<anonymous>:3898:45)
    at Function.value (<anonymous>:3841:61)
    at MapboxMap.update (<anonymous>:3926:56)
    at MapboxMap.value (<anonymous>:3841:61)
    at r.update (https://msit.powerbi.com/13.0.2278.113/scripts/visualhostcore.min.js:3:24895)
    at https://msit.powerbi.com/13.0.2278.113/scripts/visualhostcore.min.js:3:10264
    at t.executeSafely (https://msit.powerbi.com/13.0.2278.113/scripts/visualhostcore.min.js:3:12838)
    at t.update (https://msit.powerbi.com/13.0.2278.113/scripts/visualhostcore.min.js:3:10220)VM6120:1 Uncaught TypeError: Cannot read property 'push' of undefined
    at eval (eval at chroma.limits (:2995:9), <anonymous>:1:19)
    at Function.chroma.limits (<anonymous>:2995:9)
    at Function.converter (<anonymous>:3898:45)
    at Function.value (<anonymous>:3841:61)
    at MapboxMap.update (<anonymous>:3926:56)
    at MapboxMap.value (<anonymous>:3841:61)
    at r.update (https://msit.powerbi.com/13.0.2278.113/scripts/visualhostcore.min.js:3:24895)
    at https://msit.powerbi.com/13.0.2278.113/scripts/visualhostcore.min.js:3:10264
    at t.executeSafely (https://msit.powerbi.com/13.0.2278.113/scripts/visualhostcore.min.js:3:12838)
    at t.update (https://msit.powerbi.com/13.0.2278.113/scripts/visualhostcore.min.js:3:10220)

I suppose that this issue is related to the fact that domain contains only string values.

I suppose that you should update this condition something like this:

if (role !== 'category') {
    domain.push(v)
}

cc @ignatvilesov

ryanbaumann commented 7 years ago

Added category check in latest commit.

Next steps:

ryanbaumann commented 7 years ago

Categorical stops shipped in the latest release