timelyportfolio / rcdimple

htmlwidgets for rCharts + dimple
http://www.buildingwidgets.com/blog/2015/3/18/week-11-dimple-as-htmlwidget
MIT License
28 stars 9 forks source link

Additional Layers in demo #49 #24

Closed kferris10 closed 8 years ago

kferris10 commented 8 years ago

Unless I'm missing something, I don't see the line show up in example number 49. I just see the points.

#example 49 multiple layers qq style plot with 2 datasets
df <- data.frame(
  id = 1:100,
  x=ppoints(100),
  y=sort(rnorm(100)),   #100 random normal distributed points  
  normref=qnorm(ppoints(100))#lattice uses ppoints for the x
)

dimple(
  y ~ x,  #x ~ id for a different look
  groups = c("id","sample"),
  data = df[,c("id","x","y")],  #specify columns to prove diff data
  type = "bubble"
) %>%
  xAxis(type="addMeasureAxis",orderRule="x") -> d1

#now add a layer with a line to represent normal distribution
#! note: this is buggy with Chrome, but works in IE (don't hear that often)
# will eventually add full layer integration for dimple
d1$x$options$layers = list(list(
  x = "x",
  y = "normref",
  groups = c("id","sample"),
  data=df[,c("id","x","normref")],  #specify columns to prove diff data
  type="line"
))
# layers don't line up
# for now to make it work, need overrideMin and overrideMax
d1 %>% 
  yAxis(
    overrideMin = min(df$y), overrideMax = max(df$y), outputFormat = "0.2f"
  ) %>%
  xAxis( overrideMin = 0, overrideMax = 1)
timelyportfolio commented 8 years ago

With the new layer functionality, I'm not sure this still works. Let me check real quickly. Also, I know Chrome caused trouble with this one for some reason, but Firefox and IE worked.

timelyportfolio commented 8 years ago

@kferris10 have you checked out the new layer functionality proposed in #20 and the branch feature/layers?

kferris10 commented 8 years ago

I hadn't. But even with this I couldn't get it to work in the RStudio viewer or in Firefox.

image

> devtools::session_info()
Session info ------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.1.3 (2015-03-09)
 system   x86_64, mingw32             
 ui       RStudio (0.99.473)          
 language (EN)                        
 collate  English_United States.1252  
 tz       America/New_York            

Packages ----------------------------------------------------------------------------------------------------------
 package     * version    date       source                                   
 bitops      * 1.0-6      2013-08-17 CRAN (R 3.1.3)                           
 devtools    * 1.7.0      2015-01-17 CRAN (R 3.1.3)                           
 digest      * 0.6.8      2014-12-31 CRAN (R 3.1.3)                           
 htmltools     0.2.6      2014-09-08 CRAN (R 3.1.3)                           
 htmlwidgets   0.5.1      2015-09-16 Github (ramnathv/htmlwidgets@3a2e312)    
 httr        * 0.6.1      2015-01-01 CRAN (R 3.1.3)                           
 jsonlite    * 0.9.16     2015-04-11 CRAN (R 3.1.3)                           
 knitr       * 1.11.2     2015-08-29 Github (yihui/knitr@38f2511)             
 lattice     * 0.20-30    2015-02-22 CRAN (R 3.1.3)                           
 magrittr    * 1.5        2014-11-22 CRAN (R 3.1.3)                           
 rcdimple      0.1        2015-10-02 Github (timelyportfolio/rcdimple@7e91390)
 RCurl       * 1.95-4.5   2014-12-28 CRAN (R 3.1.3)                           
 rstudioapi  * 0.3.1      2015-09-16 Github (rstudio/rstudioapi@d0417a9)      
 stringi     * 0.5-9003   2015-09-16 Github (Rexamine/stringi@02c9761)        
 stringr     * 1.0.0.9000 2015-09-16 Github (hadley/stringr@5f9319b)          
 yaml        * 2.1.13     2014-06-12 CRAN (R 3.1.3) 
timelyportfolio commented 8 years ago

Try these lines after

devtools::install_github("timelyportfolio/rcdimple@feature/layers")

Thanks for trying it out and all the feedback.

kferris10 commented 8 years ago

That does it, and you're welcome. Although I really should be thanking you.