forked from AdamWilsonLabEDU/SpatialDataScience
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPS_12.html
More file actions
767 lines (677 loc) · 68.9 KB
/
PS_12.html
File metadata and controls
767 lines (677 loc) · 68.9 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<title>Dynamic Visualization</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="externals/reveal.js-3.3.0.1/css/reveal.css"/>
<style type="text/css">
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; position: absolute; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
{ position: relative; }
pre.numberSource a.sourceLine:empty
{ position: absolute; }
pre.numberSource a.sourceLine::before
{ content: attr(data-line-number);
position: absolute; left: -5em; text-align: right; vertical-align: baseline;
border: none; pointer-events: all;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ background-color: #f8f8f8; }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ef2929; } /* Alert */
code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #c4a000; } /* Attribute */
code span.bn { color: #0000cf; } /* BaseN */
code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4e9a06; } /* Char */
code span.cn { color: #000000; } /* Constant */
code span.co { color: #8f5902; font-style: italic; } /* Comment */
code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */
code span.dt { color: #204a87; } /* DataType */
code span.dv { color: #0000cf; } /* DecVal */
code span.er { color: #a40000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #0000cf; } /* Float */
code span.fu { color: #000000; } /* Function */
code span.im { } /* Import */
code span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #204a87; font-weight: bold; } /* Keyword */
code span.op { color: #ce5c00; font-weight: bold; } /* Operator */
code span.ot { color: #8f5902; } /* Other */
code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */
code span.sc { color: #000000; } /* SpecialChar */
code span.ss { color: #4e9a06; } /* SpecialString */
code span.st { color: #4e9a06; } /* String */
code span.va { color: #000000; } /* Variable */
code span.vs { color: #4e9a06; } /* VerbatimString */
code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */
</style>
<link rel="stylesheet" href="externals/reveal.js-3.3.0.1/css/theme/white.css" id="theme">
<!-- some tweaks to reveal css -->
<style type="text/css">
.reveal h1 { font-size: 2.0em; }
.reveal h2 { font-size: 1.5em; }
.reveal h3 { font-size: 1.25em; }
.reveal h4 { font-size: 1em; }
.reveal .slides>section,
.reveal .slides>section>section {
padding: 0px 0px;
}
.reveal table {
border-width: 1px;
border-spacing: 2px;
border-style: dotted;
border-color: gray;
border-collapse: collapse;
font-size: 0.7em;
}
.reveal table th {
border-width: 1px;
padding-left: 10px;
padding-right: 25px;
font-weight: bold;
border-style: dotted;
border-color: gray;
}
.reveal table td {
border-width: 1px;
padding-left: 10px;
padding-right: 25px;
border-style: dotted;
border-color: gray;
}
</style>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet" href="reveal.css"/>
<!-- Printing and PDF exports -->
<script id="paper-css" type="application/dynamic-css">
/* Default Print Stylesheet Template
by Rob Glazebrook of CSSnewbie.com
Last Updated: June 4, 2008
Feel free (nay, compelled) to edit, append, and
manipulate this file as you see fit. */
@media print {
/* SECTION 1: Set default width, margin, float, and
background. This prevents elements from extending
beyond the edge of the printed page, and prevents
unnecessary background images from printing */
html {
background: #fff;
width: auto;
height: auto;
overflow: visible;
}
body {
background: #fff;
font-size: 20pt;
width: auto;
height: auto;
border: 0;
margin: 0 5%;
padding: 0;
overflow: visible;
float: none !important;
}
/* SECTION 2: Remove any elements not needed in print.
This would include navigation, ads, sidebars, etc. */
.nestedarrow,
.controls,
.fork-reveal,
.share-reveal,
.state-background,
.reveal .progress,
.reveal .backgrounds {
display: none !important;
}
/* SECTION 3: Set body font face, size, and color.
Consider using a serif font for readability. */
body, p, td, li, div {
font-size: 20pt!important;
font-family: Georgia, "Times New Roman", Times, serif !important;
color: #000;
}
/* SECTION 4: Set heading font face, sizes, and color.
Differentiate your headings from your body text.
Perhaps use a large sans-serif for distinction. */
h1,h2,h3,h4,h5,h6 {
color: #000!important;
height: auto;
line-height: normal;
font-family: Georgia, "Times New Roman", Times, serif !important;
text-shadow: 0 0 0 #000 !important;
text-align: left;
letter-spacing: normal;
}
/* Need to reduce the size of the fonts for printing */
h1 { font-size: 28pt !important; }
h2 { font-size: 24pt !important; }
h3 { font-size: 22pt !important; }
h4 { font-size: 22pt !important; font-variant: small-caps; }
h5 { font-size: 21pt !important; }
h6 { font-size: 20pt !important; font-style: italic; }
/* SECTION 5: Make hyperlinks more usable.
Ensure links are underlined, and consider appending
the URL to the end of the link for usability. */
a:link,
a:visited {
color: #000 !important;
font-weight: bold;
text-decoration: underline;
}
/*
.reveal a:link:after,
.reveal a:visited:after {
content: " (" attr(href) ") ";
color: #222 !important;
font-size: 90%;
}
*/
/* SECTION 6: more reveal.js specific additions by @skypanther */
ul, ol, div, p {
visibility: visible;
position: static;
width: auto;
height: auto;
display: block;
overflow: visible;
margin: 0;
text-align: left !important;
}
.reveal pre,
.reveal table {
margin-left: 0;
margin-right: 0;
}
.reveal pre code {
padding: 20px;
border: 1px solid #ddd;
}
.reveal blockquote {
margin: 20px 0;
}
.reveal .slides {
position: static !important;
width: auto !important;
height: auto !important;
left: 0 !important;
top: 0 !important;
margin-left: 0 !important;
margin-top: 0 !important;
padding: 0 !important;
zoom: 1 !important;
overflow: visible !important;
display: block !important;
text-align: left !important;
-webkit-perspective: none;
-moz-perspective: none;
-ms-perspective: none;
perspective: none;
-webkit-perspective-origin: 50% 50%;
-moz-perspective-origin: 50% 50%;
-ms-perspective-origin: 50% 50%;
perspective-origin: 50% 50%;
}
.reveal .slides section {
visibility: visible !important;
position: static !important;
width: auto !important;
height: auto !important;
display: block !important;
overflow: visible !important;
left: 0 !important;
top: 0 !important;
margin-left: 0 !important;
margin-top: 0 !important;
padding: 60px 20px !important;
z-index: auto !important;
opacity: 1 !important;
page-break-after: always !important;
-webkit-transform-style: flat !important;
-moz-transform-style: flat !important;
-ms-transform-style: flat !important;
transform-style: flat !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
transform: none !important;
-webkit-transition: none !important;
-moz-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}
.reveal .slides section.stack {
padding: 0 !important;
}
.reveal section:last-of-type {
page-break-after: avoid !important;
}
.reveal section .fragment {
opacity: 1 !important;
visibility: visible !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
transform: none !important;
}
.reveal section img {
display: block;
margin: 15px 0px;
background: rgba(255,255,255,1);
border: 1px solid #666;
box-shadow: none;
}
.reveal section small {
font-size: 0.8em;
}
}
</script>
<script id="pdf-css" type="application/dynamic-css">
/**
* This stylesheet is used to print reveal.js
* presentations to PDF.
*
* https://github.com/hakimel/reveal.js#pdf-export
*/
* {
-webkit-print-color-adjust: exact;
}
body {
margin: 0 auto !important;
border: 0;
padding: 0;
float: none !important;
overflow: visible;
}
html {
width: 100%;
height: 100%;
overflow: visible;
}
/* Remove any elements not needed in print. */
.nestedarrow,
.reveal .controls,
.reveal .progress,
.reveal .playback,
.reveal.overview,
.fork-reveal,
.share-reveal,
.state-background {
display: none !important;
}
h1, h2, h3, h4, h5, h6 {
text-shadow: 0 0 0 #000 !important;
}
.reveal pre code {
overflow: hidden !important;
font-family: Courier, 'Courier New', monospace !important;
}
ul, ol, div, p {
visibility: visible;
position: static;
width: auto;
height: auto;
display: block;
overflow: visible;
margin: auto;
}
.reveal {
width: auto !important;
height: auto !important;
overflow: hidden !important;
}
.reveal .slides {
position: static;
width: 100%;
height: auto;
left: auto;
top: auto;
margin: 0 !important;
padding: 0 !important;
overflow: visible;
display: block;
-webkit-perspective: none;
-moz-perspective: none;
-ms-perspective: none;
perspective: none;
-webkit-perspective-origin: 50% 50%; /* there isn't a none/auto value but 50-50 is the default */
-moz-perspective-origin: 50% 50%;
-ms-perspective-origin: 50% 50%;
perspective-origin: 50% 50%;
}
.reveal .slides section {
page-break-after: always !important;
visibility: visible !important;
position: relative !important;
display: block !important;
position: relative !important;
margin: 0 !important;
padding: 0 !important;
box-sizing: border-box !important;
min-height: 1px;
opacity: 1 !important;
-webkit-transform-style: flat !important;
-moz-transform-style: flat !important;
-ms-transform-style: flat !important;
transform-style: flat !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
transform: none !important;
}
.reveal section.stack {
margin: 0 !important;
padding: 0 !important;
page-break-after: avoid !important;
height: auto !important;
min-height: auto !important;
}
.reveal img {
box-shadow: none;
}
.reveal .roll {
overflow: visible;
line-height: 1em;
}
/* Slide backgrounds are placed inside of their slide when exporting to PDF */
.reveal section .slide-background {
display: block !important;
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: -1;
}
/* All elements should be above the slide-background */
.reveal section>* {
position: relative;
z-index: 1;
}
/* Display slide speaker notes when 'showNotes' is enabled */
.reveal .speaker-notes-pdf {
display: block;
width: 100%;
max-height: none;
left: auto;
top: auto;
z-index: 100;
}
/* Display slide numbers when 'slideNumber' is enabled */
.reveal .slide-number-pdf {
display: block;
position: absolute;
font-size: 14px;
}
</script>
<script>
var style = document.createElement( 'style' );
style.type = 'text/css';
var style_script_id = window.location.search.match( /print-pdf/gi ) ? 'pdf-css' : 'paper-css';
var style_script = document.getElementById(style_script_id).text;
style.innerHTML = style_script;
document.getElementsByTagName('head')[0].appendChild(style);
</script>
<link href="externals/font-awesome-5.0.13/css/fa-svg-with-js.css" rel="stylesheet" />
<script src="externals/font-awesome-5.0.13/js/fontawesome-all.min.js"></script>
<script src="externals/font-awesome-5.0.13/js/fa-v4-shims.min.js"></script>
<script src="externals/htmlwidgets-1.3/htmlwidgets.js"></script>
<script src="externals/jquery-1.12.4/jquery.min.js"></script>
<link href="externals/datatables-css-0.0.0/datatables-crosstalk.css" rel="stylesheet" />
<script src="externals/datatables-binding-0.4/datatables.js"></script>
<link href="externals/dt-core-1.10.16/css/jquery.dataTables.min.css" rel="stylesheet" />
<link href="externals/dt-core-1.10.16/css/jquery.dataTables.extra.css" rel="stylesheet" />
<script src="externals/dt-core-1.10.16/js/jquery.dataTables.min.js"></script>
<link href="externals/crosstalk-1.0.0/css/crosstalk.css" rel="stylesheet" />
<script src="externals/crosstalk-1.0.0/js/crosstalk.min.js"></script>
<link href="externals/bokehjs-0.12.2/bokeh.min.css" rel="stylesheet" />
<link href="externals/bokehjs-0.12.2/loader.css" rel="stylesheet" />
<script src="externals/bokehjs-0.12.2/bokeh.min.js"></script>
<script src="externals/rbokeh-binding-0.5.0/rbokeh.js"></script>
<script src="externals/pymjs-1.3.2/pym.v1.js"></script>
<script src="externals/widgetframe-binding-0.3.1/widgetframe.js"></script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1 class="title">Dynamic Visualization</h1>
</section>
<section><section id="logistics" class="title-slide slide level1"><h1>Logistics</h1></section></section>
<section><section id="html-visualization" class="title-slide slide level1"><h1>HTML Visualization</h1></section><section id="datatables" class="slide level2">
<h2>DataTables</h2>
<p><a href="http://rstudio.github.io/DT/">DataTables</a> display R data frames as interactive HTML tables (with filtering, pagination, sorting, and search). This is a great way to make your raw data browsable without using too much space.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw">library</span>(widgetframe)</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw">library</span>(DT)</a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="kw">datatable</span>(iris, <span class="dt">options =</span> <span class="kw">list</span>(<span class="dt">pageLength =</span> <span class="dv">5</span>))</a></code></pre></div>
<div id="htmlwidget-85a6f86490cb1b19662e" style="width:100%;height:auto;" class="datatables html-widget"></div>
<script type="application/json" data-for="htmlwidget-85a6f86490cb1b19662e">{"x":{"filter":"none","data":[["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"],[5.1,4.9,4.7,4.6,5,5.4,4.6,5,4.4,4.9,5.4,4.8,4.8,4.3,5.8,5.7,5.4,5.1,5.7,5.1,5.4,5.1,4.6,5.1,4.8,5,5,5.2,5.2,4.7,4.8,5.4,5.2,5.5,4.9,5,5.5,4.9,4.4,5.1,5,4.5,4.4,5,5.1,4.8,5.1,4.6,5.3,5,7,6.4,6.9,5.5,6.5,5.7,6.3,4.9,6.6,5.2,5,5.9,6,6.1,5.6,6.7,5.6,5.8,6.2,5.6,5.9,6.1,6.3,6.1,6.4,6.6,6.8,6.7,6,5.7,5.5,5.5,5.8,6,5.4,6,6.7,6.3,5.6,5.5,5.5,6.1,5.8,5,5.6,5.7,5.7,6.2,5.1,5.7,6.3,5.8,7.1,6.3,6.5,7.6,4.9,7.3,6.7,7.2,6.5,6.4,6.8,5.7,5.8,6.4,6.5,7.7,7.7,6,6.9,5.6,7.7,6.3,6.7,7.2,6.2,6.1,6.4,7.2,7.4,7.9,6.4,6.3,6.1,7.7,6.3,6.4,6,6.9,6.7,6.9,5.8,6.8,6.7,6.7,6.3,6.5,6.2,5.9],[3.5,3,3.2,3.1,3.6,3.9,3.4,3.4,2.9,3.1,3.7,3.4,3,3,4,4.4,3.9,3.5,3.8,3.8,3.4,3.7,3.6,3.3,3.4,3,3.4,3.5,3.4,3.2,3.1,3.4,4.1,4.2,3.1,3.2,3.5,3.6,3,3.4,3.5,2.3,3.2,3.5,3.8,3,3.8,3.2,3.7,3.3,3.2,3.2,3.1,2.3,2.8,2.8,3.3,2.4,2.9,2.7,2,3,2.2,2.9,2.9,3.1,3,2.7,2.2,2.5,3.2,2.8,2.5,2.8,2.9,3,2.8,3,2.9,2.6,2.4,2.4,2.7,2.7,3,3.4,3.1,2.3,3,2.5,2.6,3,2.6,2.3,2.7,3,2.9,2.9,2.5,2.8,3.3,2.7,3,2.9,3,3,2.5,2.9,2.5,3.6,3.2,2.7,3,2.5,2.8,3.2,3,3.8,2.6,2.2,3.2,2.8,2.8,2.7,3.3,3.2,2.8,3,2.8,3,2.8,3.8,2.8,2.8,2.6,3,3.4,3.1,3,3.1,3.1,3.1,2.7,3.2,3.3,3,2.5,3,3.4,3],[1.4,1.4,1.3,1.5,1.4,1.7,1.4,1.5,1.4,1.5,1.5,1.6,1.4,1.1,1.2,1.5,1.3,1.4,1.7,1.5,1.7,1.5,1,1.7,1.9,1.6,1.6,1.5,1.4,1.6,1.6,1.5,1.5,1.4,1.5,1.2,1.3,1.4,1.3,1.5,1.3,1.3,1.3,1.6,1.9,1.4,1.6,1.4,1.5,1.4,4.7,4.5,4.9,4,4.6,4.5,4.7,3.3,4.6,3.9,3.5,4.2,4,4.7,3.6,4.4,4.5,4.1,4.5,3.9,4.8,4,4.9,4.7,4.3,4.4,4.8,5,4.5,3.5,3.8,3.7,3.9,5.1,4.5,4.5,4.7,4.4,4.1,4,4.4,4.6,4,3.3,4.2,4.2,4.2,4.3,3,4.1,6,5.1,5.9,5.6,5.8,6.6,4.5,6.3,5.8,6.1,5.1,5.3,5.5,5,5.1,5.3,5.5,6.7,6.9,5,5.7,4.9,6.7,4.9,5.7,6,4.8,4.9,5.6,5.8,6.1,6.4,5.6,5.1,5.6,6.1,5.6,5.5,4.8,5.4,5.6,5.1,5.1,5.9,5.7,5.2,5,5.2,5.4,5.1],[0.2,0.2,0.2,0.2,0.2,0.4,0.3,0.2,0.2,0.1,0.2,0.2,0.1,0.1,0.2,0.4,0.4,0.3,0.3,0.3,0.2,0.4,0.2,0.5,0.2,0.2,0.4,0.2,0.2,0.2,0.2,0.4,0.1,0.2,0.2,0.2,0.2,0.1,0.2,0.2,0.3,0.3,0.2,0.6,0.4,0.3,0.2,0.2,0.2,0.2,1.4,1.5,1.5,1.3,1.5,1.3,1.6,1,1.3,1.4,1,1.5,1,1.4,1.3,1.4,1.5,1,1.5,1.1,1.8,1.3,1.5,1.2,1.3,1.4,1.4,1.7,1.5,1,1.1,1,1.2,1.6,1.5,1.6,1.5,1.3,1.3,1.3,1.2,1.4,1.2,1,1.3,1.2,1.3,1.3,1.1,1.3,2.5,1.9,2.1,1.8,2.2,2.1,1.7,1.8,1.8,2.5,2,1.9,2.1,2,2.4,2.3,1.8,2.2,2.3,1.5,2.3,2,2,1.8,2.1,1.8,1.8,1.8,2.1,1.6,1.9,2,2.2,1.5,1.4,2.3,2.4,1.8,1.8,2.1,2.4,2.3,1.9,2.3,2.5,2.3,1.9,2,2.3,1.8],["setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica"]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>Sepal.Length<\/th>\n <th>Sepal.Width<\/th>\n <th>Petal.Length<\/th>\n <th>Petal.Width<\/th>\n <th>Species<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"pageLength":5,"columnDefs":[{"className":"dt-right","targets":[1,2,3,4]},{"orderable":false,"targets":0}],"order":[],"autoWidth":false,"orderClasses":false,"lengthMenu":[5,10,25,50,100]}},"evals":[],"jsHooks":[]}</script>
</section><section id="rbokeh" class="slide level2">
<h2>rbokeh</h2>
<p>Interface to the <a href="http://hafen.github.io/rbokeh">Bokeh</a> library for making interactive graphics.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="kw">library</span>(rbokeh)</a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="kw">figure</span>(<span class="dt">width =</span> <span class="dv">800</span>, <span class="dt">height=</span><span class="dv">400</span>) <span class="op">%>%</span></a>
<a class="sourceLine" id="cb2-3" data-line-number="3"><span class="st"> </span><span class="kw">ly_points</span>(Sepal.Length, Sepal.Width, <span class="dt">data =</span> iris,</a>
<a class="sourceLine" id="cb2-4" data-line-number="4"> <span class="dt">color =</span> Species, <span class="dt">glyph =</span> Species,</a>
<a class="sourceLine" id="cb2-5" data-line-number="5"> <span class="dt">hover =</span> <span class="kw">list</span>(Sepal.Length, Sepal.Width))</a></code></pre></div>
<div id="htmlwidget-f9b6523c34cc0c9c4682" style="width:800px;height:400px;" class="rbokeh html-widget"></div>
<script type="application/json" data-for="htmlwidget-f9b6523c34cc0c9c4682">{"x":{"elementid":"5798d2a77cb1d45f67773de6d95fb736","modeltype":"Plot","modelid":"34c100cf983beb28905a7696d4986ed5","docid":"f9bd66ddd35b7aef633e2e3db42db23f","docs_json":{"f9bd66ddd35b7aef633e2e3db42db23f":{"version":"0.12.2","title":"Bokeh Figure","roots":{"root_ids":["34c100cf983beb28905a7696d4986ed5"],"references":[{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","attributes":{"id":"34c100cf983beb28905a7696d4986ed5","plot_width":800,"plot_height":400,"sizing_mode":"scale_both","x_range":{"type":"Range1d","id":"99c49992c8bbd0c21588a9a755d0e4a2"},"y_range":{"type":"Range1d","id":"ef687be57b7af12731a88706f7916454"},"left":[{"type":"LinearAxis","id":"9bde1d9c5d65bac86b87ac213a86c430"}],"below":[{"type":"LinearAxis","id":"3c36777a5d14b96a2906357b7b08c7c5"}],"right":[],"above":[],"renderers":[{"type":"BoxAnnotation","id":"afeaee7cd6e89c2c6f7c447a32021e39"},{"type":"GlyphRenderer","id":"bb96550ac4a9b08fb95ff36981e364f0"},{"type":"GlyphRenderer","id":"80f1bc9c532c9892f8f3f920c05dc5fd"},{"type":"GlyphRenderer","id":"d039e612738747a129787814ef56f8ee"},{"type":"GlyphRenderer","id":"6904c41a7e54c0f7051212f6f9c06c21"},{"type":"GlyphRenderer","id":"af629659bed146652ee3bf7347134167"},{"type":"GlyphRenderer","id":"051d7b63d7c6e5d9c02f3d486cfc11db"},{"type":"Legend","id":"507d53111fdc8f139561edcfed91a2b4"},{"type":"LinearAxis","id":"3c36777a5d14b96a2906357b7b08c7c5"},{"type":"Grid","id":"67431e627aeeb03fed3ef6604a85ddf5"},{"type":"LinearAxis","id":"9bde1d9c5d65bac86b87ac213a86c430"},{"type":"Grid","id":"7aa69cf6de78182ecb1b75a7293de170"}],"extra_y_ranges":{},"extra_x_ranges":{},"tags":[],"min_border_left":4,"min_border_right":4,"min_border_top":4,"min_border_bottom":4,"lod_threshold":null,"toolbar":{"type":"Toolbar","id":"d21f01b72e30ed87ad74f2b967cee454"},"tool_events":{"type":"ToolEvents","id":"e030c04b75cbea4728e79e42f70e0bc1"}},"subtype":"Figure"},{"type":"Toolbar","id":"d21f01b72e30ed87ad74f2b967cee454","attributes":{"id":"d21f01b72e30ed87ad74f2b967cee454","tags":[],"active_drag":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"type":"PanTool","id":"dda8ca946520eaa96eca7c3ad1e68706"},{"type":"WheelZoomTool","id":"c83c4a8c07e73b894e2e1393aa8cd45b"},{"type":"BoxZoomTool","id":"af7df522a8e197b95ec7933baa4799d8"},{"type":"ResetTool","id":"95b711d300fbf7ebeb3d8cd97a639fab"},{"type":"SaveTool","id":"453c532ffd4e1b2f8f86a3785c8cbbd5"},{"type":"HelpTool","id":"27d55c3d8b98fa3a6d5697f20e0bb178"},{"type":"HoverTool","id":"425873221dfa2e45c8e098578bb96ef3"},{"type":"HoverTool","id":"dd74938437137d8c4337da16ce0391e4"},{"type":"HoverTool","id":"6884190a62a1197e6fa9486ed193ae4d"}],"logo":null}},{"type":"PanTool","id":"dda8ca946520eaa96eca7c3ad1e68706","attributes":{"id":"dda8ca946520eaa96eca7c3ad1e68706","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"ToolEvents","id":"e030c04b75cbea4728e79e42f70e0bc1","attributes":{"id":"e030c04b75cbea4728e79e42f70e0bc1","tags":[]},"geometries":[]},{"type":"WheelZoomTool","id":"c83c4a8c07e73b894e2e1393aa8cd45b","attributes":{"id":"c83c4a8c07e73b894e2e1393aa8cd45b","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"BoxAnnotation","id":"afeaee7cd6e89c2c6f7c447a32021e39","attributes":{"id":"afeaee7cd6e89c2c6f7c447a32021e39","tags":[],"line_color":{"units":"data","value":"black"},"line_alpha":{"units":"data","value":1},"fill_color":{"units":"data","value":"lightgrey"},"fill_alpha":{"units":"data","value":0.5},"line_dash":[4,4],"line_width":{"units":"data","value":2},"level":"overlay","top_units":"screen","bottom_units":"screen","left_units":"screen","right_units":"screen","render_mode":"css"}},{"type":"BoxZoomTool","id":"af7df522a8e197b95ec7933baa4799d8","attributes":{"id":"af7df522a8e197b95ec7933baa4799d8","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"overlay":{"type":"BoxAnnotation","id":"afeaee7cd6e89c2c6f7c447a32021e39"}}},{"type":"ResetTool","id":"95b711d300fbf7ebeb3d8cd97a639fab","attributes":{"id":"95b711d300fbf7ebeb3d8cd97a639fab","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"}}},{"type":"SaveTool","id":"453c532ffd4e1b2f8f86a3785c8cbbd5","attributes":{"id":"453c532ffd4e1b2f8f86a3785c8cbbd5","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"}}},{"type":"HelpTool","id":"27d55c3d8b98fa3a6d5697f20e0bb178","attributes":{"id":"27d55c3d8b98fa3a6d5697f20e0bb178","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"redirect":"http://hafen.github.io/rbokeh","help_tooltip":"Click to learn more about rbokeh."}},{"type":"HoverTool","id":"425873221dfa2e45c8e098578bb96ef3","attributes":{"id":"425873221dfa2e45c8e098578bb96ef3","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"renderers":[{"type":"GlyphRenderer","id":"bb96550ac4a9b08fb95ff36981e364f0"}],"names":[],"anchor":"center","attachment":"horizontal","line_policy":"prev","mode":"mouse","point_policy":"snap_to_data","tooltips":[["Sepal.Length","@hover_col_1"],["Sepal.Width","@hover_col_2"]]}},{"type":"ColumnDataSource","id":"833b88465634de7941221051c40cc2e6","attributes":{"id":"833b88465634de7941221051c40cc2e6","tags":[],"column_names":["x","y","line_color","fill_color","hover_col_1","hover_col_2"],"selected":[],"data":{"x":[5.1,4.9,4.7,4.6,5,5.4,4.6,5,4.4,4.9,5.4,4.8,4.8,4.3,5.8,5.7,5.4,5.1,5.7,5.1,5.4,5.1,4.6,5.1,4.8,5,5,5.2,5.2,4.7,4.8,5.4,5.2,5.5,4.9,5,5.5,4.9,4.4,5.1,5,4.5,4.4,5,5.1,4.8,5.1,4.6,5.3,5],"y":[3.5,3,3.2,3.1,3.6,3.9,3.4,3.4,2.9,3.1,3.7,3.4,3,3,4,4.4,3.9,3.5,3.8,3.8,3.4,3.7,3.6,3.3,3.4,3,3.4,3.5,3.4,3.2,3.1,3.4,4.1,4.2,3.1,3.2,3.5,3.6,3,3.4,3.5,2.3,3.2,3.5,3.8,3,3.8,3.2,3.7,3.3],"line_color":["#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4"],"fill_color":["#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4"],"hover_col_1":["5.1","4.9","4.7","4.6","5.0","5.4","4.6","5.0","4.4","4.9","5.4","4.8","4.8","4.3","5.8","5.7","5.4","5.1","5.7","5.1","5.4","5.1","4.6","5.1","4.8","5.0","5.0","5.2","5.2","4.7","4.8","5.4","5.2","5.5","4.9","5.0","5.5","4.9","4.4","5.1","5.0","4.5","4.4","5.0","5.1","4.8","5.1","4.6","5.3","5.0"],"hover_col_2":["3.5","3.0","3.2","3.1","3.6","3.9","3.4","3.4","2.9","3.1","3.7","3.4","3.0","3.0","4.0","4.4","3.9","3.5","3.8","3.8","3.4","3.7","3.6","3.3","3.4","3.0","3.4","3.5","3.4","3.2","3.1","3.4","4.1","4.2","3.1","3.2","3.5","3.6","3.0","3.4","3.5","2.3","3.2","3.5","3.8","3.0","3.8","3.2","3.7","3.3"]}}},{"type":"Circle","id":"7d72ac7debc3a2a1e320ac4b92c8c326","attributes":{"id":"7d72ac7debc3a2a1e320ac4b92c8c326","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"Circle","id":"29c9dd5d257d6f3c980b9eb09f6a2b8c","attributes":{"id":"29c9dd5d257d6f3c980b9eb09f6a2b8c","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"}}},{"type":"Circle","id":"43c860a4403a9b7fb37404c91cf4dfac","attributes":{"id":"43c860a4403a9b7fb37404c91cf4dfac","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"GlyphRenderer","id":"bb96550ac4a9b08fb95ff36981e364f0","attributes":{"id":"bb96550ac4a9b08fb95ff36981e364f0","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"29c9dd5d257d6f3c980b9eb09f6a2b8c"},"hover_glyph":{"type":"Circle","id":"43c860a4403a9b7fb37404c91cf4dfac"},"name":null,"data_source":{"type":"ColumnDataSource","id":"833b88465634de7941221051c40cc2e6"},"glyph":{"type":"Circle","id":"7d72ac7debc3a2a1e320ac4b92c8c326"}}},{"type":"HoverTool","id":"dd74938437137d8c4337da16ce0391e4","attributes":{"id":"dd74938437137d8c4337da16ce0391e4","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"renderers":[{"type":"GlyphRenderer","id":"80f1bc9c532c9892f8f3f920c05dc5fd"}],"names":[],"anchor":"center","attachment":"horizontal","line_policy":"prev","mode":"mouse","point_policy":"snap_to_data","tooltips":[["Sepal.Length","@hover_col_1"],["Sepal.Width","@hover_col_2"]]}},{"type":"ColumnDataSource","id":"5ac8fa215ec21115d16e9cd94e314c55","attributes":{"id":"5ac8fa215ec21115d16e9cd94e314c55","tags":[],"column_names":["x","y","line_color","fill_color","hover_col_1","hover_col_2"],"selected":[],"data":{"x":[7,6.4,6.9,5.5,6.5,5.7,6.3,4.9,6.6,5.2,5,5.9,6,6.1,5.6,6.7,5.6,5.8,6.2,5.6,5.9,6.1,6.3,6.1,6.4,6.6,6.8,6.7,6,5.7,5.5,5.5,5.8,6,5.4,6,6.7,6.3,5.6,5.5,5.5,6.1,5.8,5,5.6,5.7,5.7,6.2,5.1,5.7],"y":[3.2,3.2,3.1,2.3,2.8,2.8,3.3,2.4,2.9,2.7,2,3,2.2,2.9,2.9,3.1,3,2.7,2.2,2.5,3.2,2.8,2.5,2.8,2.9,3,2.8,3,2.9,2.6,2.4,2.4,2.7,2.7,3,3.4,3.1,2.3,3,2.5,2.6,3,2.6,2.3,2.7,3,2.9,2.9,2.5,2.8],"line_color":["#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E"],"fill_color":["#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E"],"hover_col_1":["7.0","6.4","6.9","5.5","6.5","5.7","6.3","4.9","6.6","5.2","5.0","5.9","6.0","6.1","5.6","6.7","5.6","5.8","6.2","5.6","5.9","6.1","6.3","6.1","6.4","6.6","6.8","6.7","6.0","5.7","5.5","5.5","5.8","6.0","5.4","6.0","6.7","6.3","5.6","5.5","5.5","6.1","5.8","5.0","5.6","5.7","5.7","6.2","5.1","5.7"],"hover_col_2":["3.2","3.2","3.1","2.3","2.8","2.8","3.3","2.4","2.9","2.7","2.0","3.0","2.2","2.9","2.9","3.1","3.0","2.7","2.2","2.5","3.2","2.8","2.5","2.8","2.9","3.0","2.8","3.0","2.9","2.6","2.4","2.4","2.7","2.7","3.0","3.4","3.1","2.3","3.0","2.5","2.6","3.0","2.6","2.3","2.7","3.0","2.9","2.9","2.5","2.8"]}}},{"type":"Square","id":"cbd544f0598093e1dadd0ab8677734a6","attributes":{"id":"cbd544f0598093e1dadd0ab8677734a6","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"Square","id":"435578ebc57f292b77f26d21d87eec4b","attributes":{"id":"435578ebc57f292b77f26d21d87eec4b","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"}}},{"type":"Square","id":"3bf3dd1f94a1d54eaba8e542482b37d2","attributes":{"id":"3bf3dd1f94a1d54eaba8e542482b37d2","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"GlyphRenderer","id":"80f1bc9c532c9892f8f3f920c05dc5fd","attributes":{"id":"80f1bc9c532c9892f8f3f920c05dc5fd","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Square","id":"435578ebc57f292b77f26d21d87eec4b"},"hover_glyph":{"type":"Square","id":"3bf3dd1f94a1d54eaba8e542482b37d2"},"name":null,"data_source":{"type":"ColumnDataSource","id":"5ac8fa215ec21115d16e9cd94e314c55"},"glyph":{"type":"Square","id":"cbd544f0598093e1dadd0ab8677734a6"}}},{"type":"HoverTool","id":"6884190a62a1197e6fa9486ed193ae4d","attributes":{"id":"6884190a62a1197e6fa9486ed193ae4d","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"renderers":[{"type":"GlyphRenderer","id":"d039e612738747a129787814ef56f8ee"}],"names":[],"anchor":"center","attachment":"horizontal","line_policy":"prev","mode":"mouse","point_policy":"snap_to_data","tooltips":[["Sepal.Length","@hover_col_1"],["Sepal.Width","@hover_col_2"]]}},{"type":"ColumnDataSource","id":"f1a4ea6edb8f95b2832083ec6d4c6670","attributes":{"id":"f1a4ea6edb8f95b2832083ec6d4c6670","tags":[],"column_names":["x","y","line_color","fill_color","hover_col_1","hover_col_2"],"selected":[],"data":{"x":[6.3,5.8,7.1,6.3,6.5,7.6,4.9,7.3,6.7,7.2,6.5,6.4,6.8,5.7,5.8,6.4,6.5,7.7,7.7,6,6.9,5.6,7.7,6.3,6.7,7.2,6.2,6.1,6.4,7.2,7.4,7.9,6.4,6.3,6.1,7.7,6.3,6.4,6,6.9,6.7,6.9,5.8,6.8,6.7,6.7,6.3,6.5,6.2,5.9],"y":[3.3,2.7,3,2.9,3,3,2.5,2.9,2.5,3.6,3.2,2.7,3,2.5,2.8,3.2,3,3.8,2.6,2.2,3.2,2.8,2.8,2.7,3.3,3.2,2.8,3,2.8,3,2.8,3.8,2.8,2.8,2.6,3,3.4,3.1,3,3.1,3.1,3.1,2.7,3.2,3.3,3,2.5,3,3.4,3],"line_color":["#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C"],"fill_color":["#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C"],"hover_col_1":["6.3","5.8","7.1","6.3","6.5","7.6","4.9","7.3","6.7","7.2","6.5","6.4","6.8","5.7","5.8","6.4","6.5","7.7","7.7","6.0","6.9","5.6","7.7","6.3","6.7","7.2","6.2","6.1","6.4","7.2","7.4","7.9","6.4","6.3","6.1","7.7","6.3","6.4","6.0","6.9","6.7","6.9","5.8","6.8","6.7","6.7","6.3","6.5","6.2","5.9"],"hover_col_2":["3.3","2.7","3.0","2.9","3.0","3.0","2.5","2.9","2.5","3.6","3.2","2.7","3.0","2.5","2.8","3.2","3.0","3.8","2.6","2.2","3.2","2.8","2.8","2.7","3.3","3.2","2.8","3.0","2.8","3.0","2.8","3.8","2.8","2.8","2.6","3.0","3.4","3.1","3.0","3.1","3.1","3.1","2.7","3.2","3.3","3.0","2.5","3.0","3.4","3.0"]}}},{"type":"Triangle","id":"7a5e1294f01430e98f0dd2d900a27b50","attributes":{"id":"7a5e1294f01430e98f0dd2d900a27b50","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"Triangle","id":"e8f8a3aea0bc13f15bd4ad13da37f638","attributes":{"id":"e8f8a3aea0bc13f15bd4ad13da37f638","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"}}},{"type":"Triangle","id":"b2b1b3652b79fb8cc65a9b7d6c19d83a","attributes":{"id":"b2b1b3652b79fb8cc65a9b7d6c19d83a","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"GlyphRenderer","id":"d039e612738747a129787814ef56f8ee","attributes":{"id":"d039e612738747a129787814ef56f8ee","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Triangle","id":"e8f8a3aea0bc13f15bd4ad13da37f638"},"hover_glyph":{"type":"Triangle","id":"b2b1b3652b79fb8cc65a9b7d6c19d83a"},"name":null,"data_source":{"type":"ColumnDataSource","id":"f1a4ea6edb8f95b2832083ec6d4c6670"},"glyph":{"type":"Triangle","id":"7a5e1294f01430e98f0dd2d900a27b50"}}},{"type":"ColumnDataSource","id":"8fedfab6f21e184f6222f647d2f2a1ce","attributes":{"id":"8fedfab6f21e184f6222f647d2f2a1ce","tags":[],"column_names":["x","y"],"selected":[],"data":{"x":[null,null],"y":[null,null]}}},{"type":"Circle","id":"5a0e69ddd6237592b6f3284edc61b42f","attributes":{"id":"5a0e69ddd6237592b6f3284edc61b42f","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#1F77B4"},"fill_color":{"units":"data","value":"#1F77B4"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Circle","id":"3c18e466e1f64b52632e84579229f001","attributes":{"id":"3c18e466e1f64b52632e84579229f001","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Circle","id":"70c96ae684712f7d64a188a31a4d8ea4","attributes":{"id":"70c96ae684712f7d64a188a31a4d8ea4","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"line_color":{"units":"data","value":"#1F77B4"},"fill_color":{"units":"data","value":"#1F77B4"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"6904c41a7e54c0f7051212f6f9c06c21","attributes":{"id":"6904c41a7e54c0f7051212f6f9c06c21","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"3c18e466e1f64b52632e84579229f001"},"hover_glyph":{"type":"Circle","id":"70c96ae684712f7d64a188a31a4d8ea4"},"name":null,"data_source":{"type":"ColumnDataSource","id":"8fedfab6f21e184f6222f647d2f2a1ce"},"glyph":{"type":"Circle","id":"5a0e69ddd6237592b6f3284edc61b42f"}}},{"type":"Square","id":"9482c67fdce256c209acf8dddab16db4","attributes":{"id":"9482c67fdce256c209acf8dddab16db4","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#FF7F0E"},"fill_color":{"units":"data","value":"#FF7F0E"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Square","id":"1bef2bdc6e1f91b0e86cc0b45c017306","attributes":{"id":"1bef2bdc6e1f91b0e86cc0b45c017306","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Square","id":"56fb24cd2edad967938bccae7b9d47ef","attributes":{"id":"56fb24cd2edad967938bccae7b9d47ef","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"line_color":{"units":"data","value":"#FF7F0E"},"fill_color":{"units":"data","value":"#FF7F0E"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"af629659bed146652ee3bf7347134167","attributes":{"id":"af629659bed146652ee3bf7347134167","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Square","id":"1bef2bdc6e1f91b0e86cc0b45c017306"},"hover_glyph":{"type":"Square","id":"56fb24cd2edad967938bccae7b9d47ef"},"name":null,"data_source":{"type":"ColumnDataSource","id":"8fedfab6f21e184f6222f647d2f2a1ce"},"glyph":{"type":"Square","id":"9482c67fdce256c209acf8dddab16db4"}}},{"type":"Triangle","id":"deb65801ed24478b0dce60ac5ddb785b","attributes":{"id":"deb65801ed24478b0dce60ac5ddb785b","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#2CA02C"},"fill_color":{"units":"data","value":"#2CA02C"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Triangle","id":"b69be5683a1bb93307d1fe948c44bac3","attributes":{"id":"b69be5683a1bb93307d1fe948c44bac3","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Triangle","id":"72108cd9615137434e08f52302f75c88","attributes":{"id":"72108cd9615137434e08f52302f75c88","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"line_color":{"units":"data","value":"#2CA02C"},"fill_color":{"units":"data","value":"#2CA02C"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"051d7b63d7c6e5d9c02f3d486cfc11db","attributes":{"id":"051d7b63d7c6e5d9c02f3d486cfc11db","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Triangle","id":"b69be5683a1bb93307d1fe948c44bac3"},"hover_glyph":{"type":"Triangle","id":"72108cd9615137434e08f52302f75c88"},"name":null,"data_source":{"type":"ColumnDataSource","id":"8fedfab6f21e184f6222f647d2f2a1ce"},"glyph":{"type":"Triangle","id":"deb65801ed24478b0dce60ac5ddb785b"}}},{"type":"Legend","id":"507d53111fdc8f139561edcfed91a2b4","attributes":{"id":"507d53111fdc8f139561edcfed91a2b4","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"legends":[["Species",[]],[" setosa",[{"type":"GlyphRenderer","id":"6904c41a7e54c0f7051212f6f9c06c21"}]],[" versicolor",[{"type":"GlyphRenderer","id":"af629659bed146652ee3bf7347134167"}]],[" virginica",[{"type":"GlyphRenderer","id":"051d7b63d7c6e5d9c02f3d486cfc11db"}]]],"location":"top_right"}},{"type":"Range1d","id":"99c49992c8bbd0c21588a9a755d0e4a2","attributes":{"id":"99c49992c8bbd0c21588a9a755d0e4a2","tags":[],"start":4.048,"end":8.152}},{"type":"Range1d","id":"ef687be57b7af12731a88706f7916454","attributes":{"id":"ef687be57b7af12731a88706f7916454","tags":[],"start":1.832,"end":4.568}},{"type":"LinearAxis","id":"3c36777a5d14b96a2906357b7b08c7c5","attributes":{"id":"3c36777a5d14b96a2906357b7b08c7c5","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"axis_label":"Sepal.Length","formatter":{"type":"BasicTickFormatter","id":"fa721a7b9157bdf213aa1c0b2e187125"},"ticker":{"type":"BasicTicker","id":"38f1d303635c91dfe938db138e6972b7"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"fa721a7b9157bdf213aa1c0b2e187125","attributes":{"id":"fa721a7b9157bdf213aa1c0b2e187125","tags":[]}},{"type":"BasicTicker","id":"38f1d303635c91dfe938db138e6972b7","attributes":{"id":"38f1d303635c91dfe938db138e6972b7","tags":[],"num_minor_ticks":5}},{"type":"Grid","id":"67431e627aeeb03fed3ef6604a85ddf5","attributes":{"id":"67431e627aeeb03fed3ef6604a85ddf5","tags":[],"dimension":0,"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"38f1d303635c91dfe938db138e6972b7"}}},{"type":"LinearAxis","id":"9bde1d9c5d65bac86b87ac213a86c430","attributes":{"id":"9bde1d9c5d65bac86b87ac213a86c430","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"axis_label":"Sepal.Width","formatter":{"type":"BasicTickFormatter","id":"70d327d96b4c8aa7a4ae9b6f25653fdc"},"ticker":{"type":"BasicTicker","id":"91b8529771d0b30c396adb5a95ec272e"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"70d327d96b4c8aa7a4ae9b6f25653fdc","attributes":{"id":"70d327d96b4c8aa7a4ae9b6f25653fdc","tags":[]}},{"type":"BasicTicker","id":"91b8529771d0b30c396adb5a95ec272e","attributes":{"id":"91b8529771d0b30c396adb5a95ec272e","tags":[],"num_minor_ticks":5}},{"type":"Grid","id":"7aa69cf6de78182ecb1b75a7293de170","attributes":{"id":"7aa69cf6de78182ecb1b75a7293de170","tags":[],"dimension":1,"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"91b8529771d0b30c396adb5a95ec272e"}}}]}}},"debug":false},"evals":[],"jsHooks":[]}</script>
</section><section id="leaflet" class="slide level2">
<h2>Leaflet</h2>
<p><a href="http://rstudio.github.io/leaflet/">Leaflet</a> is a really powerful JavaScript library for creating dynamic maps that support panning and zooming along with various annotations like markers, polygons, and popups.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw">library</span>(leaflet)</a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="kw">library</span>(ggmap)</a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="kw">geocode</span>(<span class="st">"Buffalo, NY"</span>, <span class="dt">source =</span> <span class="st">"dsk"</span>)</a></code></pre></div>
<pre><code>## lon lat
## 1 -78.88642 42.89606</code></pre>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1">m <-<span class="st"> </span><span class="kw">leaflet</span>() <span class="op">%>%</span><span class="st"> </span><span class="kw">setView</span>(<span class="dt">lng =</span> <span class="fl">-78.88642</span>, <span class="dt">lat =</span> <span class="fl">42.89606</span>, <span class="dt">zoom =</span> <span class="dv">12</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">addTiles</span>()</a></code></pre></div>
</section><section class="slide level2">
<div id="htmlwidget-aaa86cd3f0d846d49eaf" style="width:100%;height:500px;" class="widgetframe html-widget"></div>
<script type="application/json" data-for="htmlwidget-aaa86cd3f0d846d49eaf">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-5.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>
</section><section id="dygraphs" class="slide level2">
<h2>dygraphs</h2>
<p>Provides rich facilities for charting time-series data in R, including highly configurable series- and axis-display and interactive features like zoom/pan and series/point highlighting.</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw">library</span>(dygraphs)</a>
<a class="sourceLine" id="cb6-2" data-line-number="2">dy1=<span class="kw">dygraph</span>(nhtemp, <span class="dt">main =</span> <span class="st">"New Haven Temperatures"</span>,<span class="dt">height =</span> <span class="dv">75</span>) <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb6-3" data-line-number="3"><span class="st"> </span><span class="kw">dyRangeSelector</span>(<span class="dt">dateWindow =</span> <span class="kw">c</span>(<span class="st">"1920-01-01"</span>, <span class="st">"1960-01-01"</span>))</a></code></pre></div>
</section><section class="slide level2">
<div id="htmlwidget-8932b10be7a797c2d7af" style="width:100%;height:400px;" class="widgetframe html-widget"></div>
<script type="application/json" data-for="htmlwidget-8932b10be7a797c2d7af">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-7.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>
</section><section id="rthreejs" class="slide level2">
<h2>rthreejs</h2>
<p>Create interactive 3D scatter plots, network plots, and globes using the <a href="https://threejs.org">‘three.js’ visualization library</a>.</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="co">#devtools::install_github("bwlewis/rthreejs")</span></a>
<a class="sourceLine" id="cb7-2" data-line-number="2"><span class="kw">library</span>(threejs)</a>
<a class="sourceLine" id="cb7-3" data-line-number="3">z <-<span class="st"> </span><span class="kw">seq</span>(<span class="op">-</span><span class="dv">10</span>, <span class="dv">10</span>, <span class="fl">0.1</span>)</a>
<a class="sourceLine" id="cb7-4" data-line-number="4">x <-<span class="st"> </span><span class="kw">cos</span>(z)</a>
<a class="sourceLine" id="cb7-5" data-line-number="5">y <-<span class="st"> </span><span class="kw">sin</span>(z)</a>
<a class="sourceLine" id="cb7-6" data-line-number="6">js3=<span class="kw">scatterplot3js</span>(x, y, z, <span class="dt">color=</span><span class="kw">rainbow</span>(<span class="kw">length</span>(z)))</a></code></pre></div>
</section><section class="slide level2">
<div id="htmlwidget-d7c10ee5cdbbdcb30c2c" style="width:100%;height:500px;" class="widgetframe html-widget"></div>
<script type="application/json" data-for="htmlwidget-d7c10ee5cdbbdcb30c2c">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-9.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>
</section><section id="networkd3" class="slide level2">
<h2>networkD3</h2>
<p>Creates ‘D3’ ‘JavaScript’ network, tree, dendrogram, and Sankey graphs from ‘R’.</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="kw">library</span>(igraph)</a>
<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="kw">library</span>(networkD3)</a></code></pre></div>
</section><section id="load-example-network" class="slide level2">
<h2>Load example network</h2>
<p>This loads an example social network of friendships between 34 members of a karate club at a US university in the 1970s. See W. W. Zachary, An information flow model for conflict and fission in small groups, Journal of Anthropological Research 33, 452-473 (1977).</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1">karate <-<span class="st"> </span><span class="kw">make_graph</span>(<span class="st">"Zachary"</span>)</a>
<a class="sourceLine" id="cb9-2" data-line-number="2">wc <-<span class="st"> </span><span class="kw">cluster_walktrap</span>(karate)</a>
<a class="sourceLine" id="cb9-3" data-line-number="3">members <-<span class="st"> </span><span class="kw">membership</span>(wc)</a>
<a class="sourceLine" id="cb9-4" data-line-number="4"></a>
<a class="sourceLine" id="cb9-5" data-line-number="5"><span class="co"># Convert to object suitable for networkD3</span></a>
<a class="sourceLine" id="cb9-6" data-line-number="6">karate_d3 <-<span class="st"> </span><span class="kw">igraph_to_networkD3</span>(karate, <span class="dt">group =</span> members)</a>
<a class="sourceLine" id="cb9-7" data-line-number="7"></a>
<a class="sourceLine" id="cb9-8" data-line-number="8">n3d=<span class="kw">forceNetwork</span>(<span class="dt">Links =</span> karate_d3<span class="op">$</span>links, <span class="dt">Nodes =</span> karate_d3<span class="op">$</span>nodes,</a>
<a class="sourceLine" id="cb9-9" data-line-number="9"> <span class="dt">Source =</span> <span class="st">'source'</span>, <span class="dt">Target =</span> <span class="st">'target'</span>, <span class="dt">NodeID =</span> <span class="st">'name'</span>,</a>
<a class="sourceLine" id="cb9-10" data-line-number="10"> <span class="dt">Group =</span> <span class="st">'group'</span>)</a></code></pre></div>
</section><section id="force-directed-network-plot" class="slide level2">
<h2>Force directed network plot</h2>
<div id="htmlwidget-8777dfd4fd0f5d6dfa51" style="width:100%;height:500px;" class="widgetframe html-widget"></div>
<script type="application/json" data-for="htmlwidget-8777dfd4fd0f5d6dfa51">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-12.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>
</section><section id="sankey-network-graph" class="slide level2">
<h2>Sankey Network graph</h2>
<p>Sankey diagrams are flow diagrams in which the width of the arrows is shown proportionally to the flow quantity.</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="co"># Load energy projection data</span></a>
<a class="sourceLine" id="cb10-2" data-line-number="2"><span class="kw">library</span>(jsonlite)</a>
<a class="sourceLine" id="cb10-3" data-line-number="3">URL <-<span class="st"> </span><span class="kw">paste0</span>(</a>
<a class="sourceLine" id="cb10-4" data-line-number="4"> <span class="st">"https://cdn.rawgit.com/christophergandrud/networkD3/"</span>,</a>
<a class="sourceLine" id="cb10-5" data-line-number="5"> <span class="st">"master/JSONdata/energy.json"</span>)</a>
<a class="sourceLine" id="cb10-6" data-line-number="6">Energy <-<span class="st"> </span><span class="kw">fromJSON</span>(URL)</a>
<a class="sourceLine" id="cb10-7" data-line-number="7"></a>
<a class="sourceLine" id="cb10-8" data-line-number="8">sn1=<span class="kw">sankeyNetwork</span>(<span class="dt">Links =</span> Energy<span class="op">$</span>links, <span class="dt">Nodes =</span> Energy<span class="op">$</span>nodes, <span class="dt">Source =</span> <span class="st">"source"</span>,</a>
<a class="sourceLine" id="cb10-9" data-line-number="9"> <span class="dt">Target =</span> <span class="st">"target"</span>, <span class="dt">Value =</span> <span class="st">"value"</span>, <span class="dt">NodeID =</span> <span class="st">"name"</span>,</a>
<a class="sourceLine" id="cb10-10" data-line-number="10"> <span class="dt">units =</span> <span class="st">"TWh"</span>, <span class="dt">fontSize =</span> <span class="dv">12</span>, <span class="dt">nodeWidth =</span> <span class="dv">30</span>)</a></code></pre></div>
</section><section class="slide level2">
<div id="htmlwidget-21f742f48177738be446" style="width:100%;height:500px;" class="widgetframe html-widget"></div>
<script type="application/json" data-for="htmlwidget-21f742f48177738be446">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-14.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>
</section><section id="radial-network" class="slide level2">
<h2>Radial Network</h2>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1">URL <-<span class="st"> </span><span class="kw">paste0</span>(</a>
<a class="sourceLine" id="cb11-2" data-line-number="2"> <span class="st">"https://cdn.rawgit.com/christophergandrud/networkD3/"</span>,</a>
<a class="sourceLine" id="cb11-3" data-line-number="3"> <span class="st">"master/JSONdata//flare.json"</span>)</a>
<a class="sourceLine" id="cb11-4" data-line-number="4">## Convert to list format</a>
<a class="sourceLine" id="cb11-5" data-line-number="5">Flare <-<span class="st"> </span>jsonlite<span class="op">::</span><span class="kw">fromJSON</span>(URL, <span class="dt">simplifyDataFrame =</span> <span class="ot">FALSE</span>)</a>
<a class="sourceLine" id="cb11-6" data-line-number="6"><span class="co"># Use subset of data for more readable diagram</span></a>
<a class="sourceLine" id="cb11-7" data-line-number="7">Flare<span class="op">$</span>children =<span class="st"> </span>Flare<span class="op">$</span>children[<span class="dv">1</span><span class="op">:</span><span class="dv">3</span>]</a>
<a class="sourceLine" id="cb11-8" data-line-number="8"></a>
<a class="sourceLine" id="cb11-9" data-line-number="9">rn1=<span class="kw">radialNetwork</span>(<span class="dt">List =</span> Flare, <span class="dt">fontSize =</span> <span class="dv">10</span>, <span class="dt">opacity =</span> <span class="fl">0.9</span>, <span class="dt">height =</span> <span class="dv">400</span>, <span class="dt">width=</span><span class="dv">400</span>)</a></code></pre></div>
</section><section class="slide level2">
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1"><span class="kw">frameWidget</span>(rn1,<span class="dt">height =</span><span class="dv">500</span>)</a></code></pre></div>
<div id="htmlwidget-81d66915555c9bfb4c7b" style="width:100%;height:500px;" class="widgetframe html-widget"></div>
<script type="application/json" data-for="htmlwidget-81d66915555c9bfb4c7b">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-16.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>
</section><section id="diagonal-network" class="slide level2">
<h2>Diagonal Network</h2>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1">dn1=<span class="kw">diagonalNetwork</span>(<span class="dt">List =</span> Flare, <span class="dt">fontSize =</span> <span class="dv">10</span>, </a>
<a class="sourceLine" id="cb13-2" data-line-number="2"> <span class="dt">opacity =</span> <span class="fl">0.9</span>, <span class="dt">height =</span> <span class="dv">400</span>, <span class="dt">width=</span><span class="dv">400</span>)</a>
<a class="sourceLine" id="cb13-3" data-line-number="3"></a>
<a class="sourceLine" id="cb13-4" data-line-number="4"><span class="kw">frameWidget</span>(dn1,<span class="dt">height =</span><span class="dv">500</span>)</a></code></pre></div>
<div id="htmlwidget-06320bbbb31ef2214e9d" style="width:100%;height:500px;" class="widgetframe html-widget"></div>
<script type="application/json" data-for="htmlwidget-06320bbbb31ef2214e9d">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-17.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>
</section><section id="other-d3-visualizations" class="slide level2">
<h2>Other D3 Visualizations</h2>
<p><a href="https://github.com/d3/d3/wiki/Gallery" class="uri">https://github.com/d3/d3/wiki/Gallery</a> <img data-src="PS_12/D3_examples.png" /></p>
</section><section id="rglwidget" class="slide level2">
<h2>rglwidget</h2>
<p>RGL provides 3D interactive graphics, including functions modelled on base graphics (<code>plot3d()</code>, etc.) as well as functions for constructing representations of geometric objects (<code>cube3d()</code>, etc.). You may need to install <a href="https://www.xquartz.org/">XQuartz</a>.</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" data-line-number="1"><span class="kw">library</span>(rgl)</a>
<a class="sourceLine" id="cb14-2" data-line-number="2"><span class="kw">library</span>(htmltools)</a>
<a class="sourceLine" id="cb14-3" data-line-number="3"></a>
<a class="sourceLine" id="cb14-4" data-line-number="4">theta <-<span class="st"> </span><span class="kw">seq</span>(<span class="dv">0</span>, <span class="dv">6</span><span class="op">*</span>pi, <span class="dt">len=</span><span class="dv">100</span>)</a>
<a class="sourceLine" id="cb14-5" data-line-number="5">xyz <-<span class="st"> </span><span class="kw">cbind</span>(<span class="kw">sin</span>(theta), <span class="kw">cos</span>(theta), theta)</a>
<a class="sourceLine" id="cb14-6" data-line-number="6">lineid <-<span class="st"> </span><span class="kw">plot3d</span>(xyz, <span class="dt">type=</span><span class="st">"l"</span>, <span class="dt">alpha =</span> <span class="dv">1</span><span class="op">:</span><span class="dv">0</span>, </a>
<a class="sourceLine" id="cb14-7" data-line-number="7"> <span class="dt">lwd =</span> <span class="dv">5</span>, <span class="dt">col =</span> <span class="st">"blue"</span>)[<span class="st">"data"</span>]</a></code></pre></div>
</section><section id="animate-an-interactive-3d-process" class="slide level2">
<h2>Animate an interactive 3D process</h2>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" data-line-number="1">rg1=<span class="kw">browsable</span>(<span class="kw">tagList</span>(</a>
<a class="sourceLine" id="cb15-2" data-line-number="2"> <span class="kw">rglwidget</span>(<span class="dt">elementId =</span> <span class="st">"example"</span>, <span class="dt">width =</span> <span class="dv">800</span>, <span class="dt">height =</span> <span class="dv">600</span>,</a>
<a class="sourceLine" id="cb15-3" data-line-number="3"> <span class="dt">controllers =</span> <span class="st">"player"</span>),</a>
<a class="sourceLine" id="cb15-4" data-line-number="4"> <span class="kw">playwidget</span>(<span class="st">"example"</span>, </a>
<a class="sourceLine" id="cb15-5" data-line-number="5"> <span class="kw">ageControl</span>(<span class="dt">births =</span> theta, <span class="dt">ages =</span> <span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">0</span>, <span class="dv">1</span>),</a>
<a class="sourceLine" id="cb15-6" data-line-number="6"> <span class="dt">objids =</span> lineid, <span class="dt">alpha =</span> <span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">1</span>, <span class="dv">0</span>)),</a>
<a class="sourceLine" id="cb15-7" data-line-number="7"> <span class="dt">start =</span> <span class="dv">1</span>, <span class="dt">stop =</span> <span class="dv">6</span><span class="op">*</span>pi, <span class="dt">step =</span> <span class="fl">0.1</span>, </a>
<a class="sourceLine" id="cb15-8" data-line-number="8"> <span class="dt">rate =</span> <span class="dv">6</span>,<span class="dt">elementId =</span> <span class="st">"player"</span>)</a>
<a class="sourceLine" id="cb15-9" data-line-number="9">))<span class="op">%>%</span><span class="kw">save_html</span>(<span class="dt">file=</span><span class="st">"rgl.html"</span>)</a></code></pre></div>
</section><section class="slide level2">
<iframe class="embed-responsive-item" src="rgl.html" width="100%" height="700px" allowfullscreen>
</iframe>
</section></section>
<section><section id="final-projects" class="title-slide slide level1"><h1>Final Projects</h1></section><section id="interactive-elements" class="slide level2">
<h2>Interactive elements</h2>
<p>Consider embedding interactive elements in your site.</p>
</section></section>
</div>
</div>
<script src="externals/reveal.js-3.3.0.1/lib/js/head.min.js"></script>
<script src="externals/reveal.js-3.3.0.1/js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
// Display the page number of the current slide
slideNumber: true,
// Push each slide change to the browser history
history: true,
// Vertical centering of slides
center: false,
// Enable slide navigation via mouse wheel
mouseWheel: true,
// Opens links in an iframe preview overlay
previewLinks: true,
// Transition style
transition: 'zoom', // none/fade/slide/convex/concave/zoom
// Transition style for full page slide backgrounds
backgroundTransition: 'default', // none/fade/slide/convex/concave/zoom
// 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: '90%',
height: '100%',
// Factor of the display size that should remain empty around the content
margin: 0.1,
// Bounds for smallest/largest possible scale to apply to content
minScale: 1,
maxScale: 3,
chalkboard: {
},
keyboard: {
67: function() { RevealChalkboard.toggleNotesCanvas() }, // toggle notes canvas when 'c' is pressed
66: function() { RevealChalkboard.toggleChalkboard() }, // toggle chalkboard when 'b' is pressed
46: function() { RevealChalkboard.clear() }, // clear chalkboard when 'DEL' is pressed
8: function() { RevealChalkboard.reset() }, // reset chalkboard data on current slide when 'BACKSPACE' is pressed
68: function() { RevealChalkboard.download() }, // downlad recorded chalkboard drawing when 'd' is pressed
},
// Optional reveal.js plugins
dependencies: [
{ src: 'externals/reveal.js-3.3.0.1/plugin/zoom-js/zoom.js', async: true },
{ src: 'externals/reveal.js-3.3.0.1/plugin/chalkboard/chalkboard.js', async: true },
]
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
<script>
(function() {
if (window.jQuery) {
Reveal.addEventListener( 'slidechanged', function(event) {
window.jQuery(event.previousSlide).trigger('hidden');
window.jQuery(event.currentSlide).trigger('shown');
});
}
})();
</script>
</body>
</html>