qfes / rdeck

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

Rescalers should extend range to include mid instead, instead of failing #103

Closed anthonynorth closed 1 year ago

anthonynorth commented 1 year ago

rescale_center() and rescale_diverge() throw an assertion error if center is outside the range of the input scale. This requires manually changing the input range which is inconvenient.

rdeck::scale_linear(foo, limits = 0:1) |>
  rdeck::rescale_center(-1) |>
  generics::compile()
#> Error in `rescale_breaks()`:
#> ! Assertion failed: x >= range[1] & x <= range[2]

rdeck::scale_linear(foo, limits = 0:1) |>
  rdeck::rescale_diverge(-1) |>
  generics::compile()
#> Error in `rescale_breaks()`:
#> ! Assertion failed: x >= range[1] & x <= range[2]