Skip to content

Instantly share code, notes, and snippets.

@sdawson
Last active December 15, 2015 17:39
Show Gist options
  • Save sdawson/5297998 to your computer and use it in GitHub Desktop.
Save sdawson/5297998 to your computer and use it in GitHub Desktop.
antsim_pdf1
NoOfDeaths MinBlueDeath MajBlueDeath MinRedDeath MajRedDeath
13 0 0 0 2
14 0 0 0 1
15 0 0 0 2
16 0 3 0 0
17 0 5 0 10
18 0 6 0 8
19 0 15 0 5
20 0 25 0 20
21 0 30 0 23
22 0 36 0 41
23 0 39 0 45
24 0 66 0 78
25 0 74 0 81
26 0 128 0 107
27 0 137 0 126
28 0 140 0 155
29 0 192 0 172
30 0 186 0 191
31 0 206 0 225
32 0 224 0 245
33 0 248 0 223
34 0 232 0 230
35 0 220 0 215
36 0 228 0 225
37 0 252 0 236
38 0 208 0 202
39 0 181 0 189
40 0 150 0 171
41 0 125 0 153
42 0 133 0 111
43 0 83 0 115
44 0 97 0 64
45 0 95 0 89
46 0 65 0 54
47 0 43 0 38
48 0 29 0 38
49 0 27 0 24
50 1 16 0 14
51 0 15 0 19
52 0 14 0 13
53 0 8 0 14
54 0 6 0 7
55 0 4 0 6
56 0 1 0 3
57 0 1 0 3
58 0 4 0 2
59 0 0 0 2
60 1 1 0 0
61 0 0 0 1
62 1 0 1 0
63 0 1 0 0
64 0 0 1 0
65 2 0 0 1
66 4 0 1 0
67 5 0 2 0
68 3 0 6 0
69 5 0 1 0
70 6 0 5 0
71 5 0 2 0
72 12 0 8 0
73 9 0 7 0
74 18 0 16 0
75 19 0 9 0
76 19 0 18 0
77 24 0 40 0
78 25 0 35 0
79 38 0 51 0
80 56 0 42 0
81 45 0 49 0
82 62 0 56 0
83 75 0 63 0
84 72 0 83 0
85 92 0 98 0
86 91 0 94 0
87 114 0 101 0
88 96 0 112 0
89 112 0 126 0
90 138 0 132 0
91 137 0 132 0
92 135 0 130 0
93 143 0 146 0
94 125 0 163 0
95 137 0 165 0
96 149 0 161 0
97 144 0 141 0
98 147 0 145 0
99 158 0 134 0
100 147 0 141 0
101 132 0 142 0
102 134 0 130 0
103 121 0 125 0
104 109 0 122 0
105 105 0 112 0
106 97 0 91 0
107 86 0 112 0
108 95 0 59 0
109 61 0 75 0
110 76 0 65 0
111 62 0 50 0
112 49 0 40 0
113 52 0 31 0
114 35 0 33 0
115 39 0 33 0
116 24 0 30 0
117 28 0 23 0
118 20 0 15 0
119 17 0 12 0
120 13 0 11 0
121 17 0 11 0
122 8 0 12 0
123 7 0 14 0
124 11 0 4 0
125 5 0 10 0
126 4 0 4 0
127 6 0 3 0
128 4 0 3 0
129 1 0 2 0
130 2 0 1 0
131 2 0 1 0
132 4 0 2 0
133 1 0 0 0
134 0 0 2 0
135 0 0 2 0
{"description":"antsim_pdf1","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"antsim_p0.50_f0.25.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"antsim_p0P50_f0P25.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"antsim_v1.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
var ant_data = tributary.antsim_v1;
data.forEach(function(d) {
d.NoOfDeaths = +d.NoOfDeaths;
d.MinBlueDeath = +d.MinBlueDeath;
d.MajBlueDeath = +d.MajBlueDeath;
d.MinRedDeath = +d.MinRedDeath;
d.MajRedDeath = +d.MajRedDeath;
});
console.log(data);
var svg = d3.select("svg");
var margin = {top: 20, right: 20, bottom: 30, left: 50 },
width = 950 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var x = d3.scale.linear()
.range([0, width]);
var y = d3.scale.linear()
.range([height, 0]);
var line = d3.svg.line()
.x(function(d) {
return x(d.NoOfDeaths); })
.y(function(d) {
return y(d.MinBlueDeath); });
svg.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
x.domain(d3.extent(data, function(d) { return d.NoOfDeaths; }));
y.domain(d3.extent(data, function(d) { return d.MinBlueDeath; }));
svg.append("path")
.datum(data)
.attr("class", "line");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment