-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
83 lines (70 loc) · 2.83 KB
/
ui.R
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
library(shiny)
library(shinycssloaders)
library(DT)
# Define UI for Python 2 example app ----
ui <- fluidPage(
# App title ----
titlePanel('Reticulated app example'),
# Sidebar layout with input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ----
sidebarPanel(
h4('Inputs to native R functions'),
# Input: Select the random distribution type ----
radioButtons('dist',
'Distribution type:',
choices = c('Normal' = 'norm',
'Uniform' = 'unif',
'Log-normal' = 'lnorm',
'Exponential' = 'exp')),
br(),
# Input: Slider for the number of observations to generate ----
sliderInput('n',
'Number of observations:',
value = 5000,
min = 100,
max = 10000),
hr(),
h4('Inputs to Python functions called by R'),
# Input: Text that will be passed to a Python function ----
textInput('str',
'Text to display',
value = 'This text is being printed by a Python function!'),
# Input: Numbers that will be passed to a Python function ----
numericInput('x',
'x value',
value = 2),
numericInput('y',
'y value',
value = 2)
),
# Main panel for displaying outputs ----
mainPanel(
# Output: Tabset w/ plot, summary, and table ----
tabsetPanel(type = 'tabs',
tabPanel('Demo',
br(),
h3('Outputs generated with native R'),
br(),
withSpinner(plotOutput('plot')),
br(),
h3('Outputs generated by Python functions called by R'),
verbatimTextOutput('message'),
br(),
'Use the numpy Python package to add two numbers',
verbatimTextOutput('xy')),
tabPanel('Architecture Info',
h3('Current architecture info'),
'(These values will change when app is run locally vs on Shinyapps.io)',
hr(),
withSpinner(DT::dataTableOutput('sysinfo')),
br(),
verbatimTextOutput('python_version'),
verbatimTextOutput('rsconnect_opt'),
verbatimTextOutput('ret_env_var'),
verbatimTextOutput('ret_env'),
verbatimTextOutput('path'))
)
)
)
)