This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
# function to make inputs | |
shinyInput <- function(FUN, len, id, ...) { | |
inputs <- character(len) | |
for (i in seq_len(len)) { | |
inputs[i] <- as.character(FUN(paste0(id, i), ...)) | |
} | |
inputs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (c) 2013-2020 NDP Software, Andrew J. Peterson | |
* https://github.com/ndp/align-column | |
*/ | |
$.fn.alignColumn = function (columns, options) { | |
var config = $.extend({}, { | |
addedCellClass: 'added', | |
skipTHs: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (c) 2013-2020 NDP Software, Andrew J. Peterson | |
* https://github.com/ndp/align-column | |
*/ | |
$.fn.alignColumn = function (columns, options) { | |
var config = $.extend({}, { | |
addedCellClass: 'added', | |
skipTHs: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(DT) | |
library(purrr) | |
# the dataframe contains a column | |
# of unique vectors for each row | |
dummy <- tibble::tibble( | |
a = letters[1:3], | |
b = 1:3, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(DT) | |
data <- data.frame( | |
a = 1:10, | |
b = 1:10 | |
) | |
ui <- fluidPage( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
ui <- fluidPage( | |
# I cant add folders in a gis but script and css need to be in www for this to work! | |
addResourcePath("www", system.file('app/www')), | |
div( | |
div(id = "demo", style="position:relative;", | |
actionButton("full_screen", icon('expand', class = NULL, lib = "font-awesome")), | |
DT::dataTableOutput("demo_table") | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# checkbox color and alignment | |
library(shiny) | |
library(shinyWidgets) | |
ui <- fluidPage( | |
tags$head(tags$style(HTML(' | |
.checkbox-primary input[type="checkbox"]:checked+label::before, .checkbox-primary input[type="radio"]:checked+label::before { | |
background-color: red; | |
border-color: red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
# stealing this from the shiny source code for updateXInput | |
dropNulls <- function(x) { | |
x[!vapply(x, is.null, FUN.VALUE=logical(1))] | |
} | |
ui <- function() { | |
tagList( | |
sliderInput("test1", "Slider", value = 2, min = -2, max = 2, step = 0.01), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(ggplot2) | |
df <- data.frame( | |
x = rep(c(1, 3, 5, 7, 9, 11, 13, 15, 17, 19), 6), | |
y = rep(c(1, 2, 3, 4, 5), each = 12), | |
z = 1:60, | |
w = rep(diff(c(0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20)), 6), | |
values = c( | |
"NA", "NA", "white", "red", "white", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
ui <- fluidPage( | |
numericInput("n_questions", "Number of Questions", value = 1, min = 1), | |
# basically we should get input$n_questions number of these wellpanels | |
# so this entire thing needs to be a function | |
# but where my brain starts hurting is that the number of choices | |
# is going to dictate the number of text fields | |
# for EACH of these well panels |