-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix. Add special treatment of
dimensions
attrbute to account for th…
…e data_array propery of the "values" attribute. Closes #2385. * Add tests to check that "values" property has class "AsIs" for "parcoords", "parcats" and "splom" traces. * Add NEWS entry
- Loading branch information
Showing
5 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
expect_traces <- function(p, n.traces, name) { | ||
stopifnot(is.numeric(n.traces)) | ||
L <- expect_doppelganger_built(p, paste0("plotly-", name)) | ||
expect_equivalent(length(L$data), n.traces) | ||
L | ||
} | ||
|
||
test_that("values property has a class of AsIs", { | ||
p <- plot_ly( | ||
dimensions = list( | ||
list(values = "A"), | ||
list(values = "B") | ||
), | ||
type = "parcats" | ||
) | ||
l <- expect_traces(p, 1, "parcats-data-array") | ||
tr <- l$data[[1]]$dimensions | ||
expect_true(inherits(tr[[1]]$values, "AsIs")) | ||
expect_true(inherits(tr[[2]]$values, "AsIs")) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
expect_traces <- function(p, n.traces, name) { | ||
stopifnot(is.numeric(n.traces)) | ||
L <- expect_doppelganger_built(p, paste0("plotly-", name)) | ||
expect_equivalent(length(L$data), n.traces) | ||
L | ||
} | ||
|
||
test_that("values property has a class of AsIs", { | ||
p <- plot_ly( | ||
dimensions = list( | ||
list(label = "A", values = 3), | ||
list(label = "B", values = 8) | ||
), | ||
type = "parcoords" | ||
) | ||
l <- expect_traces(p, 1, "parcoords-data-array") | ||
tr <- l$data[[1]]$dimensions | ||
expect_true(inherits(tr[[1]]$values, "AsIs")) | ||
expect_true(inherits(tr[[2]]$values, "AsIs")) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters