forked from montesmariana/Level3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
130 lines (122 loc) · 4.5 KB
/
ui.R
File metadata and controls
130 lines (122 loc) · 4.5 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shinydashboard)
library(plotly)
library(shinyWidgets)
library(shinydashboardPlus)
library(shinycssloaders)
options(spinner.type = 6)
# Define UI for application that draws a histogram
header <- dashboardHeader(
title = "Tokens and their context words",
titleWidth = 350,
dropdownMenuOutput("tokendata")
)
sidebar <- dashboardSidebar(
width = 150,
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("About", tabName = "description", icon = icon("info"))
),
hr(),
selectInput("lemma", "Lemma",
dir(here::here("data", "wwmx"))),
selectInput("medoid", "N of medoid",
seq(8), selected = 1),
strong("Noise cues", style ="margin-left:1em;"),
materialSwitch("noise", label = "Ignore", status="success",
right = TRUE, value = TRUE),
# strong("Tokens transparency", style ="margin-left:1em;"),
# materialSwitch("alpha", label = "Scale",
# right = TRUE, value = TRUE, status = "primary"),
hr(),
h3("Define relevance", style="margin-left:1em;"),
numericInput("minfreq", "Frequency",
min = 0, value = 2, step = 1),
sliderInput("recall", "Recall",
min = 0, max = 1, value = 0.5, step = 0.1,
ticks = FALSE),
switchInput("operator", onLabel = "AND", offLabel = "OR",
onStatus = "success", offStatus = "warning"),
sliderInput("precision", "Precision",
min = 0, max = 1, value = 0.5, step = 0.1,
ticks = FALSE)
)
tsne_panel <- tabPanel(
"t-SNE",
fluidRow(
column(width = 6,
box(title = "Tokens", width = NULL,
status = "primary", solidHeader = TRUE, collapsible = TRUE,
plotlyOutput("tokens")),
box(title = "Contexts", width = NULL,
status = "primary", solidHeader = TRUE, collapsible = TRUE,
DT::dataTableOutput("contexts"))
),
column(width = 6,
box(title = "FOCs (type level vectors)", width = NULL,
status = "success", solidHeader = TRUE, collapsible = TRUE,
plotlyOutput("focs"), id = "focs_box"),
box(title = "FOCs by recall and precision", width = NULL,
status = "success", solidHeader = TRUE, collapsible = TRUE,
plotlyOutput("cor"))
)
)
)
body <- dashboardBody(
tags$style(HTML("
.target {
border : solid;
border-color : black;
border-width : 1px;
border-radius : 5px;
padding : 1px;
}
")),
tabItems(
tabItem(
tabName = "dashboard",
fluidRow(
shinydashboard::box(
h4(htmlOutput("medoid")), width = 10, background = "yellow"),
shinydashboard::box(
column(12, align = "center",
actionBttn("previous", "", icon=icon("arrow-alt-circle-left"), color = "warning", style="material-flat"),
actionBttn("nextmodel", "", icon=icon("arrow-alt-circle-right"), color = "warning", style="material-flat")
),
width = 2, status = "warning")
),
fluidRow(
tabBox(selected = "t-SNE",
width = 12, height = "100%",
tsne_panel,
tabPanel("Heatmap",
withSpinner(plotlyOutput("heatmap_or", height = "100%"), color = "#00a65a", hide.ui = FALSE)),
tabPanel("HDBSCAN structure",
fluidRow(
# box(title = "MP densities", status = "primary",
# plotOutput("mp")),
box(title = "Eps values", status = "primary",
withSpinner(plotOutput("eps"))),
box(title = "Proportion of noise per model",
status = "danger",
withSpinner(plotOutput("bars"), color = "#dd4b39")))),
tabPanel("Messages", fluidRow(
box(title = "Split relevance",
width = 12,
background = "olive",
htmlOutput("splitrelevance"))
))
)
)
),
desc_panel
)
)
dashboardPage(header, sidebar, body, skin = "green")