Skip to content

Revert "ggplot: line styles and width" #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Rapp.history
*~
.Rhistory
.RData
Makefile
Makefile
4 changes: 0 additions & 4 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
0.5.6 -- 25 October 2014.

Lines: fix styles and enhanced conversion.

0.5.5 -- 24 October 2014.

Support category histograms (with factors).
Expand Down
39 changes: 20 additions & 19 deletions R/ggplotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,30 @@ marker.defaults <- list(alpha=1,
sizeref=default.marker.sizeref,
sizemode="area",
colour="black")

line.defaults <- list(linetype="solid",
colour="black",
size=1,
direction="linear")
line.defaults <-
list(linetype="solid",
colour="black",
size=2,
direction="linear")

# Convert R lty line type codes to plotly "dash" codes.
lty2dash <- c(numeric.lty, named.lty, coded.lty)

aesConverters <- list(linetype=function(lty) {
lty2dash[as.character(lty)]
},
colour=function(col) {
toRGB(col)
},
size=identity,
sizeref=identity,
sizemode=identity,
alpha=identity,
shape=function(pch) {
pch2symbol[as.character(pch)]
},
direction=identity)
aesConverters <-
list(linetype=function(lty){
lty2dash[as.character(lty)]
},
colour=function(col){
toRGB(col)
},
size=identity,
sizeref=identity,
sizemode=identity,
alpha=identity,
shape=function(pch){
pch2symbol[as.character(pch)]
},
direction=identity)

markLegends <-
## NOTE: Do we also want to split on size?
Expand Down
5 changes: 1 addition & 4 deletions R/marker_conversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@
##' @export
##' @return named list.
##' @author Toby Dylan Hocking
paramORdefault <- function(params, aesVec, defaults) {
paramORdefault <- function(params, aesVec, defaults){
marker <- list()
for(ggplot.name in names(aesVec)){
plotly.name <- aesVec[[ggplot.name]]
ggplot.value <- params[[ggplot.name]]
if(is.null(ggplot.value)){
ggplot.value <- defaults[[ggplot.name]]
}
if(plotly.name=="width"){
ggplot.value <- ggplot.value * 2
}
if(is.null(ggplot.value)){
stop("no ggplot default for ", ggplot.name)
}
Expand Down
11 changes: 5 additions & 6 deletions R/one_to_one_corr.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,21 @@ aes2marker <- c(alpha="opacity",
shape="symbol")

# Convert numeric line type.
numeric.lty <- c("0"="none",
"1"="solid",
numeric.lty <- c("1"="solid",
"2"="dash",
"3"="dot",
"4"="dashdot",
"5"="longdash",
"6"="longdashdot")

# Convert named line type.
named.lty <- c("blank"="none",
"solid"="solid",
named.lty <- c("solid"="solid",
"blank"="none",
"dashed"="dash",
"dotted"="dot",
"dotted"="dotted",
"dotdash"="dashdot",
"longdash"="longdash",
"twodash"="longdashdot")
"twodash"="dash")

# Convert coded line type.
coded.lty <- c("22"="dash",
Expand Down
16 changes: 8 additions & 8 deletions R/trace_generation.R
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ group2NA <- function(g, geom){

# Convert basic geoms to traces.
geom2trace <- list(
path=function(data, params) {
path=function(data, params){
list(x=data$x,
y=data$y,
name=params$name,
Expand Down Expand Up @@ -487,13 +487,13 @@ geom2trace <- list(
L
},
density=function(data, params) {
list(x=data$x,
name=params$name,
text=data$text,
marker=list(color=toRGB(params$fill)),
type="histogram",
autobinx=TRUE,
histnorm="probability density")
L <- list(x=data$x,
name=params$name,
text=data$text,
marker=list(color=toRGB(params$fill)),
type="histogram",
autobinx=TRUE,
histnorm="probability density")
},
density2d=function(data, params) {
L <- list(x=data$x,
Expand Down
180 changes: 0 additions & 180 deletions tests/cookbook-test-suite/axes.R

This file was deleted.

Binary file not shown.
Binary file not shown.
Loading