ui.R 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. library(shiny)
  2. # Tab for the scatter plot output
  3. sct_plot <- tabPanel(
  4. "Scatter plot",
  5. # Div for the scatter plot
  6. tags$div(id = "sct_container",
  7. tags$div(id = "scatterplot_area"),
  8. tags$div(id = "sct_checkboxall_area"), # div for checkboxes
  9. tags$div(id = "sct_checkbox_area"), # div for checkboxes
  10. tags$div(id = "sct_dropdown_area")), # div for dropdown menu
  11. # Div for map
  12. tags$div(id = "map_area")
  13. )
  14. parset <- tabPanel(
  15. "Parallel Sets",
  16. tags$div(id = "treemap_area"),
  17. tags$div(id = "parset_area")
  18. )
  19. # Tab for dendrogram
  20. dendrogram <- tabPanel(
  21. "Dendrogram",
  22. #Div for the tree
  23. tags$div(id = "dendrogram_area")
  24. )
  25. # Tab choropleth
  26. choropleth <- tabPanel(
  27. "Choropleth",
  28. # Div for the bar chart
  29. tags$div(id = "choropleth_heatmap_container",
  30. tags$div(id = "choropleth_dropdown_area"),
  31. tags$div(id = "choropleth_area"),
  32. tags$div(id = "super_container",
  33. tags$div(id = "smallmultiples_container",
  34. tags$div(id = "sm2012_area"),
  35. tags$div(id = "sm2013_area"),
  36. tags$div(id = "sm2014_area"),
  37. tags$div(id = "sm2015_area"),
  38. tags$div(id = "sm2016_area"),
  39. tags$div(id = "sm2017_area")
  40. ),
  41. tags$div(id = "heatmap_container",
  42. tags$div(id = "heatmap_2012_area"),
  43. tags$div(id = "heatmap_2013_area"),
  44. tags$div(id = "heatmap_2014_area"),
  45. tags$div(id = "heatmap_2015_area"),
  46. tags$div(id = "heatmap_2016_area"),
  47. tags$div(id = "heatmap_2017_area")
  48. )
  49. )
  50. ),
  51. tags$div(id = "heatmap_stripes_area")
  52. )
  53. # main content UI layout
  54. body <- mainPanel(
  55. tabsetPanel(
  56. sct_plot,
  57. dendrogram,
  58. choropleth,
  59. parset
  60. )
  61. )
  62. # Combine different UI elements to form app
  63. ui <- fluidPage(
  64. tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "style.css"),
  65. tags$script(src="d3.js"),
  66. tags$script(src="polybrush.js"),
  67. tags$script(src="d3-color.js"),
  68. tags$script(src="d3.parsets.js"),
  69. tags$script(src="parset.js"),
  70. tags$script(src="scatterplot.js"),
  71. tags$script(src="dendrogram.js"),
  72. #tags$script(src="treemap.js"),
  73. tags$script(src="heatmap-table.js"),
  74. tags$script(src="choropleth.js"),
  75. tags$script(src="radarchart.js")),
  76. #tags$script(src="http://d3js.org/d3.v5.min.js"),
  77. body
  78. )