Skip to content

Instantly share code, notes, and snippets.

@mikeleeco
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeleeco/9afcc0b885b72f4b0cd2 to your computer and use it in GitHub Desktop.
Save mikeleeco/9afcc0b885b72f4b0cd2 to your computer and use it in GitHub Desktop.
video_game_theme.js
row_idx col_idx vgfreq
1 1 1
2 1 0.674872666
3 1 0.046689304
4 1 0.0127334465
5 1 0.015280136
6 1 0.094227504
7 1 0.019524618
8 1 0.0033955857
9 1 0.006791171
10 1 0.017826825
11 1 0.0475382
12 1 0.160441426
13 1 0.029711375
14 1 0.0008488964
15 1 0.0127334465
16 1 0.0008488964
17 1 0.0008488964
18 1 0.033955857
19 1 0.019524618
20 1 0.013582343
21 1 0.0220713073
22 1 0.016129032
23 1 0.0033955857
24 1 0.0042444822
25 1 0.0016977929
26 1 0
27 1 0.0050933786
28 1 0.0016977929
29 1 0.0016977929
30 1 0.0076400679
31 1 0.084040747
32 1 0.032258065
33 1 0
34 1 0.1196944
35 1 0.044991511
36 1 0.0008488964
37 1 0.003395586
38 1 0.002546689
39 1 0.0008488964
40 1 0
41 1 0.131578947
42 1 0
43 1 0.2028862479
1 2 0.1976628543
2 2 1
3 2 0.102933864
4 2 0.0417702636
5 2 0.012182994
6 2 0.03356539
7 2 0.0077076082
8 2 0.000497265
9 2 0.004475385
10 2 0.011934361
11 2 0.032073595
12 2 0.26330184
13 2 0.115614122
14 2 0.0064644455
15 2 0.0069617106
16 2 0.0019890602
17 2 0.0029835903
18 2 0.015415216
19 2 0.0002486325
20 2 0.006215813
21 2 0.0099453008
22 2 0.014669319
23 2 0.0367976131
24 2 0.0007458976
25 2 0.000497265
26 2 0.0009945301
27 2 0.0024863252
28 2 0.0087021382
29 2 0.0007458976
30 2 0.018150174
31 2 0.073843859
32 2 0.062904028
33 2 0.011934361
34 2 0.18771755
35 2 0.077573347
36 2 0.0022376927
37 2 0.002237693
38 2 0.001491795
39 2 0.0009945301
40 2 0.0002486325
41 2 0.222028841
42 2 0.0009945301
43 2 0.1307807061
1 3 0.0076719208
2 3 0.05774864
3 3 1
4 3 0.0079508997
5 3 0.010880179
6 3 0.0026503
7 3 0.002092342
8 3 0.0004184684
9 3 0.010880179
10 3 0.004882131
11 3 0.001115916
12 3 0.044915609
13 3 0.067512903
14 3 0.0352908355
15 3 0.0022318315
16 3 0.011019668
17 3 0.0033477472
18 3 0.011159157
19 3 0.0004184684
20 3 0.0008369368
21 3 0.0034872367
22 3 0.005021621
23 3 0.0161807784
24 3 0.0019528526
25 3 0.0004184684
26 3 0.0071139629
27 3 0.0379411354
28 3 0.0001394895
29 3 0.0108801785
30 3 0.0083693681
31 3 0.099455991
32 3 0.029711257
33 3 0.0163202678
34 3 0.23503975
35 3 0.312177431
36 3 0.0033477472
37 3 0.001394895
38 3 0.001115916
39 3 0.0138094574
40 3 0.0008369368
41 3 0.002371321
42 3 0.0043241735
43 3 0.0001394895
1 4 0.0338600451
2 4 0.379232506
3 4 0.128668172
4 4 1
5 4 0
6 4 0
7 4 0
8 4 0
9 4 0.009029345
10 4 0.045146727
11 4 0.002257336
12 4 0.009029345
13 4 0.090293454
14 4 0.0744920993
15 4 0.0022573363
16 4 0.0225733634
17 4 0.0022573363
18 4 0.002257336
19 4 0
20 4 0
21 4 0.0045146727
22 4 0.011286682
23 4 0.0022573363
24 4 0
25 4 0
26 4 0
27 4 0
28 4 0.0090293454
29 4 0
30 4 0.0496613995
31 4 0.011286682
32 4 0.088036117
33 4 0.006772009
34 4 0.80586907
35 4 0.388261851
36 4 0
37 4 0.002257336
38 4 0
39 4 0.0361173815
40 4 0
41 4 0.189616253
42 4 0
43 4 0.0225733634
1 5 0.0132061629
2 5 0.03595011
3 5 0.057226706
4 5 0
5 5 1
6 5 0.065297139
7 5 0.0227439472
8 5 0.0564930301
9 5 0.005869406
10 5 0.002201027
11 5 0.013939839
12 5 0.040352164
13 5 0.006603081
14 5 0.0029347029
15 5 0.0337490829
16 5 0.0007336757
17 5 0.01027146
18 5 0.005869406
19 5 0.0007336757
20 5 0
21 5 0
22 5 0.018341893
23 5 0.0007336757
24 5 0.0029347029
25 5 0.0066030814
26 5 0.0234776229
27 5 0.0066030814
28 5 0
29 5 0.0014673514
30 5 0.0007336757
31 5 0.195891416
32 5 0.03595011
33 5 0.0528246515
34 5 0.03081438
35 5 0.019809244
36 5 0.0022010271
37 5 0.001467351
38 5 0.001467351
39 5 0.0066030814
40 5 0.0007336757
41 5 0.229640499
42 5 0.0014673514
43 5 0
1 6 0.1167192429
2 6 0.141955836
3 6 0.01997897
4 6 0
5 6 0.093585699
6 6 1
7 6 0.2029442692
8 6 0.014721346
9 6 0.005257624
10 6 0.001051525
11 6 0.006309148
12 6 0.058885384
13 6 0.005257624
14 6 0
15 6 0.0021030494
16 6 0
17 6 0.0021030494
18 6 0.002103049
19 6 0
20 6 0.0010515247
21 6 0.0010515247
22 6 0.007360673
23 6 0.0010515247
24 6 0.0010515247
25 6 0.0052576236
26 6 0
27 6 0.0042060988
28 6 0.007360673
29 6 0.0021030494
30 6 0.0021030494
31 6 0.096740273
32 6 0.031545741
33 6 0.0052576236
34 6 0.03154574
35 6 0.008412198
36 6 0.0010515247
37 6 0
38 6 0
39 6 0.0010515247
40 6 0
41 6 0.12723449
42 6 0.0010515247
43 6 0.0063091483
1 7 0.0598958333
2 7 0.080729167
3 7 0.0390625
4 7 0
5 7 0.080729167
6 7 0.502604167
7 7 1
8 7 0.0182291667
9 7 0
10 7 0
11 7 0.005208333
12 7 0.005208333
13 7 0.005208333
14 7 0
15 7 0.0078125
16 7 0.0026041667
17 7 0
18 7 0
19 7 0.0026041667
20 7 0
21 7 0
22 7 0.013020833
23 7 0
24 7 0
25 7 0
26 7 0
27 7 0.0026041667
28 7 0
29 7 0.0078125
30 7 0
31 7 0.0625
32 7 0.018229167
33 7 0
34 7 0.03125
35 7 0.015625
36 7 0
37 7 0
38 7 0
39 7 0.0052083333
40 7 0
41 7 0.057291667
42 7 0
43 7 0
1 8 0.0186046512
2 8 0.009302326
3 8 0.013953488
4 8 0
5 8 0.358139535
6 8 0.065116279
7 8 0.0325581395
8 8 1
9 8 0
10 8 0
11 8 0
12 8 0.046511628
13 8 0.013953488
14 8 0.0046511628
15 8 0
16 8 0
17 8 0.0046511628
18 8 0
19 8 0
20 8 0
21 8 0
22 8 0.004651163
23 8 0.0093023256
24 8 0
25 8 0
26 8 0.0046511628
27 8 0.0046511628
28 8 0
29 8 0
30 8 0.0046511628
31 8 0.134883721
32 8 0.018604651
33 8 0.0046511628
34 8 0.04651163
35 8 0.004651163
36 8 0
37 8 0
38 8 0
39 8 0
40 8 0
41 8 0.111627907
42 8 0
43 8 0
1 9 0.0136518771
2 9 0.030716724
3 9 0.133105802
4 9 0.0068259386
5 9 0.013651877
6 9 0.008532423
7 9 0
8 9 0
9 9 1
10 9 0.017064846
11 9 0.092150171
12 9 0.030716724
13 9 0.225255973
14 9 0.0187713311
15 9 0.0068259386
16 9 0.0017064846
17 9 0.0034129693
18 9 0.02559727
19 9 0
20 9 0.0187713311
21 9 0.0068259386
22 9 0.008532423
23 9 0.0290102389
24 9 0
25 9 0.0034129693
26 9 0.0051194539
27 9 0
28 9 0.0187713311
29 9 0.0017064846
30 9 0.0119453925
31 9 0.247440273
32 9 0.017064846
33 9 0.0034129693
34 9 0.16552901
35 9 0.100682594
36 9 0.0255972696
37 9 0.015358362
38 9 0.005119454
39 9 0
40 9 0
41 9 0.017064846
42 9 0.0034129693
43 9 0.0017064846
1 10 0.0498812352
2 10 0.114014252
3 10 0.083135392
4 10 0.0475059382
5 10 0.007125891
6 10 0.002375297
7 10 0
8 10 0
9 10 0.023752969
10 10 1
11 10 0.078384798
12 10 0.064133017
13 10 0.064133017
14 10 0.0237529691
15 10 0.0023752969
16 10 0
17 10 0
18 10 0.049881235
19 10 0.0118764846
20 10 0.0166270784
21 10 0.0213776722
22 10 0
23 10 0.0166270784
24 10 0.0023752969
25 10 0.0023752969
26 10 0
27 10 0.0023752969
28 10 0.0142517815
29 10 0
30 10 0.109263658
31 10 0.159144893
32 10 0.078384798
33 10 0.0023752969
34 10 0.49406176
35 10 0.339667458
36 10 0.0285035629
37 10 0.033254157
38 10 0.019002375
39 10 0.0118764846
40 10 0
41 10 0.09976247
42 10 0.0142517815
43 10 0.0285035629
1 11 0.0424242424
2 11 0.097727273
3 11 0.006060606
4 11 0.0007575758
5 11 0.014393939
6 11 0.004545455
7 11 0.0015151515
8 11 0
9 11 0.040909091
10 11 0.025
11 11 1
12 11 0.042424242
13 11 0.008333333
14 11 0.003030303
15 11 0.0022727273
16 11 0.0007575758
17 11 0
18 11 0.126515152
19 11 0.0363636364
20 11 0.0401515152
21 11 0.0234848485
22 11 0.001515152
23 11 0.0015151515
24 11 0
25 11 0
26 11 0.0022727273
27 11 0
28 11 0.0015151515
29 11 0
30 11 0.0060606061
31 11 0.564393939
32 11 0.025757576
33 11 0.0037878788
34 11 0.07878788
35 11 0.031060606
36 11 0.0257575758
37 11 0.009090909
38 11 0.021212121
39 11 0.0007575758
40 11 0.0007575758
41 11 0.018181818
42 11 0.0007575758
43 11 0.0310606061
1 12 0.0340479193
2 12 0.190776437
3 12 0.058007566
4 12 0.0007205909
5 12 0.009908125
6 12 0.010088272
7 12 0.0003602954
8 12 0.0018014772
9 12 0.003242659
10 12 0.004863988
11 12 0.010088272
12 12 1
13 12 0.045937669
14 12 0.0039632499
15 12 0.0016213295
16 12 0.0003602954
17 12 0.0079264997
18 12 0.015492704
19 12 0.0286434877
20 12 0.023239056
21 12 0.0027022158
22 12 0.021257431
23 12 0.0100882724
24 12 0.0010808863
25 12 0.0001801477
26 12 0.0021617727
27 12 0.003242659
28 12 0.0464781121
29 12 0.0021617727
30 12 0.0041433976
31 12 0.146640245
32 12 0.150063052
33 12 0.0018014772
34 12 0.04449649
35 12 0.039812646
36 12 0.0003602954
37 12 0.010448568
38 12 0.002702216
39 12 0.0005404432
40 12 0.0001801477
41 12 0.224103765
42 12 0
43 12 0.0086470906
1 13 0.0170565302
2 13 0.226608187
3 13 0.235867446
4 13 0.0194931774
5 13 0.004385965
6 13 0.002436647
7 13 0.0009746589
8 13 0.0014619883
9 13 0.064327485
10 13 0.013157895
11 13 0.005360624
12 13 0.124269006
13 13 1
14 13 0.0082846004
15 13 0.0019493177
16 13 0.0019493177
17 13 0.0058479532
18 13 0.028752437
19 13 0.0004873294
20 13 0.0014619883
21 13 0.0029239766
22 13 0.006822612
23 13 0.1954191033
24 13 0.0029239766
25 13 0
26 13 0.0048732943
27 13 0.0009746589
28 13 0.0053606238
29 13 0.0009746589
30 13 0.014619883
31 13 0.046783626
32 13 0.028265107
33 13 0.0043859649
34 13 0.14424951
35 13 0.087719298
36 13 0.0121832359
37 13 0.011695906
38 13 0.002923977
39 13 0.0063352827
40 13 0.0004873294
41 13 0.013157895
42 13 0.0019493177
43 13 0.0019493177
1 14 0.0006257822
2 14 0.016270338
3 14 0.158322904
4 14 0.0206508135
5 14 0.002503129
6 14 0
7 14 0
8 14 0.0006257822
9 14 0.006883605
10 14 0.006257822
11 14 0.002503129
12 14 0.013767209
13 14 0.010638298
14 14 1
15 14 0
16 14 0.12077597
17 14 0.0963704631
18 14 0.001251564
19 14 0.0012515645
20 14 0
21 14 0.0025031289
22 14 0.030037547
23 14 0
24 14 0.0037546934
25 14 0
26 14 0.0306633292
27 14 0.0025031289
28 14 0.008135169
29 14 0
30 14 0.0162703379
31 14 0.021902378
32 14 0.065707134
33 14 0.0025031289
34 14 0.26595745
35 14 0.371714643
36 14 0.0050062578
37 14 0.001877347
38 14 0
39 14 0.0400500626
40 14 0.0006257822
41 14 0.010638298
42 14 0.0037546934
43 14 0
1 15 0.0402144772
2 15 0.075067024
3 15 0.042895442
4 15 0.0026809651
5 15 0.123324397
6 15 0.00536193
7 15 0.0080428954
8 15 0
9 15 0.010723861
10 15 0.002680965
11 15 0.008042895
12 15 0.024128686
13 15 0.010723861
14 15 0
15 15 1
16 15 0.0026809651
17 15 0
18 15 0.00536193
19 15 0
20 15 0
21 15 0.0026809651
22 15 0.016085791
23 15 0.0053619303
24 15 0
25 15 0.0107238606
26 15 0
27 15 0.0107238606
28 15 0
29 15 0.0026809651
30 15 0
31 15 0.144772118
32 15 0.016085791
33 15 0.0160857909
34 15 0.01876676
35 15 0.018766756
36 15 0
37 15 0
38 15 0
39 15 0
40 15 0
41 15 0.026809651
42 15 0.0053619303
43 15 0
1 16 0.0024096386
2 16 0.019277108
3 16 0.190361446
4 16 0.0240963855
5 16 0.002409639
6 16 0
7 16 0.0024096386
8 16 0
9 16 0.002409639
10 16 0
11 16 0.002409639
12 16 0.004819277
13 16 0.009638554
14 16 0.465060241
15 16 0.0024096386
16 16 1
17 16 0.0192771084
18 16 0.002409639
19 16 0
20 16 0
21 16 0.0024096386
22 16 0.012048193
23 16 0
24 16 0
25 16 0.0024096386
26 16 0.0554216867
27 16 0.0024096386
28 16 0
29 16 0
30 16 0.0048192771
31 16 0.014457831
32 16 0.057831325
33 16 0
34 16 0.0939759
35 16 0.595180723
36 16 0.0265060241
37 16 0.007228916
38 16 0
39 16 0.1397590361
40 16 0.0024096386
41 16 0.007228916
42 16 0.0024096386
43 16 0
1 17 0.0008084074
2 17 0.009700889
3 17 0.019401778
4 17 0.0008084074
5 17 0.011317704
6 17 0.001616815
7 17 0
8 17 0.0008084074
9 17 0.001616815
10 17 0
11 17 0
12 17 0.035569927
13 17 0.009700889
14 17 0.1244947454
15 17 0
16 17 0.0064672595
17 17 1
18 17 0.002425222
19 17 0.0008084074
20 17 0.0008084074
21 17 0.0008084074
22 17 0.06628941
23 17 0.0137429264
24 17 0
25 17 0
26 17 0.0945836702
27 17 0
28 17 0.0040420372
29 17 0.0008084074
30 17 0.0008084074
31 17 0.008084074
32 17 0.338722716
33 17 0
34 17 0.0113177
35 17 0.113177041
36 17 0.0032336297
37 17 0.009700889
38 17 0
39 17 0.0485044462
40 17 0
41 17 0.29668553
42 17 0
43 17 0
1 18 0.0374181478
2 18 0.057998129
3 18 0.074836296
4 18 0.0009354537
5 18 0.00748363
6 18 0.001870907
7 18 0
8 18 0
9 18 0.014031805
10 18 0.019644528
11 18 0.156220767
12 18 0.080449018
13 18 0.055191768
14 18 0.0018709074
15 18 0.0018709074
16 18 0.0009354537
17 18 0.0028063611
18 18 1
19 18 0.0402245089
20 18 0.0261927035
21 18 0.0187090739
22 18 0.002806361
23 18 0.0037418148
24 18 0.0028063611
25 18 0.0018709074
26 18 0
27 18 0.0018709074
28 18 0.0018709074
29 18 0.0065481759
30 18 0.0196445276
31 18 0.330215154
32 18 0.019644528
33 18 0.0009354537
34 18 0.11225444
35 18 0.221702526
36 18 0.0018709074
37 18 0.011225444
38 18 0.028063611
39 18 0.0028063611
40 18 0
41 18 0.018709074
42 18 0.0037418148
43 18 0.0271281572
1 19 0.0357142857
2 19 0.001552795
3 19 0.004658385
4 19 0
5 19 0.001552795
6 19 0
7 19 0.001552795
8 19 0
9 19 0
10 19 0.007763975
11 19 0.074534161
12 19 0.24689441
13 19 0.001552795
14 19 0.0031055901
15 19 0
16 19 0
17 19 0.001552795
18 19 0.066770186
19 19 1
20 19 0.0652173913
21 19 0
22 19 0.004658385
23 19 0.0031055901
24 19 0.0108695652
25 19 0
26 19 0.0062111801
27 19 0.001552795
28 19 0.0077639752
29 19 0
30 19 0.0093167702
31 19 0.209627329
32 19 0.02173913
33 19 0.001552795
34 19 0.16770186
35 19 0.001552795
36 19 0.0186335404
37 19 0
38 19 0.004658385
39 19 0
40 19 0
41 19 0.020186335
42 19 0
43 19 0
1 20 0.0330578512
2 20 0.051652893
3 20 0.012396694
4 20 0
5 20 0
6 20 0.002066116
7 20 0
8 20 0
9 20 0.022727273
10 20 0.01446281
11 20 0.109504132
12 20 0.266528926
13 20 0.006198347
14 20 0
15 20 0
16 20 0
17 20 0.0020661157
18 20 0.05785124
19 20 0.0867768595
20 20 1
21 20 0
22 20 0.004132231
23 20 0.0020661157
24 20 0
25 20 0
26 20 0.0061983471
27 20 0
28 20 0.0041322314
29 20 0
30 20 0.0144628099
31 20 0.309917355
32 20 0.018595041
33 20 0
34 20 0.16115702
35 20 0.004132231
36 20 0.0185950413
37 20 0
38 20 0.010330579
39 20 0
40 20 0
41 20 0.010330579
42 20 0
43 20 0.0041322314
1 21 0.1155555556
2 21 0.177777778
3 21 0.111111111
4 21 0.0088888889
5 21 0
6 21 0.004444444
7 21 0
8 21 0
9 21 0.017777778
10 21 0.04
11 21 0.137777778
12 21 0.066666667
13 21 0.026666667
14 21 0.0177777778
15 21 0.0044444444
16 21 0.0044444444
17 21 0.0044444444
18 21 0.088888889
19 21 0
20 21 0
21 21 1
22 21 0.013333333
23 21 0.0133333333
24 21 0.0088888889
25 21 0
26 21 0.0044444444
27 21 0
28 21 0
29 21 0
30 21 0.0044444444
31 21 0.146666667
32 21 0.022222222
33 21 0.0044444444
34 21 0.19111111
35 21 0.093333333
36 21 0.0044444444
37 21 0
38 21 0.013333333
39 21 0
40 21 0
41 21 0
42 21 0.0533333333
43 21 0.0711111111
1 22 0.0101604278
2 22 0.031550802
3 22 0.019251337
4 22 0.0026737968
5 22 0.013368984
6 22 0.003743316
7 22 0.0026737968
8 22 0.0005347594
9 22 0.002673797
10 22 0
11 22 0.001069519
12 22 0.063101604
13 22 0.007486631
14 22 0.0256684492
15 22 0.0032085561
16 22 0.0026737968
17 22 0.0438502674
18 22 0.001604278
19 22 0.0016042781
20 22 0.0010695187
21 22 0.0016042781
22 22 1
23 22 0
24 22 0.0042780749
25 22 0.0005347594
26 22 0.0112299465
27 22 0.0010695187
28 22 0.0219251337
29 22 0
30 22 0.007486631
31 22 0.020320856
32 22 0.230481283
33 22 0.0037433155
34 22 0.10481283
35 22 0.018716578
36 22 0.0032085561
37 22 0.001069519
38 22 0
39 22 0.0037433155
40 22 0.022459893
41 22 0.099465241
42 22 0.0005347594
43 22 0.0005347594
1 23 0.0075046904
2 23 0.277673546
3 23 0.217636023
4 23 0.0018761726
5 23 0.001876173
6 23 0.001876173
7 23 0
8 23 0.0037523452
9 23 0.031894934
10 23 0.013133208
11 23 0.003752345
12 23 0.105065666
13 23 0.752345216
14 23 0
15 23 0.0037523452
16 23 0
17 23 0.0318949343
18 23 0.00750469
19 23 0.0037523452
20 23 0.0018761726
21 23 0.0056285178
22 23 0
23 23 1
24 23 0.0150093809
25 23 0
26 23 0
27 23 0.0018761726
28 23 0.0075046904
29 23 0
30 23 0.009380863
31 23 0.039399625
32 23 0.020637899
33 23 0.009380863
34 23 0.05253283
35 23 0.046904315
36 23 0.0112570356
37 23 0.022514071
38 23 0.009380863
39 23 0
40 23 0
41 23 0.015009381
42 23 0
43 23 0.0018761726
1 24 0.0248756219
2 24 0.014925373
3 24 0.069651741
4 24 0
5 24 0.019900498
6 24 0.004975124
7 24 0
8 24 0
9 24 0
10 24 0.004975124
11 24 0
12 24 0.029850746
13 24 0.029850746
14 24 0.0298507463
15 24 0
16 24 0
17 24 0
18 24 0.014925373
19 24 0.0348258706
20 24 0
21 24 0.0099502488
22 24 0.039800995
23 24 0.039800995
24 24 1
25 24 0.0248756219
26 24 0.0099502488
27 24 0
28 24 0.0099502488
29 24 0.0049751244
30 24 0.0049751244
31 24 0.248756219
32 24 0.069651741
33 24 0.0348258706
34 24 0.05970149
35 24 0.019900498
36 24 0
37 24 0.004975124
38 24 0.009950249
39 24 0.0049751244
40 24 0
41 24 0.029850746
42 24 0
43 24 0.0099502488
1 25 0.0215053763
2 25 0.021505376
3 25 0.032258065
4 25 0
5 25 0.096774194
6 25 0.053763441
7 25 0
8 25 0
9 25 0.021505376
10 25 0.010752688
11 25 0
12 25 0.010752688
13 25 0
14 25 0
15 25 0.0430107527
16 25 0.0107526882
17 25 0
18 25 0.021505376
19 25 0
20 25 0
21 25 0
22 25 0.010752688
23 25 0
24 25 0.0537634409
25 25 1
26 25 0
27 25 0
28 25 0
29 25 0
30 25 0
31 25 0.494623656
32 25 0.064516129
33 25 0
34 25 0.03225806
35 25 0
36 25 0
37 25 0
38 25 0
39 25 0
40 25 0
41 25 0.107526882
42 25 0
43 25 0
1 26 0
2 26 0.007692308
3 26 0.098076923
4 26 0
5 26 0.061538462
6 26 0
7 26 0
8 26 0.0019230769
9 26 0.005769231
10 26 0
11 26 0.005769231
12 26 0.023076923
13 26 0.019230769
14 26 0.0942307692
15 26 0
16 26 0.0442307692
17 26 0.225
18 26 0
19 26 0.0076923077
20 26 0.0057692308
21 26 0.0019230769
22 26 0.040384615
23 26 0
24 26 0.0038461538
25 26 0
26 26 1
27 26 0.0019230769
28 26 0.0115384615
29 26 0
30 26 0.0153846154
31 26 0.046153846
32 26 0.240384615
33 26 0
34 26 0.07692308
35 26 0.171153846
36 26 0.0153846154
37 26 0.017307692
38 26 0
39 26 0.0442307692
40 26 0
41 26 0.146153846
42 26 0
43 26 0
1 27 0.0147058824
2 27 0.024509804
3 27 0.666666667
4 27 0
5 27 0.022058824
6 27 0.009803922
7 27 0.0024509804
8 27 0.0024509804
9 27 0
10 27 0.00245098
11 27 0
12 27 0.044117647
13 27 0.004901961
14 27 0.0098039216
15 27 0.0098039216
16 27 0.0024509804
17 27 0
18 27 0.004901961
19 27 0.0024509804
20 27 0
21 27 0
22 27 0.004901961
23 27 0.0024509804
24 27 0
25 27 0
26 27 0.0024509804
27 27 1
28 27 0
29 27 0.0220588235
30 27 0.0024509804
31 27 0.049019608
32 27 0.017156863
33 27 0.012254902
34 27 0.10294118
35 27 0.06127451
36 27 0.0024509804
37 27 0
38 27 0
39 27 0.012254902
40 27 0
41 27 0.004901961
42 27 0
43 27 0
1 28 0.0042553191
2 28 0.074468085
3 28 0.00212766
4 28 0.0085106383
5 28 0
6 28 0.014893617
7 28 0
8 28 0
9 28 0.023404255
10 28 0.012765957
11 28 0.004255319
12 28 0.54893617
13 28 0.023404255
14 28 0.0276595745
15 28 0
16 28 0
17 28 0.0106382979
18 28 0.004255319
19 28 0.0106382979
20 28 0.0042553191
21 28 0
22 28 0.087234043
23 28 0.0085106383
24 28 0.0042553191
25 28 0
26 28 0.0127659574
27 28 0
28 28 1
29 28 0
30 28 0.0319148936
31 28 0.025531915
32 28 0.295744681
33 28 0.0021276596
34 28 0.17234043
35 28 0.055319149
36 28 0.0042553191
37 28 0
38 28 0
39 28 0.0085106383
40 28 0
41 28 0.038297872
42 28 0
43 28 0
1 29 0.0067114094
2 29 0.010067114
3 29 0.261744966
4 29 0
5 29 0.006711409
6 29 0.006711409
7 29 0.0100671141
8 29 0
9 29 0.003355705
10 29 0
11 29 0
12 29 0.040268456
13 29 0.006711409
14 29 0
15 29 0.0033557047
16 29 0
17 29 0.0033557047
18 29 0.023489933
19 29 0
20 29 0
21 29 0
22 29 0
23 29 0
24 29 0.0033557047
25 29 0
26 29 0
27 29 0.0302013423
28 29 0
29 29 1
30 29 0.0033557047
31 29 0.033557047
32 29 0.006711409
33 29 0.0033557047
34 29 0.0704698
35 29 0.013422819
36 29 0
37 29 0
38 29 0
39 29 0
40 29 0.0033557047
41 29 0.003355705
42 29 0
43 29 0
1 30 0.0157618214
2 30 0.127845884
3 30 0.105078809
4 30 0.0385288967
5 30 0.001751313
6 30 0.003502627
7 30 0
8 30 0.0017513135
9 30 0.012259194
10 30 0.08056042
11 30 0.014010508
12 30 0.04028021
13 30 0.052539405
14 30 0.0455341506
15 30 0
16 30 0.003502627
17 30 0.0017513135
18 30 0.036777583
19 30 0.0105078809
20 30 0.0122591944
21 30 0.0017513135
22 30 0.024518389
23 30 0.0087565674
24 30 0.0017513135
25 30 0
26 30 0.0140105079
27 30 0.0017513135
28 30 0.0262697023
29 30 0.0017513135
30 30 1
31 30 0.085814361
32 30 0.11033275
33 30 0
34 30 0.46584939
35 30 0.392294221
36 30 0.0017513135
37 30 0.036777583
38 30 0.031523643
39 30 0.0157618214
40 30 0.0017513135
41 30 0.11558669
42 30 0.003502627
43 30 0.0122591944
1 31 0.0116033755
2 31 0.034810127
3 31 0.083567745
4 31 0.0005860291
5 31 0.031293952
6 31 0.010782935
7 31 0.0028129395
8 31 0.0033989686
9 31 0.016994843
10 31 0.007852789
11 31 0.087318331
12 31 0.095405532
13 31 0.011251758
14 31 0.0041022035
15 31 0.0063291139
16 31 0.0007032349
17 31 0.0011720581
18 31 0.041373652
19 31 0.0158227848
20 31 0.017580872
21 31 0.0038677918
22 31 0.004453821
23 31 0.0024613221
24 31 0.0058602907
25 31 0.0053914674
26 31 0.0028129395
27 31 0.0023441163
28 31 0.0014064698
29 31 0.0011720581
30 31 0.0057430849
31 31 1
32 31 0.086380684
33 31 0.0086732302
34 31 0.08766995
35 31 0.042428504
36 31 0.0096108767
37 31 0.007501172
38 31 0.013595874
39 31 0.0014064698
40 31 0.0019924988
41 31 0.024378809
42 31 0.0009376465
43 31 0.0016408814
1 32 0.0104943386
2 32 0.069870202
3 32 0.058823529
4 32 0.0107705054
5 32 0.013532173
6 32 0.008285004
7 32 0.0019331676
8 32 0.0011046672
9 32 0.002761668
10 32 0.009113505
11 32 0.009389671
12 32 0.230046948
13 32 0.016017675
14 32 0.0289975145
15 32 0.0016570008
16 32 0.0066280033
17 32 0.1157138912
18 32 0.005799503
19 32 0.0038663353
20 32 0.0024855012
21 32 0.001380834
22 32 0.119027893
23 32 0.0030378349
24 32 0.0038663353
25 32 0.0016570008
26 32 0.0345208506
27 32 0.0019331676
28 32 0.0383871859
29 32 0.0005523336
30 32 0.0173985087
31 32 0.203534935
32 32 1
33 32 0.0055233361
34 32 0.17370892
35 32 0.049157691
36 32 0.0071803369
37 32 0.005247169
38 32 0.002209334
39 32 0.0171223419
40 32 0.0074565037
41 32 0.070698702
42 32 0.0002761668
43 32 0.0016570008
1 33 0
2 33 0.074766355
3 33 0.182242991
4 33 0.0046728972
5 33 0.112149533
6 33 0.007788162
7 33 0
8 33 0.0015576324
9 33 0.003115265
10 33 0.001557632
11 33 0.007788162
12 33 0.015576324
13 33 0.014018692
14 33 0.0062305296
15 33 0.0093457944
16 33 0
17 33 0
18 33 0.001557632
19 33 0.0015576324
20 33 0
21 33 0.0015576324
22 33 0.010903427
23 33 0.007788162
24 33 0.0109034268
25 33 0
26 33 0
27 33 0.007788162
28 33 0.0015576324
29 33 0.0015576324
30 33 0
31 33 0.115264798
32 33 0.031152648
33 33 1
34 33 0.03271028
35 33 0.026479751
36 33 0
37 33 0.003115265
38 33 0.001557632
39 33 0
40 33 0
41 33 0.00623053
42 33 0.0062305296
43 33 0.0093457944
1 34 0.0187176424
2 34 0.100225674
3 34 0.223682464
4 34 0.0473914775
5 34 0.005575468
6 34 0.003982477
7 34 0.0015929908
8 34 0.0013274924
9 34 0.012876676
10 34 0.027611841
11 34 0.013805921
12 34 0.032789061
13 34 0.039293774
14 34 0.0564184256
15 34 0.0009292447
16 34 0.0051772202
17 34 0.0018584893
18 34 0.015929908
19 34 0.0143369176
20 34 0.0103544405
21 34 0.0057082172
22 34 0.02601885
23 34 0.0037169786
24 34 0.0015929908
25 34 0.0003982477
26 34 0.0053099695
27 34 0.0055754679
28 34 0.0107526882
29 34 0.002787734
30 34 0.035311297
31 34 0.099296429
32 34 0.08349927
33 34 0.002787734
34 34 1
35 34 0.470596044
36 34 0.0076994557
37 34 0.009026948
38 34 0.005973716
39 34 0.0153989115
40 34 0.0001327492
41 34 0.071684588
42 34 0.0039824771
43 34 0.0079649542
1 35 0.0069019404
2 35 0.04063029
3 35 0.291444198
4 35 0.0223987498
5 35 0.003516083
6 35 0.001041802
7 35 0.0007813517
8 35 0.0001302253
9 35 0.007683292
10 35 0.018622216
11 35 0.005339237
12 35 0.028779789
13 35 0.023440552
14 35 0.0773538221
15 35 0.000911577
16 35 0.0321656466
17 35 0.0182315406
18 35 0.030863394
19 35 0.0001302253
20 35 0.0002604506
21 35 0.0027347311
22 35 0.004557885
23 35 0.0032556322
24 35 0.0005209012
25 35 0
26 35 0.0115900508
27 35 0.0032556322
28 35 0.0033858575
29 35 0.0005209012
30 35 0.0291704649
31 35 0.047141555
32 35 0.023180102
33 35 0.0022138299
34 35 0.46164865
35 35 1
36 35 0.0223987498
37 35 0.025393932
38 35 0.014455007
39 35 0.0299518166
40 35 0.0002604506
41 35 0.003385858
42 35 0.0053392369
43 35 0.0006511264
1 36 0.0025380711
2 36 0.02284264
3 36 0.060913706
4 36 0
5 36 0.007614213
6 36 0.002538071
7 36 0
8 36 0
9 36 0.038071066
10 36 0.030456853
11 36 0.086294416
12 36 0.005076142
13 36 0.063451777
14 36 0.0203045685
15 36 0
16 36 0.0279187817
17 36 0.0101522843
18 36 0.005076142
19 36 0.0304568528
20 36 0.0228426396
21 36 0.0025380711
22 36 0.015228426
23 36 0.0152284264
24 36 0
25 36 0
26 36 0.0203045685
27 36 0.0025380711
28 36 0.0050761421
29 36 0
30 36 0.0025380711
31 36 0.208121827
32 36 0.065989848
33 36 0
34 36 0.14720812
35 36 0.436548223
36 36 1
37 36 0.28680203
38 36 0
39 36 0.0076142132
40 36 0
41 36 0.02284264
42 36 0
43 36 0
1 37 0.0090497738
2 37 0.020361991
3 37 0.022624434
4 37 0.0022624434
5 37 0.004524887
6 37 0
7 37 0
8 37 0
9 37 0.020361991
10 37 0.031674208
11 37 0.027149321
12 37 0.131221719
13 37 0.054298643
14 37 0.0067873303
15 37 0
16 37 0.0067873303
17 37 0.0271493213
18 37 0.027149321
19 37 0
20 37 0
21 37 0
22 37 0.004524887
23 37 0.0271493213
24 37 0.0022624434
25 37 0
26 37 0.020361991
27 37 0
28 37 0
29 37 0
30 37 0.0475113122
31 37 0.14479638
32 37 0.042986425
33 37 0.0045248869
34 37 0.15384615
35 37 0.441176471
36 37 0.2556561086
37 37 1
38 37 0.056561086
39 37 0.0045248869
40 37 0
41 37 0.011312217
42 37 0.0022624434
43 37 0
1 38 0.0093457944
2 38 0.018691589
3 38 0.024922118
4 38 0
5 38 0.00623053
6 38 0
7 38 0
8 38 0
9 38 0.009345794
10 38 0.024922118
11 38 0.087227414
12 38 0.046728972
13 38 0.018691589
14 38 0
15 38 0
16 38 0
17 38 0
18 38 0.093457944
19 38 0.0093457944
20 38 0.015576324
21 38 0.0093457944
22 38 0
23 38 0.015576324
24 38 0.0062305296
25 38 0
26 38 0
27 38 0
28 38 0
29 38 0
30 38 0.0560747664
31 38 0.361370717
32 38 0.024922118
33 38 0.0031152648
34 38 0.14018692
35 38 0.345794393
36 38 0
37 38 0.07788162
38 38 1
39 38 0
40 38 0
41 38 0.015576324
42 38 0
43 38 0.0031152648
1 39 0.0021691974
2 39 0.00867679
3 39 0.214750542
4 39 0.0347071584
5 39 0.019522777
6 39 0.002169197
7 39 0.0043383948
8 39 0
9 39 0
10 39 0.010845987
11 39 0.002169197
12 39 0.006507592
13 39 0.028199566
14 39 0.1388286334
15 39 0
16 39 0.125813449
17 39 0.1301518438
18 39 0.006507592
19 39 0
20 39 0
21 39 0
22 39 0.015184382
23 39 0
24 39 0.0021691974
25 39 0
26 39 0.0498915401
27 39 0.010845987
28 39 0.0086767896
29 39 0
30 39 0.0195227766
31 39 0.026030369
32 39 0.134490239
33 39 0
34 39 0.2516269
35 39 0.498915401
36 39 0.0065075922
37 39 0.004338395
38 39 0
39 39 1
40 39 0
41 39 0.075921909
42 39 0
43 39 0
1 40 0
2 40 0.00625
3 40 0.0375
4 40 0
5 40 0.00625
6 40 0
7 40 0
8 40 0
9 40 0
10 40 0
11 40 0.00625
12 40 0.00625
13 40 0.00625
14 40 0.00625
15 40 0
16 40 0.00625
17 40 0
18 40 0
19 40 0
20 40 0
21 40 0
22 40 0.2625
23 40 0
24 40 0
25 40 0
26 40 0
27 40 0
28 40 0
29 40 0.00625
30 40 0.00625
31 40 0.10625
32 40 0.16875
33 40 0
34 40 0.00625
35 40 0.0125
36 40 0
37 40 0
38 40 0
39 40 0
40 40 1
41 40 0
42 40 0
43 40 0
1 41 0.0460213777
2 41 0.265142518
3 41 0.005047506
4 41 0.0249406176
5 41 0.092933492
6 41 0.035926366
7 41 0.0065320665
8 41 0.0071258907
9 41 0.002969121
10 41 0.012470309
11 41 0.007125891
12 41 0.36935867
13 41 0.008016627
14 41 0.0050475059
15 41 0.0029691211
16 41 0.0008907363
17 41 0.1089667458
18 41 0.005938242
19 41 0.0038598575
20 41 0.0014845606
21 41 0
22 41 0.055225653
23 41 0.0023752969
24 41 0.0017814727
25 41 0.0029691211
26 41 0.0225653207
27 41 0.0005938242
28 41 0.0053444181
29 41 0.0002969121
30 41 0.0195961995
31 41 0.06175772
32 41 0.076009501
33 41 0.0011876485
34 41 0.16033254
35 41 0.007719715
36 41 0.002672209
37 41 0.001484561
38 41 0.001484561
39 41 0.010391924
40 41 0
41 41 1
42 41 0.0002969121
43 41 0.0032660333
1 42 0
2 42 0.051948052
3 42 0.402597403
4 42 0
5 42 0.025974026
6 42 0.012987013
7 42 0
8 42 0
9 42 0.025974026
10 42 0.077922078
11 42 0.012987013
12 42 0
13 42 0.051948052
14 42 0.0779220779
15 42 0.025974026
16 42 0.012987013
17 42 0
18 42 0.051948052
19 42 0
20 42 0
21 42 0.1558441558
22 42 0.012987013
23 42 0
24 42 0
25 42 0
26 42 0
27 42 0
28 42 0
29 42 0
30 42 0.025974026
31 42 0.103896104
32 42 0.012987013
33 42 0.0519480519
34 42 0.38961039
35 42 0.532467532
36 42 0
37 42 0.012987013
38 42 0
39 42 0
40 42 0
41 42 0.012987013
42 42 1
43 42 0
1 43 0.4092465753
2 43 0.900684932
3 43 0.001712329
4 43 0.0171232877
5 43 0
6 43 0.010273973
7 43 0
8 43 0
9 43 0.001712329
10 43 0.020547945
11 43 0.070205479
12 43 0.082191781
13 43 0.006849315
14 43 0
15 43 0
16 43 0
17 43 0
18 43 0.049657534
19 43 0
20 43 0.0034246575
21 43 0.0273972603
22 43 0.001712329
23 43 0.0017123288
24 43 0.0034246575
25 43 0
26 43 0
27 43 0
28 43 0
29 43 0
30 43 0.0119863014
31 43 0.023972603
32 43 0.010273973
33 43 0.0102739726
34 43 0.10273973
35 43 0.008561644
36 43 0
37 43 0
38 43 0.001712329
39 43 0
40 43 0
41 43 0.018835616
42 43 0
43 43 1
<meta charset="utf-8">
<style>
/* disable text selection */
svg *::selection {
background : transparent;
}
svg *::-moz-selection {
background:transparent;
}
svg *::-webkit-selection {
background:transparent;
}
rect.selection {
stroke : #333;
stroke-dasharray: 4px;
stroke-opacity : 0.5;
fill : transparent;
}
rect.cell-border {
stroke: #eee;
stroke-width:0.3px;
}
rect.cell-selected {
stroke: rgb(51,102,153);
stroke-width:0.5px;
}
rect.cell-hover {
stroke: #F00;
stroke-width:0.3px;
}
text.mono {
font-size: 9pt;
font-family: Andale Mono, Andale Mono;
fill: #aaa;
}
text.text-selected {
fill: #000;
}
text.text-highlight {
fill: #c00;
}
text.text-hover {
fill: #00C;
}
#tooltip {
position: absolute;
width: 200px;
height: auto;
padding: 10px;
background-color: white;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
pointer-events: none;
}
#tooltip.hidden {
display: none;
}
#tooltip p {
margin: 0;
font-family: Andale Mono;
font-size: 12px;
line-height: 20px;
}
</style>
</head>
<div id="tooltip" class="hidden">
<p><span id="value"></p>
</div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<div id="chart" style='overflow:auto; width:960px; height:960px;'></div>
<script type="text/javascript">
var margin = { top: 175, right: 10, bottom: 50, left: 175 },
cellSize=12;
col_number=43;
row_number=43;
width = cellSize*col_number, // - margin.left - margin.right,
height = cellSize*row_number , // - margin.top - margin.bottom,
//gridSize = Math.floor(width / 24),
legendElementWidth = cellSize*2.5,
colorBuckets = 11,
colors = ['#FFFFFF','#F1EEF6','#E6D3E1','#DBB9CD','#D19EB9','#C684A4','#BB6990','#B14F7C','#A63467','#9B1A53','#91003F'];
hcrow = [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],
hccol = [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],
rowLabel = ['Adult','Anime/Manga','Arcade','BattleMech','Board/PartyGame','Cards/Tiles','Casino','Chess','Comics','Cyberpunk/DarkSci-Fi','Detective/Mystery','Fantasy','Fighting','Flight','GameShow','Helicopter','HistoricalBattle','Horror','InteractiveFiction (IF)','IF (w/Graphics)','InteractiveMovie','Managerial','MartialArts','Meditative/Zen','Mentaling','Naval','Paddle/Pong','PersistentUniverse','Pinball','Post-Apocalyptic','Puzzle-Solving','Real-Time','Rhythm/Music','Sci-Fi/Futuristic','Shooter','Spy/Espionage','Stealth','Survival','Tank','Train','Turn-based','VideoBackdrop','VisualNovel'],
colLabel = ['Adult','Anime/Manga','Arcade','BattleMech','Board/PartyGame','Cards/Tiles','Casino','Chess','Comics','Cyberpunk/DarkSci-Fi','Detective/Mystery','Fantasy','Fighting','Flight','GameShow','Helicopter','HistoricalBattle','Horror','InteractiveFiction (IF)','IF (w/Graphics)','InteractiveMovie','Managerial','MartialArts','Meditative/Zen','Mentaling','Naval','Paddle/Pong','PersistentUniverse','Pinball','Post-Apocalyptic','Puzzle-Solving','Real-Time','Rhythm/Music','Sci-Fi/Futuristic','Shooter','Spy/Espionage','Stealth','Survival','Tank','Train','Turn-based','VideoBackdrop','VisualNovel'];
d3.csv("data_heatmap.csv",
function(d) {
return {
row: +d.row_idx,
col: +d.col_idx,
value: +d.vgfreq
};
},
function(error, data) {
var colorScale = d3.scale.linear()
.domain([ 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0])
.range(colors);
var svg = d3.select("#chart").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")")
;
var rowSortOrder=false;
var colSortOrder=false;
var rowLabels = svg.append("g")
.selectAll(".rowLabelg")
.data(rowLabel)
.enter()
.append("text")
.text(function (d) { return d; })
.attr("x", 0)
.attr("y", function (d, i) { return hcrow.indexOf(i+1) * cellSize; })
.style("text-anchor", "end")
.attr("transform", "translate(-6," + cellSize / 1.5 + ")")
.attr("class", function (d,i) { return "rowLabel mono r"+i;} )
.on("mouseover", function(d) {d3.select(this).classed("text-hover",true);})
.on("mouseout" , function(d) {d3.select(this).classed("text-hover",false);})
.on("click", function(d,i) {rowSortOrder=!rowSortOrder; sortbylabel("r",i,rowSortOrder);d3.select("#order").property("selectedIndex", 4).node().focus();;})
;
var colLabels = svg.append("g")
.selectAll(".colLabelg")
.data(colLabel)
.enter()
.append("text")
.text(function (d) { return d; })
.attr("x", 0)
.attr("y", function (d, i) { return hccol.indexOf(i+1) * cellSize; })
.style("text-anchor", "left")
.attr("transform", "translate("+cellSize/2 + ",-6) rotate (-90)")
.attr("class", function (d,i) { return "colLabel mono c"+i;} )
.on("mouseover", function(d) {d3.select(this).classed("text-hover",true);})
.on("mouseout" , function(d) {d3.select(this).classed("text-hover",false);})
.on("click", function(d,i) {colSortOrder=!colSortOrder; sortbylabel("c",i,colSortOrder);d3.select("#order").property("selectedIndex", 4).node().focus();;})
;
var heatMap = svg.append("g").attr("class","g3")
.selectAll(".cellg")
.data(data,function(d){return d.row+":"+d.col;})
.enter()
.append("rect")
.attr("x", function(d) { return hccol.indexOf(d.col) * cellSize; })
.attr("y", function(d) { return hcrow.indexOf(d.row) * cellSize; })
.attr("class", function(d){return "cell cell-border cr"+(d.row-1)+" cc"+(d.col-1);})
.attr("width", cellSize)
.attr("height", cellSize)
.style("fill", function(d) { return colorScale(d.value); })
/* .on("click", function(d) {
var rowtext=d3.select(".r"+(d.row-1));
if(rowtext.classed("text-selected")==false){
rowtext.classed("text-selected",true);
}else{
rowtext.classed("text-selected",false);
}
})*/
.on("mouseover", function(d){
//highlight text
d3.select(this).classed("cell-hover",true);
d3.selectAll(".rowLabel").classed("text-highlight",function(r,ri){ return ri==(d.row-1);});
d3.selectAll(".colLabel").classed("text-highlight",function(c,ci){ return ci==(d.col-1);});
//Update the tooltip position and value
d3.select("#tooltip")
.style("left", (d3.event.pageX+10) + "px")
.style("top", (d3.event.pageY-10) + "px")
.select("#value")
.text("Category:"+colLabel[d.col-1]+" Theme:"+rowLabel[d.row-1]+"\nFrequency:"+d.value);
//Show the tooltip
d3.select("#tooltip").classed("hidden", false);
})
.on("mouseout", function(){
d3.select(this).classed("cell-hover",false);
d3.selectAll(".rowLabel").classed("text-highlight",false);
d3.selectAll(".colLabel").classed("text-highlight",false);
d3.select("#tooltip").classed("hidden", true);
})
;
var legend = svg.selectAll(".legend")
.data([0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0])
.enter().append("g")
.attr("class", "legend");
legend.append("rect")
.attr("x", function(d, i) { return legendElementWidth * i; })
.attr("y", height+(cellSize*2))
.attr("width", legendElementWidth)
.attr("height", cellSize)
.style("fill", function(d, i) { return colors[i]; });
legend.append("text")
.attr("class", "mono")
.text(function(d) { return d; })
.attr("width", legendElementWidth)
.attr("x", function(d, i) { return legendElementWidth * i; })
.attr("y", height + (cellSize*4));
// Change ordering of cells
function sortbylabel(rORc,i,sortOrder){
var t = svg.transition().duration(3000);
var vgfreq=[];
var sorted; // sorted is zero-based index
d3.selectAll(".c"+rORc+i)
.filter(function(ce){
vgfreq.push(ce.value);
})
;
if(rORc=="r"){ // sort vgfreq of a gene
sorted=d3.range(col_number).sort(function(a,b){ if(sortOrder){ return vgfreq[b]-vgfreq[a];}else{ return vgfreq[a]-vgfreq[b];}});
t.selectAll(".cell")
.attr("x", function(d) { return sorted.indexOf(d.col-1) * cellSize; })
;
t.selectAll(".colLabel")
.attr("y", function (d, i) { return sorted.indexOf(i) * cellSize; })
;
}else{ // sort vgfreq of a contrast
sorted=d3.range(row_number).sort(function(a,b){if(sortOrder){ return vgfreq[b]-vgfreq[a];}else{ return vgfreq[a]-vgfreq[b];}});
t.selectAll(".cell")
.attr("y", function(d) { return sorted.indexOf(d.row-1) * cellSize; })
;
t.selectAll(".rowLabel")
.attr("y", function (d, i) { return sorted.indexOf(i) * cellSize; })
;
}
}
d3.select("#order").on("change",function(){
order(this.value);
});
var sa=d3.select(".g3")
.on("mousedown", function() {
if( !d3.event.altKey) {
d3.selectAll(".cell-selected").classed("cell-selected",false);
d3.selectAll(".rowLabel").classed("text-selected",false);
d3.selectAll(".colLabel").classed("text-selected",false);
}
var p = d3.mouse(this);
sa.append("rect")
.attr({
rx : 0,
ry : 0,
class : "selection",
x : p[0],
y : p[1],
width : 1,
height : 1
})
})
.on("mousemove", function() {
var s = sa.select("rect.selection");
if(!s.empty()) {
var p = d3.mouse(this),
d = {
x : parseInt(s.attr("x"), 10),
y : parseInt(s.attr("y"), 10),
width : parseInt(s.attr("width"), 10),
height : parseInt(s.attr("height"), 10)
},
move = {
x : p[0] - d.x,
y : p[1] - d.y
}
;
if(move.x < 1 || (move.x*2<d.width)) {
d.x = p[0];
d.width -= move.x;
} else {
d.width = move.x;
}
if(move.y < 1 || (move.y*2<d.height)) {
d.y = p[1];
d.height -= move.y;
} else {
d.height = move.y;
}
s.attr(d);
// deselect all temporary selected state objects
d3.selectAll('.cell-selection.cell-selected').classed("cell-selected", false);
d3.selectAll(".text-selection.text-selected").classed("text-selected",false);
d3.selectAll('.cell').filter(function(cell_d, i) {
if(
!d3.select(this).classed("cell-selected") &&
// inner circle inside selection frame
(this.x.baseVal.value)+cellSize >= d.x && (this.x.baseVal.value)<=d.x+d.width &&
(this.y.baseVal.value)+cellSize >= d.y && (this.y.baseVal.value)<=d.y+d.height
) {
d3.select(this)
.classed("cell-selection", true)
.classed("cell-selected", true);
d3.select(".r"+(cell_d.row-1))
.classed("text-selection",true)
.classed("text-selected",true);
d3.select(".c"+(cell_d.col-1))
.classed("text-selection",true)
.classed("text-selected",true);
}
});
}
})
.on("mouseup", function() {
// remove selection frame
sa.selectAll("rect.selection").remove();
// remove temporary selection marker class
d3.selectAll('.cell-selection').classed("cell-selection", false);
d3.selectAll(".text-selection").classed("text-selection",false);
})
.on("mouseout", function() {
if(d3.event.relatedTarget.tagName=='html') {
// remove selection frame
sa.selectAll("rect.selection").remove();
// remove temporary selection marker class
d3.selectAll('.cell-selection').classed("cell-selection", false);
d3.selectAll(".rowLabel").classed("text-selected",false);
d3.selectAll(".colLabel").classed("text-selected",false);
}
})
;
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment