Skip to content

Commit

Permalink
fixes #108
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonynorth committed Feb 2, 2024
1 parent d9190fa commit 034deef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- All layers now support geometry vectors which {wk} can read (#104)
- Feature editor accepts geometry vectors which {wk} can read (#105)
- Use {yyjsonr} for faster serialisation (#110)
- Fix quantile scales (#108)

# rdeck 0.5.2

Expand Down
1 change: 0 additions & 1 deletion R/scales.R
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ scale_quantile <- function(col, range = 0:1, na_value = 0,
na_value = na_value,
data = continuous_identity_range(data),
get_breaks = quantile_breaks(probs),
col_label = col_label,
col_label = as_labeller(col_label),
legend = legend
)
Expand Down
14 changes: 14 additions & 0 deletions tests/testthat/test-scale.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test_that("scale_quantile works", {
expect_equal(
compile(scale_quantile(foo, range = 0:1, data = 0:1, probs = seq.int(0, 1, 0.2))),
list(
scale_type = "threshold",
legend = TRUE,
col = "foo",
na_value = 0,
domain = c(0.2, 0.4, 0.6, 0.8),
range = c(0, 0.25, 0.5, 0.75, 1),
scale_by = "foo"
)
)
})

0 comments on commit 034deef

Please sign in to comment.