-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShiny Workflow Presentation.html
More file actions
801 lines (732 loc) · 32.6 KB
/
Copy pathShiny Workflow Presentation.html
File metadata and controls
801 lines (732 loc) · 32.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
<!DOCTYPE html>
<html lang="en"><head>
<script src="Shiny Workflow Presentation_files/libs/clipboard/clipboard.min.js"></script>
<script src="Shiny Workflow Presentation_files/libs/quarto-html/tabby.min.js"></script>
<script src="Shiny Workflow Presentation_files/libs/quarto-html/popper.min.js"></script>
<script src="Shiny Workflow Presentation_files/libs/quarto-html/tippy.umd.min.js"></script>
<link href="Shiny Workflow Presentation_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="Shiny Workflow Presentation_files/libs/quarto-html/light-border.css" rel="stylesheet">
<link href="Shiny Workflow Presentation_files/libs/quarto-html/quarto-syntax-highlighting-29e2c20b02301cfff04dc8050bf30c7e.css" rel="stylesheet" id="quarto-text-highlighting-styles"><meta charset="utf-8">
<meta name="generator" content="quarto-1.6.37">
<meta name="author" content="Monica Alonso y Priscilla Minotti">
<title>Shiny Workflow Presentation</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="Shiny Workflow Presentation_files/libs/revealjs/dist/reset.css">
<link rel="stylesheet" href="Shiny Workflow Presentation_files/libs/revealjs/dist/reveal.css">
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
</style>
<link rel="stylesheet" href="Shiny Workflow Presentation_files/libs/revealjs/dist/theme/quarto-bbe7401fe57d4b791b917637bb662036.css">
<link href="Shiny Workflow Presentation_files/libs/revealjs/plugin/quarto-line-highlight/line-highlight.css" rel="stylesheet">
<link href="Shiny Workflow Presentation_files/libs/revealjs/plugin/reveal-menu/menu.css" rel="stylesheet">
<link href="Shiny Workflow Presentation_files/libs/revealjs/plugin/reveal-menu/quarto-menu.css" rel="stylesheet">
<link href="Shiny Workflow Presentation_files/libs/revealjs/plugin/quarto-support/footer.css" rel="stylesheet">
<style type="text/css">
.reveal div.sourceCode {
margin: 0;
overflow: auto;
}
.reveal div.hanging-indent {
margin-left: 1em;
text-indent: -1em;
}
.reveal .slide:not(.center) {
height: 100%;
}
.reveal .slide.scrollable {
overflow-y: auto;
}
.reveal .footnotes {
height: 100%;
overflow-y: auto;
}
.reveal .slide .absolute {
position: absolute;
display: block;
}
.reveal .footnotes ol {
counter-reset: ol;
list-style-type: none;
margin-left: 0;
}
.reveal .footnotes ol li:before {
counter-increment: ol;
content: counter(ol) ". ";
}
.reveal .footnotes ol li > p:first-child {
display: inline-block;
}
.reveal .slide ul,
.reveal .slide ol {
margin-bottom: 0.5em;
}
.reveal .slide ul li,
.reveal .slide ol li {
margin-top: 0.4em;
margin-bottom: 0.2em;
}
.reveal .slide ul[role="tablist"] li {
margin-bottom: 0;
}
.reveal .slide ul li > *:first-child,
.reveal .slide ol li > *:first-child {
margin-block-start: 0;
}
.reveal .slide ul li > *:last-child,
.reveal .slide ol li > *:last-child {
margin-block-end: 0;
}
.reveal .slide .columns:nth-child(3) {
margin-block-start: 0.8em;
}
.reveal blockquote {
box-shadow: none;
}
.reveal .tippy-content>* {
margin-top: 0.2em;
margin-bottom: 0.7em;
}
.reveal .tippy-content>*:last-child {
margin-bottom: 0.2em;
}
.reveal .slide > img.stretch.quarto-figure-center,
.reveal .slide > img.r-stretch.quarto-figure-center {
display: block;
margin-left: auto;
margin-right: auto;
}
.reveal .slide > img.stretch.quarto-figure-left,
.reveal .slide > img.r-stretch.quarto-figure-left {
display: block;
margin-left: 0;
margin-right: auto;
}
.reveal .slide > img.stretch.quarto-figure-right,
.reveal .slide > img.r-stretch.quarto-figure-right {
display: block;
margin-left: auto;
margin-right: 0;
}
</style>
</head>
<body class="quarto-light">
<div class="reveal">
<div class="slides">
<section id="title-slide" class="quarto-title-block center">
<h1 class="title">Shiny Workflow Presentation</h1>
<div class="quarto-title-authors">
<div class="quarto-title-author">
<div class="quarto-title-author-name">
Monica Alonso y Priscilla Minotti
</div>
</div>
</div>
</section>
<section id="nuestro-objetivo-hoy" class="slide level2">
<h2>Nuestro Objetivo hoy</h2>
<p>Agilizar tres flujos/pasos de trabajo importantes de Shiny:</p>
<ul>
<li><p><strong>inicio ciclo de desarrollo</strong> crear aplicación, realizar cambios y experimentar con los resultados.</p></li>
<li><p><strong>depuración de errores</strong>, típico ciclo donde pruebas, descubres qué salió mal con tu código y modificas para solucionarlo. Vuelves a empezar el ciclo hasta no detectar más errores.</p></li>
<li><p><strong>reprex</strong>: Escribir un fragmento de código autónomo, pequeño, que ilustra un problema. Se usa para obtener ayuda de otras personas sin necesidad de conocer toda la aplicacion.</p></li>
</ul>
</section>
<section id="agilizar-ciclo-de-desarrollo" class="slide level2">
<h2>1. Agilizar Ciclo de Desarrollo</h2>
<p>Si vamos a crear muchas ShinyApp, conviene acelerar los procesos de desarrollo.</p>
<p>Tenemos dos momentos que podemos agilizar:</p>
<ul>
<li><p>1.1 Creación de la aplicación: El esqueleto de la aplicación es siempre igual</p></li>
<li><p>1.2 Ciclo <strong>modificar código</strong> < = > <strong>probar/obtener resultados</strong> Es un proceso que haremos muchas veces hasta obtener los resultados esperados. Es muy tedioso…</p></li>
</ul>
</section>
<section id="creación-de-la-aplicación" class="slide level2 smaller">
<h2>1.1 Creación de la aplicación</h2>
<div class="columns">
<div class="column" style="width:30%;">
<p>File-> New File -> R Script</p>
<p><img data-src="images/Creacion%20File%20RScript.png"></p>
<p>Luego atajo <code>shinyapp</code> + <code>Tab</code></p>
</div><div class="column" style="width:30%;">
<p>File-> New File -> Shiny Web app <img data-src="images/Creacion%20File%20Shiny%20Web%20app.png"></p>
</div><div class="column" style="width:40%;">
<p>File-> New Project -> Shiny Application <img data-src="images/New%20Project%20Shiny%20Application.png"></p>
</div></div>
</section>
<section id="resultado-se-generara-un-esqueleto-de-la-aplicacion" class="slide level2">
<h2>Resultado: se generara un esqueleto de la aplicacion</h2>
<div class="columns">
<div class="column" style="width:40%;">
<p>Con Rscript <img data-src="images/Creacion%20Shiny%201.2.png"></p>
</div><div class="column" style="width:60%;">
<p>Con Shiny Web Application <img data-src="images/Creacion%20Shiny%201.1.png"></p>
</div></div>
</section>
<section id="código-probar" class="slide level2 smaller">
<h2>1.2 Código < = > Probar</h2>
<div class="columns">
<div class="column" style="width:60%;">
<p><strong>Ventana Emergente y Consola</strong></p>
<pre><code>- Escribe algo de código.
- Inicia app: `Cmd/Ctrl` + `Shift` + `Enter`.
- Experimenta con la aplicación.
- Cierra la aplicación.
- Volver al paso 1.</code></pre>
<p><img data-src="images/Control%20Vista%20Default.png"></p>
</div><div class="column" style="width:40%;">
<p><strong>Background Jobs y Viewer</strong> <img data-src="images/Control%20Vista%20Viewer%20y%20BackGround%20Job.png"></p>
</div></div>
</section>
<section id="ventana-emergente-y-consola" class="slide level2">
<h2>Ventana emergente y Consola</h2>
<div class="columns">
<div class="column" style="width:95%;">
<p><img data-src="images/Vista%20por%20Defecto.png"></p>
</div></div>
</section>
<section id="viewer-y-background-jobs" class="slide level2">
<h2>Viewer y Background Jobs</h2>
<img data-src="images/Background%20y%20Viewer.png" class="r-stretch"></section>
<section>
<section id="a-limpiar-errores" class="title-slide slide level1 center">
<h1>A Limpiar Errores</h1>
<img data-src="images/Escoba%20barre%20errores.png" class="r-stretch"></section>
<section id="depuracion-debugging" class="slide level2 smaller">
<h2>Depuracion (<em>debugging</em>) <img data-src="images/bug.png"></h2>
<p>Cuando empiezas a escribir código generalmente se presentan errores. Nos centraremos en 3 de los principales de errores que te puedes encontrar:</p>
<ul>
<li>Obtienes un “error inesperado”. Shiny dará un seguimiento para averiguar donde ocurrió el error. El depurador interactivo ayuda!</li>
<li>No obtienes ningún error, pero algún valor es incorrecto. Aqui se debera utilizar el depurador interactivo y generar habilidades de investigador🔎.</li>
<li>Todos los valores son correctos, pero no se actualizan cuando lo esperas, éste es desafiante!!</li>
</ul>
<div class="footer">
<p>Para empezar con debug de scripts: <a href="https://posit.co/resources/videos/object-of-type-closure-is-not-subsettable">Jenny Bryan rstudio::conf(2020)</a>.</p>
</div>
</section>
<section id="rastreo-traceback" class="slide level2">
<h2>Rastreo (<em>Traceback</em>)</h2>
<p>Cuando tenemos un error inesperado:</p>
<ul>
<li>En un script R podemos llamar a la funcion traceback() que muestra los pasos ejecutados.</li>
<li>En shiny no es posible ejecutar código mientras corre la shiny app, pero Shiny mostrará el rastreo automaticámente</li>
</ul>
<pre><code>f <- function(x) g(x)
g <- function(x) h(x)
h <- function(x) x * 2
f("a")</code></pre>
<img data-src="images/Traceback.png" class="r-stretch"></section>
<section id="traceback-en-shiny" class="slide level2">
<h2>Traceback en Shiny</h2>
<div class="columns">
<div class="column" style="width:50%;">
<pre><code>library(shiny)
f <- function(x) g(x)
g <- function(x) h(x)
h <- function(x) x * 2
ui <- fluidPage(
selectInput("n", "N", 1:10),
plotOutput("plot")
)
server <- function(input, output, session) {
output$plot <- renderPlot({
n <- f(input$n)
plot(head(cars, n))
}, res = 96)
}
shinyApp(ui, server)</code></pre>
</div><div class="column" style="width:50%;">
<p><img data-src="images/Shiny-traceback.png"></p>
</div></div>
</section>
<section id="el-depurador-interactivo-interactive-debugger" class="slide level2">
<h2>El depurador interactivo (<em>interactive debugger</em>)</h2>
<p>Es la herramienta más potente para investigar un error. Hay dos maneras de iniciar el depurador:</p>
<div class="columns">
<div class="column" style="width:40%;">
<p><u><strong>HERRAMIENTA</strong></u></p>
<p>browser()</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>Debugger</p>
</div><div class="column" style="width:30%;">
<p><u><strong>VENTAJA</strong></u></p>
<p>Funciona tambien en Shiny Puede ser condicional su procesamiento</p>
<p>Agregar puntos de interrupcion</p>
</div><div class="column" style="width:30%;">
<p><u><strong>DESVENTAJA</strong></u></p>
<p>Ensucia Fuente (<strong>recordar eliminarlo</strong>)</p>
<p>.</p>
<p>No es tan sencillo ver las variables</p>
</div></div>
</section>
<section id="browser" class="slide level2">
<h2>browser()</h2>
<pre><code>if (input$value == "a") {
browser()
}
# Or maybe
if (my_reactive() < 0) {
browser()
}</code></pre>
<img data-src="images/menu_desplegable_debug.png" class="r-stretch"></section>
<section id="depurador-interactivo" class="slide level2">
<h2>Depurador Interactivo</h2>
<p><img data-src="images/Debug_source.png"> <img data-src="images/Barra_consola_para_Debug.png"></p>
</section>
<section id="reprex" class="slide level2">
<h2>Reprex</h2>
<p><strong>Un reprex es simplemente código R que funciona al copiarlo y pegarlo en una sesión de R en otro equipo</strong>. Aquí tenemos un reprex simple para una aplicación Shiny:</p>
<pre><code>library(shiny)
ui <- fluidPage(
selectInput("n", "N", 1:10),
plotOutput("plot")
)
server <- function(input, output, session) {
output$plot <- renderPlot({
n <- input$n * 2
plot(head(cars, n))
})
}
shinyApp(ui, server)</code></pre>
</section>
<section id="ejemplos-reproducibles-reprex" class="slide level2">
<h2>Ejemplos reproducibles (<em>reprex</em>)</h2>
<p>Se llama <strong><em>reprex</em></strong> a:</p>
<ul>
<li><p>un ejemplo reproducible</p></li>
<li><p>un paquete de R en CRAN para hacer ejemplos reproducibles, que tambien esta incluido en <em>tidyverse</em> <img data-src="https://reprex.tidyverse.org/logo.png"></p></li>
<li><p>una función del paquete :reprex: para hacer que tu código sea un ejemplo reproducible:</p>
<p>reprex::reprex()</p></li>
</ul>
</section>
<section id="qué-es-un-reprex" class="slide level2">
<h2>¿Qué es un <em>reprex</em> ?</h2>
<ul>
<li><p>Es un código que informa sobre un problema que tenemos y que sirve para que nos ayuden a encontrar una solución.</p></li>
<li><p>Se usa para postear en Slack, en Stackexchage, en RStudio community, como un Issue en Gitlab o Github, o en cualquier lugar donde querés pedir ayuda.</p></li>
</ul>
</section>
<section id="cuáles-son-las-características-de-un-reprex" class="slide level2 smaller">
<h2>¿Cuáles son las características de un <em>reprex</em>?</h2>
<ul>
<li><p>Es de extensión mínima, incluye solo las lineas de codigo realmente necesarias.</p></li>
<li><p>Es autocontenido (carga todos los paquetes necesarios, crea todos los objetos necesarios)</p></li>
<li><p>Es reproducible (puede correrse)</p></li>
<li><p>Usa un conjunto de datos los mas pequeño y simple posible, preferentemente los que vienen con los paquetes instalados con R (ej. iris, mtcars) o una muestra que se generan en el mismo codigo</p></li>
<li><p>Presenta no sólo las líneas de código sino también las salidas como comentarios</p></li>
<li><p>Puede también incluir toda la información de la session donde se corrió y se presentó el problema.</p></li>
</ul>
</section>
<section id="ventajas-de-un-reprex" class="slide level2">
<h2>Ventajas de un reprex</h2>
<ul>
<li><p>Evita copiar/pegar de la consola sin que los demas sepan qué paquetes y datos usaste.</p></li>
<li><p>Evita hacer capturas de pantalla de la sesion de R para comunicar un problema. No se tiene que reescribir todo!</p></li>
<li><p>El código corre sin problemas en cualquier computadora! Asi que si querés abrir una sesión nueva de R, lo abrís o lo pegas y lo corres!</p></li>
<li><p>Si no querés, no es necesario correr el código, porque también suele incluir las salidas.</p></li>
<li><p>En el proceso de crearlo suele encontrarse la solución al problema!</p></li>
</ul>
</section>
<section id="cómo-genero-un-reprex-con-el-paquete-reprex" class="slide level2">
<h2>¿Cómo genero un reprex con el paquete <strong>reprex</strong>?</h2>
<p>Empezar la sesión con library(reprex) en la consola (no lo llama tidyverse)</p>
<ul>
<li><p>Armar el código del reprex</p></li>
<li><p>Opción 1. Correr en la consola `reprex()`, se genera el reprex y te lo muestra en el Viewer. Lo copiás y pegás donde corresponda.</p></li>
<li><p>Opción 2. Desde RStudio addins seleccionar REPREX y elegir las opciones mas convenientes segun la salida buscada</p></li>
</ul>
</section>
<section id="lista-de-chequeo-para-hacer-ejemplos-reproducibles-en-shiny-5.5.3" class="slide level2">
<h2>Lista de chequeo para hacer ejemplos reproducibles en Shiny (5.5.3)</h2>
<ol type="1">
<li><p>Todas las entradas y salidas de la UI estan relacionadas con el problema?</p></li>
<li><p>Se puede simplificar el layout dejando sólo lo necesario?</p></li>
<li><p>Hay reactives en el server() que se puedan remover?</p></li>
<li><p>Necesitas todos los paquetes cargados para ilustrar el problema?</p></li>
<li><p>Quitaste ya todo aquello que no funcionó?</p></li>
</ol>
</section>
<section id="vemos-los-ejemplos-del-libro" class="slide level2">
<h2>¿Vemos los ejemplos del libro?</h2>
<ul>
<li><p>5.3.1 reprex basics</p></li>
<li><p>5.3.4 posteo de Scott Novogoratz en RStudio community</p></li>
</ul>
</section>
<section id="materiales" class="slide level2 smaller">
<h2>Materiales</h2>
<h3 id="debugging">Debugging</h3>
<ul>
<li><p><a href="https://posit.co/resources/videos/object-of-type-closure-is-not-subsettable">Jenny Bryan rstudio::conf(2020)</a></p></li>
<li><p><a href="https://www.youtube.com/watch?v=NgEocgBUH_A&t=1120s">Mauro Lepore Video sobre debugging</a></p></li>
</ul>
<h3 id="reprex-1">Reprex</h3>
<ul>
<li><p><a href="https://reprex.tidyverse.org/">Paquete Reprex</a></p></li>
<li><p><a href="https://speakerdeck.com/jennybc/reprex-reproducible-examples-with-r">Charla Jenny Brian presentando Reprex</a></p></li>
</ul>
<div class="footer">
<p>Agradecimiento a Yanina Bellini por su Taller <a href="https://www.youtube.com/watch?v=q7Yg5Ooto7M&t=645s">Hermosas presentaciones con Quarto</a></p>
</div>
</section></section>
</div>
<div class="quarto-auto-generated-content" style="display: none;">
<p><img src="images/Logo R ladies BA floralis.png" class="slide-logo"></p>
<div class="footer footer-default">
</div>
</div></div>
<script>window.backupDefine = window.define; window.define = undefined;</script>
<script src="Shiny Workflow Presentation_files/libs/revealjs/dist/reveal.js"></script>
<!-- reveal.js plugins -->
<script src="Shiny Workflow Presentation_files/libs/revealjs/plugin/quarto-line-highlight/line-highlight.js"></script>
<script src="Shiny Workflow Presentation_files/libs/revealjs/plugin/pdf-export/pdfexport.js"></script>
<script src="Shiny Workflow Presentation_files/libs/revealjs/plugin/reveal-menu/menu.js"></script>
<script src="Shiny Workflow Presentation_files/libs/revealjs/plugin/reveal-menu/quarto-menu.js"></script>
<script src="Shiny Workflow Presentation_files/libs/revealjs/plugin/quarto-support/support.js"></script>
<script src="Shiny Workflow Presentation_files/libs/revealjs/plugin/notes/notes.js"></script>
<script src="Shiny Workflow Presentation_files/libs/revealjs/plugin/search/search.js"></script>
<script src="Shiny Workflow Presentation_files/libs/revealjs/plugin/zoom/zoom.js"></script>
<script src="Shiny Workflow Presentation_files/libs/revealjs/plugin/math/math.js"></script>
<script>window.define = window.backupDefine; window.backupDefine = undefined;</script>
<script>
// Full list of configuration options available at:
// https://revealjs.com/config/
Reveal.initialize({
'controlsAuto': true,
'previewLinksAuto': false,
'pdfSeparateFragments': false,
'autoAnimateEasing': "ease",
'autoAnimateDuration': 1,
'autoAnimateUnmatched': true,
'jumpToSlide': true,
'menu': {"side":"left","useTextContentForMissingTitles":true,"markers":false,"loadIcons":false,"custom":[{"title":"Tools","icon":"<i class=\"fas fa-gear\"></i>","content":"<ul class=\"slide-menu-items\">\n<li class=\"slide-tool-item active\" data-item=\"0\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.fullscreen(event)\"><kbd>f</kbd> Fullscreen</a></li>\n<li class=\"slide-tool-item\" data-item=\"1\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.speakerMode(event)\"><kbd>s</kbd> Speaker View</a></li>\n<li class=\"slide-tool-item\" data-item=\"2\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.overview(event)\"><kbd>o</kbd> Slide Overview</a></li>\n<li class=\"slide-tool-item\" data-item=\"3\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.togglePdfExport(event)\"><kbd>e</kbd> PDF Export Mode</a></li>\n<li class=\"slide-tool-item\" data-item=\"4\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.toggleScrollView(event)\"><kbd>r</kbd> Scroll View Mode</a></li>\n<li class=\"slide-tool-item\" data-item=\"5\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.keyboardHelp(event)\"><kbd>?</kbd> Keyboard Help</a></li>\n</ul>"}],"openButton":true},
'smaller': false,
// Display controls in the bottom right corner
controls: false,
// Help the user learn the controls by providing hints, for example by
// bouncing the down arrow when they first encounter a vertical slide
controlsTutorial: false,
// Determines where controls appear, "edges" or "bottom-right"
controlsLayout: 'edges',
// Visibility rule for backwards navigation arrows; "faded", "hidden"
// or "visible"
controlsBackArrows: 'faded',
// Display a presentation progress bar
progress: true,
// Display the page number of the current slide
slideNumber: 'c/t',
// 'all', 'print', or 'speaker'
showSlideNumber: 'all',
// Add the current slide number to the URL hash so that reloading the
// page/copying the URL will return you to the same slide
hash: true,
// Start with 1 for the hash rather than 0
hashOneBasedIndex: false,
// Flags if we should monitor the hash and change slides accordingly
respondToHashChanges: true,
// Push each slide change to the browser history
history: true,
// Enable keyboard shortcuts for navigation
keyboard: true,
// Enable the slide overview mode
overview: true,
// Disables the default reveal.js slide layout (scaling and centering)
// so that you can use custom CSS layout
disableLayout: false,
// Vertical centering of slides
center: false,
// Enables touch navigation on devices with touch input
touch: true,
// Loop the presentation
loop: false,
// Change the presentation direction to be RTL
rtl: false,
// see https://revealjs.com/vertical-slides/#navigation-mode
navigationMode: 'linear',
// Randomizes the order of slides each time the presentation loads
shuffle: false,
// Turns fragments on and off globally
fragments: true,
// Flags whether to include the current fragment in the URL,
// so that reloading brings you to the same fragment position
fragmentInURL: false,
// Flags if the presentation is running in an embedded mode,
// i.e. contained within a limited portion of the screen
embedded: false,
// Flags if we should show a help overlay when the questionmark
// key is pressed
help: true,
// Flags if it should be possible to pause the presentation (blackout)
pause: true,
// Flags if speaker notes should be visible to all viewers
showNotes: false,
// Global override for autoplaying embedded media (null/true/false)
autoPlayMedia: null,
// Global override for preloading lazy-loaded iframes (null/true/false)
preloadIframes: null,
// Number of milliseconds between automatically proceeding to the
// next slide, disabled when set to 0, this value can be overwritten
// by using a data-autoslide attribute on your slides
autoSlide: 0,
// Stop auto-sliding after user input
autoSlideStoppable: true,
// Use this method for navigation when auto-sliding
autoSlideMethod: null,
// Specify the average time in seconds that you think you will spend
// presenting each slide. This is used to show a pacing timer in the
// speaker view
defaultTiming: null,
// Enable slide navigation via mouse wheel
mouseWheel: false,
// The display mode that will be used to show slides
display: 'block',
// Hide cursor if inactive
hideInactiveCursor: true,
// Time before the cursor is hidden (in ms)
hideCursorTime: 5000,
// Opens links in an iframe preview overlay
previewLinks: false,
// Transition style (none/fade/slide/convex/concave/zoom)
transition: 'none',
// Transition speed (default/fast/slow)
transitionSpeed: 'default',
// Transition style for full page slide backgrounds
// (none/fade/slide/convex/concave/zoom)
backgroundTransition: 'none',
// Number of slides away from the current that are visible
viewDistance: 3,
// Number of slides away from the current that are visible on mobile
// devices. It is advisable to set this to a lower number than
// viewDistance in order to save resources.
mobileViewDistance: 2,
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
// specified using percentage units.
width: 1050,
height: 700,
// Factor of the display size that should remain empty around the content
margin: 0.1,
math: {
mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js',
config: 'TeX-AMS_HTML-full',
tex2jax: {
inlineMath: [['\\(','\\)']],
displayMath: [['\\[','\\]']],
balanceBraces: true,
processEscapes: false,
processRefs: true,
processEnvironments: true,
preview: 'TeX',
skipTags: ['script','noscript','style','textarea','pre','code'],
ignoreClass: 'tex2jax_ignore',
processClass: 'tex2jax_process'
},
},
// reveal.js plugins
plugins: [QuartoLineHighlight, PdfExport, RevealMenu, QuartoSupport,
RevealMath,
RevealNotes,
RevealSearch,
RevealZoom
]
});
</script>
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const toggleBodyColorMode = (bsSheetEl) => {
const mode = bsSheetEl.getAttribute("data-mode");
const bodyEl = window.document.querySelector("body");
if (mode === "dark") {
bodyEl.classList.add("quarto-dark");
bodyEl.classList.remove("quarto-light");
} else {
bodyEl.classList.add("quarto-light");
bodyEl.classList.remove("quarto-dark");
}
}
const toggleBodyColorPrimary = () => {
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
if (bsSheetEl) {
toggleBodyColorMode(bsSheetEl);
}
}
toggleBodyColorPrimary();
const tabsets = window.document.querySelectorAll(".panel-tabset-tabby")
tabsets.forEach(function(tabset) {
const tabby = new Tabby('#' + tabset.id);
});
const isCodeAnnotation = (el) => {
for (const clz of el.classList) {
if (clz.startsWith('code-annotation-')) {
return true;
}
}
return false;
}
const onCopySuccess = function(e) {
// button target
const button = e.trigger;
// don't keep focus
button.blur();
// flash "checked"
button.classList.add('code-copy-button-checked');
var currentTitle = button.getAttribute("title");
button.setAttribute("title", "Copied!");
let tooltip;
if (window.bootstrap) {
button.setAttribute("data-bs-toggle", "tooltip");
button.setAttribute("data-bs-placement", "left");
button.setAttribute("data-bs-title", "Copied!");
tooltip = new bootstrap.Tooltip(button,
{ trigger: "manual",
customClass: "code-copy-button-tooltip",
offset: [0, -8]});
tooltip.show();
}
setTimeout(function() {
if (tooltip) {
tooltip.hide();
button.removeAttribute("data-bs-title");
button.removeAttribute("data-bs-toggle");
button.removeAttribute("data-bs-placement");
}
button.setAttribute("title", currentTitle);
button.classList.remove('code-copy-button-checked');
}, 1000);
// clear code selection
e.clearSelection();
}
const getTextToCopy = function(trigger) {
const codeEl = trigger.previousElementSibling.cloneNode(true);
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
return codeEl.innerText;
}
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
text: getTextToCopy
});
clipboard.on('success', onCopySuccess);
if (window.document.getElementById('quarto-embedded-source-code-modal')) {
const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
text: getTextToCopy,
container: window.document.getElementById('quarto-embedded-source-code-modal')
});
clipboardModal.on('success', onCopySuccess);
}
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
var mailtoRegex = new RegExp(/^mailto:/);
var filterRegex = new RegExp('/' + window.location.host + '/');
var isInternal = (href) => {
return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
}
// Inspect non-navigation links and adorn them if external
var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
for (var i=0; i<links.length; i++) {
const link = links[i];
if (!isInternal(link.href)) {
// undo the damage that might have been done by quarto-nav.js in the case of
// links that we want to consider external
if (link.dataset.originalHref !== undefined) {
link.href = link.dataset.originalHref;
}
}
}
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
const config = {
allowHTML: true,
maxWidth: 500,
delay: 100,
arrow: false,
appendTo: function(el) {
return el.closest('section.slide') || el.parentElement;
},
interactive: true,
interactiveBorder: 10,
theme: 'light-border',
placement: 'bottom-start',
};
if (contentFn) {
config.content = contentFn;
}
if (onTriggerFn) {
config.onTrigger = onTriggerFn;
}
if (onUntriggerFn) {
config.onUntrigger = onUntriggerFn;
}
config['offset'] = [0,0];
config['maxWidth'] = 700;
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
for (var i=0; i<noterefs.length; i++) {
const ref = noterefs[i];
tippyHover(ref, function() {
// use id or data attribute instead here
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
try { href = new URL(href).hash; } catch {}
const id = href.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
if (note) {
return note.innerHTML;
} else {
return "";
}
});
}
const findCites = (el) => {
const parentEl = el.parentElement;
if (parentEl) {
const cites = parentEl.dataset.cites;
if (cites) {
return {
el,
cites: cites.split(' ')
};
} else {
return findCites(el.parentElement)
}
} else {
return undefined;
}
};
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
for (var i=0; i<bibliorefs.length; i++) {
const ref = bibliorefs[i];
const citeInfo = findCites(ref);
if (citeInfo) {
tippyHover(citeInfo.el, function() {
var popup = window.document.createElement('div');
citeInfo.cites.forEach(function(cite) {
var citeDiv = window.document.createElement('div');
citeDiv.classList.add('hanging-indent');
citeDiv.classList.add('csl-entry');
var biblioDiv = window.document.getElementById('ref-' + cite);
if (biblioDiv) {
citeDiv.innerHTML = biblioDiv.innerHTML;
}
popup.appendChild(citeDiv);
});
return popup.innerHTML;
});
}
}
});
</script>
</body></html>