-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
executable file
·734 lines (716 loc) · 35.6 KB
/
index.html
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
<html>
<head>
<title>The Shape of History</title>
<link href='https://fonts.googleapis.com/css?family=PT+Sans|PT+Sans+Narrow:400,700|Inconsolata' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.9.2/jquery.fullPage.css" />
<!-- jQuery-->
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/jquery.color.js"></script>
<!-- <script src="../dist/js/animsition.min.js"></script> -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="js/d3.min.js"></script>
<script src="js/two.min.js"></script>
<script src="js/newCode/helpers.js"></script>
<script src="js/newCode/evtEvtSet.js"></script>
<script src="js/newCode/compare.js"></script>
<script src="js/newCode/buildCorrector.js"></script>
<script src="js/newCode/grid.js"></script>
<script src="js/newCode/gridAccessories.js"></script>
<script src="js/navigator.js"></script>
<!-- animsition.js -->
<!-- <script src="../dist/js/animsition.min.js"></script> -->
</head>
<body onload="checkHash(window.location.hash)">
<div href="#myModal" class="constant burgerNav">
<div id="burg-0" class="capRow current"></div>
<div class="midRow">
<div id="burg-1" class="sqr"></div>
<div id="burg-2" class="sqr"></div>
<div id="burg-3" class="sqr"></div>
</div>
<div class="midRow">
<div id="burg-4" class="sqr"></div>
<div id="burg-5" class="sqr"></div>
<div id="burg-6" class="sqr"></div>
</div>
<div class="midRow">
<div id="burg-7" class="sqr"></div>
<div id="burg-8" class="sqr"></div>
<div id="burg-9" class="sqr"></div>
</div>
<div id="burg-10" class="capRow"></div>
</div>
<div class="navModal" id="myModal">
<div class="bigBurg">
<div id="nav-0" data-to="#splash"
class="capRow current modalRow capModalRow navigate">
<h4>The Shape of History</h4>
</div>
<div class="midRow modalRow">
<div data-to="#intro" id="nav-1" class="modalSqr navigate">
<h4>Introduction</h4>
</div>
<div data-to="#howitworks" id="nav-2" class="modalSqr navigate">
<h4>How it Works</h4>
</div>
<div data-to="#explore" id="nav-3" class="modalSqr navigate">
<h4>Explore</h4>
</div>
</div>
<div class="midRow modalRow">
<div data-to="#design" id="nav-4" class="modalSqr navigate">
<h4>Imagining Futures</h4>
</div>
<div data-to="#learn" id="nav-5" class="modalSqr navigate">
<h4>Learn</h4>
</div>
<div data-to="#interaction" id="nav-6" class="modalSqr navigate">
<h4>Updating Interaction</h4>
</div>
</div>
<div class="midRow modalRow">
<div data-to="#play" id="nav-7" class="modalSqr navigate">
<h4>Play</h4>
</div>
<div data-to="#data" id="nav-8" class="modalSqr navigate">
<h4>Shaping<br>History</h4>
</div>
<div data-to="#compare" id="nav-9" class="modalSqr navigate">
<h4>Compare</h4>
</div>
</div>
<div data-to="#creds" id="nav-10"
class="capRow modalRow capModalRow navigate">
<h4>Site Information</h4>
</div>
</div>
</div>
</div>
<div class="navrow vertical-scrolling">
<div id="splash" class="speculative_intro cell">
<div class="fullrow intro section centered">
<div id="title" class="container-fluid introban">
<h1>The Shape of History</h1>
<br>
<div class="col-md-8 col-md-offset-2">
<h3>Reimagining Elizabeth Palmer Peabody’s Historical Visualization Work</h3>
<p><center>Click the arrow below to begin.</center></p>
<p><center id="browser-notice"></center></p>
</div>
</div>
</div>
</div><!--close section intro-->
<div class="speculative_intro cell" id="splash1">
<div class="fullrow intro section centered"></div>
</div>
<div class="speculative_intro cell" id="splash2">
<div class="fullrow intro section centered"></div>
</div>
</div>
<!-- <section class="walkthrough">-->
<div class="navrow vertical-scrolling introduction">
<div class="cell narrative" id="intro">
<div class="container section centered">
<h2 class="head">Introduction</h2>
<br>
<div class = "cell">
<div class="col-md-6">
<p>As media viewers today, accustomed to the charts and graphs of Microsoft Excel, or to the interactive features on <i>The New York Times</i> frontpage, we tend to think that visualizations of data should be clear and intuitive, and yield immediate insight—or, alternately, we look to visualization techniques to help us make sense of the underlying data.</p>
<br>
<p>But what would it mean if we took a different view of what visualization could do? What would it mean if a visualization was designed to be difficult and abstract? If it was intended to send us back to the original source of the data in order to make sense of the image we encountered? What if the goal of visualization was to allow each person, individually, to interpret the image for herself?
</p>
<br>
<p>This was the aim of Elizabeth Palmer Peabody, the nineteenth-century writer, editor, and educator. Inspired by a system developed in Poland earlier in the century, she devised a method of translating historical events into shape and color. In her textbook, she explained her desire to appeal to the "mind’s eye" so that each student could create a personal account of the past.</p>
<p><center>Click the arrow at right to continue.</center></p>
</div>
</div>
</div>
</div><!--close history-->
<div class="explanation cell" id="howitworks">
<div class="container section">
<h2 class="head">How it Works</h2>
<h3 id="h3_howitworks" class="subhead">Click the chart to begin.</h3>
<div class="clickThru"></div>
</div>
</div>
<div id="explore" class="cell">
<div class='section contain'>
<h2 class="head">Explore</h2>
<h3 class="subhead">Mouse over each event to see its position on the grid.</h3>
<div class="flexy">
<div id="mainExplore" style="flex:1;"></div>
<div class="accessories">
<div class="dropdown">
<div class="dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<h4 class="drop">
<span class="currentDataSet">1. Table of the Sixteenth Century</span>
<span class="caret"></span>
</h4>
</div>
<ul class="dropdown-menu data-picker" aria-labelledby="dropdownMenu1">
<li><a data-index="0" data-parent="#explore">1. Table of the Sixteenth Century</a></li>
<li><a data-index="1" data-parent="#explore">2. Table of the Seventeenth Century</a></li>
<li><a data-index="2" data-parent="#explore">3. Table of the Eighteenth Century</a></li>
<li><a data-index="3" data-parent="#explore">4. Table of the Nineteenth Century</a></li>
<li><a data-index="4" data-parent="#explore">5. Table of Women's History</a></li>
<li><a data-index="5" data-parent="#explore">6. 100 Days before the 2016 Election</a></li>
</ul>
</div>
<ol id="exploreList" class="eList interactive spec-scroll"></ol>
<h4 class="sidetitle">Palette</h4>
<div id="explorePallete" class="pallete"></div>
<h4 class="sidetitle">Event Key</h4>
<div id="exploreKey" class="key interactive "></div>
</div>
</div>
</div>
</div><!--close view-->
</div>
<div class="navrow vertical-scrolling">
<div class="cell narrative" id="design">
<div class="container section centered">
<h2 class="head">Imagining Futures</h2>
<br>
<div class = "cell">
<div class="col-md-6">
<p>Then, as now, the process of converting text to image was very hard to do. But for Peabody, the difficulty of the process was part of the point. She devised her method at a time of great national crisis—the decade leading up to the Civil War—and she recognized that the nation’s problems would be difficult to resolve. She hoped that by prompting her students to create new narratives of the past, they would also imagine new possible futures.</p>
<br>
<p>Some of her students rose to the challenge, but archival evidence suggests that others resisted the exercise, choosing instead to create patterns that bore no relation to the text. Indeed, it is difficult to resist the desire to employ Peabody's grid as a Modernist canvas, appealing to the imagination through color and form.</p>
<br>
<p>In this way, we see the uses and limits of Peabody’s charts. While they may or may not have prompted a range of interpretations of history, they are most useful today for how they affirm the role of pleasure and the senses, as well as of the individual viewer, in the process of knowledge production.</p>
</div>
</div>
</div><!--close design-->
</div>
<div id="learn" class="cell interactive">
<div class='section contain'>
<h2 class="head">Learn</h2>
<h3 class="subhead">Click on the color of each event, then plot it on the grid.</h3>
<div class="flexy">
<div id="mainLearn"></div>
<div class="accessories">
<div class="dropdown">
<div class="dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<h4 class="drop">
<span class="currentDataSet">1. Table of the Sixteenth Century</span>
<span class="caret"></span>
</h4>
</div>
<ul class="dropdown-menu data-picker" aria-labelledby="dropdownMenu1">
<li><a data-index="0" data-parent="#learn">1. Table of the Sixteenth Century</a></li>
<li><a data-index="1" data-parent="#learn">1. Table of the Seventeenth Century</a></li>
<li><a data-index="2" data-parent="#learn">1. Table of the Eighteenth Century</a></li>
<li><a data-index="3" data-parent="#learn">2. Table of the Nineteenth Century</a></li>
<li><a data-index="4" data-parent="#learn">5. Table of Women's History</a></li>
<li><a data-index="5" data-parent="#learn">6. 100 Days before the 2016 Election</a></li>
</ul>
</div>
<div id="buildList" class="spec-scroll">
<div id="infoNavArea">
<div class="info">
<div id="currentYr">1501.</div>
<div id="currentBuildEvent" class = "spec-scroll">Henry VII. grants patent for colonizing America. </div>
</div>
<div id="eventsNavigation">
<div>
<span id="previous" class="glyphicon glyphicon-chevron-left nextPrevButtons" aria-hidden="true"></span>
<span id="eventCounter">1</span>
<span id="next" class="glyphicon glyphicon-chevron-right nextPrevButtons" aria-hidden="true"></span>
</div>
</div>
</div>
<div id="correctionArea">
<img class="corIncor" id="correct" width="21px" height="21px" src="img/checkx-check.png" alt="correct" hidden/>
<img class="corIncor" id="incorrect" width="21px" height="21px" src="img/checkx-x.png" alt="incorrect" hidden/>
<span class="corIncor" id="na" width="21px" height="21px"></span>
<a id='show-hide'>Show me</a>
</div>
</div>
<h4 class="sidetitle">Palette</h4>
<div id="learnPallete" class="pallete"></div>
<h4 class="sidetitle">Event Key</h4>
<div id="learnKey" class="key"></div>
</div>
</div>
</div>
</div>
<div class="cell narrative" id="interaction">
<div class="container section centered">
<h2 class="head">Updating Interaction</h2>
<br>
<div class = "cell">
<div class="col-md-6">
<p>Elizabeth Peabody intended her images to be interactive. Along with her history textbook, Peabody sold workbooks of blank charts for student use. She envisioned the exercise as one in which each student would not merely study, but actually create his or her own chart of history.</p>
<br>
<p>In Peabody’s era, this process involved cross-referencing between textbook and workbook— first identifying the type of event and its actors, and then coloring in the corresponding location on the chart. Updating this interaction for the web, we find easy analogues to the original exercise; a color palette presents the six possible colors, and a simple click places the color on the grid.</p>
<br>
<p>But more complex is Peabody’s own sense of how her charts produce knowledge. By emphasizing interaction, she places the source of knowledge in the interplay between viewer, text, and image. Her hope was that, through the act of converting historical account to abstract image and back again, each student would create his or her own narrative of historical change.</p>
</div>
</div>
</div><!--close interaction-->
</div>
</div>
<div class="navrow vertical-scrolling">
<div id="play" class="cell interactive">
<div class='section contain'>
<h2 class="head">Play</h2>
<h3 class="subhead">Click to add your own events to the grid.</h3>
<div class="flexy">
<div id="mainPlay"></div>
<div class="accessories">
<input class="sidetitle editable head4" type="text" value="Title"></input>
<textarea id="playEvents" class="editable spec-scroll" placeholder="Type or paste events here."></textarea>
<h4 class="sidetitle">Palette</h4>
<div id="playPallete" class="pallete"></div>
<h4 class="sidetitle">Event Key</h4>
<div id="playKey" class="key"></div>
</div>
</div>
</div>
</div>
<div id="data" class="cell narrative">
<div class="container section centered">
<h2 class="head">Shaping History</h2>
<br>
<div class = "cell">
<div class="col-md-6">
<p>
The unfamiliarity of Peabody’s grid is striking in
contrast to the familiar form of the timeline. The same
history, depicted in timeline form, assumes a comforting
legibility: the unfolding of past to present, steadily
punctuated by significant events.
</p>
<br>
<p>
The conversion from grid to timeline is made possible because
of Peabody’s own sense of history as a form of data. Although
not described as such, Peabody’s atomizing of history into a
series of events, each defined by its actors and type, eases
the translation of historical event into data object. Once stored as data, this history can be visually represented
in any number of different ways.
</p>
<br>
<p>Comparing these representations. we become alerted to how the representation of data truly matters. We learn how each visual form reflects a particular sense of the historical record. We also recognize the role of the designer, as well as those who create and clean the data, in shaping the interpretation of history that we see.</p>
</div>
</div>
</div><!--close data-->
</div>
<div id="compare" class="cell interactive">
<div class="section contain">
<h2 class="head">Compare</h2>
<h3 class="subhead">Mouse over any event to compare representations.</h3>
<div id="timeline"></div>
<div class="flexy">
<div class="accessories left-acc">
<h4 class="sidetitle">CSV Data</h4>
<ol id="csv" class="eList spec-scroll"></ol>
</div>
<div id="mainComp"></div>
<div class="accessories right-acc">
<div class="dropdown">
<div class="dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<h4 class="drop">
<span class="currentDataSet">1. Table of the Sixteenth Century</span>
<span class="caret"></span>
</h4>
</div>
<ul class="dropdown-menu data-picker" aria-labelledby="dropdownMenu1">
<li><a data-index="0" data-parent="#compare">1. Table of the Sixteenth Century</a></li>
<li><a data-index="1" data-parent="#compare">2. Table of the Seventeenth Century</a></li>
<li><a data-index="2" data-parent="#compare">3. Table of the Eighteenth Century</a></li>
<li><a data-index="3" data-parent="#compare">4. Table of the Nineteenth Century</a></li>
<li><a data-index="4" data-parent="#compare">5. Table of Women's History</a></li>
<li><a data-index="5" data-parent="#compare">6. 100 Days before the 2016 Election</a></li>
</ul>
</div>
<ol id="compEvtList" class="eList spec-scroll"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="navrow vertical-scrolling" id = "credits">
<div class="section cell narrative" id="creds">
<div class="container section centered">
<h2 class="head">Credits</h2>
<br>
<div class="cell">
<div class="col-md-6">
<p>"The Shape of History" was conceived by <a href="http://lklein.com/">Lauren Klein</a> as part of a larger project on the history of data visualization. The site was designed and prototyped in Spring 2016 by Lauren Klein, <a href="https://www.carolinerfoster.com/">Caroline Foster</a>, and <a href="http://ericapramer.weebly.com/">Erica Pramer</a>. <a href="http://adamhayward.me">Adam Hayward</a> and <a href="http://www.shivaninegi.com/">Shivani Negi</a> joined the team in Fall 2016, and worked with Lauren and Caroline to implement the version of the site that you see.</p>
<p>Fellowships from the <a href="http://www.americanantiquarian.org/">American Antiquarian Society</a> and the <a href="http://www.librarycompany.org/">Library Company of Philadelphia</a> supported the initial archival research for this project. </p>
<p><center>A project of the Georgia Tech <a href="http://dhlab.lmc.gatech.edu/">Digital Humanities Lab</a>.</center></p>
</div>
</div>
</div>
</div>
<div class="section cell narrative" id="aboutSite">
<div class="container section centered">
<h2 class="head">About the Site</h2>
<br>
<div class="cell">
<div class="col-md-6">
<p>"The Shape of History" was built using HTML5, CSS, and JavaScript, and makes use of several open-source libraries including
<a href="https://jquery.com/">jQuery</a>, <a href="http://getbootstrap.com/">Bootstrap</a>,
<a href="https://d3js.org/">D3.js</a>, and <a href="https://two.js.org/">two.js</a>. Our code is available on
<a href="https://github.com/GeorgiaTechDHLab/speculative">GitHub</a>. Please contact Lauren Klein, <a href="mailto:[email protected]">[email protected]</a>, with any additional questions or comments.</p>
<p><center>A project of the Georgia Tech <a href="http://dhlab.lmc.gatech.edu/">Digital Humanities Lab</a>.</center></p>
</div>
</div>
</div>
</div>
<div class="section cell narrative" id="reading">
<div class="container section centered">
<h2 class="head">Further Reading</h2>
<br>
<div class="cell">
<div class="col-md-6">
<p>For updates on the project, including information about our interactive full-scale recreation of Peabody’s floor charts, please consult the DH Lab <a href="http://dhlab.lmc.gatech.edu/category/peabodyvis/">research blog</a>. You can read more about the historical and theoretical framing for the project <a href="http://lklein.com/2017/01/feminist-data-visualization-or-the-shape-of-history/">here</a>. Some additional writing about Elizabeth Peabody’s visualization scheme is available <a href="http://lklein.com/2014/12/visualization-as-argument/">here</a> and <a href="https://medium.com/genres-of-scholarly-knowledge-production/visualization-as-argument-and-on-the-floor-736bb8859cf#.i12y3ke85">here</a>. (Other publications, as well as a detailed bibliography, are in press). </p>
<p>In addition, Bruce Rhonda’s <a href="http://www.hup.harvard.edu/catalog.php?isbn=9780674246959">
Elizabeth Palmer Peabody: A Reformer on Her Own Terms</a> (Harvard University Press, 1999) offers a thorough biography of
the subject. Daniel Rosenberg and Anthony Grafton’s
<a href="https://www.papress.com/html/book.details.page.tpl?isbn=9781568987637">
Cartographies of Time: A History of the Timeline
</a>
(Princeton Architectural Press, 2010) presents a dazzling survey of the range of visual representations of history, including a substantial section on Peabody. Peabody's original textbook, <a href="https://archive.org/details/chronologicalhis00peab">A Chronological History of the United States</a> (1856), can be found on archive.org.</p>
<p><center>A project of the Georgia Tech <a href="http://dhlab.lmc.gatech.edu/">Digital Humanities Lab</a>.</center></p>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(".burgerNav").click(function(e){
$('#myModal').show();
});
$("#myModal").on('click',
function(e){
$("#myModal").hide();
});
$(".navigate").click(function(e){
$('#myModal').hide();
navigate(e.currentTarget);
})
function toggle(){
$('#myModal').show();
}
recommendBrowser();
</script>
<script>
var peabody = new EventSet();
var soh16 = new EventSet();
var soh17 = new EventSet();
var soh18 = new EventSet();
var sohWomen = new EventSet([
"Reproduction",
"Right to Vote",
"Workforce",
"Legal Issues",
"Domestic Life",
"Education",
"Harassment",
"Military",
"Discrimination"
], 16);
var sohElection = new EventSet([
"Announcements",
"Controversy",
"Projections",
"Debates"
]);
var compareGrid=new Grid("mainComp",.6,0,345),
compEvtList=new List("compEvtList"),
compDataList=new List("csv",true)
timeline= new Timeline(),
compareVisualizations=[compareGrid,compEvtList,compDataList,timeline];
var learnGrid=new Grid("mainLearn",.87,1,500),
learnPallete=new Pallete("learnPallete"),
learnCorrector=null,
learnKey=new EventKey(100,"learnKey"),
learnVisualizations=[learnGrid,learnPallete, learnKey];
var playGrid=new Grid("mainPlay",.87,2,500),
playPallete=new Pallete("playPallete",true),
playKey=new EventKey(100,"playKey",true),
playCorrector=null;
playVisualizations=[playGrid,playKey];
var exploreGrid=new Grid("mainExplore",.87,0,500),
exploreList=new List("exploreList"),
exploreKey=new EventKey(100,"exploreKey"),
explorePallete=new Pallete("explorePallete",false,false),
exploreVisualizations=[exploreGrid,exploreList,exploreKey,explorePallete];
var visualizations=compareVisualizations.concat(learnVisualizations)
.concat(playVisualizations).concat(exploreVisualizations);
var dataSets=[peabody, soh16, soh17, soh18, sohWomen, sohElection];
// start handles all loading for events.
function start(){
console.log("Loading data 1/" + dataSets.length);
peabody.loadFromCSV("SoH1500.csv", loadSoh16);
}
function loadSoh16(){
console.log("Loading data 2/" + dataSets.length);
soh16.loadFromCSV("SoH1600.csv",loadSoh17);
}
function loadSoh17(){
console.log("Loading data 3/" + dataSets.length);
soh17.loadFromCSV("SoH1700.csv",loadSoh18);
}
function loadSoh18(){
console.log("Loading data 4/" + dataSets.length);
soh18.loadFromCSV("SoH1800.csv",loadSohWomen);
}
function loadSohWomen(){
console.log("Loading data 5/" + dataSets.length);
sohWomen.loadFromCSV("SoHWomen.csv",loadSohElection);
}
function loadSohElection(){
console.log("Loading data 6/" + dataSets.length);
sohElection.loadFromCSV("SoHElection.csv",main);
}
function main(){
learnCorrector=new BuildCorrector(peabody);
playCorrector =new BuildCorrector(peabody);
learnVisualizations.push(learnCorrector);
playVisualizations.push(playCorrector);
sortAllByYear(dataSets);
loadAllWithEventSet(visualizations,peabody);
playPallete.initEmpty([
['rgb(141, 43, 29)','Enter Label'],
['rgb(50, 91, 103)','Enter Label'],
['rgb(69, 136, 103)','Enter Label'],
['#9CB23E ','Enter Label'],
['#74436C','Enter Label'],
['#BF602E','Enter Label']
]);
drawAll(visualizations);
playPallete.draw();
learnGrid.initBuild(learnPallete,learnCorrector);
playGrid.initBuild(playPallete,playCorrector);
$("#timeline>svg").width($("#timeline").innerWidth());
}
start();
$("#compare").on("mouseover","path, rect, li",function(e){
if (e.currentTarget.getAttribute('data-date')==undefined){
if(e.currentTarget.parentNode.getAttribute('data-date')==undefined){
return;
}
var el=e.currentTarget.parentNode;
}else{
var el=e.currentTarget;
}
highlight(el,compareVisualizations);
});
$("#compare").on("mouseout","path, rect, li",function(e){
if (e.currentTarget.getAttribute('data-date')==undefined){
if(e.currentTarget.parentNode.getAttribute('data-date')==undefined){
return;
}
var el=e.currentTarget.parentNode;
}else{
var el=e.currentTarget;
}
unhighlight(el,compareVisualizations);
});
$("#explore").on("mouseover","path, rect, li",function(e){
if (e.currentTarget.getAttribute('data-date')==undefined){
if(e.currentTarget.parentNode.getAttribute('data-date')==undefined){
return;
}
var el=e.currentTarget.parentNode;
}else{
var el=e.currentTarget;
}
highlight(el,exploreVisualizations);
});
$("#explore").on("mouseout","path, rect, li",function(e){
if (e.currentTarget.getAttribute('data-date')==undefined){
if(e.currentTarget.parentNode.getAttribute('data-date')==undefined){
return;
}
var el=e.currentTarget.parentNode;
}else{
var el=e.currentTarget;
}
unhighlight(el,exploreVisualizations);
});
$("#mainComp").on("click","path",function(e){
compareGrid.clickHandle(e);
});
$(".data-picker").on("click","a",function(e){
changeSet(e,e.currentTarget.dataset.parent)
});
function changeSet(e, parent) {
console.log(e);
var ind = e.currentTarget.dataset.index;
if (ind < dataSets.length) {
var newSet = dataSets[ind];
} else {
return;
}
reload(compareVisualizations,newSet);
reload(learnVisualizations,newSet);
learnGrid.corrector=new BuildCorrector(newSet);
learnCorrector=learnGrid.corrector;
learnCorrector.update();
learnVisualizations[2]=learnCorrector;
playGrid.corrector=new BuildCorrector(newSet);
playCorrector=playGrid.corrector;
playCorrector.update();
playVisualizations[2]=playCorrector;
reload(exploreVisualizations,newSet);
$(".currentDataSet").html(e.currentTarget.innerHTML);
}
$("#mainLearn").on("mouseover","path",function(e){
learnGrid.hoverHandle(e,true);
});
$("#mainLearn").on("mouseout","path",function(e){
learnGrid.hoverHandle(e,false);
});
$("#mainLearn").on("click","path",function(e){
learnGrid.clickHandle(e);
});
$("#mainPlay").on("mouseover","path",function(e){
playGrid.hoverHandle(e,true);
});
$("#mainPlay").on("mouseout","path",function(e){
playGrid.hoverHandle(e,false);
});
$("#mainPlay").on("click","path",function(e){
playGrid.clickHandle(e);
});
$("#next").click(function(e){
learnCorrector.loadNext();
});
$("#previous").click(function(e){
learnCorrector.loadPrev();
});
$("#learnPallete").on("mousedown",".palleteSquare:not(.disabled)",function(e){
learnPallete.selectColor(e.currentTarget);
});
$("#show-hide").on("click",function(e){
learnGrid.showAnswer();
});
$("#play").on("mousedown",".palleteSquare:not(.disabled)",function(e){
playPallete.selectColor(e.currentTarget);
});
$("#play").on("dblclick",".palleteSquare:not(.disabled)",function(e){
playPallete.changeColor(e.currentTarget);
});
$("#play").on("dblclick",".palleteSquare",function(e){
e.currentTarget.children[0].disabled=false;
$(e.currentTarget.children[0]).trigger("click");
});
$("#play").on("change",".secretColor",function(e){
e.currentTarget.parentNode.style.backgroundColor=e.currentTarget.value;
playPallete.currentColor=e.currentTarget.value;
e.currentTarget.disabled=true;
});
$("#play").on("focusout",".secretColor",function(e){
e.currentTarget.parentNode.style.backgroundColor=e.currentTarget.value;
playPallete.currentColor=e.currentTarget.value;
e.currentTarget.disabled=true;
});
$(".suggested").on("click",function(e){
e.currentTarget.innerHTML="";
});
$(document).on("keydown",function(e){
if(e.keyCode==38){//up
e.preventDefault();
//nothing yet
}else if(e.keyCode==40){//dn
e.preventDefault();
//nothing yet
}else if (e.keyCode==39){//rt
e.preventDefault();
//nothing yet
}else if(e.keyCode==37){//lft
e.preventDefault();
//nothing yet
}
});
</script>
<script>
function hide(target){
document.getElementById(target).style.display = 'none';
}
imageTitle="img/howitworks/HIW";
current=0;
$(".clickThru").css("background-image","url('"+imageTitle+current+".png')");
$(".clickThru").on("click",function(e){
current++;
if(current>8){
current=0
}
e.target.style.backgroundImage="url('"+imageTitle+current+".png')";
});
var h= window.innerHeight;
var gline="gridline";
var currentPos=[0,0];
var gridlines=[["-l","-v"],["-r","-v"],["-t","-h"],["-b","-h"]];
var suggestions=[
[3] ,[3] ,[3],
[1,2,3],[1,0,2,3],[3,0,2],
[3,1,2],[0,1,2,3],[0,2,3],
[1,2,3],[1,0,2,3],[3,0,2],
[1,2] ,[0,1,2] ,[0,2]
];
// 0- left | 1- right | 2- up | 3- down
var dataTos=[
['#intro'],['#howitworks'],['#explore'],
['#howitworks','#splash','#design'], // $ intro
['#explore','#intro','#splash1','#learn'], // $ howitworks
['#interaction','#howitworks','#splash2'], // $ explore
['#play','#learn','#intro'], // design
['#design','#interaction','#howitworks','#data'], // learn
['#learn','#explore','#compare'], // $ interaction
['#data','#design','#creds'],//play
['#compare','#play','#learn','#aboutSite'],//data
['#reading','#data','#interaction'],//compare
['#aboutSite','#play'],['#creds','#reading','#data'],['#aboutSite','#compare']
];
$(".navrow>.cell").css("height", h+"px");
var cells=$(".navrow>.cell");
for( var i=0;i<15;i++){
var direction=null;
var f=true;
for(var j in suggestions[i]){
var dTo=dataTos[i][j];
if(f){
f = !f;
suggested="suggested";
}else{
suggested="";
}
if(suggestions[i][j]==0){
direction="left";
}else if (suggestions[i][j]==1){
direction="right";
}else if (suggestions[i][j]==2) {
direction="up";
}else{
direction="down";
}
$(cells[i]).append("<div data-to='"+dTo+"' class='"+suggested+" "+gline+" "+gline+gridlines[suggestions[i][j]][0]+" "+
gline+gridlines[suggestions[i][j]][1]+"'><span class='glyphicon glyphicon-chevron-"+
direction+"'></span></div>"
);
if(gline=="gridline suggested"){
gline="gridline";
}
}
}
$(".navrow>.cell>*:not(.gridline)").css("height", "100%")
$(".cell").on("click",".gridline", function(e){
navigate(e.currentTarget)
});
if (window.location.hash == "") {
setTimeout(function() {window.scrollTo(0, 0);},1);
} else {
setTimeout(function() {navigateById(window.location.hash)},1);
}
</script>
</body>
</html>