-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
1335 lines (1139 loc) · 57.4 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
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<head>
<title>Telling stories with data</title>
<script src="d3.min.js"></script>
<script type='text/javascript' src='jquery211.min.js'></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<style type='text/css'>
@font-face{
font-family: "BentonSans";
src: url("http://s1.ft-static.com/m/font/ft-velcro/bentonsans-regular.eot");
src: url("http://s1.ft-static.com/m/font/ft-velcro/bentonsans-regular.eot?#iefix") format("embedded-opentype"),
url("http://interactivegraphics.ft-static.com/inc/fonts/BentonSansRegular.woff") format("woff"),
url("http://interactivegraphics.ft-static.com/inc/fonts/BentonSansRegular.ttf") format("truetype");
font-style: normal;
font-weight: normal;
}
@font-face{
font-family: "BentonSans";
src: url("http://s1.ft-static.com/m/font/ft-velcro/bentonsans-bold.eot");
src: url("http://s1.ft-static.com/m/font/ft-velcro/bentonsans-bold.eot?#iefix") format("embedded-opentype"),
url("http://interactivegraphics.ft-static.com/inc/fonts/BentonSansBold.woff") format("woff"),
url("http://interactivegraphics.ft-static.com/inc/fonts/BentonSansBold.ttf") format("truetype");
font-style: normal;
font-weight: bold;
}
@font-face{
font-family: "MillerDisplay";
src: url('http://interactivegraphics.ft-static.com/inc/fonts/MillerDisplay-Roman.eot');
src: url('http://interactivegraphics.ft-static.com/inc/fonts/MillerDisplay-Roman.eot?#iefix') format('embedded-opentype'),
url("http://interactivegraphics.ft-static.com/inc/fonts/MillerDisplay-Roman.woff") format("woff"),
url("http://interactivegraphics.ft-static.com/inc/fonts/MillerDisplay-Roman.ttf") format("truetype");
font-style: normal;
font-weight: normal;
}
@font-face{
font-family: "Clarion";
src: url("http://interactivegraphics.ft-static.com/inc/fonts/Clarion.woff") format("woff"),
url("http://interactivegraphics.ft-static.com/inc/fonts/Clarion.ttf") format("truetype");
font-style: normal;
font-weight: normal;
}
text{font-family:"BentonSans",sans-serif;cursor:default;}
a{color:#43423e;margin-right:0px;text-decoration:none;background-color:#fff1e0;padding:4px 8px;border-radius:3px;font-family:"BentonSans",sans-serif;height:20px;line-height:19px;transition: background-color 0.3s, color 0.3s;}
#credits a{color:#2e6e9e;position:relative;margin-right:0px;text-decoration:none;none;background-color:#fff1e0;padding:0px;border-radius:0px;font-size:11px;font-weight:normal;}
div#credits{position:relative;top:650px;margin-left:auto;margin-right:auto;width:972px;z-index:1000}
#credits span{font-size:11px;font-weight:bold;}
#credits span#author{position:relative;left:16px;}
#credits span#inspiredby{position:relative;left:32px;font-weight:normal;}
#credits span#maps{position:relative;left:8px;}
span{color:#43423e;font-family:"BentonSans",sans-serif;cursor:default;}
a:hover{background-color:#74736c;color:#fff1e0;}
#credits a:hover{background-color:none;color:#000;}
#credits a.ftr:hover{background-color:none;color:#43423e;}
#credits a.ftr{color:#43423e;}
.axis path,
.axis line{fill:none;stroke:#a7a59b;shape-rendering:crispEdges;}
.axis text{font-family:"BentonSans"sans-serif;font-size: 12px;fill:#43423e;}
text.fixtures{font-size:18px;fill:#d7706c;}
path.selected{stroke:#4e86b6;}
text.namelabel{cursor:default;}
.scattertext{pointer-events:none;}
.scatterhovertext{pointer-events:none;}
.servetext{pointer-events:none;}
.returntext{pointer-events:none;}
.scattercircle{cursor:pointer;}
.scattercircle:hover{stroke-width:2px;}
.goalspath{stroke-width:1px;stroke:#b8b1a9;fill:none;stroke-opacity:0.5;}
.goalspath.keyplayer{stroke-width:2px;stroke:#76acb8;stroke-opacity:1;}
.goalspath.keyplayer.hovered{stroke-width:3px;}
.goalspath.hovered{stroke:#af516c;stroke-opacity:1;stroke-width:2px;}
.goalscircle{fill:#b8b1a9;fill-opacity:0.5;}
.goalscircle.keyplayer{fill:#76acb8;fill-opacity:1;stroke:#76acb8;}
.goalscircle.hovered{fill:#af516c;fill-opacity:1;stroke:#af516c;}
.goalscircle.keyplayer.hovered{fill:#af516c;fill-opacity:1;stroke:#af516c;stroke-width:2px;}
.goalspathblank{stroke:transparent;stroke-width:8px;fill:none;}
.hovertext{font-size:10px;fill:transparent;pointer-events:none;}
.hovertext.keyplayer{fill:#43423e;}
.hovertext.hovered{fill:#43423e;}
.hovertext.keyplayer.hovered{font-weight:bold;}
#ft-header {
height: 50px;
background-color: #FFF9F1;
width: 100%;
position: fixed;
top: 0;
z-index: 50;
overflow: hidden;
text-align: center;
border-bottom: 1px solid #cec6b9;
box-shadow: 0 2px 2px 0 rgba(0,0,0,.1);
}
#ft-header a{background-color:#fff9f1;}
#ft-header a>img {
margin-top: 13px;
opacity: .8;
transition: opacity .3s;
}
h1 {
text-align: center;
margin: 70px auto auto;
font-family: MillerDisplay,Clarion,Georgia,serif;
font-weight: 400;
font-size: 3em;
}
h1 {
display: block;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;
}
#captiondiv span {
font-family: Clarion,Georgia,serif;
font-size: 0.9em;
line-height: 1.5em;
color: #43423e;
margin-top: 1em;
}
#captiondiv a {
font-family: Clarion,Georgia,serif;
font-size: 0.9em;
line-height: 1.5em;
margin-top: 1em;
}
a.clickselected{background-color:#74736c;color:#fff1e0;}
a#captionlink{color:#2e6e9e;padding:0px;border-radius:0px;font-weight:normal;background-color:transparent;}
a#captionlink:hover{background-color:none;color:#000;}
.slidetitle{text-anchor:middle;font-size:56px;font-family:"BentonSans";font-weight:bold;}
.slideheader{font-size:56px;font-family:"BentonSans";font-weight:bold;}
.mydetails{text-anchor:middle;font-size:36px;font-family:"BentonSans";}
.mydetails2{text-anchor:middle;font-size:24px;font-family:"BentonSans";}
.anyqs{text-anchor:middle;font-size:48px;font-family:"BentonSans";}
.keypoint.hed{fill:#74736c;font-weight:bold;font-size:24px;}
.keypoint.sub{fill:#434234;font-size:22px;}
.keypoint.sub2{fill:#434234;font-size:22px;}
#chart{width:1572px;background-color:#fff1e0;opacity:0.2;}
.tick text{opacity:0;}
.projectcircle{opacity:0;}
.projects{fill:#b8b1a9;}
.Maps,.Animated,.Placemarkers,.Interactive{fill:#3C5F5E;}
.Charts,.Calculators,.Dashboards,.Narrative,.Nonstandard{fill:#9e2f50;}
.videos{fill:#76acb8;}
.Statistical{fill:#d7706c;}
.projecttext{fill:#74736c;opacity:0;}
.newcircle{opacity:0;}
.newcircle.inner{fill:#d7706c;}
.newcircle.mid{fill:#76acb8;}
.newcircle.outer{fill:#9e2f50;}
body{background-color:#fff1e0;width:ww;margin:auto;}
.ui-loader.ui-corner-all.ui-body-a.ui-loader-default{display:none;}
#introholder{position:absolute;left:50%;top:350px;}
#navintro{position:relative;left:-50%;background-color:white;padding:10px;font-size:18px;border-radius:5px;border:1px solid #b8b1a9;}
#navintroclose{border-radius:12px;font-weight:bold;color:darkblue;background-color:transparent;position:relative;top:-8px;padding:0px;left:6px;cursor:pointer;}
</style>
</head>
<body>
<header id="ft-header" class="stickable">
<a href="//www.ft.com/"><img src="//interactivegraphics.ft-static.com/sites/2014/deficit-calculator/images/content/ft.svg" alt="Financial Times" height="20"></a>
</header>
<!-- <h1 class="introtext">Telling stories with data</h1> -->
<!-- <div id="credits"><span>Source: <a target="_blank" href="http://www.worldfootball.net/alltime_goalgetter/champions-league/tore/1/">WorldFootball.net</a><span id="author">Graphic by: <a target="_blank" href="https://twitter.com/jburnmurdoch">John Burn-Murdoch</a></span><span id="inspiredby">Inspired by: <a target="_blank" href="http://www.nytimes.com/interactive/2014/10/19/upshot/peyton-manning-breaks-touchdown-passing-record.html">NYT Upshot</a></span></div> -->
<script type="text/javascript">
var ww = window.innerWidth;
// Here I'm setting the page background to the FT style
// This block adds a div to hold everything that follows (except the hard-coded "credits" div which I have positioned below it)
var cont = d3.select("body").append("div")
.attr("id","container")
.style("height","925")
.style("width","1572")
.style("margin-left","auto")
.style("margin-right","auto")
.style("background-color","transparent");
d3.select("body").append("span")
.attr("id","introholder")
d3.select("#introholder").append("span")
.attr("id","navintro")
.text("Right arrow or swipe right-to-left to continue")
// This block is the "next" button I use to navigate forwards
// d3.select("div#container").append("a")
// .attr("href","#")
// .attr("id","page2")
// .text("Next >")
// .style("border","solid 1px #43423e")
// .style("position","relative")
// .style("top","63px")
// .style("left","911px")
// .style("z-index","1000")
// .style("font-size","13px");
// This one is the "restart" button that appears at the end of the sequence and simply reloads the frame
// d3.select("div#container").append("a")
// .attr("href","#")
// .attr("id","restart")
// .style("pointer-events","none")
// .style("opacity","0")
// .style("border","solid 1px #43423e")
// .style("position","relative")
// .style("top","63px")
// .style("left","850px")
// .text("Restart")
// .style("font-size","13px");
// This block defines the shaded box in which our caption and navigation buttons will sit
// d3.select("div#container").append("div")
// .attr("id","captionouter")
// .style("height","93")
// .style("width","956")
// .style("padding","0px 8px")
// .style("margin","0px")
// // .style("background-color","#f6e9d8")
// .style("border-radius","3px");
// // This div holds the caption and stops it overflowing onto the buttons
// d3.select("div#captionouter").append("div")
// .attr("id","captiondiv")
// .style("height","90")
// .style("width","956")
// .style("padding","0px")
// .style("margin-right","50px");
// d3.select("div#container").append("a")
// .attr("href","#")
// .attr("id","clicktogoals")
// .attr("class","clickselected")
// .text("Raw number of goals")
// .style("border","solid 1px #74736c")
// .style("position","relative")
// .style("top","8px")
// .style("left","655px")
// .style("z-index","1000")
// .style("font-size","13px");
// d3.select("div#container").append("a")
// .attr("href","#")
// .attr("id","clicktogpg")
// .text("Adjusted for games played")
// .style("border","solid 1px #74736c")
// .style("position","relative")
// .style("top","8px")
// .style("left","658px")
// .style("z-index","1000")
// .style("font-size","13px");
// This is my caption text
// d3.select("div#captiondiv").append("span")
// .attr("id","caption")
// .text("These are the 100 highest scoring players in the history of elite European club tournament football. Lionel Messi and Raul are tied for first place on 71 goals, with Cristiano Ronaldo just one behind. Each line shows how a player's goals total has built up since their first season playing in the Champions League or its predecessor the European Cup. Standout players are highlighted. But what happens when we adjust for the increase in games played over the decades? Use the buttons below to switch between views")
// .style("position","relative")
// .style("top","0px")
// .style("left","0px")
// // .style("font-size","14px")
// .style("line-height","22px");
// d3.select("#captiondiv")
// .append("a").text("read more »").attr("target","_blank").attr("href","http://www.ft.com/cms/s/6492885c-71a4-11e4-9048-00144feabdc0.html").attr("id","captionlink").attr("title","Where does Lionel Messi rank among European football’s goal scorers? - FT.com").style("opacity","0").style("pointer-events","none")
// This div sits below out caption holding divs and will hold the chart(s)
d3.select("div#container").append("div")
.attr("id","chart")
.style("position","relative")
.style("top","0px")
.style("margin-left","auto")
.style("margin-right","auto")
.style("height","925")
.style("width","1572")
.style("background-color","none");
// And now we add an SVG inside our chart container
var svg = d3.select("div#chart").append("svg")
.style("position","relative")
.style("top","-15px")
.attr("height","925")
.attr("width","1572");
svg.append("svg:image")
.attr({
"x":"350",
"y":"400",
"width":"300",
"height":"250",
"class":"promo1",
"xlink:href":"clgoalspromo.png"
})
svg.append("svg:image")
.attr({
"x":"670",
"y":"420",
"width":"260",
"height":"200",
"class":"promo2",
"xlink:href":"https://raw.githubusercontent.com/johnburnmurdoch/new_image/master/lifts.png"
})
svg.append("svg:image")
.attr({
"x":"950",
"y":"415",
"width":"300",
"height":"200",
"class":"promo3",
"xlink:href":"isis.png"
})
svg.append("svg:image")
.attr({
"x":"360",
"y":"610",
"width":"300",
"height":"250",
"class":"promo4",
"xlink:href":"digidivide.png"
})
svg.append("svg:image")
.attr({
"x":"655",
"y":"630",
"width":"300",
"height":"250",
"class":"promo5",
"xlink:href":"atpfinals.png"
})
svg.append("svg:image")
.attr({
"x":"920",
"y":"620",
"width":"300",
"height":"250",
"class":"promo6",
"xlink:href":"gavimmig.png"
})
svg.append("text")
.attr({
"class":"introtext slidetitle",
"x":"786",
"y":"200"
})
.text("Telling stories with data")
svg.append("text")
.attr({
"class":"introtext slideheader",
"x":"1786",
"y":"250"
})
.text("The FT Interactive News Desk")
svg.append("text")
.attr({
"class":"introtext mydetails",
"x":"786",
"y":"300"
})
.text("John Burn-Murdoch, Interactive Data Journalist")
svg.append("text")
.attr({
"class":"introtext mydetails2",
"x":"786",
"y":"340"
})
.text("Twitter: @jburnmurdoch, email [email protected]")
svg.append("text")
.attr({
"class":"introtext anyqs",
"x":"786",
"y":"1450"
})
.text("Any questions?")
svg.append("text")
.attr({
"class":"keypoint hed num1",
"x":"350",
"y":"350"
})
.text("Who are we?")
.style("opacity","0")
svg.append("text")
.attr({
"class":"keypoint sub num1",
"x":"350",
"y":"380"
})
.text("Specialist generalists")
.style("opacity","0")
svg.append("text")
.attr({
"class":"keypoint sub2 num1",
"x":"350",
"y":"410"
})
.text("")
.style("opacity","0")
svg.append("text")
.attr({
"class":"keypoint hed num2",
"x":"350",
"y":"480"
})
.text("Specific specialisms")
.style("opacity","0")
svg.append("text")
.attr({
"class":"keypoint sub num2",
"x":"350",
"y":"510"
})
.text("Database manipulation, statistical analysis, mapping, front-end development, design")
.style("opacity","0")
svg.append("text")
.attr({
"class":"keypoint sub2 num2",
"x":"350",
"y":"540"
})
.text("")
.style("opacity","0")
svg.append("text")
.attr({
"class":"keypoint hed num3",
"x":"350",
"y":"610"
})
.text("What is our role within the FT?")
.style("opacity","0")
svg.append("text")
.attr({
"class":"keypoint sub num3",
"x":"350",
"y":"640"
})
.text("Finding new and innovative ways to engage existing audience and attract new readers")
.style("opacity","0")
svg.append("text")
.attr({
"class":"keypoint sub2 num3",
"x":"350",
"y":"670"
})
.text("")
.style("opacity","0")
// This defines the domain (data values) and range (potion of SVG) that the x scale refers to
var xScale = d3.scale.linear()
.domain([0,100])
.range([350, 1222]);
// // And this does the same for the y scale
var yScale = d3.scale.linear()
.domain([0,100])
.range([820, 320]);
// var yScalegpg = d3.scale.linear()
// .domain([0,8.5])
// .range([480, 50]);
// // This then defins an axis based on the x scale, and where to draw ticks along the axis
var xAxis = d3.svg.axis()
.scale(xScale)
.orient("bottom")
.tickFormat(d3.format("d"))
// .tickValues([5null,57,60,63,66])
;
// // And this does the same for the y axis based on the y scale
var yAxis = d3.svg.axis()
.scale(yScale)
.orient("left")
// .tickValues([41,4null,47,50])
;
// var yAxisgpg = d3.svg.axis()
// .scale(yScalegpg)
// .orient("left")
// // .tickValues([41,4null,47,50])
// ;
//This then draws the x axis on our SVG
d3.select("svg").append("g")
.attr("class", "axis")
.attr("id", "xaxis")
.attr("transform", "translate(2000,820)")
.call(xAxis);
// // And here is the same for the y axis
d3.select("svg").append("g")
.attr("class", "axis")
.attr("id", "yaxis")
.attr("transform", "translate(2350,0)")
.call(yAxis);
// d3.select("svg").append("g")
// .attr("class", "axis")
// .attr("id", "yaxisgpg")
// .attr("transform", "translate(23,-1000)")
// .call(yAxisgpg);
// Now we're adding a title at the top of our y axis, anchored to the left hand edge of the SVG
d3.select("svg").append("text")
.attr("class","yscattertitle")
.text("Specialist skills required")
.attr("x","350")
.attr("y","305")
.attr("transform","translate(2000,0)")
.style("font-size","18")
.style("font-weight","bold")
.style("fill-opacity","1")
.style("fill","#43423e");
// // And here's one for the x axis, anchored to the middle of our SVG
d3.select("svg").append("text")
.attr("class","xscattertitle")
.text("Time/personnel required")
.attr("x","786")
.attr("y","845")
.attr("text-anchor","middle")
.attr("transform","translate(2000,0)")
.style("font-size","18")
.style("font-weight","bold")
.style("fill-opacity","1")
.style("fill","#43423e");
var xticks = [10,20,30,40,50,60,70,80,90,100];
var yticks = [10,20,30,40,50,60,70,80,90,100];
svg.selectAll("line.horizontalGrid").data(yticks).enter()
.append("line")
.attr(
{
"class":"horizontalGrid",
"x1" : 350,
"x2" : 1222,
"y1" : function(d){ return yScale(d);},
"y2" : function(d){ return yScale(d);},
"fill" : "none",
"shape-rendering" : "crispEdges",
"stroke" : "#cec6b9",
"stroke-width" : "1px",
"stroke-dasharray" : "1 1",
"transform":"translate(2000,0)"
});
svg.selectAll("line.verticalGrid").data(xticks).enter()
.append("line")
.attr(
{
"class":"verticalGrid",
"y1" : 320,
"y2" : 820,
"x1" : function(d){ return xScale(d);},
"x2" : function(d){ return xScale(d);},
"fill" : "none",
"shape-rendering" : "crispEdges",
"stroke" : "#cec6b9",
"stroke-width" : "1px",
"stroke-dasharray" : "1 1",
"transform":"translate(2000,0)"
});
var circlenames = ["All projects","Maps","Charts","Graphics videos","Statistical analyses","Animated maps","Placemarkers","Interactive maps","Calculators","Dashboards","Narrative or animated graphics","Nonstandard charts"];
function getxcoords(str)
{
return d3.select(".projectcircle." + str).attr("cx")
};
function getycoords(str)
{
return d3.select(".projectcircle." + str).attr("cy")
};
svg.selectAll("projectcircles").data(circlenames).enter()
.append("circle")
.attr({
"class":function(d,i){return "projectcircle " + d;},
"cx":"786",
"cy":"570",
"r":"40px"
})
svg.selectAll("projecttext").data(circlenames).enter()
.append("text")
.attr({
"class":function(d,i){return "projecttext " + d;},
"x":"826",
"y":"610"
})
.text(function(d,i){return d;})
svg.append("circle")
.attr({
"class":"newcircle outer",
"cx":"2000",
"cy":"-400",
"r":"10px"
})
svg.append("circle")
.attr({
"class":"newcircle mid",
"cx":"2000",
"cy":"-400",
"r":"7px"
})
svg.append("circle")
.attr({
"class":"newcircle inner",
"cx":"2000",
"cy":"-400",
"r":"4px"
})
// var path = d3.svg.line()
// .defined(function(d) { return d != null; })
// .interpolate("linear")
// .x(function(d, i) { return xScale(seasons[i]); })
// .y(yScale);
// var path2 = d3.svg.line()
// .defined(function(d) { return d != null; })
// .interpolate("linear")
// .x(function(d, i) { return xScale(seasons[i]); })
// .y(yScalegpg);
// svg.selectAll(".linegoalsblank")
// .data(goals)
// .enter()
// .append("path")
// .attr("class",function(d,i) {return "graphic goalspathblank " + names[i];})
// .attr("d", path);
// svg.selectAll(".linegoals")
// .data(goals)
// .enter()
// .append("path")
// .attr("class",function(d,i) {return "graphic goalspath " + names[i];})
// // .attr("d", path);
// svg.selectAll(".circlegoals")
// .data(goals)
// .enter()
// .append("circle")
// .attr({
// "cx":function(d,i){return xScale(yearsmax[i]);},
// "cy":function(d,i){return yScale(d3.max(goals[i]));},
// "r":"1.5px",
// "class":function(d,i){return "graphic goalscircle " + names[i];}
// })
// svg.selectAll(".hovertext")
// .data(goals)
// .enter()
// .append("text")
// .attr({
// "x":function(d,i){return xScale(yearsmax[i])+4;},
// "y":function(d,i){return yScale(d3.max(goals[i]))+4;},
// "class":function(d,i){return "graphic hovertext " + names[i];}
// })
// .text(function(d,i){return names[i].replace(/_/g," ");})
// var messilength = d3.select(".goalspath.Lionel_Messi").attr("d").replace(/[A-z]/,"").split("L").length-1;
// svg.append("circle")
// .attr({
// "cx":function(){return d3.select(".goalspath.Lionel_Messi").attr("d").replace(/[A-z]/,"").split("L")[messilength].split(",")[0];},
// "cy":function(){return d3.select(".goalspath.Lionel_Messi").attr("d").replace(/[A-z]/,"").split("L")[messilength].split(",")[1];},
// "r":"2px"
// })
window.onload = function() {
if ( window.orientation == 0 || window.orientation == 180 ) {
alert ('Please rotate your device to landscape mode');
}
};
function bgchange() {
d3.select("#chart").transition().duration(5000).style("background-color","#9e2f50")
d3.selectAll(".introtext").transition().duration(5000).style({"color":"#fff1e0","fill":"#fff1e0"})
d3.select("#chart").transition().delay(5000).duration(5000).style("background-color","#fff1e0")
d3.selectAll(".introtext").transition().delay(5000).duration(5000).style({"color":"#000000","fill":"#000000"})
d3.select("#chart").transition().delay(10000).duration(5000).style("background-color","#76acb8")
d3.selectAll(".introtext").transition().delay(10000).duration(5000).style({"color":"#fff1e0","fill":"#fff1e0"})
d3.select("#chart").transition().delay(15000).duration(5000).style("background-color","#fff1e0")
d3.selectAll(".introtext").transition().delay(15000).duration(5000).style({"color":"#000000","fill":"#000000"})
d3.select("#chart").transition().delay(20000).duration(5000).style("background-color","#d7706c")
d3.selectAll(".introtext").transition().delay(20000).duration(5000).style({"color":"#fff1e0","fill":"#fff1e0"})
d3.select("#chart").transition().delay(25000).duration(5000).style("background-color","#fff1e0")
d3.selectAll(".introtext").transition().delay(25000).duration(5000).style({"color":"#000000","fill":"#000000"}).each("end", bgchange)
}
var slidenum = -1;
function toslide0() {
d3.select("#navintro").style("display","none")
d3.select("#chart").style("opacity","1")
slidenum = 0
}
function toslide1() {
d3.select("#chart").transition().duration(100).style("background-color","#fff1e0")
d3.selectAll(".introtext").transition().duration(100).style({"color":"#000000","fill":"#000000"})
d3.select(".slidetitle").transition().delay(700).duration(800).attr("y","160").style("font-weight","normal")
d3.select(".mydetails").transition().delay(700).duration(800).style("font-size","24px").attr("y","900")
d3.select(".mydetails2").transition().delay(700).duration(800).style("font-size","18px").attr("y","920")
d3.select(".slideheader").transition().delay(700).duration(800).attr("x","360")
d3.select(".promo1").transition().duration(1000).attr("x","-1000").attr("y","-1000")
d3.select(".promo2").transition().duration(1000).attr("y","-1000")
d3.select(".promo3").transition().duration(1000).attr("x","2000").attr("y","-1000")
d3.select(".promo4").transition().duration(1000).attr("x","-1000").attr("y","2000")
d3.select(".promo5").transition().duration(1000).attr("y","2000")
d3.select(".promo6").transition().duration(1000).attr("x","2000").attr("y","2000")
d3.selectAll(".keypoint").transition().delay(700).duration(800).style("opacity","1")
slidenum = 1
}
function toslide2() {
d3.select(".slideheader")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("What do we produce?")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num1")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("All the things")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num1")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("The FT produces more than 150 bespoke graphics per week")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num2")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("And the interactive team in particular?")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num2")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("Maps, charts, narrative graphics, timelines, calculators, explorative tools, analyses")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num3")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("What resources does each require in terms of time and skills?")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num3")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("I've got a chart for that...")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
slidenum = 2
}
function toslide3() {
d3.select("#xaxis").transition().delay(1000).duration(500).attr("transform","translate(0,820)")
d3.select("#yaxis").transition().delay(1000).duration(500).attr("transform","translate(350,0)")
d3.selectAll(".verticalGrid").transition().delay(1000).duration(500).attr("transform","translate(0,0)")
d3.selectAll(".horizontalGrid").transition().delay(1000).duration(500).attr("transform","translate(0,0)")
d3.select(".xscattertitle").transition().delay(1000).duration(500).attr("transform","translate(0,0)")
d3.select(".yscattertitle").transition().delay(1000).duration(500).attr("transform","translate(0,0)")
d3.selectAll(".All").transition().delay(1250).duration(500).style("opacity","1")
d3.select(".slideheader")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("A graphic about graphics")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num1")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num1")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num2")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num2")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num3")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num3")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
slidenum = 3
}
function toslide4() {
d3.selectAll(".All").transition().duration(1000).style("opacity","0")
d3.select(".projectcircle.Maps").style("opacity","1").transition().duration(1000).attr("r","15px").attr("cx","850").attr("cy","550")
d3.select(".projecttext.Maps").style("opacity","1").transition().duration(1000).attr("x","860").attr("y","570")
d3.select(".projectcircle.Charts").style("opacity","1").transition().duration(1000).attr("r","15px").attr("cx","770").attr("cy","560")
d3.select(".projecttext.Charts").style("opacity","1").transition().duration(1000).attr("x","780").attr("y","580")
d3.select(".projectcircle.videos").style("opacity","1").transition().duration(1000).attr("r","15px").attr("cx","880").attr("cy","490")
d3.select(".projecttext.videos").style("opacity","1").transition().duration(1000).attr("x","890").attr("y","510")
d3.select(".projectcircle.Statistical").style("opacity","1").transition().duration(1000).attr("r","15px").attr("cx","950").attr("cy","445")
d3.select(".projecttext.Statistical").style("opacity","1").transition().duration(1000).attr("x","960").attr("y","465")
slidenum = 4
}
function toslide5() {
d3.select(".projectcircle.Maps").style("opacity","1").transition().duration(1000).style("opacity","0")
d3.select(".projecttext.Maps").style("opacity","1").transition().duration(1000).style("opacity","0")
d3.select(".projectcircle.Charts").style("opacity","1").transition().duration(1000).style("opacity","0")
d3.select(".projecttext.Charts").style("opacity","1").transition().duration(1000).style("opacity","0")
// d3.select(".projectcircle.videos").style("opacity","1").transition().duration(1000).style("opacity","0")
// d3.select(".projecttext.videos").style("opacity","1").transition().duration(1000).style("opacity","0")
// d3.select(".projectcircle.Statistical").style("opacity","1").transition().duration(1000).style("opacity","0")
// d3.select(".projecttext.Statistical").style("opacity","1").transition().duration(1000).style("opacity","0")
d3.select(".projectcircle.Animated").style("opacity","1").transition().duration(1000).attr("r","10px").attr("cx","500").attr("cy","700")
d3.select(".projecttext.Animated").style("opacity","1").transition().duration(1000).attr("x","505").attr("y","720")
d3.select(".projectcircle.Placemarkers").style("opacity","1").transition().duration(1000).attr("r","10px").attr("cx","570").attr("cy","550")
d3.select(".projecttext.Placemarkers").style("opacity","1").transition().duration(1000).attr("x","575").attr("y","570")
d3.select(".projectcircle.Interactive").style("opacity","1").transition().duration(1000).attr("r","10px").attr("cx","960").attr("cy","460")
d3.select(".projecttext.Interactive").style("opacity","1").transition().duration(1000).attr("x","965").attr("y","480")
d3.select(".projectcircle.Calculators").style("opacity","1").transition().duration(1000).attr("r","10px").attr("cx","850").attr("cy","450")
d3.select(".projecttext.Calculators").style("opacity","1").transition().duration(1000).attr("x","855").attr("y","470")
d3.select(".projectcircle.Dashboards").style("opacity","1").transition().duration(1000).attr("r","10px").attr("cx","750").attr("cy","650")
d3.select(".projecttext.Dashboards").style("opacity","1").transition().duration(1000).attr("x","755").attr("y","670")
d3.select(".projectcircle.Nonstandard").style("opacity","1").transition().duration(1000).attr("r","10px").attr("cx","950").attr("cy","550")
d3.select(".projecttext.Nonstandard").style("opacity","1").transition().duration(1000).attr("x","955").attr("y","570")
d3.select(".projectcircle.Narrative").style("opacity","1").transition().duration(1000).attr("r","10px").attr("cx","800").attr("cy","480")
d3.select(".projecttext.Narrative").style("opacity","1").transition().duration(1000).attr("x","805").attr("y","500")
slidenum = 5
}
function toslide6() {
d3.select(".slideheader")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("Templating and skill-sharing")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.selectAll(".projecttext").transition().duration(1000).style("opacity","0")
d3.selectAll(".projectcircle").transition().duration(1750)
.attr("cx",function(d,i){return getxcoords(circlenames[i].split(" ")[0])*0.8;})
.attr("cy",function(d,i){return (getycoords(circlenames[i].split(" ")[0])*1.1);})
slidenum = 6
}
function toslide7() {
d3.select(".slideheader")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("Capacity for new challenges")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.selectAll(".newcircle")
.transition().duration(1750).attr("cx","1180").attr("cy","360").style("opacity","1")
slidenum = 7
}
function toslide8() {
d3.selectAll(".verticalGrid").transition().duration(250).attr("transform","translate(-2000,0)")
d3.selectAll(".horizontalGrid").transition().duration(250).attr("transform","translate(-2000,0)")
d3.selectAll(".projectcircle").transition().duration(250).attr("transform","translate(-2000,0)")
d3.select(".xscattertitle").transition().duration(250).attr("transform","translate(-2000,0)")
d3.select(".yscattertitle").transition().duration(250).attr("transform","translate(-2000,0)")
d3.select("#xaxis").transition().duration(250).attr("transform","translate(-1700,820)")
d3.select("#yaxis").transition().duration(250).attr("transform","translate(-1350,0)")
d3.selectAll(".newcircle").transition().duration(250).attr("transform","translate(-2000,0)")
d3.select(".slideheader")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("How are they produced?")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num1")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("Programming languages, both in the back...")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num1")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("SQL, R, various command line tools for obtaining, cleaning and manipulating data")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num2")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("And up front")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num2")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("d3, Leaflet.js")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num3")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("Aptitude and attitude")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num3")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("Underpinning everything is the desire, ability and scope to learn new skills on the job")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
slidenum = 8
}
function toslide9() {
d3.select(".slideheader")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("Goals and guidelines")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num1")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("Serving current and prospective subscribers")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num1")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("Our readers are very intelligent people and they pay for what they read online as well as ")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub2.num1")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("in print")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".hed.num2")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("Meeting and expanding their expectations")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub.num2")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("We aim to produce analysis and visualisation that satisfies their intellect and does not ")
.transition().delay(1000).duration(500).attr("x","350").style("opacity","1")
d3.select(".sub2.num2")
.transition().duration(250).attr("x","-1000").style("opacity","0")
.transition().delay(750).duration(250).attr("x","2000").text("oversimplify")