Skip to content

Instantly share code, notes, and snippets.

@gcmsrc
Created January 22, 2017 17:44
Show Gist options
  • Save gcmsrc/3db79ffec5b9a4bc0dd3f7fcfd96717a to your computer and use it in GitHub Desktop.
Save gcmsrc/3db79ffec5b9a4bc0dd3f7fcfd96717a to your computer and use it in GitHub Desktop.
Version1
year Business Holiday Miscellaneous Study VFR visits
2002 0.240537416822 0.419084373331 0.0919486883813 0.016049084009 0.232380437456 11603.3820794
2003 0.233770307173 0.422897682993 0.085784628018 0.0181440926277 0.239403289189 11695.7504415
2004 0.215826107241 0.437541332975 0.0890771265708 0.0154869013269 0.242068531886 13389.3304112
2005 0.228533909167 0.42173304222 0.087183370819 0.0133643225538 0.249185355241 13892.5689795
2006 0.234664484002 0.419806489788 0.093073567256 0.013739721358 0.238715737597 15592.6461415
2007 0.233333961796 0.42387871279 0.0849470608291 0.0165324393778 0.241307825207 15339.7714895
2008 0.210064603451 0.443573192493 0.0827974900599 0.0132584581988 0.250306255797 14752.993692
2009 0.179890520023 0.4964035094 0.0830677885476 0.011952853439 0.228685328591 14211.2979861
2010 0.18873697009 0.498114965082 0.0805382743866 0.0137382315809 0.218871558861 14705.5413382
2011 0.196025160757 0.498118487455 0.0712648770799 0.011640846875 0.222950627834 15289.4929047
2012 0.198437950809 0.494743422747 0.0669662869851 0.0115857100563 0.228266629403 15460.8642467
2013 0.193008040602 0.506139968784 0.0652531982258 0.0105825027692 0.225016289619 16810.7582222
2014 0.188156322911 0.512160505986 0.058654456489 0.0141020379591 0.226926676655 17404.2156497
2015 0.199749941472 0.495645761132 0.0610388286996 0.00971210251104 0.233853366185 18581.145357
market year visits spend nights
Argentina 2002 14.595359056 11.645796946 381.704931824
Argentina 2003 21.530759141 11.891398317 153.825188452
Argentina 2004 23.171488881 11.961477865 222.882036474
Argentina 2005 20.924879968 9.945730848 143.580526039
Argentina 2006 28.379647089 18.108859826 241.002596727
Argentina 2007 30.49079013 13.561095751 193.24384177
Argentina 2008 20.118808958 10.976591989 149.574805918
Argentina 2009 55.374188977 29.554749969 334.597669436
Argentina 2010 52.414780794 34.629544127 334.786282445
Argentina 2011 61.069963991 26.753335965 299.31908584
Argentina 2012 93.743351292 88.447887324 779.509242639
Argentina 2013 93.481250411 48.411256409 425.413666354
Argentina 2014 92.49973935 51.159190423 560.946713705
Argentina 2015 113.332157317 73.246060012 714.647259032
Australia 2002 436.891726977 203.405994314 3058.72203974
Australia 2003 450.713646944 234.717044713 4205.48033209
Australia 2004 477.734498041 240.2440073 3663.48217983
Australia 2005 552.648102308 255.621045035 3943.06351451
Australia 2006 578.843809276 308.023090309 4459.64301881
Australia 2007 595.252244474 328.503942477 4635.56162934
Australia 2008 583.716974443 354.075683491 4207.86027423
Australia 2009 571.190791364 411.227277492 4486.41319389
Australia 2010 624.27647898 432.894774005 4809.24843861
Australia 2011 681.266423449 500.720573211 4639.68286281
Australia 2012 596.938201199 469.668479606 4267.55807341
Australia 2013 687.332245511 547.131245083 5381.18809822
Australia 2014 614.870687128 561.692305239 4608.2017888
Australia 2015 628.96030356 506.38067865 5149.58088564
Austria 2002 109.51329462 46.187891457 560.219160278
Austria 2003 128.980634988 54.610825917 715.239468929
Austria 2004 128.658540893 40.046268686 495.841162563
Austria 2005 122.257793143 45.865800167 573.304512996
Austria 2006 140.786416167 54.209739914 776.018085183
Austria 2007 163.69116187 57.451088185 611.545806178
Austria 2008 141.659064416 66.954949425 757.157958899
Austria 2009 168.772010803 93.032874155 759.70485152
Austria 2010 165.925534873 85.501635234 723.135211146
Austria 2011 164.87809062 79.383250414 869.110876546
Austria 2012 153.013415406 70.083344749 834.034427329
Austria 2013 142.837581666 67.172804096 621.923696208
Austria 2014 145.397741168 78.922753272 705.184427178
Austria 2015 152.690298781 84.488373964 700.888652669
Bahrain 2011 12.069186924 20.054755019 99.834846825
Bahrain 2012 21.520883025 40.387553461 143.563823847
Bahrain 2013 23.936109067 64.237167089 205.774021117
Bahrain 2014 19.202672242 36.067622446 180.631993881
Bahrain 2015 11.562628361 18.326127473 130.633844612
Belgium 2002 288.61380129 70.858193138 866.135183284
Belgium 2003 306.2103679 71.774204579 816.831627566
Belgium 2004 359.225734557 95.800883901 1134.1619467
Belgium 2005 300.533481351 76.659480363 858.933717814
Belgium 2006 342.794214696 117.443666971 1212.93080638
Belgium 2007 351.088228335 105.077229724 1059.95696039
Belgium 2008 307.737222023 98.63806044 961.938566697
Belgium 2009 349.916623629 117.866033172 1291.6650967
Belgium 2010 488.811480542 169.265690498 1634.76384669
Belgium 2011 406.373370059 130.67673779 1139.53199267
Belgium 2012 470.317992212 158.580855134 1336.62819112
Belgium 2013 530.6930997 203.70933471 1512.48808213
Belgium 2014 490.205149656 175.795652652 1683.05372741
Belgium 2015 529.811186764 186.297959069 1417.73758268
Brazil 2002 64.70641233 51.951970087 796.477315022
Brazil 2003 46.135519952 53.39886499 812.646411955
Brazil 2004 58.593485637 38.519156574 853.10808673
Brazil 2005 65.440758256 70.001204386 996.630727308
Brazil 2006 91.486316918 76.291986087 1353.64539066
Brazil 2007 108.885178967 94.1864503125 1388.16132121
Brazil 2008 150.894644205 109.036440747 1570.15476483
Brazil 2009 108.442686068 102.244583164 1386.39083435
Brazil 2010 149.18974625 117.717645854 1337.51715283
Brazil 2011 211.282784145 209.795152655 1615.22902427
Brazil 2012 215.207797515 182.897918158 1601.98982617
Brazil 2013 219.955471948 213.549876216 1605.26223407
Brazil 2014 255.997815108 197.803774247 2126.71991846
Brazil 2015 259.638746712 199.448467049 1975.56509433
Bulgaria 2008 44.320264249 19.486827893 686.649343675
Bulgaria 2009 55.70139277 43.179313567 378.256932789
Bulgaria 2010 49.265095859 25.716996622 356.386976218
Bulgaria 2011 52.615440126 39.165722978 708.426438176
Bulgaria 2012 53.871897102 26.882122459 598.593613059
Bulgaria 2013 55.159902929 27.925706233 318.235774509
Bulgaria 2014 71.739023285 50.656288605 972.524412222
Bulgaria 2015 70.269849718 28.647519525 471.01633546
Canada 2002 358.334336168 146.692507799 2092.6454035
Canada 2003 317.240284095 133.876439609 1892.85204754
Canada 2004 368.865334028 209.167970406 2281.89827774
Canada 2005 399.203653401 180.326762417 2058.9804013
Canada 2006 439.541143005 221.96885904 2592.3258956
Canada 2007 478.147525676 257.444068823 2594.10871569
Canada 2008 499.691436728 256.579030633 2787.08411475
Canada 2009 371.213649843 192.835134245 2238.87426732
Canada 2010 389.452477611 242.394495514 2605.71282083
Canada 2011 428.770805489 265.490604322 2475.055562
Canada 2012 402.856259223 270.876031292 2423.05703053
Canada 2013 434.479241265 269.5711594 2502.8561085
Canada 2014 359.187932734 227.507734737 2251.40076825
Canada 2015 407.532041724 241.403287418 2188.39777829
Chile 2011 18.697606743 18.752824976 122.116444342
Chile 2012 16.651711197 11.102989643 73.066465793
Chile 2013 28.9869419 25.362873876 132.429847893
Chile 2014 38.009156614 18.65851898 190.586687594
Chile 2015 31.62692532 13.259613354 133.797346029
China 2002 39.520290702 32.395248528 289.76100013
China 2003 42.630867945 28.439456206 305.786561929
China 2004 61.00658491 41.097042528 598.737879826
China 2005 58.081053897 53.083822127 585.732147787
China 2006 64.771069883 48.953070168 488.12371757
China 2007 79.168682084 61.300676602 540.877433742
China 2008 60.107489675 67.628797662 518.450019402
China 2009 46.699951595 55.686572241 393.821978646
China 2010 55.352449081 87.744919575 780.519113751
China 2011 80.626072512 88.885081499 576.661776622
China 2012 104.125517014 142.129450276 1005.05892812
China 2013 96.425143629 186.909251803 813.365821206
China 2014 98.879508137 148.724492944 860.395200622
China 2015 167.073829654 310.434142587 1460.95855747
Czech Republic 2002 63.630266074 18.124885066 647.555059911
Czech Republic 2003 79.656266543 34.08094986 526.501910946
Czech Republic 2004 126.103420045 31.04149667 624.306510423
Czech Republic 2005 106.915724172 38.292817015 598.334642344
Czech Republic 2006 112.030878336 37.491068173 974.186147113
Czech Republic 2007 134.118388508 39.696932652 842.633383358
Czech Republic 2008 169.695025949 44.290377967 761.604650763
Czech Republic 2009 144.812957886 50.946143035 805.949630672
Czech Republic 2010 109.73616491 40.471442249 545.46230373
Czech Republic 2011 108.749555941 40.407085219 650.560656102
Czech Republic 2012 144.625346842 47.262660929 723.720856625
Czech Republic 2013 136.474250497 52.129824303 865.115622444
Czech Republic 2014 134.691170811 46.803715843 744.698752654
Czech Republic 2015 166.255916274 57.635723285 1375.33825911
Denmark 2002 191.428620819 73.230581086 888.109378564
Denmark 2003 209.833470412 83.793328129 910.978596278
Denmark 2004 238.120456988 101.603871775 984.365009353
Denmark 2005 286.685698318 114.712083605 1417.65365047
Denmark 2006 291.332003564 117.802029601 1128.08308994
Denmark 2007 312.299082285 143.517842565 1264.55470906
Denmark 2008 298.390928044 137.215702929 1080.30016295
Denmark 2009 332.161131937 165.888076006 1247.62538644
Denmark 2010 273.764614333 142.284063078 1055.61407199
Denmark 2011 340.237900042 159.898891254 1416.27660029
Denmark 2012 325.727032146 183.035994913 1427.39189804
Denmark 2013 378.453464146 196.703115628 1438.54253088
Denmark 2014 339.443922328 162.635510594 1159.47098444
Denmark 2015 422.733418098 195.118102513 1602.7319163
Egypt 2002 19.676177787 27.000527512 264.55557251
Egypt 2003 25.033167229 26.917891471 215.943430984
Egypt 2004 21.556451097 26.443089104 224.245886783
Egypt 2005 19.483566181 25.114164959 282.746324563
Egypt 2006 33.632623029 32.461627943 334.789551406
Egypt 2007 21.840031042 66.93133939 194.577551953
Egypt 2008 31.642433169 37.095098582 326.748178128
Egypt 2009 30.472555996 48.219691467 302.240810364
Egypt 2010 31.046822862 48.146625123 327.232166516
Egypt 2011 29.872413916 46.475888207 229.343015653
Egypt 2012 35.044817822 45.895029098 317.979876194
Egypt 2013 39.11707574 59.109056943 316.721222035
Egypt 2014 39.884898692 113.154669836 333.071211715
Egypt 2015 38.139182987 63.164691552 413.873455596
Finland 2002 66.278738992 27.252596338 489.610155317
Finland 2003 59.292796864 26.551188494 300.802306298
Finland 2004 78.123355824 35.088571 395.911496486
Finland 2005 97.466170195 37.293169078 415.165467073
Finland 2006 102.584148766 42.74871592 520.408219267
Finland 2007 99.402503626 37.886145819 403.681489656
Finland 2008 94.937135783 46.799970425 411.056285513
Finland 2009 94.386108717 48.551683546 350.38430519
Finland 2010 103.600015147 52.27141949 439.289051019
Finland 2011 124.474146852 73.260406921 611.551601913
Finland 2012 130.734270165 73.74591821 598.365358551
Finland 2013 134.207573715 72.694133781 774.743142678
Finland 2014 159.439352287 77.601150271 817.48236438
Finland 2015 160.692837382 86.533263299 737.403957346
France 2002 1102.86331086 295.981663927 4475.59590756
France 2003 1190.87091954 332.440341859 5136.39101728
France 2004 1258.11961828 322.441295918 5809.97163752
France 2005 1367.34791587 356.535957036 5887.15452019
France 2006 1447.54987594 431.044224364 7322.97767459
France 2007 1342.35349873 406.425294945 6524.12479453
France 2008 1409.85547644 444.913523203 6580.45886983
France 2009 1528.24792916 472.277169665 6395.83402126
France 2010 1624.25306658 543.701435379 6639.45964504
France 2011 1600.46908383 530.169305415 6603.58987167
France 2012 1681.27086053 744.902574265 7130.27349372
France 2013 1903.98215595 689.083870339 7596.61461811
France 2014 2009.97687487 788.980562726 8688.80929097
France 2015 2071.39706989 762.827963764 8875.64999854
Germany 2002 889.434648778 275.305061879 3954.55002864
Germany 2003 891.72890752 290.45432064 4475.30839822
Germany 2004 1172.91922443 337.500577387 4886.74745113
Germany 2005 1280.9184801 393.918226392 5757.87988352
Germany 2006 1274.71849913 405.35360499 5607.84738102
Germany 2007 1196.57597702 391.923542151 4732.04002336
Germany 2008 1052.3987693 418.220754961 4665.03413824
Germany 2009 1068.93234147 353.454100108 4216.8715257
Germany 2010 1257.36818745 465.004158586 5735.98223303
Germany 2011 1214.47225363 480.410003776 5691.38663205
Germany 2012 1199.06053678 483.278221793 5060.67285336
Germany 2013 1295.26190273 540.032959313 5705.16550437
Germany 2014 1341.07339455 621.917753208 6306.5244665
Germany 2015 1401.21940243 549.293358611 6021.87282052
Greece 2002 97.846777886 76.651487649 694.823315928
Greece 2003 96.6311502 81.463514129 648.140626772
Greece 2004 109.766340346 74.858295247 767.220914709
Greece 2005 111.776234448 71.014222829 685.564823399
Greece 2006 102.487967591 73.65907245 619.71586894
Greece 2007 99.552077891 109.216601143 498.079964491
Greece 2008 124.447059153 104.676874043 946.236021029
Greece 2009 116.932060426 88.34490051 609.169047675
Greece 2010 104.547194077 81.633019195 735.416632658
Greece 2011 134.377277844 97.997771712 893.159967408
Greece 2012 92.300163656 65.622292291 618.92331624
Greece 2013 110.832369593 96.538435865 780.380691832
Greece 2014 155.354991728 90.519957858 1084.44625938
Greece 2015 147.76058228 115.356198192 1289.5461892
Hong Kong S.A.R. 2002 96.096161129 74.6278217 600.692782531
Hong Kong S.A.R. 2003 78.753786062 60.363391912 488.801476424
Hong Kong S.A.R. 2004 82.86582171 63.83157721 475.570103476
Hong Kong S.A.R. 2005 88.943741814 76.008136671 482.035085505
Hong Kong S.A.R. 2006 96.550382946 64.286533643 502.603196168
Hong Kong S.A.R. 2007 85.092973074 74.346337669 512.642771759
Hong Kong S.A.R. 2008 84.474332898 76.861935429 553.198466136
Hong Kong S.A.R. 2009 86.691656749 67.239322992 566.062141676
Hong Kong S.A.R. 2010 84.37004225 84.669895332 564.998661024
Hong Kong S.A.R. 2011 97.925671338 104.035139629 766.241896132
Hong Kong S.A.R. 2012 92.730198745 90.885077907 618.190408606
Hong Kong S.A.R. 2013 99.483665199 137.463458997 688.760665577
Hong Kong S.A.R. 2014 107.488126599 137.696732506 844.131107007
Hong Kong S.A.R. 2015 134.414885638 162.82594267 977.508935473
Hungary 2002 43.683604776 12.465778708 243.375792714
Hungary 2003 45.148987086 20.826898276 1022.26023147
Hungary 2004 83.478904787 30.080885789 757.548369123
Hungary 2005 120.898381064 55.126186507 1162.03545516
Hungary 2006 119.511893779 38.229633189 981.806397203
Hungary 2007 149.114814963 62.562022674 786.42577637
Hungary 2008 108.247728972 32.425660938 660.794225703
Hungary 2009 102.422103076 51.366306447 875.325676956
Hungary 2010 75.62250823 22.938587904 367.044010089
Hungary 2011 80.749654089 47.528834229 920.140145141
Hungary 2012 104.921369564 42.981733621 739.839983038
Hungary 2013 88.179874986 36.185628922 734.952662867
Hungary 2014 115.565012914 31.272847336 822.228380964
Hungary 2015 95.239152401 26.161197629 452.517685132
Iceland 2002 20.138197988 14.510025014 298.042298817
Iceland 2003 23.700039997 14.562842882 90.905252314
Iceland 2004 49.795671463 23.944536947 186.825495925
Iceland 2005 42.968266815 19.116681039 149.022221202
Iceland 2006 46.665953189 32.338861291 144.404175369
Iceland 2007 46.103127715 27.729764346 170.490204369
Iceland 2008 32.328583897 16.96207762 79.353152043
Iceland 2009 23.710144104 15.431581842 108.046044703
Iceland 2010 19.937233922 9.366075468 77.831399918
Iceland 2011 24.46911308 14.343098987 105.349133413
Iceland 2012 25.399086513 14.947920417 95.771897912
Iceland 2013 28.956171185 12.581015017 116.211491973
Iceland 2014 28.497370123 12.890991526 101.910896594
Iceland 2015 26.062992604 16.232404047 109.351220577
India 2002 135.2455692 81.229963539 2140.02408107
India 2003 130.368243308 77.740725685 2062.97096751
India 2004 160.283381715 106.54016991 2566.64660312
India 2005 166.028632103 107.134315423 2721.20122332
India 2006 229.563927901 151.547238827 3321.45105709
India 2007 219.690350857 157.855232681 3918.09941862
India 2008 241.642909449 148.765170042 2874.69318378
India 2009 177.912951888 133.017652375 2662.38853421
India 2010 235.926606822 213.40026073 4020.97630165
India 2011 235.270438442 166.784586424 3579.06416056
India 2012 231.530003438 176.664233814 3436.84405161
India 2013 243.577920193 224.461614803 3941.47522771
India 2014 252.319172779 240.230134923 3508.62132022
India 2015 275.745304803 203.382041776 3769.26950128
Indonesia 2011 19.232790185 18.729922345 183.531875752
Indonesia 2012 18.511527148 19.235060952 116.969855419
Indonesia 2013 17.862094969 33.506933924 125.295827836
Indonesia 2014 22.100618512 22.907434531 126.9222005
Indonesia 2015 24.770477862 30.610188533 190.141914008
Ireland 2002 628.87316278 201.491079658 2436.68650835
Ireland 2003 623.551949644 173.169436708 2301.06355878
Ireland 2004 682.793252892 218.00489741 2702.13084517
Ireland 2005 726.536117353 250.073288958 2880.69524173
Ireland 2006 718.41196907 233.22461785 2663.93642106
Ireland 2007 732.273407233 243.696641789 2549.26324966
Ireland 2008 736.149258673 244.7702125 2600.47861619
Ireland 2009 690.420430604 238.039399401 2120.89782818
Ireland 2010 656.638842603 256.646089901 2434.32069102
Ireland 2011 620.318850911 230.235788105 2686.05846959
Ireland 2012 595.940047533 225.273807412 2562.88115565
Ireland 2013 610.624598379 228.63720236 2378.53827822
Ireland 2014 620.292018401 251.293152892 2419.08863641
Ireland 2015 793.230451092 285.752557148 2900.18570725
Israel 2002 152.707565459 79.544885353 911.669105782
Israel 2003 122.673849154 57.460759767 782.028457666
Israel 2004 127.445260059 54.767918901 859.605029188
Israel 2005 106.940677091 55.752071849 807.887502113
Israel 2006 138.398791702 71.650826748 964.260289855
Israel 2007 102.699348314 71.436141243 581.796104064
Israel 2008 125.663918139 64.330363929 740.131740815
Israel 2009 124.930476672 92.427163848 727.64505674
Israel 2010 122.84391089 72.277361784 779.509974735
Israel 2011 120.505570128 67.997540179 745.226726979
Israel 2012 108.20603365 70.476019428 634.508470399
Israel 2013 140.963267149 88.99426077 762.642828293
Israel 2014 147.578702305 88.539134457 936.442431385
Israel 2015 164.652568704 224.553538531 1000.15589386
Italy 2002 541.596296626 199.042412987 3400.50441743
Italy 2003 601.414401465 292.877784674 3957.11604912
Italy 2004 765.362094092 292.790685121 5234.56246525
Italy 2005 643.726423381 281.15221145 3490.90632395
Italy 2006 851.175278407 379.966785874 5122.62013925
Italy 2007 837.74345064 359.982884342 5028.5967351
Italy 2008 981.044688346 475.83381634 5346.81414523
Italy 2009 747.639986905 360.481410781 4471.74653129
Italy 2010 932.242943809 437.122886339 5392.13967267
Italy 2011 1009.29021802 544.041148864 5288.99463139
Italy 2012 962.807205067 453.162828168 5336.89953453
Italy 2013 1072.18071784 504.420096402 5951.92981631
Italy 2014 1185.74823577 637.913375358 8484.09557077
Italy 2015 1165.08363105 535.571811858 6536.51001121
Japan 2002 294.470769653 176.091895113 1983.6845984
Japan 2003 232.529126021 145.663303639 1427.51316028
Japan 2004 264.993393358 145.635860265 1680.48096487
Japan 2005 242.928388792 165.5230634 1840.91635146
Japan 2006 245.202310342 134.070288849 1528.91898534
Japan 2007 220.056651044 134.684054724 1271.81769451
Japan 2008 167.837907073 102.290747527 950.565354944
Japan 2009 180.451489276 227.445664489 1578.05852233
Japan 2010 168.205166511 117.744828932 1051.27517744
Japan 2011 166.35645556 110.750889517 900.930832109
Japan 2012 177.854013144 181.772683119 1821.50509273
Japan 2013 155.349278417 135.588357499 1186.03282437
Japan 2014 157.478226994 162.708562874 857.46266806
Japan 2015 151.399137515 135.355034941 1027.48627716
Kenya 2002 31.58049698 48.521780691 580.357282367
Kenya 2003 19.836604095 21.872587551 431.220268475
Kenya 2004 22.092889158 19.004897421 363.454598483
Kenya 2005 16.468625933 13.643074449 237.616694385
Kenya 2006 15.9477102 14.068192986 266.934358443
Kenya 2007 12.670248942 6.569855984 92.721741267
Kenya 2008 24.644500956 28.656424308 400.362795948
Kenya 2009 14.897177068 17.993153066 229.29687344
Kenya 2010 18.549059943 21.819105994 169.019827287
Kenya 2011 17.843812079 15.811756373 210.770678504
Kenya 2012 20.771585137 28.150980093 243.83630665
Kenya 2013 22.347663999 17.586168841 301.171662863
Kenya 2014 12.465435057 21.348214334 194.265140356
Kenya 2015 22.400750873 21.416291443 391.171681354
Kuwait 2002 31.059023976 62.259014763 465.491328578
Kuwait 2003 36.172743831 72.594121291 623.823091095
Kuwait 2004 32.452613876 51.219271103 657.996494756
Kuwait 2005 33.815372247 77.548559407 460.665282809
Kuwait 2006 43.648717116 84.54785799 602.577890437
Kuwait 2007 46.689408015 158.543782974 808.30957073
Kuwait 2008 35.422521858 87.547954395 485.83474344
Kuwait 2009 48.981363492 106.648906553 734.609759215
Kuwait 2010 41.936100047 75.164518971 511.667101714
Kuwait 2011 52.781241207 156.243170369 747.546470117
Kuwait 2012 50.478253754 247.996315524 707.691262222
Kuwait 2013 105.689057952 441.027663926 1302.54286867
Kuwait 2014 84.274896293 405.202597196 1682.75271323
Kuwait 2015 83.367399367 260.182543985 1219.17166302
Luxembourg 2002 23.933049037 7.964432107 75.376758563
Luxembourg 2003 16.853040887 4.627072073 36.566882656
Luxembourg 2004 38.373454112 14.095235976 146.650610218
Luxembourg 2005 25.894775986 11.345872013 96.370990908
Luxembourg 2006 28.203738065 11.604422269 70.480262157
Luxembourg 2007 31.687745869 10.426364229 94.461734683
Luxembourg 2008 34.968839024 18.183148155 184.809839967
Luxembourg 2009 27.883183557 10.397154464 62.496860013
Luxembourg 2010 26.796334176 8.203654872 88.504338456
Luxembourg 2011 39.955056098 13.942970716 181.540470812
Luxembourg 2012 40.060612677 17.378149975 115.156021061
Luxembourg 2013 51.212061613 27.916001038 160.099354502
Luxembourg 2014 56.097075656 27.495210717 168.321194593
Luxembourg 2015 78.103773057 45.989562767 266.848338474
Malaysia 2002 60.489580401 36.273494484 581.614992067
Malaysia 2003 46.671644109 35.431856297 372.97743036
Malaysia 2004 65.029698134 39.482846424 439.574001804
Malaysia 2005 52.811654209 44.911311194 410.059850939
Malaysia 2006 52.731740159 44.717164113 632.558814791
Malaysia 2007 46.977626995 43.257650287 362.905389377
Malaysia 2008 45.606669154 31.348802829 443.244665288
Malaysia 2009 77.888682098 95.152684338 1262.7863285
Malaysia 2010 89.840815901 80.045947439 581.51643887
Malaysia 2011 82.473542527 63.425630273 658.450495637
Malaysia 2012 72.020530429 74.207899603 637.851496765
Malaysia 2013 113.369886238 106.429103107 1032.48357581
Malaysia 2014 109.536848217 96.253918531 807.420703855
Malaysia 2015 126.019232076 102.173075671 899.035522277
Mexico 2002 53.038406775 27.046252038 363.643978618
Mexico 2003 57.868399022 21.979233964 281.217875983
Mexico 2004 52.161828796 78.860210862 2283.93822382
Mexico 2005 54.978638791 27.477377478 418.891732782
Mexico 2006 69.46794288 50.307291926 562.507128345
Mexico 2007 38.147950919 24.544705236 347.515995974
Mexico 2008 50.400364814 29.23231851 322.731916174
Mexico 2009 60.741047926 36.648947146 428.152174179
Mexico 2010 51.855554385 213.315860684 223.870932739
Mexico 2011 62.158638969 38.922425661 419.672700782
Mexico 2012 69.80439256 28.551172702 363.067339123
Mexico 2013 91.442435235 48.834694843 569.634555296
Mexico 2014 72.790233951 47.619644586 434.255525643
Mexico 2015 82.209436002 41.751434744 439.918890427
Netherlands 2002 492.361354336 155.645332178 2299.55558838
Netherlands 2003 619.204837056 222.209585439 2439.91896748
Netherlands 2004 578.316150527 177.123476049 1936.3944979
Netherlands 2005 606.717000315 187.693785844 2029.88951575
Netherlands 2006 659.76702364 188.014216983 2057.56158767
Netherlands 2007 665.328416209 208.598655598 1980.83998395
Netherlands 2008 654.148838244 217.890448083 2111.05172492
Netherlands 2009 683.86947586 252.644542021 2409.77136133
Netherlands 2010 621.170322925 264.18876822 2238.45642736
Netherlands 2011 631.23411574 241.482617917 2411.96713529
Netherlands 2012 637.930629298 252.006503807 2440.84989798
Netherlands 2013 686.710988132 269.498082004 2470.47749963
Netherlands 2014 705.18628612 300.258991725 2298.42871814
Netherlands 2015 690.48509869 275.573840519 2341.25631046
New Zealand 2002 82.672175795 34.240505739 755.153884829
New Zealand 2003 100.542815802 38.475843963 903.512382253
New Zealand 2004 101.896097228 49.485394303 822.766950573
New Zealand 2005 121.742069976 60.439415509 1247.68676986
New Zealand 2006 124.546996139 70.129536655 1063.45923302
New Zealand 2007 119.742466217 83.33399242 1086.08324264
New Zealand 2008 103.127243013 51.248873996 1073.26985496
New Zealand 2009 108.81879197 74.601964211 977.557522541
New Zealand 2010 111.301523178 62.732991291 810.468956633
New Zealand 2011 95.538711549 66.579654776 875.213959877
New Zealand 2012 104.540870009 69.524206957 893.896198335
New Zealand 2013 93.70729328 48.781041502 669.684533767
New Zealand 2014 106.606376708 78.432176735 1088.17733443
New Zealand 2015 118.41910725 90.629376913 1213.26031573
Nigeria 2002 93.006873726 145.218424078 1379.21971509
Nigeria 2003 85.612025783 108.361217065 1371.53405171
Nigeria 2004 120.64473516 144.519342267 1760.54209426
Nigeria 2005 119.830542859 154.40631469 2653.86346167
Nigeria 2006 118.350131704 170.873395016 2198.47501338
Nigeria 2007 125.048341018 143.507304527 2282.52376323
Nigeria 2008 113.607711358 183.364085036 1715.40241905
Nigeria 2009 116.506480483 151.657939013 1464.24291586
Nigeria 2010 124.566580578 202.319694833 1659.93697366
Nigeria 2011 106.090201676 162.048351092 1451.58246589
Nigeria 2012 109.897160794 176.095605667 1402.93425865
Nigeria 2013 120.674999088 179.84301905 1270.88730313
Nigeria 2014 95.805418072 166.015920495 1238.20267953
Nigeria 2015 89.781191708 123.297504313 1740.32683112
Norway 2002 178.391173858 81.479776634 768.808869253
Norway 2003 182.015397697 77.108416959 665.79632919
Norway 2004 218.042984697 115.822571481 817.891046752
Norway 2005 265.90286889 122.857800834 1065.12753586
Norway 2006 302.19125942 144.791463583 1106.11277364
Norway 2007 306.600373016 160.616305464 1164.71111365
Norway 2008 337.616037783 215.92419856 1240.10824423
Norway 2009 324.079936144 191.62270927 1192.1322485
Norway 2010 372.106886018 204.274739973 1304.71607482
Norway 2011 382.144642293 237.050687274 1500.84855718
Norway 2012 396.797842111 235.689349096 1364.69354972
Norway 2013 480.109934232 301.655102525 2009.71868907
Norway 2014 471.936939652 307.342728743 1719.53188848
Norway 2015 434.629713202 241.40746914 1645.84637744
Oman 2011 8.083898006 11.138113834 129.47263419
Oman 2012 8.475467951 9.882687211 59.206122428
Oman 2013 12.137767049 85.5399365 127.755179491
Oman 2014 9.607254713 10.235126762 80.915359052
Oman 2015 14.259101365 19.68378019 97.175172275
Pakistan 2002 43.017465784 39.027289465 633.353589618
Pakistan 2003 35.563234237 27.204590749 687.981128863
Pakistan 2004 49.235691172 48.981200859 1176.21183562
Pakistan 2005 58.265575066 52.962719316 1373.48744669
Pakistan 2006 66.121777165 68.376152006 1438.88319954
Pakistan 2007 55.53223288 67.546660364 1099.18255037
Pakistan 2008 47.742180077 45.200413179 1107.95988778
Pakistan 2009 38.376398948 40.549927299 813.705558511
Pakistan 2010 32.486232878 30.500957382 628.204151303
Pakistan 2011 31.407247062 54.513331431 909.610453507
Pakistan 2012 40.592528316 44.588863248 802.76300989
Pakistan 2013 39.727047144 77.319594329 649.96592038
Pakistan 2014 49.005519208 42.629322553 867.771879451
Pakistan 2015 35.145472198 41.794113644 622.825188626
Poland 2002 115.330063358 48.227597441 2762.66254528
Poland 2003 167.22525453 67.784051365 4811.05850061
Poland 2004 277.796814197 148.152278799 6400.65759607
Poland 2005 425.190471091 163.762872117 8529.01836499
Poland 2006 528.204189355 277.686564427 7841.54305758
Poland 2007 432.714744 174.78710482 4791.26825225
Poland 2008 451.259513744 198.163330709 5422.20871425
Poland 2009 359.55149619 146.507678942 3670.90855269
Poland 2010 355.729288338 159.96353584 3954.35642058
Poland 2011 353.732700054 140.07991852 3083.34204245
Poland 2012 396.219619372 135.032679181 3663.24848447
Poland 2013 419.227723117 174.993578681 3054.52446295
Poland 2014 446.49400552 141.704074925 3298.31642492
Poland 2015 531.353701889 167.371915413 4074.11740214
Portugal 2002 97.801483599 49.1498293 582.096827868
Portugal 2003 97.46053818 38.543992993 434.355494029
Portugal 2004 96.982153379 41.404241126 631.948027567
Portugal 2005 113.63602124 65.71891986 763.905688968
Portugal 2006 120.754423854 41.846149835 488.428296605
Portugal 2007 144.055465882 66.377346458 729.044000116
Portugal 2008 133.780615654 68.830358038 712.777204166
Portugal 2009 136.706512476 66.000506166 645.279439583
Portugal 2010 172.387961782 74.792632782 1115.22100333
Portugal 2011 165.590969369 76.50650857 817.798393102
Portugal 2012 152.953654512 80.652516897 1157.74229354
Portugal 2013 137.999037501 61.194138947 819.240307467
Portugal 2014 191.279089575 86.01858215 1328.81695476
Portugal 2015 222.978525757 99.824994105 1203.82395386
Qatar 2011 24.602314903 63.465727339 253.390421929
Qatar 2012 31.665262997 68.936601439 253.811940221
Qatar 2013 43.604431864 155.683149783 413.58602141
Qatar 2014 32.847070363 100.060774375 293.235496599
Qatar 2015 41.836869585 104.117327241 356.63441715
Republic of Serbia 2011 18.796171904 16.691929599 118.346614307
Republic of Serbia 2012 17.821087 16.566473307 245.369890685
Republic of Serbia 2013 16.262249113 8.929905607 122.411679146
Republic of Serbia 2014 12.519155802 8.452065365 69.746522723
Republic of Serbia 2015 16.909916253 9.853377929 222.233502028
Romania 2008 101.059056547 44.863480285 1195.40409143
Romania 2009 107.840485722 51.921443467 1403.11303964
Romania 2010 121.934340507 71.657162956 1554.48503395
Romania 2011 127.93483901 67.397828171 1385.86519484
Romania 2012 109.833407299 57.409980696 1457.77063481
Romania 2013 158.621421161 100.35604197 1771.79377014
Romania 2014 170.453668545 99.096964208 2382.22260492
Romania 2015 237.738125816 121.750549413 2946.06945758
Russia 2002 143.199269516 119.324379814 943.871484777
Russia 2003 160.122495709 166.535587544 1957.89273625
Russia 2004 193.370773468 189.093143905 3216.8255833
Russia 2005 133.19067581 105.112985288 951.628934359
Russia 2006 159.587758473 126.47369651 1165.79694932
Russia 2007 165.122779638 193.247362536 1450.96822278
Russia 2008 125.006901865 113.900877059 757.469787425
Russia 2009 85.735525481 87.796926428 545.093726091
Russia 2010 119.078942848 120.167190101 905.634685211
Russia 2011 154.364110862 234.342324303 1291.35598057
Russia 2012 155.282329175 164.995619929 1122.48319938
Russia 2013 147.243733888 168.810895843 956.954502949
Russia 2014 164.825299916 178.507857896 1340.79223207
Russia 2015 99.009386869 83.587959592 772.633480858
Saudi Arabia 2002 42.841656881 59.649383228 384.546200263
Saudi Arabia 2003 34.149793881 47.792184396 294.723346824
Saudi Arabia 2004 37.725659101 54.229391808 364.414006868
Saudi Arabia 2005 36.982993765 74.392219623 438.333839042
Saudi Arabia 2006 39.512731388 87.634131023 442.513373967
Saudi Arabia 2007 56.480272172 93.699074353 621.354756257
Saudi Arabia 2008 63.827496203 137.95174382 714.008504779
Saudi Arabia 2009 58.588155046 120.198379589 571.599429463
Saudi Arabia 2010 54.211539894 101.535352569 424.567795891
Saudi Arabia 2011 66.835191606 175.521728032 761.84345047
Saudi Arabia 2012 74.441872833 202.831133895 645.817343888
Saudi Arabia 2013 90.946555524 218.74663904 906.868393031
Saudi Arabia 2014 99.147129657 250.320610352 1051.98513683
Saudi Arabia 2015 103.909091669 317.295232584 1151.92269589
Singapore 2002 57.456061362 32.399872942 328.762222492
Singapore 2003 52.554538756 39.936430494 277.062338721
Singapore 2004 57.155779411 40.280639686 331.70966636
Singapore 2005 49.905190988 35.26390089 359.466451243
Singapore 2006 70.865267975 54.702767228 506.922351586
Singapore 2007 63.444957898 61.636883602 449.220106564
Singapore 2008 76.959014416 62.08750835 403.624409938
Singapore 2009 64.700659195 59.286738831 410.820049818
Singapore 2010 89.24954079 77.104335403 533.327936959
Singapore 2011 88.866435722 105.683423194 585.082647015
Singapore 2012 106.654526381 125.508570955 861.323122689
Singapore 2013 91.506256951 122.772204226 495.517578802
Singapore 2014 120.618488104 144.326621852 735.171468655
Singapore 2015 148.586448654 212.382597213 946.89452246
South Africa 2002 162.530594247 111.153718025 2008.14329857
South Africa 2003 156.753932017 152.304186708 1662.90063497
South Africa 2004 167.643890379 97.516182443 1732.82832377
South Africa 2005 180.130481524 106.50880081 1568.23802255
South Africa 2006 216.824578136 134.692024022 2549.64743666
South Africa 2007 174.829447507 124.700149424 2115.15135752
South Africa 2008 164.232284009 126.532365372 1571.06994816
South Africa 2009 131.536326752 79.576585666 1684.61543254
South Africa 2010 123.439927086 106.411520539 960.252912061
South Africa 2011 108.734812082 87.548856931 773.488456619
South Africa 2012 118.816167048 115.063328266 1026.88780913
South Africa 2013 142.342565892 131.80918642 1379.98997149
South Africa 2014 124.489544614 132.121614885 996.677433734
South Africa 2015 134.481453206 138.824333631 1059.47179506
South Korea 2002 66.993415148 35.779908837 548.81519092
South Korea 2003 88.628364226 39.641526182 568.538459357
South Korea 2004 114.559069241 40.384204721 513.424447813
South Korea 2005 119.130647487 46.331899989 868.786936789
South Korea 2006 119.403595416 44.490132962 684.360078301
South Korea 2007 127.956514627 64.593556169 828.034095079
South Korea 2008 109.46713204 67.481160373 1244.17347518
South Korea 2009 58.031894745 48.520485902 635.152406783
South Korea 2010 84.789878621 50.67651719 856.545867759
South Korea 2011 108.105051471 78.965555226 691.879005796
South Korea 2012 130.74695834 66.0603955 631.681118716
South Korea 2013 154.823069451 83.336410801 914.275549237
South Korea 2014 164.58170167 127.64215091 1075.18466863
South Korea 2015 181.91495477 82.276955287 799.758065525
Spain 2002 444.350326627 211.963851937 3255.10448316
Spain 2003 526.562875591 220.592685695 3568.4770226
Spain 2004 691.629815098 273.299906603 4201.32723744
Spain 2005 709.688241207 268.825939773 4289.93027778
Spain 2006 933.518572525 376.36738788 5189.64654124
Spain 2007 967.51332405 402.751733566 5224.01972962
Spain 2008 895.293693557 381.06793329 4496.56829308
Spain 2009 1011.26223091 463.792260339 5066.9552163
Spain 2010 875.238526769 403.188861232 4542.38967311
Spain 2011 894.848653806 436.161561767 4785.41050653
Spain 2012 795.8884001 365.6398736 4923.33820994
Spain 2013 865.731672618 498.686653378 5335.692118
Spain 2014 984.288076086 508.759369328 6129.08674822
Spain 2015 1153.21263132 513.217055705 6017.16701301
Sweden 2002 291.889962082 112.951555806 1263.9520348
Sweden 2003 307.882878224 105.908738408 1299.18617185
Sweden 2004 327.232622976 120.838720947 1478.77591516
Sweden 2005 333.756596071 118.044044366 1653.70238513
Sweden 2006 383.067848811 143.368369362 1390.56976647
Sweden 2007 401.862557444 155.736171657 1832.86327966
Sweden 2008 417.519887497 195.894527216 1736.46153571
Sweden 2009 335.088042129 146.454795117 1404.18018839
Sweden 2010 442.619784418 206.789439446 1699.14892837
Sweden 2011 457.673084953 237.999945758 1978.99180289
Sweden 2012 503.056276106 239.656560166 2038.19430161
Sweden 2013 516.135676514 277.6061527 2223.44438569
Sweden 2014 547.405309927 325.206451703 1942.9475533
Sweden 2015 553.649813626 365.165980891 2315.68354975
Switzerland 2002 310.64369049 129.748191627 1149.09601478
Switzerland 2003 297.14938551 125.557038628 1217.30275971
Switzerland 2004 292.607341616 138.313173803 1066.21407726
Switzerland 2005 331.378789519 163.905322612 1388.12114941
Switzerland 2006 389.227227379 206.152865457 1943.10190142
Switzerland 2007 372.418972391 184.024457583 1492.67381274
Switzerland 2008 348.246871795 157.759869164 1380.43091852
Switzerland 2009 354.314323389 202.793353393 1612.74702439
Switzerland 2010 314.509065251 162.239824719 1178.89883746
Switzerland 2011 391.208891587 233.417270264 1752.55836023
Switzerland 2012 425.032107776 337.645587995 1689.4349553
Switzerland 2013 453.770637726 303.014860244 1908.27193531
Switzerland 2014 503.073927285 308.48360659 1853.63168832
Switzerland 2015 504.372474513 332.97591637 2300.12920926
Taiwan 2002 18.857968017 15.955491733 205.214950243
Taiwan 2003 20.369664953 15.554080236 236.162749599
Taiwan 2004 23.325825051 18.593411317 224.621538103
Taiwan 2005 22.123662174 16.893727358 238.857259586
Taiwan 2006 18.94439295 9.89225117 124.623040781
Taiwan 2007 23.110429958 18.709958181 136.482750483
Taiwan 2008 17.792403013 19.18260968 388.021486466
Taiwan 2009 23.055323988 54.970564296 146.577218849
Taiwan 2010 23.329388187 21.752215469 215.324430721
Taiwan 2011 23.635838922 9.240711795 112.919488984
Taiwan 2012 27.022714093 35.234047021 430.570936932
Taiwan 2013 28.751088798 34.171291267 224.597179219
Taiwan 2014 37.919176399 38.897883665 403.484709981
Taiwan 2015 33.658773453 62.759100114 340.611223471
Thailand 2002 21.438677997 13.744902887 180.104785562
Thailand 2003 26.333806054 18.692680967 200.416630179
Thailand 2004 29.555614789 23.612913927 262.342118979
Thailand 2005 27.289642808 21.272283448 205.69614639
Thailand 2006 29.681224137 22.991350649 361.93473985
Thailand 2007 36.54388094 32.960833459 415.411004391
Thailand 2008 22.049665063 18.614353847 268.486429262
Thailand 2009 39.387633327 34.334704254 384.88501269
Thailand 2010 30.076497867 25.240210541 453.572570057
Thailand 2011 35.895861118 43.297853998 419.490031138
Thailand 2012 38.022603778 35.259303946 384.78295829
Thailand 2013 41.944174948 58.207469442 271.741842381
Thailand 2014 35.467313957 30.169357145 332.539712956
Thailand 2015 43.326052338 51.896106917 510.896709298
Turkey 2002 41.186853795 31.658529966 381.032422863
Turkey 2003 61.043753971 44.486876916 536.657977116
Turkey 2004 55.925491035 50.936270396 494.060111936
Turkey 2005 51.86198698 60.531588186 372.451918775
Turkey 2006 91.641897084 56.70764517 1167.65071684
Turkey 2007 77.892664643 94.5834194 841.240725892
Turkey 2008 75.405928641 62.300206594 614.608284541
Turkey 2009 58.857911195 50.926242506 530.123251557
Turkey 2010 71.74700676 76.313064876 645.011495085
Turkey 2011 69.419882848 73.299850972 669.825384079
Turkey 2012 91.463656944 101.478748387 913.892372605
Turkey 2013 90.813643518 83.560988712 627.851371949
Turkey 2014 102.988284264 100.944289802 817.256309512
Turkey 2015 116.805887608 79.745229049 627.337240356
United Arab Emirates 2002 60.558880074 68.703576175 663.001085558
United Arab Emirates 2003 58.285024126 58.439258437 538.96094449
United Arab Emirates 2004 73.195767778 94.970065633 689.261991168
United Arab Emirates 2005 61.776979349 90.384866953 562.347335266
United Arab Emirates 2006 89.069556102 107.297036054 867.015420549
United Arab Emirates 2007 91.490018934 101.226725265 838.371727611
United Arab Emirates 2008 123.686443519 173.301367535 849.93571699
United Arab Emirates 2009 121.426994999 184.406873655 1119.07762499
United Arab Emirates 2010 107.223095579 174.217207975 1133.78448411
United Arab Emirates 2011 118.191408584 141.301586617 973.60447918
United Arab Emirates 2012 133.326225036 286.122559819 1228.31354779
United Arab Emirates 2013 161.316132338 415.680793417 1651.52260799
United Arab Emirates 2014 152.078279318 297.601187105 1187.91039828
United Arab Emirates 2015 181.312990062 301.392911513 1504.94313621
United States of America 2002 2446.3302443 1462.29888727 14139.1329431
United States of America 2003 2233.11619324 1412.34278983 12677.4591186
United States of America 2004 2406.37663044 1400.74041513 13340.6866506
United States of America 2005 2276.81509661 1473.22981267 12345.9879364
United States of America 2006 2536.89637122 1598.57375524 13843.4218878
United States of America 2007 2333.61419013 1578.08445669 13218.4603951
United States of America 2008 1907.87105513 1333.43895517 11463.8467912
United States of America 2009 1839.14863343 1278.77179294 10242.8405768
United States of America 2010 1765.5577235 1295.27219844 11390.2157471
United States of America 2011 1842.79152983 1386.56157572 10485.4465359
United States of America 2012 1862.3213585 1487.03798029 11225.6772102
United States of America 2013 1877.87329691 1522.32864228 10265.301655
United States of America 2014 1982.18632865 1667.50550195 13388.3303856
United States of America 2015 2142.32434708 1811.13504614 11832.3804234
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DAND - Data Viz</title>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="https://d3js.org/colorbrewer.v1.min.js"></script>
<!-- https://github.com/d3/d3-scale-chromatic -->
<script src="https://d3js.org/d3-color.v1.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v1.min.js"></script>
<script src="https://d3js.org/d3-scale-chromatic.v1.min.js"></script>
<script type="text/javascript" src='support.js'></script>
<script type="text/javascript" src='trends.js'></script>
<script type="text/javascript" src='map.js'></script>
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="newstyle.css">
</head>
<body>
<!--Tooltip as per Scott Murray-->
<div id="tooltip" class='hidden focus-bar map'>
<p><span id='tooltip-title'></span></p>
<p><span id='tooltip-value'></span></p>
</div>
<script type="text/javascript">
//----------------------------------------------------------//
// *** CHART AND DRAWING AREA ***
// Add chart
var chart = d3.select("body")
.append("svg")
.attr("width", outerWidth)
.attr("height", outerHeight)
.append('g');
// TEST: Append chart buttons
var buttons = ['visits', 'purpose', 'origin'];
chart.selectAll('text')
.data(buttons)
.enter()
.append('text')
.attr('class', 'button')
.attr('x', function(d, i) {
return 0.7 * innerWidth + i * 60;
})
.attr('y', 1.2 * padding.top)
.attr('id', function(d) {return d;})
.text(function(d) {
return d;
});
// Add drawing area
var area = chart.append('g')
.attr('class', 'area');
// Append title
chart.append('g')
.attr('id', 'title')
.attr('transform', 'translate(' + (3 * padding.left) + ',' + (1.3 * padding.top) + ')')
.append('text')
.style("text-anchor", "start");
// Add click behaviour to buttons
d3.select('#visits')
.on('click', function() {
trends(1)
});
d3.select('#purpose')
.on('click', function() {
trends(2)
});
d3.select('#origin')
.on('click', function() {
map();
})
// This function draws charts for points 3 and 4
/*var map = function() {
// Remove elements in area
remove_object('*', all=true)
// Define color function
var color = d3.scale.linear()
.range([0,1]);
// Change title
changeTitle('International Visitors to London by Country of Origin');
// File downloaded from natural earth data as per Scott Murray
// File was simplified with mapshaper
// coropleth chapter from Scott Murray
d3.csv('dataset_geo.csv', parseMap, function(data) {
// Extract years
var years = d3.set();
data.forEach(function(d) {
years.add(d.year)
})
var years = years.values();
// Nesting by market, i.e. by country of origin
// https://github.com/d3/d3-collection#nests
var nested = d3.nest()
.key(function(d) {
return d.market;
})
.entries(data)
// Update color domain
color.domain([0,
roundUpThousand(d3.max(nested, function(d) {
return d3.max(d.values, function(x) {
return +x.visits;
});
}))]);
// Transform nested from array of objects to object
nested.forEach(function(x) {
// Empty object
var rv = {};
x.values.forEach(function(d, i) {
rv[d.year] = {
visits: d.visits,
spend: d.spend,
rel_spend: d.spend / d.visit
}
});
// Replace array with object
x.values = rv;
})
// Load json data (map)
d3.json('coord_names_only.json', function(json) {
// Enrich map with nested data
for (var i = 0; i < nested.length; i++) {
var dataCountry = nested[i].key;
var dataValues = nested[i].values;
for (var j = 0; j < json.features.length; j++) {
var jsonCountry = json.features[j].properties.name;
if (dataCountry == jsonCountry) {
json.features[j].properties.visitors = dataValues;
break;
}
}
}
// *** Bind data ***
var countries = area.selectAll('path')
.data(json.features)
.enter()
.append('path')
.attr('d', path)
.attr('class', 'map country')
.style('stroke', 'white')
.style('stroke-width', 0.75)
.style('fill', 'white');
// Append year box
var year_box = area.append('text')
.attr('x', 4 * padding.right)
.attr('y', 0.88 * outerHeight)
.attr('class', 'year map')
.style('opacity', 0)
// *** TEST ***
// *************************
var focus = area.append('g')
.attr('id', 'focus')
.attr('class', 'hidden map')
.attr('transform', 'translate(' + 4 * padding.right + ',' + 0.63 * outerHeight + ')')
var yearAxis = d3.svg.axis()
.orient('bottom')
.innerTickSize(0)
.tickValues([2002, 2015])
.tickPadding(5)
focus.append('g')
.attr('class', 'axis focus-x');
var xScale = d3.scale.ordinal()
.rangeRoundBands([5, 130], 0.05)
.domain(years)
yearAxis.scale(xScale);
area.select('.focus-x')
.call(yearAxis);
focus.append('g')
.attr('class', 'axis focus-y');
var yScale = d3.scale.linear()
.range([-30,0]);
var valueAxis = d3.svg.axis()
.orient('left')
.ticks(0);
var countryData = function(state) {
return area.selectAll('.country')
.filter(function(d) {
return d.properties['name'] == state;
}).data()[0].properties.visitors;
};*/
// *************************
// *** END TEST ***
// Define update function
/*var update_map = function(year) {
// Update fill
countries.transition()
.duration(50)
.style('stroke', '#beb7b7')
.style('fill', function(d) {
// Check if visitors and year data is available
if(d.properties.visitors) {
if(d.properties.visitors[year]) {
var dataColor = color(+d.properties.visitors[year].visits);
return d3.interpolateBlues(dataColor);
} else {
return 'white'
}
} else {
return 'white'
}
})
// Update year box
year_box.transition()
.duration(50)
.text(year)
.style('opacity', 1);
// Update tootltip value
d3.select('#tooltip-value')
.text(function() {
if (this.textContent != '') {
var state = d3.select('#tooltip-title').node().textContent;
var stateData = countryData(state);
if (stateData[year]) {
d3.select(this)
.transition()
.duration(500)
.text(formatMap(stateData[year].visits))
} else {
d3.select(this)
.transition()
.duration(500)
.text('N/A');
}
}
});
// Update circle (if any)
if(focus.select('circle')[0][0]) {
focus.select('circle')
.transition()
.duration(50)
.attr('cx', xScale(year) + xScale.rangeBand()/2)
.attr('cy', function() {
var state = d3.select('#tooltip-title').node().textContent;
var stateData = countryData(state)
if(stateData[year]){
return yScale(+stateData[year].visits);
}
})
.style('fill', function() {
var state = d3.select('#tooltip-title').node().textContent;
var stateData = countryData(state)
if(!stateData[year]) {
return 'white';
} else {
return 'red';
}
})
}
// Behaviour of clicking on map
//debugger;
// Update mouseover behaviour
countries.on('mouseover', function(d) {
// Check if visitors and year data is available
if (d.properties.visitors) {
if (d.properties.visitors[year]) {
// Change the cursor
d3.select(this)
.style('cursor', 'pointer');
}
}
})
.on('click', function(d) {
var previous = null;
if (d3.select('#tooltip-title')[0][0].textContent != '') {
previous = d3.select('#tooltip-title')[0][0].textContent;
}
var current = d.properties.name;
// Check if selected
var active = this.active? true:false;
console.log(previous, current, active)
// Check if visitors and year data is available
if (d.properties.visitors) {
if (d.properties.visitors[year]) {
// Change tooltip
d3.select("#tooltip")
.style("left", (4 * padding.right) + "px")
.style("top", (0.68 * outerHeight) + 'px')
.style("width", '200px')
.classed('map', true)
.classed('trend', false)
// Add tooltip content
d3.select('#tooltip-title')
.text(current);
d3.select("#tooltip-value")
.text(formatMap(d.properties.visitors[year].visits));
// Make tooltip visible
//http://bl.ocks.org/d3noob/5d621a60e2d1d02086bf
// TESTING
var state = d.properties.name;
var stateData = countryData(state);
var test = Object.keys(stateData)
.map(function(key) {
return {
'x':key,
'y':stateData[key].visits
}
})
yScale.domain([
d3.max(test, function(d) {
return +d.y;
}),
d3.min(test, function(d) {
return +d.y;
})]);
valueAxis.scale(yScale);
focus.select('.focus-y')
.call(valueAxis);
var testLine = d3.svg.line()
.x(function(d) { return xScale(d.x) + xScale.rangeBand() / 2; })
.y(function(d) { return yScale(+d.y); });
if (previous!=current) {
focus.select('.focus-line')
.remove();
focus.select('.focus-circle')
.remove();
focus.append('path')
.attr('d', testLine(test))
.attr('class', 'focus-line')
focus.append('circle')
.attr('r', 4)
.attr('class', 'focus-circle')
.attr('cx', function() {
return xScale(year) + xScale.rangeBand() / 2;
})
.attr('cy', function() {
return yScale(stateData[year].visits)
})
.style('fill', 'red')
.style('stroke', 'white')
.style('stroke-width', 2)
d3.select('#focus')
.classed('hidden', false);
d3.select('#tooltip')
.classed('hidden', false);
} else {
focus.select('.focus-line')
.remove();
focus.select('.focus-circle')
.remove();
d3.select('#focus')
.classed('hidden', true);
d3.select('#tooltip')
.classed('hidden', true);
d3.select('#tooltip-title')
.text('');
}
// END TESTING
this.active = !active;
} /*else {
if (d3.select('#tooltip-title').textContent != '') {
d3.select('#tooltip')
.classed('hidden', active);
d3.select('#focus')
.classed('hidden', active);
}
}*/
/* }
});
};
var year = '2015'
update_map(year);
year_box.on('mouseover', function() {
// Change cursor
d3.select(this)
.style('cursor', 'ew-resize');
var box = year_box.node().getBBox();
var yearScale = d3.scale.linear()
.domain([2002, 2015])
.range([box.x + 5 , box.x + box.width - 5]);
year_box.on('mousemove', function() {
// Cancel current transition if any
area.transition().duration(0);
var value = Math.round(yearScale.invert(d3.mouse(this)[0]));
if(value < 2002) {
return 2002;
} else if (value > 2015) {
return 2015
}
year_box.transition()
.duration(150)
.text(value);
update_map(value.toString());
})
})
// Add legend
//http://bl.ocks.org/lucguillemot/37cc6eccbdd365556feb
var legend = area.append('g')
.attr('class', 'map legend')
.attr('transform', 'translate(' + (4 * padding.right) + ',' + (0.88 * outerHeight) + ')')
var newData = [];
var legend_width = 150;
var divisions = 100;
var sectionWidth = Math.floor(legend_width / divisions);
for (var i=0; i < legend_width; i+= sectionWidth ) {
newData.push(i);
};
var legend_scale = d3.scale.linear()
.domain([0, newData.length - 1])
.range([0, 1]);
legend.selectAll('rect')
.data(newData)
.enter()
.append('rect')
.attr("x", function(d) { return d; })
.attr("y", 10)
.attr("height", 10)
.attr("width", sectionWidth)
.attr('fill', function(d, i) {
var dataColor = legend_scale(i);
return d3.interpolateBlues(dataColor);
});
legend.append("text")
.attr('class', 'legend-range')
.text(0)
.attr("transform","translate(" + 2.5 +',' + 35 + ')')
legend.append("text")
.attr('class', 'legend-range')
.text(formatMap(color.domain()[1]))
.attr("transform","translate(" + 127.5 + ',' + 35 + ')')
})
})
};*/
/*d3.select('#origin')
.on('click', function() {
map();
});*/
</script>
</body>
</html>
/// UDACITY DAND - Data Visualisation - Giacomo Sarchioni
/*This JavaScript modules contains the code for rendering the
visualisation of the final chart in the project (i.e. map)*/
function map() {
// Remove all elements in area
removeObjs('*');
// Change title
changeTitle('International Visitors to London by Country of Origin');
// File downloaded from natural earth data as per Scott Murray
// File was simplified with mapshaper
// coropleth chapter from Scott Murray
d3.csv('dataset_geo.csv', parseMap, function(data) {
// Nesting by market, i.e. by country of origin
// https://github.com/d3/d3-collection#nests
var nested = extractNested(data);
/*Convert nested values from array of objects to a single
object, where keys are the years*/
nested.forEach(function(obj) {
newObj = {};
obj.values.forEach(function(value) {
newObj[value.year] = value.visits
});
// Replace array with object
obj.values = newObj;
});
// Load geoJSON data
d3.json('world_simple.json', function(json) {
// Source Scott Murray choropleth
json = addDataToMap(nested, json);
// Bind data
var countries = area.selectAll('path')
.data(json.features)
.enter()
.append('path')
.attr('d', mapPath)
.attr('class', 'map country');
// Append year-box
var year_box = area.append('text')
.attr('x', 4 * padding.right)
.attr('y', 0.88 * outerHeight)
.attr('class', 'map year')
.style('opacity', 0);
// ** DO LATER **
// Update and call xAxis
// Append focus group (i.e. where the small line chart is going to be)
var focus = area.append('g')
.attr('id', 'focus')
.attr('class', 'hidden map')
.attr('transform', 'translate(' + 4 * padding.right + ',' + 0.63 * outerHeight + ')');
})
})
};
/*/// UDACITY DAND - Data Visualisation - Giacomo Sarchioni*/
/*This is the main CSS stylesheet for the project*/
.axis {
font-family: 'Roboto Condensed', sans-serif;
font-weight: 300i;
font-size: 14px;
}
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
.axis path {
display: none;
}
.bar {
fill: #428bca;
}
.bar.focus {
fill: #ffbf00;
}
.country {
stroke: #beb7b7;
stroke-width: 0.75;
fill: white;
}
.hidden {
display: none;
}
.line {
fill: none;
}
.purpose path {
stroke-width: 2;
}
.purpose text {
font-family: 'Roboto Condensed', sans-serif;
font-weight: 300;
font-size: 16px;
}
.purpose.focused path {
stroke-width: 3;
}
.purpose.focused text {
font-weight: 400;
}
.purpose.unfocused path {
stroke: #d8d8d8;
}
.purpose.unfocused text {
fill: #d8d8d8;
}
.purpose .percentage-box {
text-align: left;
alignment-baseline: middle;
}
.purpose .purpose-box {
cursor: default;
text-anchor: start;
}
.tick line {
stroke-width: 0.5;
opacity: 0.3;
}
#title {
font-family: 'Roboto Condensed', sans-serif;
font-weight: 700;
font-size: 18px;
}
#tooltip {
position: absolute;
pointer-events: none;
height: auto;
}
#tooltip.focus-bar {
text-align: center;
padding: 10px;
background-color: white;
border-style: solid;
border-color: black;
border-width: 1px;
opacity: 0.9;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
#tooltip.focus-bar p {
margin: 0;
font-family: 'Roboto Condensed', sans-serif;
font-size: 16px;
line-height: 20px;
}
#tooltip-title {
font-weight: 700;
}
/// UDACITY DAND - Data Visualisation - Giacomo Sarchioni
/*This JavaScript modules contains all the supporting functions for
the Data Analyst Nanodegree - Data Visualisation project.*/
// ### MARGINS ###
//Margins as per convention from bl.ocks.org
var margin = {top: 20, right: 10, bottom: 20, left: 10};
var padding = {top: 20, right: 20, bottom: 20, left:20};
var outerWidth = 960,
outerHeight = 500,
width = outerWidth - margin.left - margin.right,
height = outerHeight - margin.top - margin.bottom,
innerWidth = width - padding.left - padding.right,
innerHeight = height - padding.top - padding.bottom
// ### UPDATING CHART ###
// Title
function changeTitle(newTitle) {
chart.select('#title')
.select('text')
.text(newTitle);
};
// ### FORMATTING ###
// Formatting nymbers
var formatDec = d3.format('.2f');
var formatInt = d3.format(',.0f');
var formatPerc = d3.format(',%');
function formatMillAxis(value) {
return formatInt(parseFloat(value) / 1e3) + ' M';
}
function formatMill(value) {
return formatDec(parseFloat(value) / 1e3) + ' M';
};
function formatMap(value) {
return formatInt(parseFloat(value) * 1e3);
};
function roundUpThousand(value) {
/*Round up to the next hundredth thousand for a value expressed
in thousands*/
return Math.ceil(value / 1e2) * 1e2;
};
// ### DATA PARSING ###
// Trends
function parseTrends(data) {
for (var key in data) {
if (key != 'year') {
data[key] = +data[key];
}
}
return data;
};
// Map
function parseMap(data) {
for (var key in data) {
if ((key!= 'year') && (key!='market')) {
data[key] = +data[key];
}
}
return data;
};
// ### OBJECT REMOVING ###
// Remove objects from area
function removeObjs(object) {
area.selectAll(object).remove();
};
// ### TOOLTIP MANAGING ###
// Change tooltip title
function changeTooltipTitle(newTitle) {
d3.select('#tooltip-title')
.text(newTitle);
}
// Change tooltip value
function changeTooltipValue(newValue) {
d3.select('#tooltip-value')
.text(newValue);
}
// Change tooltip width
function changeTooltipWidth(newValue) {
d3.select('#tooltip')
.style('width', newValue + 'px');
}
// Change tooltip class
function changeTooltipClass(classed, boolean) {
d3.select('#tooltip')
.classed(classed, boolean);
}
// Change tooltip position
function changeTooltipPosition(left, top) {
d3.select('#tooltip')
.style('left', left + 'px')
.style('top', top + 'px');
}
// ### D3 SCALES ###
// Axis scales
var xScale = d3.scale.ordinal();
var yScale = d3.scale.linear();
// Color scales
var trendColor = d3.scale.ordinal().range(colorbrewer.Set1[5]);
var mapColor = d3.scale.linear().range([0,1]);
// ### D3 AXIS ###
var xAxis = d3.svg.axis().orient('bottom');
var yAxis = d3.svg.axis().orient('left');
// ### LINE ###
var line = d3.svg.line()
.x(function(d) { return xScale(d.year) + xScale.rangeBand() / 2; })
.y(function(d) { return yScale(d.value); });
// ### PROJECTIONS ###
var mapProjection = d3.geo.mercator()
.scale(110)
.translate([outerWidth/1.7, outerHeight/1.35]);
var mapPath = d3.geo.path().projection(mapProjection);
// ### CREATE PURPOSE OBJECT ###
function createPurposesData(data) {
/*Creates an object where for each purpose (key), there is an
array of values, one for every year*/
var dataPurposes = Object.keys(data[0]).slice(1,6).map(function(purpose) {
return {
purpose: purpose,
values: data.map(function(d) {
return {
year: d.year,
value: d[purpose]
};
})
};
})
return dataPurposes;
};
// ### EXTRACTING VALUES ###
// Extract max value of the max values in an object
function extractMaxMax(data) {
return d3.max(data, function(d) {
return d3.max(d.values, function(d) {
return d.value;
});
});
};
// Extract properly formatted purpose name from an Object
function extractPurposeName(purpose, datum) {
if(purpose == 'VFR') {
return 'Visiting friends and relatives'
} else {
return datum.purpose;
}
};
// Extract purpose percentage
function extractPurposePerc(datum, index) {
return formatPerc(datum.values[index].value);
};
// Extract y of purpose-box
function extractPurposeBoxY(purpose, datum, index) {
// Ad hoc code to position labelling correctly
if (purpose == 'Business') {
return yScale(datum.values[index].value) + 25;
} else if (purpose == 'VFR') {
return yScale(datum.values[index].value) - 25;
} else {
return yScale(datum.values[index].value) - 15;
}
};
// Extract nested, i.e. visits data by country as a JS object
function extractNested(data) {
return d3.nest()
.key(function(d) {
return d.market;
})
.entries(data);
};
// Extract unique values from array of objects
function extractUniques(data, field) {
var uniques = d3.set();
data.forEach(function(d) {
uniques.add(d[field]);
});
var uniques = uniques.values();
return uniques;
};
// ### MERGE DATASETS ***
// Add visitors to data to geoJSON
function addDataToMap(data, map) {
for (var i = 0; i < data.length; i++) {
var dataCountry = data[i].key;
var dataValues = data[i].values;
for (var j = 0; j < map.features.length; j++) {
var mapCountry = map.features[j].properties.name;
if (dataCountry == mapCountry) {
map.features[j].properties.visitors = dataValues;
break;
}
}
};
return map;
};
// ### UPDATE MAP ###
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment