-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathindex.html
782 lines (740 loc) · 32.1 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Cohort Visualizer » A handy tool for browsing cohort datasets</title>
<meta name="description" content="A cohort is a group of people who share a common characteristic or experience within a defined period. This is a handy tool for browsing cohort datasets.">
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8">
<script src="jquery-1.8.2.min.js"></script>
<script src="d3.v2.min.js"></script>
<script src="cohorts.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-36415834-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="fancy-bg">
<div class="drop-info">
<div class="drop-message-container">
<div class="drop-message">
Drop your CSV file
</div>
</div>
</div>
<div class="drop-target"></div>
<div class="title-section">
<h1 class="main-title">Cohort Visualizer</h1>
<span class="sub-title">A handy tool for browsing cohort datasets</span>
</div>
<a class="fork-me" href="https://github.com/bslatkin/cohorts"><img style="position: absolute; top: 0; right: 0; border: 0; width: 120px; height: 120px;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<div id="viz_container">
<div id="viz_title1">
<input class="viz-title fancy-bg" type="text" placeholder="Enter a graph title here">
</div>
<div id="viz_graph1" class="chart-cell">
<svg class="stacked">
<g></g>
</svg>
</div>
<div id="loading-message">
Crunching...
</div>
<div id="below-area" class="below-area-column-wrap">
<div id="control-section">
<div class="section">
<div class="section-header">
Transforms
</div>
<div class="section-content">
<div>
<input type="checkbox" name="normalize" id="normalize-check">
<label for="normalize-check" title="Scale each bar to 100%">Normalize</label>
</div>
</div>
</div>
<div class="section">
<div class="section-header">
Period
</div>
<div class="section-content">
<div>
<input type="radio" name="period" id="daily-check" value="daily" checked>
<label for="daily-check" title="Group cohorts by day">Daily</label>
</div>
<div>
<input type="radio" name="period" id="weekly-check" value="weekly">
<label for="weekly-check" title="Group cohorts by week">Weekly</label>
</div>
<div>
<input type="radio" name="period" id="monthly-check" value="monthly">
<label for="monthly-check" title="Group cohorts by month">Monthly</label>
</div>
</div>
</div>
<div class="section">
<div class="section-header">
Graph type
</div>
<div class="section-content">
<div>
<input type="radio" name="point_type" id="point-rate" value="points" checked>
<label for="point-rate" title="Datapoints are independently">Points</label>
</div>
<div>
<input type="radio" name="point_type" id="point-left" value="cumulative">
<label for="point-left" title="Cumulative sum">Cumulative</label>
</div>
</div>
</div>
<div class="section">
<div class="section-header">
Included signs
</div>
<div class="section-content">
<div>
<input type="radio" name="sign" id="positives-check" value="positive" checked>
<label for="positives-check" title="Show positive values">Positive</label>
</div>
<div>
<input type="radio" name="sign" id="negatives-check" value="negative">
<label for="negatives-check" title="Show negative values">Negative</label>
</div>
<div>
<input type="radio" name="sign" id="both-check" value="both">
<label for="both-check" title="Positive and negative values">Both</label>
</div>
</div>
</div>
</div>
<div class="section">
<div class="section-header">
Cohort Group type
</div>
<div class="section-content">
<div id="viz_group_type1"></div>
</div>
</div>
<div id="viz_group_value1" class="section"></div>
<div class="section">
<div class="section-header">
Legend <span class="legend-target"></span>
</div>
<div id="viz_legend" class="section-content"></div>
</div>
<div class="section">
<div class="section-header">
Calculations <a href="#calculations" class="question-mark">?</a>
</div>
<div id="calc_legend" class="section-content"></div>
</div>
</div>
</div>
<div class="clear"></div>
<div id="explanation">
<h2>Drag/drop your CSV file <span class="quiet">(or paste it here)</span></h2>
<div>
<p>
Note: No data will go to the server. This is all client-side in your browser.
</p>
<p>
<textarea rows="15" id="data">
Cohort group type,Cohort group value,Cohort day,Born,Updated profile,Sent first message,Unlocked first achievement,Made two posts
Total,,10/18/12,55,26,244,146,135
Total,,10/19/12,57,27,246,147,142
Total,,10/20/12,59,29,247,148,148
Total,,10/21/12,61,31,248,149,155
Total,,10/22/12,63,33,249,149,161
Total,,10/23/12,65,35,250,149,167
Total,,10/24/12,66,37,250,149,173
Total,,10/25/12,68,39,249,149,180
Total,,10/26/12,70,40,249,148,185
Total,,10/27/12,71,42,248,148,191
Total,,10/28/12,72,44,247,147,197
Total,,10/29/12,74,46,245,146,202
Total,,10/30/12,75,48,243,145,207
Total,,10/31/12,76,49,241,143,212
Total,,11/01/12,77,51,238,141,217
Total,,11/02/12,78,53,235,140,221
Total,,11/03/12,79,54,232,138,226
Total,,11/04/12,80,56,229,135,230
Total,,11/05/12,80,57,225,133,233
Total,,11/06/12,81,59,221,131,237
Total,,11/07/12,81,60,217,128,240
Total,,11/08/12,81,62,212,125,242
Total,,11/09/12,82,63,207,122,245
Total,,11/10/12,82,64,202,119,247
Total,,11/11/12,82,65,197,116,249
Total,,11/12/12,82,66,192,112,250
Total,,11/13/12,81,67,186,109,251
Total,,11/14/12,81,68,180,106,252
Total,,11/15/12,80,68,174,102,252
Total,,11/16/12,80,69,168,98,252
Sign-up referrer,Email,10/18/12,422,371,296,7,32
Sign-up referrer,Email,10/19/12,431,386,287,8,32
Sign-up referrer,Email,10/20/12,440,401,278,8,32
Sign-up referrer,Email,10/21/12,448,415,269,8,31
Sign-up referrer,Email,10/22/12,455,429,260,8,31
Sign-up referrer,Email,10/23/12,462,442,251,8,31
Sign-up referrer,Email,10/24/12,469,456,241,8,30
Sign-up referrer,Email,10/25/12,474,468,231,8,30
Sign-up referrer,Email,10/26/12,480,481,221,8,30
Sign-up referrer,Email,10/27/12,484,493,211,8,29
Sign-up referrer,Email,10/28/12,488,504,201,8,29
Sign-up referrer,Email,10/29/12,491,515,191,8,28
Sign-up referrer,Email,10/30/12,494,525,181,8,28
Sign-up referrer,Email,10/31/12,496,534,171,8,27
Sign-up referrer,Email,11/01/12,497,543,161,8,26
Sign-up referrer,Email,11/02/12,497,551,151,8,26
Sign-up referrer,Email,11/03/12,497,559,142,8,25
Sign-up referrer,Email,11/04/12,496,565,132,8,24
Sign-up referrer,Email,11/05/12,495,571,123,8,23
Sign-up referrer,Email,11/06/12,492,576,113,8,23
Sign-up referrer,Email,11/07/12,490,581,104,8,22
Sign-up referrer,Email,11/08/12,486,585,95,8,21
Sign-up referrer,Email,11/09/12,482,587,87,8,20
Sign-up referrer,Email,11/10/12,477,589,79,8,19
Sign-up referrer,Email,11/11/12,472,591,71,8,19
Sign-up referrer,Email,11/12/12,465,591,63,8,18
Sign-up referrer,Email,11/13/12,459,591,56,7,17
Sign-up referrer,Email,11/14/12,452,590,49,7,16
Sign-up referrer,Email,11/15/12,444,588,42,7,15
Sign-up referrer,Email,11/16/12,435,585,36,7,14
Sign-up referrer,Search,10/18/12,371,296,7,32,597
Sign-up referrer,Search,10/19/12,386,287,8,32,598
Sign-up referrer,Search,10/20/12,401,278,8,32,599
Sign-up referrer,Search,10/21/12,415,269,8,31,598
Sign-up referrer,Search,10/22/12,429,260,8,31,597
Sign-up referrer,Search,10/23/12,442,251,8,31,594
Sign-up referrer,Search,10/24/12,456,241,8,30,591
Sign-up referrer,Search,10/25/12,468,231,8,30,588
Sign-up referrer,Search,10/26/12,481,221,8,30,583
Sign-up referrer,Search,10/27/12,493,211,8,29,578
Sign-up referrer,Search,10/28/12,504,201,8,29,571
Sign-up referrer,Search,10/29/12,515,191,8,28,565
Sign-up referrer,Search,10/30/12,525,181,8,28,557
Sign-up referrer,Search,10/31/12,534,171,8,27,549
Sign-up referrer,Search,11/01/12,543,161,8,26,540
Sign-up referrer,Search,11/02/12,551,151,8,26,530
Sign-up referrer,Search,11/03/12,559,142,8,25,520
Sign-up referrer,Search,11/04/12,565,132,8,24,509
Sign-up referrer,Search,11/05/12,571,123,8,23,497
Sign-up referrer,Search,11/06/12,576,113,8,23,485
Sign-up referrer,Search,11/07/12,581,104,8,22,473
Sign-up referrer,Search,11/08/12,585,95,8,21,460
Sign-up referrer,Search,11/09/12,587,87,8,20,446
Sign-up referrer,Search,11/10/12,589,79,8,19,432
Sign-up referrer,Search,11/11/12,591,71,8,19,418
Sign-up referrer,Search,11/12/12,591,63,8,18,403
Sign-up referrer,Search,11/13/12,591,56,7,17,389
Sign-up referrer,Search,11/14/12,590,49,7,16,373
Sign-up referrer,Search,11/15/12,588,42,7,15,358
Sign-up referrer,Search,11/16/12,585,36,7,14,343
Sign-up referrer,Coupon,10/18/12,296,7,32,597,603
Sign-up referrer,Coupon,10/19/12,287,8,32,598,578
Sign-up referrer,Coupon,10/20/12,278,8,32,599,553
Sign-up referrer,Coupon,10/21/12,269,8,31,598,527
Sign-up referrer,Coupon,10/22/12,260,8,31,597,502
Sign-up referrer,Coupon,10/23/12,251,8,31,594,476
Sign-up referrer,Coupon,10/24/12,241,8,30,591,450
Sign-up referrer,Coupon,10/25/12,231,8,30,588,425
Sign-up referrer,Coupon,10/26/12,221,8,30,583,400
Sign-up referrer,Coupon,10/27/12,211,8,29,578,375
Sign-up referrer,Coupon,10/28/12,201,8,29,571,350
Sign-up referrer,Coupon,10/29/12,191,8,28,565,326
Sign-up referrer,Coupon,10/30/12,181,8,28,557,302
Sign-up referrer,Coupon,10/31/12,171,8,27,549,278
Sign-up referrer,Coupon,11/01/12,161,8,26,540,255
Sign-up referrer,Coupon,11/02/12,151,8,26,530,233
Sign-up referrer,Coupon,11/03/12,142,8,25,520,212
Sign-up referrer,Coupon,11/04/12,132,8,24,509,191
Sign-up referrer,Coupon,11/05/12,123,8,23,497,171
Sign-up referrer,Coupon,11/06/12,113,8,23,485,152
Sign-up referrer,Coupon,11/07/12,104,8,22,473,134
Sign-up referrer,Coupon,11/08/12,95,8,21,460,117
Sign-up referrer,Coupon,11/09/12,87,8,20,446,101
Sign-up referrer,Coupon,11/10/12,79,8,19,432,86
Sign-up referrer,Coupon,11/11/12,71,8,19,418,72
Sign-up referrer,Coupon,11/12/12,63,8,18,403,59
Sign-up referrer,Coupon,11/13/12,56,7,17,389,47
Sign-up referrer,Coupon,11/14/12,49,7,16,373,37
Sign-up referrer,Coupon,11/15/12,42,7,15,358,28
Sign-up referrer,Coupon,11/16/12,36,7,14,343,20
Sign-up referrer,Tweet,10/18/12,7,32,597,603,13
Sign-up referrer,Tweet,10/19/12,8,32,598,578,13
Sign-up referrer,Tweet,10/20/12,8,32,599,553,12
Sign-up referrer,Tweet,10/21/12,8,31,598,527,12
Sign-up referrer,Tweet,10/22/12,8,31,597,502,11
Sign-up referrer,Tweet,10/23/12,8,31,594,476,10
Sign-up referrer,Tweet,10/24/12,8,30,591,450,10
Sign-up referrer,Tweet,10/25/12,8,30,588,425,9
Sign-up referrer,Tweet,10/26/12,8,30,583,400,8
Sign-up referrer,Tweet,10/27/12,8,29,578,375,8
Sign-up referrer,Tweet,10/28/12,8,29,571,350,7
Sign-up referrer,Tweet,10/29/12,8,28,565,326,7
Sign-up referrer,Tweet,10/30/12,8,28,557,302,6
Sign-up referrer,Tweet,10/31/12,8,27,549,278,6
Sign-up referrer,Tweet,11/01/12,8,26,540,255,5
Sign-up referrer,Tweet,11/02/12,8,26,530,233,4
Sign-up referrer,Tweet,11/03/12,8,25,520,212,4
Sign-up referrer,Tweet,11/04/12,8,24,509,191,4
Sign-up referrer,Tweet,11/05/12,8,23,497,171,3
Sign-up referrer,Tweet,11/06/12,8,23,485,152,3
Sign-up referrer,Tweet,11/07/12,8,22,473,134,2
Sign-up referrer,Tweet,11/08/12,8,21,460,117,2
Sign-up referrer,Tweet,11/09/12,8,20,446,101,1
Sign-up referrer,Tweet,11/10/12,8,19,432,86,1
Sign-up referrer,Tweet,11/11/12,8,19,418,72,1
Sign-up referrer,Tweet,11/12/12,8,18,403,59,1
Sign-up referrer,Tweet,11/13/12,7,17,389,47,0
Sign-up referrer,Tweet,11/14/12,7,16,373,37,0
Sign-up referrer,Tweet,11/15/12,7,15,358,28,0
Sign-up referrer,Tweet,11/16/12,7,14,343,20,0
Favorite feature,Chat,10/18/12,873,180,558,141,346
Favorite feature,Chat,10/19/12,897,170,546,125,335
Favorite feature,Chat,10/20/12,921,159,534,110,324
Favorite feature,Chat,10/21/12,944,149,521,96,313
Favorite feature,Chat,10/22/12,966,139,507,82,301
Favorite feature,Chat,10/23/12,986,129,493,70,289
Favorite feature,Chat,10/24/12,1006,119,479,58,277
Favorite feature,Chat,10/25/12,1024,110,464,47,265
Favorite feature,Chat,10/26/12,1041,100,449,38,253
Favorite feature,Chat,10/27/12,1057,91,433,29,241
Favorite feature,Chat,10/28/12,1072,83,417,21,229
Favorite feature,Chat,10/29/12,1085,74,401,15,217
Favorite feature,Chat,10/30/12,1096,66,385,10,205
Favorite feature,Chat,10/31/12,1107,59,368,5,192
Favorite feature,Chat,11/01/12,1115,51,352,2,180
Favorite feature,Chat,11/02/12,1122,45,335,0,169
Favorite feature,Chat,11/03/12,1128,38,318,0,157
Favorite feature,Chat,11/04/12,1132,32,301,0,146
Favorite feature,Chat,11/05/12,1135,27,284,1,134
Favorite feature,Chat,11/06/12,1136,22,268,4,123
Favorite feature,Chat,11/07/12,1136,17,251,8,113
Favorite feature,Chat,11/08/12,1133,13,235,13,103
Favorite feature,Chat,11/09/12,1130,9,219,19,93
Favorite feature,Chat,11/10/12,1125,6,203,26,83
Favorite feature,Chat,11/11/12,1118,4,187,34,74
Favorite feature,Chat,11/12/12,1110,2,172,43,65
Favorite feature,Chat,11/13/12,1100,1,158,54,57
Favorite feature,Chat,11/14/12,1089,0,143,65,49
Favorite feature,Chat,11/15/12,1077,0,130,77,42
Favorite feature,Chat,11/16/12,1063,0,116,90,35
Favorite feature,Reading news,10/18/12,180,558,141,346,952
Favorite feature,Reading news,10/19/12,170,546,125,335,931
Favorite feature,Reading news,10/20/12,159,534,110,324,909
Favorite feature,Reading news,10/21/12,149,521,96,313,886
Favorite feature,Reading news,10/22/12,139,507,82,301,862
Favorite feature,Reading news,10/23/12,129,493,70,289,837
Favorite feature,Reading news,10/24/12,119,479,58,277,812
Favorite feature,Reading news,10/25/12,110,464,47,265,785
Favorite feature,Reading news,10/26/12,100,449,38,253,758
Favorite feature,Reading news,10/27/12,91,433,29,241,731
Favorite feature,Reading news,10/28/12,83,417,21,229,703
Favorite feature,Reading news,10/29/12,74,401,15,217,675
Favorite feature,Reading news,10/30/12,66,385,10,205,646
Favorite feature,Reading news,10/31/12,59,368,5,192,617
Favorite feature,Reading news,11/01/12,51,352,2,180,588
Favorite feature,Reading news,11/02/12,45,335,0,169,559
Favorite feature,Reading news,11/03/12,38,318,0,157,530
Favorite feature,Reading news,11/04/12,32,301,0,146,501
Favorite feature,Reading news,11/05/12,27,284,1,134,472
Favorite feature,Reading news,11/06/12,22,268,4,123,444
Favorite feature,Reading news,11/07/12,17,251,8,113,415
Favorite feature,Reading news,11/08/12,13,235,13,103,387
Favorite feature,Reading news,11/09/12,9,219,19,93,360
Favorite feature,Reading news,11/10/12,6,203,26,83,333
Favorite feature,Reading news,11/11/12,4,187,34,74,306
Favorite feature,Reading news,11/12/12,2,172,43,65,281
Favorite feature,Reading news,11/13/12,1,158,54,57,256
Favorite feature,Reading news,11/14/12,0,143,65,49,232
Favorite feature,Reading news,11/15/12,0,130,77,42,208
Favorite feature,Reading news,11/16/12,0,116,90,35,186
Favorite feature,Fun facts,10/18/12,558,141,346,952,19
Favorite feature,Fun facts,10/19/12,546,125,335,931,14
Favorite feature,Fun facts,10/20/12,534,110,324,909,10
Favorite feature,Fun facts,10/21/12,521,96,313,886,6
Favorite feature,Fun facts,10/22/12,507,82,301,862,3
Favorite feature,Fun facts,10/23/12,493,70,289,837,1
Favorite feature,Fun facts,10/24/12,479,58,277,812,0
Favorite feature,Fun facts,10/25/12,464,47,265,785,0
Favorite feature,Fun facts,10/26/12,449,38,253,758,0
Favorite feature,Fun facts,10/27/12,433,29,241,731,1
Favorite feature,Fun facts,10/28/12,417,21,229,703,2
Favorite feature,Fun facts,10/29/12,401,15,217,675,4
Favorite feature,Fun facts,10/30/12,385,10,205,646,7
Favorite feature,Fun facts,10/31/12,368,5,192,617,11
Favorite feature,Fun facts,11/01/12,352,2,180,588,16
Favorite feature,Fun facts,11/02/12,335,0,169,559,21
Favorite feature,Fun facts,11/03/12,318,0,157,530,26
Favorite feature,Fun facts,11/04/12,301,0,146,501,33
Favorite feature,Fun facts,11/05/12,284,1,134,472,40
Favorite feature,Fun facts,11/06/12,268,4,123,444,48
Favorite feature,Fun facts,11/07/12,251,8,113,415,56
Favorite feature,Fun facts,11/08/12,235,13,103,387,65
Favorite feature,Fun facts,11/09/12,219,19,93,360,74
Favorite feature,Fun facts,11/10/12,203,26,83,333,84
Favorite feature,Fun facts,11/11/12,187,34,74,306,94
Favorite feature,Fun facts,11/12/12,172,43,65,281,105
Favorite feature,Fun facts,11/13/12,158,54,57,256,116
Favorite feature,Fun facts,11/14/12,143,65,49,232,128
Favorite feature,Fun facts,11/15/12,130,77,42,208,140
Favorite feature,Fun facts,11/16/12,116,90,35,186,153
Favorite feature,Polls,10/18/12,141,346,952,19,787
Favorite feature,Polls,10/19/12,125,335,931,14,735
Favorite feature,Polls,10/20/12,110,324,909,10,683
Favorite feature,Polls,10/21/12,96,313,886,6,632
Favorite feature,Polls,10/22/12,82,301,862,3,583
Favorite feature,Polls,10/23/12,70,289,837,1,534
Favorite feature,Polls,10/24/12,58,277,812,0,487
Favorite feature,Polls,10/25/12,47,265,785,0,442
Favorite feature,Polls,10/26/12,38,253,758,0,398
Favorite feature,Polls,10/27/12,29,241,731,1,356
Favorite feature,Polls,10/28/12,21,229,703,2,316
Favorite feature,Polls,10/29/12,15,217,675,4,278
Favorite feature,Polls,10/30/12,10,205,646,7,242
Favorite feature,Polls,10/31/12,5,192,617,11,208
Favorite feature,Polls,11/01/12,2,180,588,16,176
Favorite feature,Polls,11/02/12,0,169,559,21,147
Favorite feature,Polls,11/03/12,0,157,530,26,120
Favorite feature,Polls,11/04/12,0,146,501,33,96
Favorite feature,Polls,11/05/12,1,134,472,40,74
Favorite feature,Polls,11/06/12,4,123,444,48,55
Favorite feature,Polls,11/07/12,8,113,415,56,39
Favorite feature,Polls,11/08/12,13,103,387,65,26
Favorite feature,Polls,11/09/12,19,93,360,74,15
Favorite feature,Polls,11/10/12,26,83,333,84,7
Favorite feature,Polls,11/11/12,34,74,306,94,2
Favorite feature,Polls,11/12/12,43,65,281,105,0
Favorite feature,Polls,11/13/12,54,57,256,116,0
Favorite feature,Polls,11/14/12,65,49,232,128,4
Favorite feature,Polls,11/15/12,77,42,208,140,10
Favorite feature,Polls,11/16/12,90,35,186,153,19
</textarea>
</p>
<p>
<button id="visualize_my_data">Visualize my data</button>
</p>
</div>
<h2>CSV format explanation</h2>
<div>
<p>
Format is comma-separated with quotes like Excel. A guide to columns:
</p>
<ol>
<li>Cohort group type: Think of this as an <a href="http://en.wikipedia.org/wiki/Enumerated_type#C_and_syntactically_similar_languages">enum type</a> name.</li>
<li>Cohort group value: Think of these as enum values within an enum type.</li>
<li>Cohort day: Day to which the entry belongs, in the format MM/DD/YY (American short), MM/DD/YYYY (American long), or YYYY-MM-DD (ISO 8601). For October 25, 2012, the formats respectively are: 10/25/12, 10/25/2015, 2015-10-25.</li>
<li>State1: Number of users exclusively in state 1.</li>
<li>State2: Number of users exclusively in state 2.</li>
<li>... Additional state columns</li>
</ol>
<p>
First row is used to name the various user states you have. It should be in the format "Cohort group type,Cohort group value,Cohort day,State1 name,State2 name,...".
</p>
<p>
The dataset may have the same user appear in many rows that are of different
group types. What's important is for each group type the user is only in one
row with one group value; aka the tuple (group value, cohort day) should be
a unique row for each cohort group type. Order of the rows does not matter.
</p>
<h3>Example CSV</h3>
<p>
Here's a simple example for a fake social network with "Sign-up Referrer",
"Favorite feature", and "Total" cohort group types. This only counts a user
towards one sign-up referrer row, one favorite feature row, and one
total row. In the case of "Total" the only valid grouping value is the empty
string, which this tool treats specially.
<div class="example-table-container">
<table class="example-table">
<tr>
<th>Cohort group type</th>
<th>Cohort group value</th>
<th>Cohort day</th>
<th>Born</th>
<th>Updated profile</th>
<th>Sent first message</th>
</tr>
<!-- Sign-up referrer -->
<tr>
<td>Sign-up referrer</td>
<td>Search</td>
<td>10/25/12</td>
<td>5</td>
<td>5</td>
<td>5</td>
</tr>
<tr>
<td>Sign-up referrer</td>
<td>Search</td>
<td>10/26/12</td>
<td>10</td>
<td>10</td>
<td>0</td>
</tr>
<tr>
<td>Sign-up referrer</td>
<td>Email</td>
<td>10/25/12</td>
<td>5</td>
<td>5</td>
<td>5</td>
</tr>
<tr>
<td>Sign-up referrer</td>
<td>Email</td>
<td>10/26/12</td>
<td>5</td>
<td>0</td>
<td>5</td>
</tr>
<!-- Favorite feature -->
<tr>
<td>Favorite feature</td>
<td>Chat</td>
<td>10/25/12</td>
<td>0</td>
<td>5</td>
<td>10</td>
</tr>
<tr>
<td>Favorite feature</td>
<td>Chat</td>
<td>10/26/12</td>
<td>15</td>
<td>5</td>
<td>0</td>
</tr>
<tr>
<td>Favorite feature</td>
<td>Reading news</td>
<td>10/25/12</td>
<td>10</td>
<td>5</td>
<td>0</td>
</tr>
<tr>
<td>Favorite feature</td>
<td>Reading news</td>
<td>10/26/12</td>
<td>5</td>
<td>5</td>
<td>5</td>
</tr>
<!-- Total -->
<tr>
<td>Total</td>
<td></td>
<td>10/25/12</td>
<td>10</td>
<td>10</td>
<td>10</td>
</tr>
<tr>
<td>Total</td>
<td></td>
<td>10/26/12</td>
<td>20</td>
<td>10</td>
<td>5</td>
</tr>
</table>
</div>
</p>
<h3>Negative values</h3>
<p>
The sign of a column value is treated specially. The cohort data may include
two rows with the same (group value, cohort day) tuple, but one with all
positive column values, and one with all negative column values. Example
usage: When a user joins your service, have a positive value on their
birthday. When the same user leaves the service, have the same negative
value on their leave date. This lets you see the rate of sign-ups and drop-
offs independently. If you view both positive and negative values
cumulatively, you will plot your peak active users over time.
</p>
</div>
<h1>Why cohort analysis?</h1>
<div>
<p>
A cohort is a group of people who share a common characteristic or experience
within a defined period (<a
href="http://en.wikipedia.org/wiki/Cohort_study">Wikipedia</a>). It's used a
lot in health to track how different groups of patients respond to disease and
medication. It can be used in business to track progress in the funnel.
</p>
<p>
For software and websites, cohorts are useful because they let you measure the
impact of your product changes over time. Simple example: Using cohorts you
can see the conversion rate of new users from two months ago and compare it to
new users of today. Ideally, this would let you judge if your software is
getting better over time, users are getting happier, etc. Sometimes you'll see
that things are getting worse.
</p>
<p>
Cohort analysis can apply to more than just users. For example, you could
treat a set of articles on a blog as the source dataset; the levels of traffic
or reshares could be mutually exclusive states; and you could treat common
tags as a group type, or author as a group type. This tool would let you drill
down and compare all of those groupings pretty easily.
</p>
<p>
One of the most interesting things about cohort analysis is the graphs change
over time. If you take a snapshot of your cohort data today and then take
another snapshot two months from now, you'll see that the older cohort bars
have changed. This happens because users who signed up two months ago remain
active and continue to make progress in your funnel over extended periods.
It's useful to save your cohort datasets after you collect them, so you can
compare to the past.
</p>
<p>
Other things to read to understand the motivation and method behind this:
<ul>
<li><a href="http://blog.kera.io/post/33745559146/cohort-analysis-metrics-for-a-scalable-business">Cohort Analysis: Metrics for a Scalable Business</a> (kera.io)</li>
<li><a href="http://goo.gl/nb3KY">My Cohort Analysis workshop for the Google Ventures Startup Lab</a> (read the speaker notes)</li>
<li><a href="http://www.ashmaurya.com/2010/07/3-rules-to-actionable-metrics/">Ash Maurya on Actionable Metrics</a> (ashmaurya.com)</li>
<li><a href="http://www.avc.com/a_vc/2009/10/the-cohort-analysis.html">The Cohort Analysis</a> (avc.com)</li>
<li><a href="http://www.onebigfluke.com/2012/10/doing-cohort-analysis-with-map-reduce.html">Doing Cohort Analysis with Map Reduce</a> (my blog)</li>
</ul>
</p>
</div>
<h1 id="calculations">Calculations</h1>
<div>
<p>
Here's a quick guide to the calculations presented on the right. A "bar" is
every cohort for a particular day. A "bar segment" is one part of the bar for a
day in single color, corresponding to a particular "cohort state" (like "Made
two posts" above), which is usually some level of progression in the funnel.
</p>
<p class="calculations-legend">
<div class="single-calculation">
<span class="calculations-formula">∑↑ / ∑↕</span>
<span class="calculations-short-name">"Percentage here and up"</span>
<div class="calculations-description">
Sum the bar your mouse is over vertically upward, including the bar
segment your mouse is on top of. Then divide by the total sum for that bar
vertically. Answers: "On this day, what percentage of users are beyond and
including this cohort state in the funnel?" For the bottom bar segment
this will be 100%.
</div>
</div>
<div class="single-calculation">
<span class="calculations-formula">∑↓ / ∑↕</span>
<span class="calculations-short-name">"Percentage here and down"</span>
<div class="calculations-description">
Sum the bar your mouse is over vertically downward, including the bar
segment your mouse is on top of. Then divide by the total sum for that bar
vertically. Answers: "On this day, what percentage of users are before and
including this cohort state in the funnel?" For the top bar segment this
will be 100%.
</div>
</div>
<div class="single-calculation">
<span class="calculations-formula">X / ∑←</span>
<span class="calculations-short-name">"Percentage here of cumulative past sum"</span>
<div class="calculations-description">
Sum all bar segments from the cohort state you have your mouse over going
back in time to the left, including the one your mouse is over. Divide the
bar segment you have your mouse over by that sum. Answers: "What
percentage of users does the highlighted bar segment represent as part of
the whole past for that cohort state, including this day?"
</div>
</div>
<div class="single-calculation">
<span class="calculations-formula">X / ∑→</span>
<span class="calculations-short-name">"Percentage here of cumulative future sum"</span>
<div class="calculations-description">
Sum all bar segments from the cohort state you have your mouse over going
forward in time to the right, including the one your mouse is over. Divide
the bar segment you have your mouse over by that sum. Answers: "What
percentage of users does the highlighted bar segment represent as part of
the whole future for that cohort state, including this day?"
</div>
</div>
<div class="single-calculation">
<span class="calculations-formula">X / ∑↔</span>
<span class="calculations-short-name">"Percentage here of cumulative sum over time"</span>
<div class="calculations-description">
Sum all bar segments for the cohort state you have your mouse over for all
days. Divide the bar segment you have your mouse over by that sum.
Answers: "What percentage of users does the highlighted bar segment
represent over all time for that cohort state?"
</div>
</div>
<div class="single-calculation">
<span class="calculations-formula">∑← / ∑↔</span>
<span class="calculations-short-name">"Contribution of past to cumulative sum over time"</span>
<div class="calculations-description">
Sum all bar segments from the cohort state you have your mouse over going
back in time to the left, including the one your mouse is over. Answers:
"What percentage of users over all time got into the highlighted cohort
state before and including the highlighted day?" For the last day this
will be 100%.
</div>
</div>
<div class="single-calculation">
<span class="calculations-formula">∑→ / ∑↔</span>
<span class="calculations-short-name">"Contribution of future to cumulative sum over time"</span>
<div class="calculations-description">
Sum all bar segments from the cohort state you have your mouse over going
forward in time to the right, including the one your mouse is over.
Answers: "What percentage of users over all time got into the highlighted
cohort state after and including the highlighted day?" For the first day
this will be 100%.
</div>
</div>
<div class="single-calculation">
<span class="calculations-formula">X / Max ↔</span>
<span class="calculations-short-name">"Percentage of maximum single day ever"</span>
<div class="calculations-description">
Find the biggest bar segment for the cohort state you have your mouse over
for all time. Divide the bar segment you have your mouse over by the the
biggest amount. Answers: "How big is this day for users to get into the
highlighted cohort state compared to all other days ever?" The biggest day
will be 100%.
</div>
</div>
<div class="single-calculation">
<span class="calculations-formula">1 - X / Max ↔</span>
<span class="calculations-short-name">"Delta from maximum single day ever"</span>
<div class="calculations-description">
Find the biggest bar segment for the cohort state you have your mouse over
for all time. Divide the bar segment you have your mouse over by the the
biggest amount. Subtract that from 100%. Answers: "How much bigger is the
biggest day ever for this cohort state compared to this day?" The biggest
day will be 0%.
</div>
</div>
</p>
</div>
<h1>About</h1>
<div>
<p>Copyright 2012-2015 <a href="http://www.onebigfluke.com">Brett Slatkin</a></p>
<p>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
</p>
<p>
<a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>
</p>
<p>
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</p>
<p>
<br>
Built using <a href="http://d3js.org/">D3</a>, <a href="http://www.jquery.org">jQuery</a>, <a href="http://www.google.com/webfonts">Web Fonts</a>, and <a href="http://subtlepatterns.com/">Subtle Patterns</a>
</p>
</div>
</div>
</body>
</html>