aephidayatuloh commited on
Commit
ced4569
·
1 Parent(s): 9314c17

change layout

Browse files
Files changed (1) hide show
  1. app.R +58 -35
app.R CHANGED
@@ -16,42 +16,65 @@ library(echarts4r)
16
 
17
  model <- readRDS("MoE-model.rds")
18
 
19
- ui <- page_sidebar(
20
- theme = bs_theme(bootswatch = "minty"),
21
  title = "Simulation of Study Success",
22
- sidebar = sidebar(width = "20%",
23
- h5("Input"),
24
- fluidRow(prettySwitch("playgroup", "Playgroup", fill = TRUE, status = "primary"),
25
- prettySwitch("preelementary_school", "Pre-Elementary School", fill = TRUE, status = "primary"),
26
- prettySwitch("gov_scholarship_holder", "Gov. Scholarship Holder", fill = TRUE, status = "primary"),
27
- numericInput("home_sch_dist", "Home to School Distance", value = 3, min = 0),
28
- prettySwitch("sex", "Male?", fill = TRUE, status = "primary"),
29
- selectInput("school_location", "School Location", choices = c("Rural", "Urban")),
30
- prettySwitch("parents_spc_need", "Parent have special needs?", fill = TRUE, status = "primary"),
31
- selectInput("parents_occupation_category", "Parents Occupation Category",
32
- choices = c("Civil Servants", "Labor Workers", "Private Employee")),
33
- numericInput("household_income", "Household Income", 4000000, min = 0, max = 19949598),
34
- selectInput("parents_education_level_cat", "Parent Education Level",
35
- choices = c("Bachelor", "Diploma", "Master/Doctorate", "Senior Highschool", "Junior Highschool", "Elementary School", "Unschooled"))
36
- ),
37
- fluidRow(
38
- selectInput("highsch_major", "Highschool Major", width = "60%",
39
- choices = c("Natural Science", "Social Sciences", "Language Studies")),
40
- numericInput("math_score", "Math Score", 50, min = 0, max = 100, width = "39%")
41
- ),
42
- fluidRow(
43
- numericInput("science_score", "Science Score", 50, min = 0, max = 100, width = "48%"),
44
- numericInput("english_score", "English Score", 50, min = 0, max = 100, width = "48%")
45
- ),
46
- fluidRow(
47
- numericInput("indonesian_score", "B. Indonesia Score", 50, min = 0, max = 100, width = "48%"),
48
- numericInput("social_score", "Social Score", 50, min = 0, max = 100, width = "48%")
49
- ),
50
- selectInput("university", "University", choices = c("Private", "Public")),
51
- hr()
52
- ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  # tableOutput("tblout")
54
- echarts4rOutput("gpa_plot")
55
  )
56
 
57
  server <- function(input, output, session) {
@@ -88,7 +111,7 @@ server <- function(input, output, session) {
88
  e_bar(predict_GPA, label = list(show = TRUE)) |>
89
  e_flip_coords() |>
90
  e_y_axis(inverse = TRUE) |>
91
- e_grid(left = "15%", right = "15%")
92
  }
93
  )
94
  }
 
16
 
17
  model <- readRDS("MoE-model.rds")
18
 
19
+ ui <- fluidPage(
20
+ # theme = bs_theme(bootswatch = "minty"),
21
  title = "Simulation of Study Success",
22
+ # sidebar = sidebar(width = "20%",
23
+ # ,
24
+ # hr()
25
+ # ),
26
+ column(6,
27
+ h1("Input"),
28
+ wellPanel(
29
+ style = "background-color: transparent;",
30
+ fluidRow(
31
+ style = "display: flex;",
32
+ prettySwitch("sex", "Male?", fill = TRUE, status = "primary"),
33
+ prettySwitch("playgroup", "Playgroup", fill = TRUE, status = "primary"),
34
+ prettySwitch("preelementary_school", "Pre-Elementary School", fill = TRUE, status = "primary"),
35
+ prettySwitch("gov_scholarship_holder", "Gov. Scholarship Holder", fill = TRUE, status = "primary"),
36
+ prettySwitch("parents_spc_need", "Parent have special needs?", fill = TRUE, status = "primary")
37
+ ),
38
+ fluidRow(
39
+ style = "display: flex;",
40
+ selectInput("parents_occupation_category", "Parents Occupation Category",
41
+ choices = c("Civil Servants", "Labor Workers", "Private Employee"),
42
+ width = "33.333%"),
43
+ numericInput("household_income", "Household Income", 4000000, min = 0, max = 19949598,
44
+ width = "33.333%"),
45
+ selectInput("parents_education_level_cat", "Parent Education Level",
46
+ choices = c("Bachelor", "Diploma", "Master/Doctorate", "Senior Highschool", "Junior Highschool", "Elementary School", "Unschooled"),
47
+ width = "33.333%")
48
+ ),
49
+ fluidRow(
50
+ style = "display: flex;",
51
+ selectInput("school_location", "School Location", choices = c("Rural", "Urban"), width = "50%"),
52
+ numericInput("home_sch_dist", "School Distance (km)", value = 3, min = 0, width = "50%")
53
+ ),
54
+ fluidRow(
55
+ selectInput("highsch_major", "Highschool Major", width = "60%",
56
+ choices = c("Natural Science", "Social Sciences", "Language Studies")),
57
+ ),
58
+ fluidRow(
59
+ style = "display: flex;",
60
+ numericInput("math_score", "Math Score", 50, min = 0, max = 100, width = "20%"),
61
+ numericInput("science_score", "Science Score", 50, min = 0, max = 100, width = "20%"),
62
+ numericInput("english_score", "English Score", 50, min = 0, max = 100, width = "20%"),
63
+ numericInput("indonesian_score", "Bahasa Indonesia Score", 50, min = 0, max = 100, width = "20%"),
64
+ numericInput("social_score", "Social Score", 50, min = 0, max = 100, width = "20%")
65
+ ),
66
+ fluidRow(selectInput("university", "University", choices = c("Private", "Public")))
67
+
68
+ ),
69
+ ),
70
+ column(6,
71
+ h1("Output"),
72
+ wellPanel(
73
+ echarts4rOutput("gpa_plot"),
74
+ style = "background-color: transparent;"
75
+ )
76
+ )
77
  # tableOutput("tblout")
 
78
  )
79
 
80
  server <- function(input, output, session) {
 
111
  e_bar(predict_GPA, label = list(show = TRUE)) |>
112
  e_flip_coords() |>
113
  e_y_axis(inverse = TRUE) |>
114
+ e_grid(left = "20%", right = "5%")
115
  }
116
  )
117
  }