File size: 2,015 Bytes
40559c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
window.makeSlides = function(){
  var slides = [
    {
      xKey: 'grid',
      circleDelayFn: d => axii.ageScale(d.age),
      showFlipRect: 0,
      populationTarget: 144,
      headsProbTarget: .5,
    },
    {
      xKey: 'age',
      showAgeAxis: 1,
    },
    {
      xKey: 'ageState',
      showStateAxis: 1,
    },
    {
      showUniqueBox: 1
    },
    {
      xKey: 'ageStateSeason',
      showUniqueBox: 1,
      showUniqueSeasonBox: 1,
      showSeasonAxis: 1,
    },
    {
      xKey: 'heads',
      showUniqueBox: 0,
      showUniqueSeasonBox: 0,
      showSeasonAxis: 0,
      showAgeAxis: 0,
      showStateAxis: 0,
      showHeadAxis: 1,  
    },
    {
      showFlipCircle: 1,
      showHeadCaptionAxis: 1,
    },

    // Flip coin
    {
      xKey: 'plagerizedShifted',
      showHeadAxis: 0,
      showHeadCaptionAxis: 0,
      showHistogramAxis: 1,
    },

    // Exactly how far off can these estimates be after adding noise? Flip more coins to see the distribution.
    {
      enterHistogram: 1,
      showHistogram: 1,
      // showPlagerizedAxis: 0,
      showEstimate: 1,
    },

    // Reducing the random noise increases our point estimate, but risks leaking information about students.
    {
      animateHeadsProbSlider: 1,
      animatePopulationSlider: 1,
      enterHistogram: 0,
      name: 'noise', 
      headsProbTarget: .35,
    },

    // If we collect information from lots of people, we can have high accuracy and protect everyone's privacy.
    {
      showEstimate: 0,
      showAllStudents: 1,
      name: 'population',
      animateHeadsProbSlider: -1,
      animatePopulationSlider: 1,
      populationTarget: 400,
    },

  ]

  var keys = []
  slides.forEach((d, i) => {
    keys = keys.concat(d3.keys(d))
    d.index = i
  })
  _.uniq(keys).forEach(str => {
    var prev = null
    slides.forEach(d => {
      if (typeof(d[str]) === 'undefined'){
        d[str] = prev
      }
      prev = d[str]
    }) 
  })

  return slides
}



if (window.init) window.init()