Spaces:
Running
Running
Update app.R
Browse files
app.R
CHANGED
|
@@ -27,12 +27,12 @@ ui <- fluidPage(
|
|
| 27 |
icon("external-link", style = "font-size: 12px;")
|
| 28 |
)
|
| 29 |
),
|
| 30 |
-
|
| 31 |
# ---- Here is the minimal "Share" button HTML + JS inlined in Shiny ----
|
| 32 |
# We wrap it in tags$div(...) and tags$script(HTML(...)) so it is recognized
|
| 33 |
# by Shiny. You can adjust the styling or placement as needed.
|
| 34 |
tags$div(
|
| 35 |
-
|
| 36 |
HTML('
|
| 37 |
<button id="share-button"
|
| 38 |
style="
|
|
@@ -128,8 +128,8 @@ ui <- fluidPage(
|
|
| 128 |
sidebarPanel(
|
| 129 |
# Use sliderInput for alpha0
|
| 130 |
sliderInput("alpha0",
|
| 131 |
-
|
| 132 |
-
|
| 133 |
min = 0.1, max = 200, value = 6, step = 0.1),
|
| 134 |
|
| 135 |
# Use sliderInput for alphaTilde1
|
|
@@ -152,16 +152,27 @@ ui <- fluidPage(
|
|
| 152 |
|
| 153 |
helpText(HTML("\\(\\alpha_k = \\alpha_0 \\cdot \\tilde{\\alpha}_k\\)")),
|
| 154 |
|
| 155 |
-
#
|
| 156 |
-
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
),
|
| 159 |
|
|
|
|
|
|
|
| 160 |
mainPanel(
|
| 161 |
verbatimTextOutput("resultsText"),
|
| 162 |
plotOutput("plotPi"),
|
| 163 |
plotOutput("plotIndex") # Representation Index vs. varied alpha0
|
| 164 |
-
)
|
|
|
|
| 165 |
)
|
| 166 |
)
|
| 167 |
|
|
@@ -343,3 +354,4 @@ server <- function(input, output) {
|
|
| 343 |
}
|
| 344 |
|
| 345 |
shinyApp(ui=ui, server=server)
|
|
|
|
|
|
| 27 |
icon("external-link", style = "font-size: 12px;")
|
| 28 |
)
|
| 29 |
),
|
| 30 |
+
|
| 31 |
# ---- Here is the minimal "Share" button HTML + JS inlined in Shiny ----
|
| 32 |
# We wrap it in tags$div(...) and tags$script(HTML(...)) so it is recognized
|
| 33 |
# by Shiny. You can adjust the styling or placement as needed.
|
| 34 |
tags$div(
|
| 35 |
+
style = "text-align: left; margin: 1em 0 1em 0em;",
|
| 36 |
HTML('
|
| 37 |
<button id="share-button"
|
| 38 |
style="
|
|
|
|
| 128 |
sidebarPanel(
|
| 129 |
# Use sliderInput for alpha0
|
| 130 |
sliderInput("alpha0",
|
| 131 |
+
# label = "Concentration Parameter (alpha0) \ More <--> Less Concentrated",
|
| 132 |
+
label = HTML("Concentration Parameter (\\(\\alpha_0\\))<br/>Concentrated ←→ Dispersed"),
|
| 133 |
min = 0.1, max = 200, value = 6, step = 0.1),
|
| 134 |
|
| 135 |
# Use sliderInput for alphaTilde1
|
|
|
|
| 152 |
|
| 153 |
helpText(HTML("\\(\\alpha_k = \\alpha_0 \\cdot \\tilde{\\alpha}_k\\)")),
|
| 154 |
|
| 155 |
+
# --- Add the citation ---
|
| 156 |
+
helpText(HTML(
|
| 157 |
+
paste0(
|
| 158 |
+
"<strong>Citation:</strong> ",
|
| 159 |
+
"John Gerring, Allan Hicken, Connor T. Jerzak, Robert Moser, Erzen Öncel (2024). ",
|
| 160 |
+
"<em>Where Minorities are the Majority: Electoral Rules and Ethnic Representation.</em> ",
|
| 161 |
+
"OSF Preprint. ",
|
| 162 |
+
"<a href='https://osf.io/preprints/osf/ums8y' target='_blank'>PDF</a> | ",
|
| 163 |
+
"<a href='https://connorjerzak.com/wp-content/uploads/2024/07/WhereTheMinoritiesBib.txt' target='_blank'>BibTex</a>"
|
| 164 |
+
)
|
| 165 |
+
))
|
| 166 |
),
|
| 167 |
|
| 168 |
+
|
| 169 |
+
|
| 170 |
mainPanel(
|
| 171 |
verbatimTextOutput("resultsText"),
|
| 172 |
plotOutput("plotPi"),
|
| 173 |
plotOutput("plotIndex") # Representation Index vs. varied alpha0
|
| 174 |
+
),
|
| 175 |
+
|
| 176 |
)
|
| 177 |
)
|
| 178 |
|
|
|
|
| 354 |
}
|
| 355 |
|
| 356 |
shinyApp(ui=ui, server=server)
|
| 357 |
+
|