From 979431915339225dc4498dfe4fa746b291fd49a5 Mon Sep 17 00:00:00 2001 From: zerinahuang Date: Mon, 5 Aug 2019 15:39:22 +0200 Subject: [PATCH 1/6] add introjs into shiny --- app.R | 19 +++++++++---- common.R | 2 +- tab_design.R | 78 +++++++++++++++++++++++++++++++++++++++++---------- tab_inspect.R | 27 ++++++++++++------ 4 files changed, 97 insertions(+), 29 deletions(-) diff --git a/app.R b/app.R index fc04b24..7fe462a 100644 --- a/app.R +++ b/app.R @@ -43,6 +43,7 @@ if (file.exists(piwik_code_file)) { ui <- function(request) { material_page( + introjsUI(), # title title = app_title, nav_bar_color = nav_bar_color, @@ -61,12 +62,16 @@ ui <- function(request) { bookmarkButton("SHARE", title = "Share the status of your design and diagnoses"), # tabs + introBox( material_tabs( tabs = c( "Design" = "tab_design", "Diagnose" = "tab_inspect" ) ), + data.step = 12, + data.intro = "Switch to diagnose tab", + data.position = "auto"), # "Design" tab useShinyalert(), @@ -75,6 +80,7 @@ ui <- function(request) { # "Inspect" tab inspectTabUI('tab_inspect'), + introBox( #Footer tags$footer( actionLink("show_help_text", "Help"), @@ -90,7 +96,10 @@ ui <- function(request) { padding: 10px; background-color: #F5F5F5; z-index: 1000;" - ) + ), + data.step = 11, + data.intro = "Any question?", + data.position = "auto") ) } @@ -110,7 +119,7 @@ server <- function(input, output, session) { observeEvent(input$show_legal_notice, { alert_with_content_from_html_file('Legal notice', 'www/legal_notice.html', className = 'wide') }) - + # data protection button clicked observeEvent(input$show_data_protection_policy, { alert_with_content_from_html_file('Data protection policy', 'www/data_protection_policy.html', className = 'wide') @@ -142,7 +151,7 @@ server <- function(input, output, session) { state$values$current_tab <- input$current_tab print(state$values$current_tab) }) - + onBookmarked(function(url) { shinyalert( sprintf('

Share and restore the status of your design and diagnoses by copying the link below into your browser:

@@ -157,7 +166,7 @@ server <- function(input, output, session) { imageUrl = "", confirmButtonCol = "light-blue darken-3", animation = TRUE - ) + ) }) onRestore(function(state) { @@ -173,4 +182,4 @@ server <- function(input, output, session) { } # Run the application -shinyApp(ui = ui, server = server, enableBookmarking = 'server') +shinyApp(ui = ui, server = server, enableBookmarking = 'server') \ No newline at end of file diff --git a/common.R b/common.R index f1ad98a..08d1980 100644 --- a/common.R +++ b/common.R @@ -15,7 +15,7 @@ library(digest) library(DeclareDesign) -# Append `v` to list `l` and return the resulting list. Appending is slow, don't use that often! +# Append `v` to list `l` and return the resulting list. Appending is slow, don't use that often! list_append <- function(l, v) { l[[length(l)+1]] <- v l diff --git a/tab_design.R b/tab_design.R index 7628a64..2a1d843 100644 --- a/tab_design.R +++ b/tab_design.R @@ -24,40 +24,82 @@ designTabUI <- function(id, label = 'Design') { # tagList("Read about the library ", a("here", href="https://declaredesign.org/library/")), div(style="text-align: center;", # add a selectbox to choose the design from DesignLibrary - uiOutput(nspace("import_design_lib_id")), + introjsUI(), + introBox( + uiOutput(nspace("import_design_lib_id")), + data.step = 1, + data.intro = "Select the design you want" + ), actionButton(nspace("import_from_design_lib"), label = "Load", disabled = "disabled"), + actionButton(inputId='learn_more', label= NULL, icon = icon("question-circle"), style = "text-align: center; padding-left: 8px; padding-right: 8px", onclick = "window.open('https://declaredesign.org/library', '_blank')") + ) ), # show designer parameters if a design was loaded hidden(div(id = nspace('design_params_panel_wrapper'), material_card("Set design parameters", - uiOutput(nspace('design_vignette')), - br(), - textInput(nspace('design_arg_design_name'), 'Design name'), - conditionalPanel(paste0("output['", nspace('design_supports_fixed_arg'), "'] != ''"), - div(style="text-align: right;", uiOutput(nspace('fix_toggle_btn'))) - ), - uiOutput(nspace("design_parameters")) # display *all* arguments of an imported design - ) + introBox( + introBox( + uiOutput(nspace('design_vignette')), + data.step = 3, + data.intro = "Check more details about the design" + ), + + br(), + textInput(nspace('design_arg_design_name'), 'Design name'), + introBox( + + + conditionalPanel(paste0("output['", nspace('design_supports_fixed_arg'), "'] != ''"), + div(style="text-align: right;", uiOutput(nspace('fix_toggle_btn'))) + ), + data.step = 4, + data.intro = "Fix all the arguments or not" + ), + uiOutput(nspace("design_parameters")), # display *all* arguments of an imported design + data.step = 2, + data.intro = "Display all arguments of the imported design" + ) + ) )) ), material_column( # center: design output width = 9, + introBox( uiOutput(nspace("load_design_info")), + data.step = 5, + data.intro = "Brief description of design"), + material_card("Download", - downloadButton(nspace('download_r_script'), label = 'R code', disabled = 'disabled'), - downloadButton(nspace('download_rds_obj'), label = 'Design as RDS file', disabled = 'disabled')), + introBox( + downloadButton(nspace('download_r_script'), label = 'R code', disabled = 'disabled'), + downloadButton(nspace('download_rds_obj'), label = 'Design as RDS file', disabled = 'disabled'), + data.step = 6, + data.intro = "Download R script & RDS file" + ) + ), bsCollapse(id=nspace('sections_container'), multiple = TRUE, - bsCollapsePanel('Warnings or errors', uiOutput(nspace("section_messages"))), - bsCollapsePanel('Summary', uiOutput(nspace("section_summary"))), - bsCollapsePanel('Code output', uiOutput(nspace('section_design_code'))), - bsCollapsePanel('Simulated data', + + bsCollapsePanel(introBox('Warnings or errors', + data.step = 7, + data.intro = "Check out the warnings or errors"), uiOutput(nspace("section_messages"))), + bsCollapsePanel(introBox('Summary', + data.step = 8, + data.intro = "Check out the summary of design"), uiOutput(nspace("section_summary"))), + bsCollapsePanel(introBox('Code output', + data.step = 9, + data.intro = "Check out the output of code" + ), uiOutput(nspace('section_design_code'))), + bsCollapsePanel(introBox('Simulated data', + data.step = 10, + data.intro = "Check out the simulated data of design" + ), p("The following table shows a single draw of the data."), actionButton(nspace("simdata_redraw"), label = "Redraw data", disabled = "disabled"), downloadButton(nspace("simdata_download"), label = "Download data", disabled = "disabled"), @@ -352,12 +394,18 @@ designTab <- function(input, output, session) { # input observer for click on design import observeEvent(input$import_from_design_lib, { + + introjs(session, options = list("nextLabel"="next", + "prevLabel"="back", + "skipLabel"="skip")) # loads a pre-defined designer from the library if (!is.null(input$import_design_library)) { load_designer(input$import_design_library) } + }) + # input observer for click on "Fix/Unfix all" button observeEvent(input$fix_toggle_click, { args <- get_designer_args(react$design) diff --git a/tab_inspect.R b/tab_inspect.R index 0a3b045..588f8ab 100644 --- a/tab_inspect.R +++ b/tab_inspect.R @@ -32,9 +32,12 @@ inspectTabUI <- function(id, label = 'Inspect') { material_column( # left: design parameters for comparison width = 3, material_card("Compare design parameters", - conditionalPanel(paste0("output['", nspace_design('design_loaded'), "'] != ''"), - uiOutput(nspace("compare_design_parameters")) # display not-fixed parameters of a design / allow to define sequences - ), + introjsUI(), + conditionalPanel(paste0("output['", nspace_design('design_loaded'), "'] != ''"), + introBox(uiOutput(nspace("compare_design_parameters")), + data.step = 13, + data.intro = "Display not-fixed parameters of the design" # display not-fixed parameters of a design / allow to define sequences + )), conditionalPanel(paste0("output['", nspace_design('design_loaded'), "'] == ''"), p('Load a design first') ) @@ -43,7 +46,7 @@ inspectTabUI <- function(id, label = 'Inspect') { material_column( # center: inspection output width = 6, bsCollapse(id = nspace('inspect_sections_simconf_container'), - bsCollapsePanel('Configure simulations', + bsCollapsePanel(introBox('Configure simulations', data.step = 15, data.intro = "Open the panel and set the Num. of simulation and Num.of bootstraps you want"), checkboxInput(nspace('simconf_force_rerun'), label = 'Always re-run simulations (disable cache)'), numericInput(nspace("simconf_sim_num"), label = "Num. of simulations", value = default_diag_sims, @@ -55,13 +58,18 @@ inspectTabUI <- function(id, label = 'Inspect') { conditionalPanel(paste0("output['", nspace('all_design_args_fixed'), "'] === false"), material_card("Diagnostic plots", uiOutput(nspace('plot_message')), - div(actionButton(nspace('update_plot'), 'Run diagnoses'), style = "margin-bottom:10px"), + introBox(div(actionButton(nspace('update_plot'), 'Run diagnoses'), style = "margin-bottom:10px"), + data.step = 16, + data.intro = "click on it and wait for several seconds"), uiOutput(nspace('plot_output')), + introBox( downloadButton(nspace("download_plot"), label = "Download plot", disabled = "disabled"), - downloadButton(nspace("download_plot_code"), label = "Download plot code", disabled = "disabled") + downloadButton(nspace("download_plot_code"), label = "Download plot code", disabled = "disabled"), + data.step = 17, + data.intro = "Download the plot & code") ), bsCollapse(id = nspace('inspect_sections_container'), - bsCollapsePanel('Diagnosis', + bsCollapsePanel(introBox('Diagnosis', data.step = 18, data.intro = "Check out the dignosis"), uiOutput(nspace("section_diagnosands_message")), dataTableOutput(nspace("section_diagnosands_table")), checkboxInput(nspace("reshape_diagnosands"), @@ -83,7 +91,10 @@ inspectTabUI <- function(id, label = 'Inspect') { ), material_column( # right: plot configuration width = 3, - uiOutput(nspace("plot_conf")) + introBox( + uiOutput(nspace("plot_conf")), + data.step = 14, + data.intro = "Change any parameters you want") ) ) ) From de7a9593d7cd743b5508bfd909541633959d0b9e Mon Sep 17 00:00:00 2001 From: zerinahuang Date: Thu, 8 Aug 2019 14:53:04 +0200 Subject: [PATCH 2/6] load the essential package --- README.md | 1 + app.R | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 652be13..fa9c4a5 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Authors: - stringr - rlang **<= 0.3.4 (>= 0.4.0 produces problems)** - digest +- rintrojs Optional for parallel processing during simulation: diff --git a/app.R b/app.R index 7fe462a..05e9b41 100644 --- a/app.R +++ b/app.R @@ -21,6 +21,7 @@ library(stringr) library(stringi) library(dplyr) library(MASS) +library(rintrojs) source('conf.R') source('common.R') From 354337e9fa5f45d6b3690c5f52e924eeaef2ba23 Mon Sep 17 00:00:00 2001 From: zerinahuang Date: Mon, 12 Aug 2019 17:55:30 +0200 Subject: [PATCH 3/6] update get_started messages --- app.R | 8 +++---- tab_design.R | 50 ++++++++++++++++++++++++++------------------ tab_inspect.R | 18 ++++++++-------- www/get_started.html | 1 + 4 files changed, 44 insertions(+), 33 deletions(-) diff --git a/app.R b/app.R index cf58161..fe805ae 100644 --- a/app.R +++ b/app.R @@ -69,9 +69,9 @@ ui <- function(request) { "Diagnose" = "tab_inspect" ) ), - data.step = 12, - data.intro = "Switch to diagnose tab", - data.position = "auto"), + data.step = 13, + data.intro = "Please switch to diagnose tab", + data.position = "left"), # "Design" tab useShinyalert(), @@ -97,7 +97,7 @@ ui <- function(request) { background-color: #F5F5F5; z-index: 1000;" ), - data.step = 11, + data.step = 12, data.intro = "Any question?", data.position = "auto") ) diff --git a/tab_design.R b/tab_design.R index 2a1d843..9babc6d 100644 --- a/tab_design.R +++ b/tab_design.R @@ -21,6 +21,9 @@ designTabUI <- function(id, label = 'Design') { material_column( # left: input and design parameters width = 3, material_card("Choose design", + div(style="text-align: center;", + actionButton(nspace("intro_tutorial"), + label = "tutorial")), # tagList("Read about the library ", a("here", href="https://declaredesign.org/library/")), div(style="text-align: center;", # add a selectbox to choose the design from DesignLibrary @@ -28,16 +31,21 @@ designTabUI <- function(id, label = 'Design') { introBox( uiOutput(nspace("import_design_lib_id")), data.step = 1, - data.intro = "Select the design you want" + data.intro = "Choose the design you want" ), + + introBox( actionButton(nspace("import_from_design_lib"), label = "Load", disabled = "disabled"), + actionButton(inputId='learn_more', label= NULL, icon = icon("question-circle"), style = "text-align: center; padding-left: 8px; padding-right: 8px", - onclick = "window.open('https://declaredesign.org/library', '_blank')") + onclick = "window.open('https://declaredesign.org/library', '_blank')"), + data.step = 2, + data.intro = "Click on 'LOAD' button to load the design you selected") ) ), @@ -47,8 +55,8 @@ designTabUI <- function(id, label = 'Design') { introBox( introBox( uiOutput(nspace('design_vignette')), - data.step = 3, - data.intro = "Check more details about the design" + data.step = 4, + data.intro = "Check out more details about the design" ), br(), @@ -59,12 +67,12 @@ designTabUI <- function(id, label = 'Design') { conditionalPanel(paste0("output['", nspace('design_supports_fixed_arg'), "'] != ''"), div(style="text-align: right;", uiOutput(nspace('fix_toggle_btn'))) ), - data.step = 4, - data.intro = "Fix all the arguments or not" - ), + data.step = 5, + data.intro = "Once you click on 'FIX ALL', the values of arguments cannot be changed in the 'Diagnose' tab, + of course, you can unfix all the arguments unless you click on 'UNFIX ALL'"), uiOutput(nspace("design_parameters")), # display *all* arguments of an imported design - data.step = 2, - data.intro = "Display all arguments of the imported design" + data.step = 3, + data.intro = "Display all arguments of the imported design and you can change the values if you want" ) ) )) @@ -73,31 +81,31 @@ designTabUI <- function(id, label = 'Design') { width = 9, introBox( uiOutput(nspace("load_design_info")), - data.step = 5, + data.step = 6, data.intro = "Brief description of design"), material_card("Download", introBox( downloadButton(nspace('download_r_script'), label = 'R code', disabled = 'disabled'), downloadButton(nspace('download_rds_obj'), label = 'Design as RDS file', disabled = 'disabled'), - data.step = 6, - data.intro = "Download R script & RDS file" + data.step = 7, + data.intro = "Download R script & RDS file if you want" ) ), bsCollapse(id=nspace('sections_container'), multiple = TRUE, bsCollapsePanel(introBox('Warnings or errors', - data.step = 7, + data.step = 8, data.intro = "Check out the warnings or errors"), uiOutput(nspace("section_messages"))), bsCollapsePanel(introBox('Summary', - data.step = 8, + data.step = 9, data.intro = "Check out the summary of design"), uiOutput(nspace("section_summary"))), bsCollapsePanel(introBox('Code output', - data.step = 9, + data.step = 10, data.intro = "Check out the output of code" ), uiOutput(nspace('section_design_code'))), bsCollapsePanel(introBox('Simulated data', - data.step = 10, + data.step = 11, data.intro = "Check out the simulated data of design" ), p("The following table shows a single draw of the data."), @@ -394,10 +402,6 @@ designTab <- function(input, output, session) { # input observer for click on design import observeEvent(input$import_from_design_lib, { - - introjs(session, options = list("nextLabel"="next", - "prevLabel"="back", - "skipLabel"="skip")) # loads a pre-defined designer from the library if (!is.null(input$import_design_library)) { load_designer(input$import_design_library) @@ -405,6 +409,12 @@ designTab <- function(input, output, session) { }) + observeEvent(input$intro_tutorial,{ + introjs(session, options = list("nextLabel"="next", + "prevLabel"="back", + "skipLabel"="skip")) + }) + # input observer for click on "Fix/Unfix all" button observeEvent(input$fix_toggle_click, { diff --git a/tab_inspect.R b/tab_inspect.R index 588f8ab..b9ec23b 100644 --- a/tab_inspect.R +++ b/tab_inspect.R @@ -35,8 +35,8 @@ inspectTabUI <- function(id, label = 'Inspect') { introjsUI(), conditionalPanel(paste0("output['", nspace_design('design_loaded'), "'] != ''"), introBox(uiOutput(nspace("compare_design_parameters")), - data.step = 13, - data.intro = "Display not-fixed parameters of the design" # display not-fixed parameters of a design / allow to define sequences + data.step = 14, + data.intro = "Display changable parameters of the imported design, you can vary the argument if you want" # display not-fixed parameters of a design / allow to define sequences )), conditionalPanel(paste0("output['", nspace_design('design_loaded'), "'] == ''"), p('Load a design first') @@ -46,7 +46,7 @@ inspectTabUI <- function(id, label = 'Inspect') { material_column( # center: inspection output width = 6, bsCollapse(id = nspace('inspect_sections_simconf_container'), - bsCollapsePanel(introBox('Configure simulations', data.step = 15, data.intro = "Open the panel and set the Num. of simulation and Num.of bootstraps you want"), + bsCollapsePanel(introBox('Configure simulations', data.step = 16, data.intro = "Open the panel and set the Num. of simulation and Num.of bootstraps you want"), checkboxInput(nspace('simconf_force_rerun'), label = 'Always re-run simulations (disable cache)'), numericInput(nspace("simconf_sim_num"), label = "Num. of simulations", value = default_diag_sims, @@ -59,17 +59,17 @@ inspectTabUI <- function(id, label = 'Inspect') { material_card("Diagnostic plots", uiOutput(nspace('plot_message')), introBox(div(actionButton(nspace('update_plot'), 'Run diagnoses'), style = "margin-bottom:10px"), - data.step = 16, + data.step = 17, data.intro = "click on it and wait for several seconds"), uiOutput(nspace('plot_output')), introBox( downloadButton(nspace("download_plot"), label = "Download plot", disabled = "disabled"), downloadButton(nspace("download_plot_code"), label = "Download plot code", disabled = "disabled"), - data.step = 17, - data.intro = "Download the plot & code") + data.step = 18, + data.intro = "Download the plot & code if you want") ), bsCollapse(id = nspace('inspect_sections_container'), - bsCollapsePanel(introBox('Diagnosis', data.step = 18, data.intro = "Check out the dignosis"), + bsCollapsePanel(introBox('Diagnosis', data.step = 19, data.intro = "Check out the dignosis"), uiOutput(nspace("section_diagnosands_message")), dataTableOutput(nspace("section_diagnosands_table")), checkboxInput(nspace("reshape_diagnosands"), @@ -93,8 +93,8 @@ inspectTabUI <- function(id, label = 'Inspect') { width = 3, introBox( uiOutput(nspace("plot_conf")), - data.step = 14, - data.intro = "Change any parameters you want") + data.step = 15, + data.intro = "Change any plot parameters you want, e.g show CI or not, display bias of diagnosand or other criteria on the plot") ) ) ) diff --git a/www/get_started.html b/www/get_started.html index 0aa9e4d..3206fd6 100644 --- a/www/get_started.html +++ b/www/get_started.html @@ -3,6 +3,7 @@
DESIGN TAB

Design menu (top left)
+
Follow the step by step tutorial for new visitors
Load any of designer in the R package 'DesignLibrary'
Left panel
Set values of every argument in the chosen designer. Vector inputs need to be separated by commas.
From 843b8f22de73097492ebaed1fa5bc206bc8e23f9 Mon Sep 17 00:00:00 2001 From: zerinahuang Date: Tue, 20 Aug 2019 12:06:14 +0200 Subject: [PATCH 4/6] update the intro descriptions --- app.R | 2 +- tab_design.R | 6 +++--- tab_inspect.R | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app.R b/app.R index fe805ae..7df0fe1 100644 --- a/app.R +++ b/app.R @@ -70,7 +70,7 @@ ui <- function(request) { ) ), data.step = 13, - data.intro = "Please switch to diagnose tab", + data.intro = "Please switch to diagnose tab, click on 'DIAGNOSE'", data.position = "left"), # "Design" tab diff --git a/tab_design.R b/tab_design.R index 9babc6d..9021237 100644 --- a/tab_design.R +++ b/tab_design.R @@ -96,13 +96,13 @@ designTabUI <- function(id, label = 'Design') { bsCollapsePanel(introBox('Warnings or errors', data.step = 8, - data.intro = "Check out the warnings or errors"), uiOutput(nspace("section_messages"))), + data.intro = "Check out the warnings or errors, if the panel is open"), uiOutput(nspace("section_messages"))), bsCollapsePanel(introBox('Summary', data.step = 9, - data.intro = "Check out the summary of design"), uiOutput(nspace("section_summary"))), + data.intro = "Check out the summary of design, you will see how you set the parameters in the design"), uiOutput(nspace("section_summary"))), bsCollapsePanel(introBox('Code output', data.step = 10, - data.intro = "Check out the output of code" + data.intro = "Check out the output of code, which can be applied independently" ), uiOutput(nspace('section_design_code'))), bsCollapsePanel(introBox('Simulated data', data.step = 11, diff --git a/tab_inspect.R b/tab_inspect.R index b9ec23b..25fd164 100644 --- a/tab_inspect.R +++ b/tab_inspect.R @@ -60,7 +60,7 @@ inspectTabUI <- function(id, label = 'Inspect') { uiOutput(nspace('plot_message')), introBox(div(actionButton(nspace('update_plot'), 'Run diagnoses'), style = "margin-bottom:10px"), data.step = 17, - data.intro = "click on it and wait for several seconds"), + data.intro = "click on it if you want the diagnostic plot"), uiOutput(nspace('plot_output')), introBox( downloadButton(nspace("download_plot"), label = "Download plot", disabled = "disabled"), @@ -69,7 +69,7 @@ inspectTabUI <- function(id, label = 'Inspect') { data.intro = "Download the plot & code if you want") ), bsCollapse(id = nspace('inspect_sections_container'), - bsCollapsePanel(introBox('Diagnosis', data.step = 19, data.intro = "Check out the dignosis"), + bsCollapsePanel(introBox('Diagnosis', data.step = 19, data.intro = "Check out the table of dignosis"), uiOutput(nspace("section_diagnosands_message")), dataTableOutput(nspace("section_diagnosands_table")), checkboxInput(nspace("reshape_diagnosands"), From 24bcad89275b221a26d0a862e8f32570dac47205 Mon Sep 17 00:00:00 2001 From: Markus Konrad Date: Wed, 21 Aug 2019 14:28:45 +0200 Subject: [PATCH 5/6] move tutorial button to top right fix typos --- app.R | 19 +++++++++++++------ tab_design.R | 10 ---------- tab_inspect.R | 2 +- www/custom.css | 12 +++++++++++- www/get_started.html | 3 +-- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/app.R b/app.R index 7df0fe1..c16c06d 100644 --- a/app.R +++ b/app.R @@ -59,7 +59,11 @@ ui <- function(request) { ), shinyjs::useShinyjs(), - bookmarkButton("SHARE", title = "Share the status of your design and diagnoses"), + div( + class="btns_top_right", + actionButton("intro_tutorial", label = "Start tutorial"), + bookmarkButton("SHARE", title = "Share the status of your design and diagnoses") + ), # tabs introBox( @@ -80,7 +84,6 @@ ui <- function(request) { # "Inspect" tab inspectTabUI('tab_inspect'), - introBox( #Footer tags$footer( actionLink("show_help_text", "Help"), @@ -96,10 +99,7 @@ ui <- function(request) { padding: 10px; background-color: #F5F5F5; z-index: 1000;" - ), - data.step = 12, - data.intro = "Any question?", - data.position = "auto") + ) ) } @@ -115,6 +115,13 @@ server <- function(input, output, session) { ### observers global events ### + # tutorial button clicked + observeEvent(input$intro_tutorial,{ + introjs(session, options = list("nextLabel"="next", + "prevLabel"="back", + "skipLabel"="skip")) + }) + # legal notice button clicked observeEvent(input$show_legal_notice, { alert_with_content_from_html_file('Legal notice', 'www/legal_notice.html', className = 'wide') diff --git a/tab_design.R b/tab_design.R index 9021237..27cf547 100644 --- a/tab_design.R +++ b/tab_design.R @@ -21,9 +21,6 @@ designTabUI <- function(id, label = 'Design') { material_column( # left: input and design parameters width = 3, material_card("Choose design", - div(style="text-align: center;", - actionButton(nspace("intro_tutorial"), - label = "tutorial")), # tagList("Read about the library ", a("here", href="https://declaredesign.org/library/")), div(style="text-align: center;", # add a selectbox to choose the design from DesignLibrary @@ -409,13 +406,6 @@ designTab <- function(input, output, session) { }) - observeEvent(input$intro_tutorial,{ - introjs(session, options = list("nextLabel"="next", - "prevLabel"="back", - "skipLabel"="skip")) - }) - - # input observer for click on "Fix/Unfix all" button observeEvent(input$fix_toggle_click, { args <- get_designer_args(react$design) diff --git a/tab_inspect.R b/tab_inspect.R index 25fd164..cc367b3 100644 --- a/tab_inspect.R +++ b/tab_inspect.R @@ -69,7 +69,7 @@ inspectTabUI <- function(id, label = 'Inspect') { data.intro = "Download the plot & code if you want") ), bsCollapse(id = nspace('inspect_sections_container'), - bsCollapsePanel(introBox('Diagnosis', data.step = 19, data.intro = "Check out the table of dignosis"), + bsCollapsePanel(introBox('Diagnosis', data.step = 19, data.intro = "Check out the diagnosis results"), uiOutput(nspace("section_diagnosands_message")), dataTableOutput(nspace("section_diagnosands_table")), checkboxInput(nspace("reshape_diagnosands"), diff --git a/www/custom.css b/www/custom.css index 27c8818..524efbc 100644 --- a/www/custom.css +++ b/www/custom.css @@ -36,12 +36,22 @@ body { position: relative; } -body > button.btn.btn-default.action-button.shiny-bound-input { /** bookmark button */ +div.btns_top_right { position: absolute; top: 0; right: 0; } +div.btns_top_right button { + font-size: 80%; + padding-left: 0.5rem; + padding-right: 0.5rem; +} + +div.btns_top_right button i { + font-size: 80%; +} + pre.share-url { margin-top: 15px; font-size: 13px; diff --git a/www/get_started.html b/www/get_started.html index 3206fd6..c8cbfee 100644 --- a/www/get_started.html +++ b/www/get_started.html @@ -1,9 +1,8 @@ -
This web application allows you to easily simulate and diagnose designs following the DeclareDesign framework. +
This web application allows you to easily simulate and diagnose designs following the DeclareDesign framework. For a quick tour, use the "Start tutorial" button on the top right.

DESIGN TAB

Design menu (top left)
-
Follow the step by step tutorial for new visitors
Load any of designer in the R package 'DesignLibrary'
Left panel
Set values of every argument in the chosen designer. Vector inputs need to be separated by commas.
From 265efd72e14f40d9688abfc0b180ea249a1acb3c Mon Sep 17 00:00:00 2001 From: Markus Konrad Date: Wed, 21 Aug 2019 14:31:16 +0200 Subject: [PATCH 6/6] better position for tutorial step 3 --- tab_design.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tab_design.R b/tab_design.R index 27cf547..ff3396e 100644 --- a/tab_design.R +++ b/tab_design.R @@ -69,7 +69,8 @@ designTabUI <- function(id, label = 'Design') { of course, you can unfix all the arguments unless you click on 'UNFIX ALL'"), uiOutput(nspace("design_parameters")), # display *all* arguments of an imported design data.step = 3, - data.intro = "Display all arguments of the imported design and you can change the values if you want" + data.intro = "Display all arguments of the imported design and you can change the values if you want", + data.position = 'right' ) ) ))