ui.R 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 dendrogram
  19. dendrogram <- tabPanel(
  20. "Dendrogram",
  21. #Div for the tree
  22. tags$div(id = "dendrogram_area")
  23. )
  24. # Tab choropleth
  25. choropleth <- tabPanel(
  26. "Choropleth",
  27. # Div for the bar chart
  28. tags$div(id = "choropleth_area")
  29. )
  30. # Tab for a Treemap
  31. treemap2 <- tabPanel(
  32. "TreeMap",
  33. # Div for the bar chart
  34. tags$div(id = "treemap2_area")
  35. )
  36. # Tab for a Parallel Coordinates
  37. parallelcoordinates <- tabPanel(
  38. "Parallel Coordinates",
  39. # Div for the Parallel Coordinates
  40. tags$div(id = "parallelcoordinates_area"),
  41. tags$div(id = "parallelcoordinates_table",
  42. tags$table(
  43. tags$tr(
  44. tags$th("Acidentes"),
  45. tags$th("Sexo"),
  46. tags$th("Hora")
  47. )
  48. )
  49. )
  50. )
  51. # main content UI layout
  52. body <- mainPanel(
  53. tabsetPanel(
  54. sct_plot,
  55. dendrogram,
  56. choropleth,
  57. treemap2,
  58. parallelcoordinates
  59. )
  60. )
  61. # Combine different UI elements to form app
  62. ui <- fluidPage(
  63. tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "style.css"),
  64. tags$script(src="d3.js"),
  65. tags$script(src="polybrush.js"),
  66. tags$script(src="scatterplot.js"),
  67. # tags$script(src="tree.js"),
  68. tags$script(src="dendrogram.js"),
  69. # tags$script(src="treemap.js"),
  70. tags$script(src="choropleth.js"),
  71. tags$script(src="treemap2.js"),
  72. tags$script(src="parallelcoordinates.js"),
  73. tags$script(src="radarchart.js")),
  74. #tags$script(src="http://d3js.org/d3.v5.min.js"),
  75. body
  76. )