qfes / rdeck

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

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

Closed anthonynorth closed 10 months ago

anthonynorth commented 10 months 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]