-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathhtmlwidget_Libraries_Overview.Rmd
98 lines (80 loc) · 3.06 KB
/
htmlwidget_Libraries_Overview.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
title: "htmlwidget Libraries Overview"
output: html_document
runtime: shiny
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r xlsx_2_csv}
xlsx_convert_import <- function(inputFile = NA, outputFile = NA){
if(file.exists(outputFile)){
imported_data <<- read.csv(outputFile)
} else {
library(xlsx)
xlsx_import <- read.xlsx(inputFile, sheetIndex = 1)
write.csv(xlsx_import, file = outputFile, row.names = FALSE)
remove(xlsx_import)
imported_data <<- read.csv(outputFile)
}
}
```
## Overview of Document
This document considers only those htmlwidget libraries which are available on CRAN, only a few are covered in detail - submissions are welcome.
## Visualisations by Library
```{r viz_by_library_glyphicons}
library(DT)
library(shiny)
viz_by_library <- xlsx_convert_import(inputFile = "chart-type_htmlwidget-libraries.xlsx", outputFile = "chart-type_htmlwidget-libraries.csv")
viz_by_library
# viz_by_library[viz_by_library==1] <- "<span class='glyphicon glyphicon-ok' aria-hidden='true'></span>"
# viz_by_library[viz_by_library==0] <- "<span class='glyphicon glyphicon-remove' aria-hidden='true'></span>"
# viz_by_library[is.na(viz_by_library)] <- "<span class='glyphicon glyphicon-question-sign' aria-hidden='true'></span>"
viz_by_library[viz_by_library==1] <- 'YES'
viz_by_library[viz_by_library==0] <- "NO"
viz_by_library[is.na(viz_by_library)] <- "?"
viz_by_library[viz_by_library=="Future"] <- "FUTURE"
viz_types <- colnames(viz_by_library)[2:length(colnames(viz_by_library))]
shinyApp(
ui = fluidPage(
# uiOutput("column_selector"),
# wellPanel(
# fluidRow(
# column(
# checkboxGroupInput("selected_comparitiveVizs", label = "Select Visualisations",
# choices = as.list(setNames(viz_types, gsub("[.]"," ", viz_types))),
# inline = FALSE,
# selected = c("Barchart","Gantt.Chart","Choropleth")),
# width = 4
# ),
# column(
# checkboxGroupInput("selected_3DVizs", label = "Select Visualisations",
# choices = as.list(setNames(viz_types, gsub("[.]"," ", viz_types))),
# inline = FALSE,
# selected = c("Barchart","Gantt.Chart","Choropleth")), width = 4)
#
#
# )
# ),
sidebarLayout(
sidebarPanel(
checkboxGroupInput("selected_columns", label = "Select Visualisations",
choices = as.list(setNames(viz_types, gsub("[.]"," ", viz_types))),
inline = FALSE,
selected = c("Barchart","Gantt.Chart","Choropleth"))
),
mainPanel(
dataTableOutput("summary")
)
)
),
server = function(input, output){
output$summary <- renderDataTable({
datatable(viz_by_library[,c("Library",input$selected_columns)],
filter = list(position = 'top', clear = TRUE, plain = TRUE),
rownames = F,options = list(paging = FALSE, searching = FALSE)
)
})
}
)
```