This file contains hidden or 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
# server.R | |
library("shiny") | |
shinyServer( | |
function(input, output, session) { | |
# Debug Area | |
output$Console <- renderUI({ |
This file contains hidden or 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
# server.R | |
shinyServer( | |
function(input, output, session){ | |
# Part I: create an observer on the state of actionButton "calculate" | |
busy <- reactiveValues(state = 0) | |
observe({ |
This file contains hidden or 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
# server.R | |
shinyServer( | |
function(input, output, session){ | |
# This approach triggers a delay when the box is filled before the actionButton is actioned | |
# busyReactive <- reactive({ | |
# delay <- as.integer(input$delay) | |
# if(input$trigger > 0) {Sys.sleep(delay)} | |
# return(input$trigger) |
This file contains hidden or 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
# server.R | |
library("shiny") | |
library("shinyAce") | |
shinyServer( | |
function(input, output) { | |
# A reactiveValues object holds the value of the counter | |
values <- reactiveValues(i = 0) |
This file contains hidden or 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
# server.R | |
shinyServer(function(input, output, session) { | |
output$sliders <- renderUI({ | |
if (is.null(input$n) || is.na(input$n)) { | |
n <- 1 | |
} else { | |
n <- round(input$n,0) | |
} | |
lapply(1:n, function(i) { |
This file contains hidden or 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
# server.R | |
library("shiny") | |
shinyServer( | |
function(input, output, session) { | |
# Reactive slider | |
v <- reactiveValues(min = -5, max = +5, status = 0) |
This file contains hidden or 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
# server.R | |
library("shiny") | |
shinyServer( | |
function(session, input, output) { | |
observe({ | |
if (is.null(input$submit) || input$submit == 0){return()} | |
js_string <- 'alert("Do you want to submit now?");' |
This file contains hidden or 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
% !TeX document-id = {cf6594ac-97a2-46b5-af4f-f9d9c8aaa47d} | |
% !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape] | |
\documentclass{article}% | |
\usepackage{filecontents}% | |
\begin{filecontents*}{tmp.tex}% | |
\input{tikz-board}% | |
\end{filecontents*} | |
%% | |
%% compile pdf | |
\immediate\write18{pdflatex tmp} |
This file contains hidden or 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
// This script just listens for "enter"s on the text input and simulates | |
// clicking the "send" button when that occurs. Totally optional. | |
jQuery(document).ready(function(){ | |
jQuery('#entry').keypress(function(evt){ | |
if (evt.keyCode == 13){ | |
// Enter, simulate clicking send | |
jQuery('#send').click(); | |
} | |
}); | |
}) |
This file contains hidden or 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
# global.R | |
# Static Non-Reactive Area | |
# Read Survey Questions & Suggested Answers | |
Q <- read.csv("survey.csv", 'header' = FALSE) | |
# column 1 : questions | |
# column 2+: several answers | |
# Store Survey Questions & User Answers in a dataframe |