daattali / timevis

📅 Create interactive timeline visualizations in R
http://daattali.com/shiny/timevis-demo/
Other
653 stars 157 forks source link

node colours not working #39

Closed yonicd closed 6 years ago

yonicd commented 6 years ago

i am trying to recreate this example and cant figure out how to add the different colours

data <- data.frame(
  id      = 1:4,
  content = c("Item one"  , "Item two"  ,"Ranged item", "Item four"),
  start   = c("2016-01-10", "2016-01-11", "2016-01-20", "2016-02-14 15:00:00"),
  end     = c(NA          ,           NA, "2016-02-04", NA)
)

timevis(data)

you have in the vignette

but i get this:

image

devtools::session_info()
Session info ----------------------------------------------------------------
 setting  value                       
 version  R version 3.3.2 (2016-10-31)
 system   x86_64, darwin13.4.0        
 ui       RStudio (1.1.331)           
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/New_York            
 date     2017-10-03                  

Packages --------------------------------------------------------------------
 package    * version date       source        
 backports    1.1.0   2017-05-22 CRAN (R 3.3.2)
 base       * 3.3.2   2016-10-31 local         
 datasets   * 3.3.2   2016-10-31 local         
 devtools     1.13.3  2017-08-02 cran (@1.13.3)
 digest       0.6.12  2017-01-27 cran (@0.6.12)
 evaluate     0.10.1  2017-06-24 cran (@0.10.1)
 graphics   * 3.3.2   2016-10-31 local         
 grDevices  * 3.3.2   2016-10-31 local         
 htmltools    0.3.6   2017-04-28 CRAN (R 3.3.2)
 httpuv       1.3.5   2017-07-04 cran (@1.3.5) 
 knitr        1.17    2017-08-10 cran (@1.17)  
 magrittr     1.5     2014-11-22 CRAN (R 3.3.0)
 memoise      1.1.0   2017-09-07 local         
 methods    * 3.3.2   2016-10-31 local         
 mime         0.5     2016-07-07 CRAN (R 3.3.0)
 R6           2.2.2   2017-06-17 cran (@2.2.2) 
 Rcpp         0.12.12 2017-07-15 CRAN (R 3.3.2)
 rmarkdown    1.6     2017-06-15 CRAN (R 3.3.2)
 rprojroot    1.2     2017-01-16 CRAN (R 3.3.2)
 rstudioapi   0.7     2017-09-07 cran (@0.7)   
 shiny        1.0.5   2017-08-23 cran (@1.0.5) 
 stats      * 3.3.2   2016-10-31 local         
 stringi      1.1.5   2017-04-07 CRAN (R 3.3.2)
 stringr      1.2.0   2017-02-18 CRAN (R 3.3.2)
 timevis    * 0.4     2016-09-17 CRAN (R 3.3.0)
 tools        3.3.2   2016-10-31 local         
 utils      * 3.3.2   2016-10-31 local         
 withr        2.0.0   2017-07-28 CRAN (R 3.3.2)
 xtable       1.8-2   2016-02-05 CRAN (R 3.3.0)
 yaml         2.1.14  2016-11-12 cran (@2.1.14)
daattali commented 6 years ago

In the vignette image, the yellow box is yellow probably because it is selected (ie. I clicked on it). Now that you mention this, maybe I shouldn't have used such a picture. You can check the docs http://visjs.org/docs/timeline/ to see if what you want is supported, I think you can give different items different class names and use CSS to colour boxes of a certain class.

yonicd commented 6 years ago

thanks.

i can see it in the js doc.

closing