visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.06k stars 2.08k forks source link

[Bug] getAngle transition goes wrong direction at 359 <-> 1 #9092

Open Fabioni opened 3 weeks ago

Fabioni commented 3 weeks ago

Description

using something like:

new IconLayer({
    id: "test",
    data: DATA,
    getAngle: d => d.angle,
    transitions: {
        getAngle: 50,
    }
})

this breaks when the angle switched from 350 to 10 because the transition does not do 351, 352, ... 0, 1, 2 but it does 349, 348, ..., 12, 11, 10.

Flavors

Expected Behavior

Transition the getAngle property correctly.

Steps to Reproduce

I omit a coderpad for now, because I think the bug is pretty self explanatory. Let me know if still needed.

Environment

Logs

No response

Pessimistress commented 2 weeks ago

The current attribute transition logic is very generic so it does not understand that "angle" is something that loops around. Before a proper fix, I think you can pass 370 instead of 10 as a work around.