Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fill-extrusion-color data-driven styling error in v0.29 #3838

Closed
ashleyclough opened this issue Dec 20, 2016 · 6 comments · Fixed by mapbox/mapbox-gl-function#35 or #3840
Closed

fill-extrusion-color data-driven styling error in v0.29 #3838

ashleyclough opened this issue Dec 20, 2016 · 6 comments · Fixed by mapbox/mapbox-gl-function#35 or #3840

Comments

@ashleyclough
Copy link

3D maps that rendered correctly in v0.28 have odd colour shift in v0.29. The following works code works fine as type 'exponential' and 'interval' in 0.28 but has bizarre colour shift in the mid-range when default type 'exponential' in 0.29

"fill-extrusion-color": {
"property": 'density_per_km',
"stops": [
[2, "rgb(46,124,172)"],
[55, "rgb(77,165,177)"],
[132, "rgb(102,194,165)"],
[607, "rgb(171,221,164)"],
[1287, "rgb(230,245,152)"],
[1985, "rgb(254,224,140)"],
[2650, "rgb(253,198,118)"],
[3299, "rgb(253,174,97)"],
[3995, "rgb(244,109,67)"],
[4927, "rgb(213,62,79)"],
[7147, "rgb(158,2,66)"],
[10028, "rgb(128,1,10)"],
[12889, "rgb(69,1,5)"],
[40000, "rgb(34,0,2)"]
]
},

Expected Behavior

https://parallel.co.uk/3D/population-density/#10.2/53.7394/-1.6581/0/40
v28 extrusion

Actual Behavior

https://parallel.co.uk/3D/population-density/index29.html#10.2/53.7394/-1.6581/0/40
v29 extrusion

@mourner
Copy link
Member

mourner commented Dec 20, 2016

Interesting, @kronick could this be caused by your changes?

@ashleyclough
Copy link
Author

Tried the same thing with HSL rather than RGB colours and there's still a difference between v0.28 and v0.29.

There's also a long-standing issue with HSL colours which is why I always use RGB - you can see the lack of yellows and oranges in the v0.28 version compared to the RGB. I used Photoshop's colour picker to convert between RGB and HSL.

"fill-extrusion-color": {
"property": 'density_per_km',
"stops": [
[2, 'hsl(203,73%,67%)'],
[55, 'hsl(187,56%,69%)'],
[132, 'hsl(161,47%,76%)'],
[607, 'hsl(113,26%,87%)'],
[1287, 'hsl(170,38%,96%)'],
[1985, 'hsl(44,45%,99%)'],
[2650, 'hsl(36,53%,99%)'],
[3299, 'hsl(30,62%,99%)'],
[3995, 'hsl(14,73%,96%)'],
[4927, 'hsl(353,71%,84%)'],
[7147, 'hsl(335,99%,62%)'],
[10028, 'hsl(356,99%,50%)'],
[12889, 'hsl(356,99%,27%)'],
[40000, 'hsl(356,100%,13%)']
]
},

HSL v0.28
https://parallel.co.uk/3D/population-density/index28hsl.html#10.2/53.7394/-1.6581/0/40
v28 hsl extrusion

HSL v0.29
https://parallel.co.uk/3D/population-density/index29hsl.html#10.2/53.7394/-1.6581/0/40
v29 hsl extrusion

@ashleyclough
Copy link
Author

Is it possible that an issue with the interpolation between HSL colours may be the hue value passing through 0/360 degrees? You can go either way between green and orange: the quick way via the yellows or the long way via the purples, passing through the 0/360 threshold.

@mourner
Copy link
Member

mourner commented Dec 20, 2016

@ashleyclough thanks for the details! If you want to help out further with this, try reproducing the difference in an isolated form using just the mapbox-gl-function module, and then doing git bisect to find the offending commit that changed the behavior.

@kronick
Copy link

kronick commented Dec 20, 2016

@mourner - yes, very possible this is in my binary search changes. I'll look into it today.

@mourner
Copy link
Member

mourner commented Dec 20, 2016

@ashleyclough we found the bug and submitted a fix (mapbox/mapbox-gl-function#35) so no need to investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants