qfes / rdeck

Deck.gl widget for R
https://qfes.github.io/rdeck
MIT License
97 stars 0 forks source link

Continuous scales with manual breaks have incorrect legend ticks #106

Open anthonynorth opened 10 months ago

anthonynorth commented 10 months ago

Legend ticks for continuous colour scales aren't functioning correctly when breaks are supplied. This is noticeable when breaks produce a piecewise function which greatly alters the colour mapping.

These should not produce the same legend:

# auto-breaks
scale_color_power(col, limits = -3:3)
# manual-linear-breaks
scale_color_power(col, limits = -3:3, breaks = 0:3)
# manual-breaks-power
scale_color_power(col, limits = -3:3, breaks = breaks_power()(0:3))

These scales have the following form when applied to a 0:1 numeric range: image

Expected colour legend something like: image