ui.R 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 = "scatterplot_area"),
  7. # table for selected elements
  8. tags$div(id = "table",
  9. tags$table(
  10. tags$tr(
  11. tags$th("Agente Causador"),
  12. tags$th("Hora"),
  13. tags$th("Idade")
  14. )
  15. )
  16. )
  17. )
  18. # Tab for tree
  19. #tree <- tabPanel(
  20. # "Tree",
  21. # #Div for the tree
  22. # tags$div(id = "tree_area")
  23. #)
  24. # Tab for dendrogram
  25. dendrogram <- tabPanel(
  26. "Dendrogram",
  27. #Div for the tree
  28. tags$div(id = "dendrogram_area")
  29. )
  30. # Tab for a Treemap
  31. #treemap <- tabPanel(
  32. # "TreeMap",
  33. # # Div for the bar chart
  34. # tags$div(id = "treemap_area")
  35. #)
  36. # Tab choropleth
  37. choropleth <- tabPanel(
  38. "Choropleth",
  39. # Div for the bar chart
  40. tags$div(id = "choropleth_area")
  41. )
  42. # Tab for a Treemap
  43. treemap2 <- tabPanel(
  44. "TreeMap",
  45. # Div for the bar chart
  46. tags$div(id = "treemap2_area")
  47. )
  48. # Tab for a Parallel Coordinates
  49. parallelcoordinates <- tabPanel(
  50. "Parallel Coordinates",
  51. # Div for the Parallel Coordinates
  52. tags$div(id = "parallelcoordinates_area"),
  53. tags$div(id = "parallelcoordinates_table",
  54. tags$table(
  55. tags$tr(
  56. tags$th("Acidentes"),
  57. tags$th("Sexo"),
  58. tags$th("Hora")
  59. )
  60. )
  61. )
  62. )
  63. # Tab for a Radarchart
  64. radarchart <- tabPanel(
  65. "RadarChart",
  66. # Div for the bar chart
  67. tags$div(id = "radarchart_area")
  68. )
  69. # main content UI layout
  70. body <- mainPanel(
  71. tabsetPanel(
  72. sct_plot,
  73. # tree,
  74. dendrogram,
  75. # treemap,
  76. choropleth,
  77. treemap2,
  78. parallelcoordinates,
  79. radarchart
  80. )
  81. )
  82. # Combine different UI elements to form app
  83. ui <- fluidPage(
  84. tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "style.css"),
  85. tags$script(src="d3.js"),
  86. tags$script(src="polybrush.js"),
  87. tags$script(src="scatterplot.js"),
  88. # tags$script(src="tree.js"),
  89. tags$script(src="dendrogram.js"),
  90. # tags$script(src="treemap.js"),
  91. tags$script(src="choropleth.js"),
  92. tags$script(src="treemap2.js"),
  93. tags$script(src="parallelcoordinates.js"),
  94. tags$script(src="radarchart.js")),
  95. #tags$script(src="http://d3js.org/d3.v5.min.js"),
  96. body
  97. )