diff --git a/R/by_aesthetics.R b/R/by_aesthetics.R index 6dd8921..4891732 100755 --- a/R/by_aesthetics.R +++ b/R/by_aesthetics.R @@ -85,7 +85,7 @@ by_pch = function(ngrps, type, pch) { by_lty = function(ngrps, type, lty) { # don't care about line type, return NULL - if (!type %in% c("l", "b", "o")) { + if (!type %in% c("l", "b", "o", "c", "h", "s", "S")) { out = NULL # NULL -> solid line diff --git a/R/plot2.R b/R/plot2.R index 2cd42f3..efe80f4 100644 --- a/R/plot2.R +++ b/R/plot2.R @@ -399,7 +399,7 @@ plot2.default = function( ) ) } - if (type %in% c("l", "o", "b")) { + if (type %in% c("l", "o", "b", "c", "h", "s", "S")) { invisible( lapply( seq_along(split_data), diff --git a/inst/tinytest/_tinysnapshot/type_c.svg b/inst/tinytest/_tinysnapshot/type_c.svg new file mode 100644 index 0000000..962feb1 --- /dev/null +++ b/inst/tinytest/_tinysnapshot/type_c.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + +2 +4 +6 +8 +10 + + + + + + + +0 +2 +4 +6 +8 +10 + + + + + + + + + + + + + + + + + + + + +Index +0:10 + + diff --git a/inst/tinytest/_tinysnapshot/type_c_group.svg b/inst/tinytest/_tinysnapshot/type_c_group.svg new file mode 100644 index 0000000..f7e4f60 --- /dev/null +++ b/inst/tinytest/_tinysnapshot/type_c_group.svg @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + +Month +5 +6 +7 +8 +9 + + + + + + + + +0 +5 +10 +15 +20 +25 +30 + + + + + +60 +70 +80 +90 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Day +Temp + + diff --git a/inst/tinytest/_tinysnapshot/type_cap_s.svg b/inst/tinytest/_tinysnapshot/type_cap_s.svg new file mode 100644 index 0000000..8725685 --- /dev/null +++ b/inst/tinytest/_tinysnapshot/type_cap_s.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + +2 +4 +6 +8 +10 + + + + + + + +0 +2 +4 +6 +8 +10 + + + + + + + + + + + +Index +0:10 + + diff --git a/inst/tinytest/_tinysnapshot/type_cap_s_group.svg b/inst/tinytest/_tinysnapshot/type_cap_s_group.svg new file mode 100644 index 0000000..26b0a3e --- /dev/null +++ b/inst/tinytest/_tinysnapshot/type_cap_s_group.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + +Month +5 +6 +7 +8 +9 + + + + + + + + +0 +5 +10 +15 +20 +25 +30 + + + + + +60 +70 +80 +90 + + + + + + + + + + + + + + + + + + + + +Day +Temp + + diff --git a/inst/tinytest/_tinysnapshot/type_h.svg b/inst/tinytest/_tinysnapshot/type_h.svg new file mode 100644 index 0000000..ad8cceb --- /dev/null +++ b/inst/tinytest/_tinysnapshot/type_h.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + +2 +4 +6 +8 +10 + + + + + + + +0 +2 +4 +6 +8 +10 + + + + + + + + + + + + + + + + + + + + + +Index +0:10 + + diff --git a/inst/tinytest/_tinysnapshot/type_h_group.svg b/inst/tinytest/_tinysnapshot/type_h_group.svg new file mode 100644 index 0000000..4d938ff --- /dev/null +++ b/inst/tinytest/_tinysnapshot/type_h_group.svg @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + +Month +5 +6 +7 +8 +9 + + + + + + + + +0 +5 +10 +15 +20 +25 +30 + + + + + +60 +70 +80 +90 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Day +Temp + + diff --git a/inst/tinytest/_tinysnapshot/type_s.svg b/inst/tinytest/_tinysnapshot/type_s.svg new file mode 100644 index 0000000..f8f9047 --- /dev/null +++ b/inst/tinytest/_tinysnapshot/type_s.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + +2 +4 +6 +8 +10 + + + + + + + +0 +2 +4 +6 +8 +10 + + + + + + + + + + + +Index +0:10 + + diff --git a/inst/tinytest/_tinysnapshot/type_s_group.svg b/inst/tinytest/_tinysnapshot/type_s_group.svg new file mode 100644 index 0000000..b225086 --- /dev/null +++ b/inst/tinytest/_tinysnapshot/type_s_group.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + +Month +5 +6 +7 +8 +9 + + + + + + + + +0 +5 +10 +15 +20 +25 +30 + + + + + +60 +70 +80 +90 + + + + + + + + + + + + + + + + + + + + +Day +Temp + + diff --git a/inst/tinytest/test-type-other.R b/inst/tinytest/test-type-other.R new file mode 100644 index 0000000..ed6ee26 --- /dev/null +++ b/inst/tinytest/test-type-other.R @@ -0,0 +1,27 @@ +source("helpers.R") +using("tinysnapshot") +if (Sys.info()["sysname"] != "Linux") exit_file("Linux snapshots") + +f = function() plot2(0:10, type = "c") +expect_snapshot_plot(f, label = "type_c") + +f = function() plot2(0:10, type = "h") +expect_snapshot_plot(f, label = "type_h") + +f = function() plot2(0:10, type = "s") +expect_snapshot_plot(f, label = "type_s") + +f = function() plot2(0:10, type = "S") +expect_snapshot_plot(f, label = "type_cap_s") + +f = function() plot2(Temp ~ Day | Month, airquality, type = "c") +expect_snapshot_plot(f, label = "type_c_group") + +f = function() plot2(Temp ~ Day | Month, airquality, type = "h") +expect_snapshot_plot(f, label = "type_h_group") + +f = function() plot2(Temp ~ Day | Month, airquality, type = "s") +expect_snapshot_plot(f, label = "type_s_group") + +f = function() plot2(Temp ~ Day | Month, airquality, type = "S") +expect_snapshot_plot(f, label = "type_cap_s_group")