Skip to content

Instantly share code, notes, and snippets.

@officeofjane
Last active May 19, 2017 10:27
Show Gist options
  • Save officeofjane/12c0a51183f098645e36dc891dad5d0e to your computer and use it in GitHub Desktop.
Save officeofjane/12c0a51183f098645e36dc891dad5d0e to your computer and use it in GitHub Desktop.
Scatterplot I - log scale toggle
license: mit
airport_code region airport_size airport_city ontime_ranking flights tracked ontime_d14 delayed_15min avg_delay
ABQ North America Regional airports Albuquerque, NM, US 112 2067 0.941 0.85 0.15 54
ABZ Europe Regional airports Aberdeen, SC, GB 124 1909 0.666 0.844 0.156 49.9
ACE Europe Regional airports Lanzarote, CI, ES 171 2211 0.99 0.826 0.174 41.9
ADD Middle East and Africa Mid-size airports Addis Ababa, ET 211 3346 0.943 0.808 0.192 48.2
ADL Asia Pacific Mid-size airports Adelaide, SA, AU 23 3120 0.931 0.9 0.1 45.1
AEP Latin America Mid-size airports Buenos Aires, BA, AR 175 4679 0.959 0.824 0.176 41.3
AGP Europe Mid-size airports Malaga, SP, ES 299 5361 0.984 0.754 0.246 38.7
AHB Middle East and Africa Regional airports Abha, SA 287 1385 0.731 0.767 0.233 53.8
AKL Asia Pacific Mid-size airports Auckland, NZ 206 6493 0.977 0.81 0.19 43.4
ALA Asia Pacific Regional airports Almaty, KZ 11 2034 0.623 0.917 0.083 46
ALC Europe Regional airports Alicante, SP, ES 262 4010 0.998 0.781 0.219 40.3
AMD Asia Pacific Regional airports Ahmedabad, IN 70 2376 0.814 0.873 0.127 36.4
AMM Middle East and Africa Regional airports Amman, JO 266 2872 0.747 0.78 0.22 49.8
AMS Europe Global hubs Amsterdam, NL 302 19622 0.928 0.746 0.254 32.6
ANC North America Regional airports Anchorage, AK, US 5 3306 0.917 0.938 0.062 49.9
ARN Europe Major airports Stockholm, SE 239 9663 0.969 0.796 0.204 35.9
ATH Europe Mid-size airports Athens, GR 30 6523 0.842 0.896 0.104 37.2
ATL North America Global hubs Atlanta, GA, US 288 35856 0.996 0.766 0.234 91.4
AUA Latin America Regional airports Aruba, AW 164 1077 0.648 0.829 0.171 52.2
AUH Middle East and Africa Major airports Abu Dhabi, AE 285 5914 0.868 0.768 0.232 33.1
AUS North America Mid-size airports Austin, TX, US 165 4931 0.992 0.828 0.172 72.9
BAH Middle East and Africa Mid-size airports Bahrain, BH 123 3538 0.776 0.845 0.155 53.4
BAQ Latin America Regional airports Baranquila, CO 279 883 0.988 0.771 0.229 71.9
BCN Europe Global hubs Barcelona, SP, ES 202 13019 0.986 0.813 0.187 39.8
BDL North America Regional airports Hartford, CT, US 110 2804 0.985 0.851 0.149 71.3
BEG Europe Regional airports Belgrade, RS 43 2146 0.597 0.889 0.111 37.7
BEL Latin America Regional airports Belem, PA, BR 98 1016 0.992 0.857 0.143 49
BEY Middle East and Africa Regional airports Beirut, LB 218 2480 0.834 0.805 0.195 46.1
BFS Europe Regional airports Belfast, NI, GB 125 1702 0.989 0.843 0.157 42.6
BGO Europe Regional airports Bergen, NO 78 2633 0.985 0.868 0.132 40.7
BHD Europe Regional airports Belfast, NI, GB 77 1534 0.725 0.869 0.131 42.1
BHM North America Regional airports Birmingham, AL, US 160 1546 1 0.831 0.169 87.8
BHX Europe Mid-size airports Birmingham, EN, GB 264 4455 0.815 0.781 0.22 39.9
BIO Europe Regional airports Bilbao, SP, ES 22 1817 0.972 0.9 0.1 42.3
BJV Middle East and Africa Regional airports Bodrum, TR 21 579 0.506 0.901 0.099 50.2
BKI Asia Pacific Regional airports Kota Kinabalu, MY 300 2840 0.856 0.75 0.25 44.5
BKK Asia Pacific Global hubs Bangkok, TH 281 13675 0.748 0.77 0.23 43.5
BLQ Europe Regional airports Bologna, IT 144 2651 0.697 0.836 0.164 36.7
BLR Asia Pacific Mid-size airports Bengaluru, IN 166 6119 0.843 0.828 0.172 34.8
BMA Europe Regional airports Stockholm, SE 40 1885 0.907 0.89 0.11 27.7
BNA North America Mid-size airports Nashvile, TN, US 246 6128 0.954 0.792 0.208 61.4
BNE Asia Pacific Major airports Brisbane, QLD, AU 35 7776 0.953 0.895 0.105 42.3
BOD Europe Regional airports Bordeaux, FR 227 2334 0.53 0.799 0.201 44.9
BOG Latin America Major airports Bogota, CO 223 10876 0.913 0.801 0.199 51
BOI North America Regional airports Boise, ID, US 45 1839 1 0.888 0.112 58.3
BOM Asia Pacific Global hubs Mumbai, IN 294 12113 0.819 0.762 0.238 36.2
BOS North America Major airports Boston, MA, US 248 15143 0.987 0.791 0.21 70
BRS Europe Regional airports Bristol, EN, GB 179 2575 0.835 0.822 0.178 36
BRU Europe Major airports Brussels, BE 284 8522 0.997 0.769 0.231 34.9
BSB Latin America Major airports Brasilia, DF, BR 103 4766 0.996 0.854 0.146 34.2
BSL Europe Regional airports Basel, Switzerland/Mu. 98 2520 0.858 0.857 0.143 35.1
BUD Europe Mid-size airports Budapest, HU 301 3690 0.654 0.75 0.25 39.6
BUF North America Regional airports Bufalo, NY, US 172 2352 1 0.826 0.174 84.5
BUR North America Regional airports Burbank, CA, US 174 2181 1 0.824 0.176 57.3
BWI North America Major airports Baltimore, MD, US 208 9581 0.96 0.809 0.191 58.2
CAI Middle East and Africa Mid-size airports Cairo, EG 335 5942 0.709 0.691 0.309 49.4
CAN Asia Pacific Global hubs Guangzhou, CN 369 18057 0.949 0.586 0.414 66.2
CBR Asia Pacific Regional airports Canbera, ACT, AU 41 1590 0.918 0.889 0.111 44.4
CCJ Asia Pacific Regional airports Kozhikode, IN 86 1055 0.87 0.866 0.134 44.1
CCU Asia Pacific Mid-size airports Kolkata, IN 60 5810 0.801 0.877 0.123 42.7
CDG Europe Global hubs Paris, FR 310 18790 0.845 0.735 0.265 36.7
CEB Asia Pacific Mid-size airports Cebu City, PH 371 3964 0.645 0.583 0.417 58.8
CGB Latin America Regional airports Cuiaba, MT, BR 56 1121 0.942 0.882 0.118 45.6
CGH Latin America Major airports Sao Paulo, SP, BR 263 7022 0.993 0.781 0.219 35.1
CGK Asia Pacific Global hubs Jakarta, ID 375 18154 0.826 0.532 0.468 43.8
CGN Europe Mid-size airports Cologne, DE 168 3732 0.823 0.827 0.173 34.1
CGO Asia Pacific Mid-size airports Zhengzhou, CN 309 7754 0.888 0.736 0.264 78.9
CGQ Asia Pacific Mid-size airports Changchun, CN 359 3197 0.917 0.618 0.382 76.1
CHC Asia Pacific Regional airports Christchurch, NZ 295 3064 0.974 0.76 0.24 43.2
CHS North America Regional airports Charleston, SC, US 227 1983 0.999 0.799 0.201 89
CKG Asia Pacific Major airports Chongqing, CN 320 11185 0.908 0.717 0.283 58
CLE North America Regional airports Cleveland, OH, US 187 4257 0.999 0.817 0.183 80.2
CLO Latin America Regional airports Cali, CO 236 1927 0.924 0.796 0.204 58
CLT North America Global hubs Charlote, NC, US 201 21813 0.988 0.814 0.187 61
CMB Asia Pacific Mid-size airports Colombo, LK 146 2447 0.846 0.836 0.165 46.3
CMH North America Regional airports Columbus, OH, US 136 4055 0.998 0.839 0.161 81.3
CMN Middle East and Africa Mid-size airports Casablanca, MA 250 3453 0.769 0.789 0.211 54.2
CNF Latin America Mid-size airports Belo Horizonte, MG, . 41 3628 0.982 0.889 0.111 39.9
CNS Asia Pacific Regional airports Cairns, QLD, AU 71 2043 0.755 0.872 0.128 43.3
CNX Asia Pacific Mid-size airports Chiang Mai, TH 148 2998 0.658 0.835 0.165 49.4
COK Asia Pacific Regional airports Kochi, IN 84 2623 0.998 0.867 0.133 54.9
CPH Europe Major airports Copenhagen, DK 154 10274 0.845 0.833 0.167 37.4
CPT Middle East and Africa Mid-size airports Cape Town, ZA 47 3488 0.572 0.888 0.112 49.7
CSX Asia Pacific Mid-size airports Changsha, CN 346 7098 0.79 0.656 0.344 75.3
CTA Europe Regional airports Catania, IT 318 2647 0.691 0.72 0.28 41.5
CTG Latin America Regional airports Cartagena, CO 257 1479 0.99 0.785 0.215 53.6
CTS Asia Pacific Major airports Sapporo, JP 6 5886 0.99 0.938 0.062 36.1
CTU Asia Pacific Global hubs Chengdu, CN 338 13202 0.95 0.682 0.318 62.8
CUN Latin America Mid-size airports Cancun, MX 205 6821 0.626 0.81 0.19 66.3
CUZ Latin America Regional airports Cuzco, PE 225 1340 0.63 0.8 0.201 44.8
CVG North America Regional airports Cincinnati, OH, US 207 4158 0.977 0.81 0.19 85.6
CWB Latin America Mid-size airports Curitiba, PR, BR 85 2491 0.995 0.866 0.134 47.2
DAD Asia Pacific Regional airports Da Nang, VN 261 2601 0.502 0.782 0.218 47.7
DAL North America Mid-size airports Dalas, TX, US 305 5706 0.999 0.739 0.261 53.3
DCA North America Major airports Washington, DC, US 219 12177 0.996 0.804 0.196 76.4
DEL Asia Pacific Global hubs Delhi, IN 138 17112 0.974 0.839 0.161 48.5
DEN North America Global hubs Denver, CO, US 135 22031 0.961 0.84 0.161 59.9
DFW North America Global hubs Dalas, TX, US 254 24879 0.981 0.786 0.214 70.9
DLC Asia Pacific Mid-size airports Dalian, CN 319 5692 0.916 0.718 0.282 63.7
DLM Middle East and Africa Regional airports Dalaman, TR 159 445 0.611 0.831 0.169 43.7
DME Europe Major airports Moscow, RU 79 8313 0.512 0.868 0.132 34.6
DMK Asia Pacific Major airports Bangkok, TH 180 9999 0.702 0.821 0.179 37.9
DMM Middle East and Africa Mid-size airports Dammam, SA 233 3134 0.647 0.798 0.202 50.9
DOH Middle East and Africa Major airports Doha, QA 91 9636 0.993 0.863 0.137 42.5
DPS Asia Pacific Mid-size airports Denpasar, ID 325 5786 0.522 0.709 0.291 50.8
DTW North America Global hubs Detroit, MI, US 224 15787 0.999 0.8 0.2 83.2
DUB Europe Mid-size airports Dublin, IE 131 8626 0.998 0.841 0.159 34
DUR Middle East and Africa Regional airports Durban, ZA 52 1971 0.522 0.884 0.116 47.8
DUS Europe Major airports Dusseldorf, DE 322 8840 0.996 0.716 0.284 36.1
DVO Asia Pacific Regional airports Davao, PH 347 1118 0.634 0.655 0.345 56.4
DXB Middle East and Africa Global hubs Dubai, AE 305 16849 0.874 0.739 0.261 35.7
EDI Europe Mid-size airports Edinburgh, SC, GB 242 5049 0.939 0.795 0.205 37.3
ELP North America Regional airports El Paso, TX, US 118 1418 0.999 0.848 0.152 80.3
EWR North America Global hubs Newark, NJ, US 308 17146 0.992 0.736 0.264 69.5
EZE Latin America Mid-size airports Buenos Aires, BA, AR 62 2160 0.906 0.876 0.124 56.5
FAO Europe Regional airports Faro, PT 167 2482 0.888 0.827 0.173 38.8
FCO Europe Global hubs Rome, IT 333 12117 0.996 0.693 0.307 37.2
FLL North America Major airports Fort Lauderdale, FL, . 311 11292 0.974 0.733 0.267 69.8
FLN Latin America Regional airports Florianopolis, SC, BR 73 1197 0.979 0.871 0.129 35.7
FLR Europe Regional airports Florence, IT 247 1380 0.61 0.791 0.209 53
FOR Latin America Regional airports Fortaleza, CE, BR 83 1525 0.912 0.867 0.133 39.8
FRA Europe Global hubs Frankfurt, DE 282 18571 0.923 0.77 0.23 29.5
FUE Europe Regional airports Puerto del Rosario, CI. 213 1704 0.988 0.807 0.193 40.2
FUK Asia Pacific Major airports Fukuoka, JP 59 6864 0.973 0.88 0.12 34.2
GAU Asia Pacific Regional airports Guwahati, IN 53 1676 0.776 0.884 0.116 39.1
GDN Europe Regional airports Gdansk, PL 88 1451 0.621 0.865 0.135 35.1
GEG North America Regional airports Spokane, WA, US 12 1455 1 0.914 0.086 54.7
GIG Latin America Mid-size airports Rio De Janeiro, RJ, BR 44 4273 0.833 0.889 0.111 36.7
GLA Europe Regional airports Glasgow, SC, GB 143 3552 0.96 0.836 0.164 41.6
GMP Asia Pacific Major airports Seoul, KR 158 5610 0.601 0.831 0.169 28.4
GOI Asia Pacific Regional airports Goa, IN 276 2017 0.794 0.772 0.228 36.8
GOT Europe Regional airports Gothenburg, SE 221 2528 0.957 0.803 0.197 35.9
GRR North America Regional airports Grand Rapids, MI, US 116 1593 0.996 0.848 0.152 93.8
GRU Latin America Global hubs Sao Paulo, SP, BR 48 9174 0.906 0.887 0.113 43.2
GUA Latin America Regional airports Guatemala City, GT 19 1481 0.712 0.904 0.096 68.5
GUM Asia Pacific Regional airports Guam, GU 8 1030 0.805 0.927 0.073 74.8
GVA Europe Mid-size airports Geneva, CH 238 6330 0.999 0.796 0.204 36.5
GYE Latin America Regional airports Guayaquil, EC 128 1478 0.686 0.841 0.159 75.2
GYN Latin America Regional airports Goiania, GO, BR 127 1101 0.992 0.842 0.158 35.4
HAJ Europe Regional airports Hanover, DE 116 2006 0.702 0.848 0.152 40.4
HAK Asia Pacific Mid-size airports Haikou, CN 348 6086 0.925 0.654 0.346 72.2
HAM Europe Mid-size airports Hamburg, DE 303 5784 0.852 0.742 0.258 35.1
HAN Asia Pacific Mid-size airports Hanoi, VN 157 6054 0.57 0.832 0.168 40.9
HAV Latin America Regional airports Havana, CU 275 2122 0.55 0.772 0.228 53.8
HBE Middle East and Africa Regional airports Alexandria, EG 334 861 0.504 0.691 0.309 70.4
HEL Europe Mid-size airports Helsinki, FI 45 6568 0.879 0.888 0.112 35.1
HER Europe Regional airports Heraklion, GR 89 1002 0.732 0.865 0.135 33.9
HET Asia Pacific Regional airports Hohhot, CN 351 3933 0.9 0.644 0.356 60.6
HFE Asia Pacific Regional airports Hefei, CN 369 2919 0.899 0.586 0.414 71
HGH Asia Pacific Major airports Hangzhou, CN 383 10358 0.835 0.429 0.572 68.9
HIJ Asia Pacific Regional airports Hiroshima, JP 66 897 0.908 0.874 0.126 33.2
HKD Asia Pacific Regional airports Hakodate, JP 1 661 0.923 0.963 0.037 31
HKG Asia Pacific Global hubs Hong Kong, HK 349 14783 0.995 0.649 0.351 54.6
HKT Asia Pacific Mid-size airports Phuket, TH 297 4033 0.775 0.756 0.244 49.5
HND Asia Pacific Global hubs Tokyo, JP 9 18189 0.998 0.923 0.077 32
HNL North America Mid-size airports Honolulu, HI, US 24 6592 0.791 0.899 0.101 66.2
HOU North America Mid-size airports Houston, TX, US 241 5027 0.998 0.795 0.205 52.1
HRB Asia Pacific Mid-size airports Harbin, CN 345 5514 0.889 0.656 0.344 65
HRG Middle East and Africa Regional airports Hurghada, EG 337 950 0.585 0.683 0.317 61
HYD Asia Pacific Mid-size airports Hyderabad, IN 32 5881 0.823 0.895 0.105 46.3
IAD North America Major airports Dules, VA, US 177 9008 0.974 0.823 0.177 77.1
IAH North America Global hubs Houston, TX, US 151 17262 0.987 0.834 0.166 65.8
IBZ Europe Regional airports Ibiza, SP, ES 107 1879 0.982 0.852 0.148 41.3
ICN Asia Pacific Global hubs Seoul, KR 326 12495 0.757 0.705 0.295 34.2
INC Asia Pacific Regional airports Yinchuan, CN 266 2550 0.904 0.78 0.22 59.6
IND North America Regional airports Indianapolis, IN, US 134 4328 0.987 0.84 0.16 78.2
ISB Asia Pacific Regional airports Islamabad, PK 376 1627 0.581 0.517 0.483 71.8
ITM Asia Pacific Mid-size airports Osaka, JP 3 5550 0.995 0.94 0.06 28.1
JAI Asia Pacific Regional airports Jaipur, IN 169 1340 0.801 0.827 0.174 42.7
JAX North America Regional airports Jacksonvile, FL, US 186 2563 0.998 0.818 0.182 89
JED Middle East and Africa Major airports Jeddah, SA 360 8935 0.632 0.617 0.383 54.9
JFK North America Global hubs New York, NY, US 307 17771 0.959 0.737 0.263 72.9
JHB Asia Pacific Regional airports Johor Bharu, MY 252 1271 0.566 0.787 0.213 41.2
JHG Asia Pacific Regional airports Jinghong, CN 242 1339 0.946 0.795 0.205 64.4
JJN Asia Pacific Regional airports Jinjiang, CN 388 1617 0.558 0.342 0.658 84.3
JNB Middle East and Africa Major airports Johannesburg, ZA 119 8126 0.697 0.848 0.152 49.4
KBP Europe Regional airports Kiev/Kyiv, UA 38 2813 0.869 0.891 0.11 36.4
KBV Asia Pacific Regional airports Krabi, TH 152 1126 0.588 0.834 0.166 49.8
KCH Asia Pacific Regional airports Kuching, MY 217 1811 0.935 0.805 0.195 62.3
KEF Europe Regional airports Reykjavik, IS 372 1797 0.994 0.578 0.422 43.2
KHH Asia Pacific Regional airports Kaohsiung, TW 54 1834 0.991 0.884 0.116 49
KHI Asia Pacific Regional airports Karachi, PK 340 2201 0.607 0.675 0.326 61.9
KHN Asia Pacific Mid-size airports Nanchang, CN 355 2889 0.924 0.636 0.364 74.3
KIX Asia Pacific Major airports Osaka, JP 96 6705 0.998 0.858 0.142 43.4
KMG Asia Pacific Major airports Kunming, CN 350 15052 0.939 0.648 0.353 57.9
KMI Asia Pacific Regional airports Miyazaki, JP 14 1443 0.979 0.911 0.089 27.9
KMJ Asia Pacific Regional airports Kumamoto, JP 63 1153 0.858 0.876 0.125 27.6
KOA North America Regional airports Kailua-Kona, HI, US 33 1836 0.641 0.895 0.105 51.3
KOJ Asia Pacific Regional airports Kagoshima, JP 13 2347 0.958 0.912 0.088 30.2
KUL Asia Pacific Global hubs Kuala Lumpur, MY 344 15556 0.835 0.663 0.337 40.9
KWE Asia Pacific Mid-size airports Guiyang, CN 356 5824 0.893 0.634 0.366 64
KWL Asia Pacific Regional airports Guilin, CN 354 2749 0.881 0.637 0.364 68.2
LAS North America Global hubs Las Vegas, NV, US 232 14378 0.985 0.798 0.202 58.7
LAX North America Global hubs Los Angeles, CA, US 317 25889 0.964 0.721 0.279 57.2
LBA Europe Regional airports Leeds, EN, GB 67 1416 0.792 0.874 0.126 36.1
LCA Middle East and Africa Regional airports Larnaca, CY 216 1887 0.557 0.806 0.194 34.2
LCY Europe Regional airports London, EN, GB 145 3068 0.992 0.836 0.164 42.5
LED Europe Mid-size airports Saint Petersburg, RU 25 4966 0.976 0.899 0.101 46.3
LGA North America Major airports New York, NY, US 296 15154 0.998 0.757 0.243 77.4
LGK Asia Pacific Regional airports Langkawi, MY 367 988 0.607 0.597 0.403 40.5
LGW Europe Global hubs London, EN, GB 288 11599 0.995 0.766 0.234 40.8
LHE Asia Pacific Regional airports Lahore, PK 312 1376 0.534 0.732 0.268 78
LHR Europe Global hubs London, EN, GB 94 19687 0.903 0.859 0.141 39.4
LHW Asia Pacific Regional airports Lanzhou, CN 293 3916 0.895 0.762 0.238 66.6
LIH North America Regional airports Kauai Island, HI, US 18 1179 0.847 0.907 0.094 63
LIM Latin America Mid-size airports Lima, PE 192 6516 0.926 0.816 0.184 67.4
LIN Europe Mid-size airports Milan, IT 75 3816 0.987 0.87 0.13 34.2
LIS Europe Mid-size airports Lisbon, PT 290 7896 0.821 0.763 0.237 36.2
LJG Asia Pacific Regional airports Lijiang, CN 315 2267 0.956 0.726 0.274 58.4
LKO Asia Pacific Regional airports Lucknow, IN 198 1298 0.767 0.814 0.186 37.5
LPA Europe Regional airports Las Palmas, CI, ES 101 3916 0.979 0.855 0.145 40.4
LPL Europe Regional airports Liverpool, EN, GB 58 1552 0.875 0.881 0.119 46.9
LTN Europe Mid-size airports London, EN, GB 245 4379 0.596 0.793 0.207 39.7
LUX Europe Regional airports Luxembourg, LU 139 2037 0.975 0.839 0.161 37.7
LXA Asia Pacific Regional airports Lhasa, CN 339 1415 0.888 0.681 0.319 87.7
LYS Europe Mid-size airports Lyon, FR 280 4403 0.545 0.771 0.229 46.6
MAA Asia Pacific Mid-size airports Chennai, IN 34 6103 0.852 0.895 0.105 48
MAD Europe Global hubs Madrid, SP, ES 95 14857 0.967 0.858 0.142 39.7
MAN Europe Mid-size airports Manchester, EN, GB 274 7836 0.874 0.773 0.228 40.6
MAO Latin America Regional airports Manaus, AM, BR 97 761 0.992 0.857 0.143 41.9
MBJ Latin America Regional airports Montego Bay, JM 183 1257 0.867 0.82 0.18 62.1
MCI North America Mid-size airports Kansas City, MO, US 133 4680 0.998 0.84 0.16 65.9
MCO North America Global hubs Orlando, FL, US 185 13692 0.998 0.818 0.182 72.2
MDE Latin America Regional airports Medelin, CO 258 2789 0.947 0.785 0.215 59.1
MDW North America Major airports Chicago, IL, US 163 7879 0.973 0.829 0.171 51.1
MED Middle East and Africa Regional airports Madinah, SA 353 2024 0.719 0.639 0.361 58.9
MEL Asia Pacific Global hubs Melbourne, VIC, AU 155 9586 0.954 0.833 0.167 42.6
MEM North America Regional airports Memphis, TN, US 178 2146 0.927 0.822 0.178 91.2
MEX Latin America Major airports Mexico City, MX 327 16712 0.94 0.705 0.295 44.8
MFM Asia Pacific Regional airports Macau, MO 373 2297 0.589 0.554 0.446 51.7
MIA North America Global hubs Miami, FL, US 237 13937 0.992 0.796 0.204 65.7
MKE North America Regional airports Milwaukee, WI, US 146 3293 0.991 0.836 0.165 78.8
MLA Europe Regional airports Malta, MT 269 1701 0.801 0.779 0.221 41.1
MNL Asia Pacific Global hubs Manila, PH 329 10995 0.629 0.704 0.296 49.3
MRS Europe Regional airports Marseile, FR 298 3438 0.564 0.755 0.245 46.3
MRU Middle East and Africa Regional airports Mauritius, MU 253 977 0.886 0.787 0.214 57.4
MSP North America Global hubs Minneapolis, MN, US 114 15535 0.942 0.849 0.151 74.6
MSQ Europe Regional airports Minsk, BY 20 1668 0.921 0.902 0.098 32.3
MSY North America Mid-size airports New Orleans, LA, US 230 4502 0.999 0.799 0.201 72.5
MUC Europe Global hubs Munich, DE 210 15584 0.836 0.808 0.192 32
MXP Europe Mid-size airports Milan, IT 105 6634 0.988 0.853 0.147 47.4
MYJ Asia Pacific Regional airports Matsuyama, JP 15 1126 0.973 0.91 0.09 36.1
MYY Asia Pacific Regional airports Miri, MY 314 1421 0.932 0.729 0.271 59.8
NAP Europe Regional airports Naples, IT 100 2586 0.994 0.856 0.144 35.3
NAS Latin America Regional airports Nassau, BS 321 2550 0.79 0.717 0.284 50.3
NAT Latin America Regional airports Natal, RN, BR 87 611 0.854 0.866 0.134 35.9
NAY Asia Pacific Regional airports Beijing, CN 222 1733 0.975 0.802 0.198 54.7
NBO Middle East and Africa Regional airports Nairobi, KE 268 3483 0.836 0.78 0.22 46.1
NCE Europe Mid-size airports Nice, FR 229 4646 0.719 0.799 0.201 40.5
NCL Europe Regional airports Newcastle, EN, GB 111 1710 0.84 0.851 0.149 37.1
NGB Asia Pacific Regional airports Ningbo, CN 385 2765 0.909 0.411 0.589 73.6
NGO Asia Pacific Mid-size airports Nagoya, JP 31 4008 0.946 0.896 0.105 39.4
NGS Asia Pacific Regional airports Nagasaki, JP 27 1173 0.955 0.899 0.101 31.2
NKG Asia Pacific Major airports Nanjing, CN 378 8188 0.897 0.484 0.516 64.8
NNG Asia Pacific Mid-size airports Nanning, CN 374 4436 0.833 0.54 0.46 86.2
NRT Asia Pacific Global hubs Tokyo, JP 141 9132 0.824 0.837 0.163 40.8
NTE Europe Regional airports Nantes, FR 272 2221 0.53 0.774 0.226 42.2
NUE Europe Regional airports Nuremberg, DE 121 1631 0.709 0.847 0.153 36.5
OAK North America Mid-size airports Oakland, CA, US 269 4425 0.97 0.779 0.221 43.5
OGG North America Regional airports Kahului, HI, US 39 3377 0.654 0.89 0.11 48.9
OKA Asia Pacific Mid-size airports Okinawa, JP 336 5366 0.912 0.69 0.311 31.9
OKC North America Regional airports Oklahoma City, OK, U. 106 1875 0.998 0.853 0.147 68.8
OMA North America Regional airports Omaha, NE, US 64 2165 0.999 0.875 0.125 76.9
ONT North America Regional airports Ontario, CA, US 200 1767 0.983 0.814 0.186 70.2
OOL Asia Pacific Regional airports Coolangata (Gold Co. 220 1861 0.923 0.804 0.197 36.6
OPO Europe Regional airports Porto, PT 132 3375 0.868 0.84 0.16 35.8
ORD North America Global hubs Chicago, IL, US 189 33229 0.985 0.816 0.184 69.6
ORF North America Regional airports Norfolk, VA, US 192 1955 0.998 0.816 0.184 82.3
ORY Europe Major airports Paris, FR 316 10070 0.794 0.725 0.275 40
OSL Europe Major airports Oslo, NO 231 9313 0.998 0.798 0.202 44.6
OVB Europe Regional airports Novosibirsk, RU 25 1552 0.526 0.899 0.101 51.4
PBI North America Regional airports West Palm Beach, FL. 286 2730 0.985 0.767 0.233 85
PDX North America Mid-size airports Portland, OR, US 176 7303 0.984 0.823 0.177 53.1
PEK Asia Pacific Global hubs Beijing, CN 380 21120 0.951 0.462 0.538 66.1
PEN Asia Pacific Regional airports Penang, MY 341 2616 0.5 0.673 0.327 42.8
PER Asia Pacific Mid-size airports Perth, WA, AU 16 3942 0.875 0.907 0.093 45.9
PHL North America Global hubs Philadelphia, PA, US 169 13908 0.997 0.827 0.174 60.6
PHX North America Global hubs Phoenix, AZ, US 149 16183 0.979 0.835 0.165 53.5
PIT North America Mid-size airports Pitsburgh, PA, US 129 5066 0.802 0.841 0.159 69.8
PMI Europe Mid-size airports Palma Malorca, SP, . 260 7580 0.984 0.784 0.216 42.7
PMO Europe Regional airports Palermo, IT 209 1742 0.777 0.809 0.191 46
PNH Asia Pacific Regional airports Phnom Penh, KH 226 1336 0.79 0.799 0.201 48.9
PNQ Asia Pacific Regional airports Pune, IN 108 1999 0.823 0.852 0.148 39
POA Latin America Mid-size airports Porto Alegre, RS, BR 56 2558 0.983 0.882 0.118 39.3
POS Latin America Regional airports Port Of Spain, TT 271 1654 0.96 0.777 0.223 53.1
PRG Europe Mid-size airports Prague, CZ 199 4828 0.993 0.814 0.186 37.7
PTY Latin America Mid-size airports Panama City, PA 10 5339 0.978 0.919 0.081 55.2
PUJ Latin America Regional airports Punta Cana, DO 215 1750 0.803 0.806 0.194 69.9
PUS Asia Pacific Mid-size airports Busan, KR 292 4184 0.514 0.762 0.238 42.5
PVD North America Regional airports Providence, RI, US 104 1670 0.997 0.854 0.147 72.5
PVG Asia Pacific Global hubs Shanghai, CN 384 18531 0.959 0.423 0.577 64.9
PVR Latin America Regional airports Puerto Valarta, MX 136 1756 0.655 0.839 0.161 51.2
RAK Middle East and Africa Regional airports Marakech, MA 140 1367 0.73 0.838 0.162 41.2
RDU North America Mid-size airports Raleigh/Durham, NC, . 251 5338 0.998 0.787 0.213 77.2
REC Latin America Regional airports Recife, PE, BR 28 2308 0.962 0.898 0.102 40.7
REP Asia Pacific Regional airports Siem Reap, KH 256 1337 0.591 0.785 0.215 45.5
RHO Europe Regional airports Rhodes, GR 81 556 0.739 0.868 0.132 34.1
RIC North America Regional airports Richmond, VA, US 265 2156 0.97 0.78 0.22 84.1
RIX Europe Regional airports Riga, LV 29 2695 0.854 0.897 0.103 37.3
RNO North America Regional airports Reno, NV, US 184 1694 0.993 0.818 0.182 53
RSW North America Mid-size airports Fort Myers, FL, US 211 4109 0.972 0.808 0.192 76.1
RUH Middle East and Africa Major airports Riyadh, SA 328 7397 0.683 0.704 0.296 49.8
SAL Latin America Regional airports San Salvador, SV 50 1696 0.89 0.885 0.115 67.7
SAN North America Mid-size airports San Diego, CA, US 130 7390 0.996 0.841 0.159 64.4
SAT North America Mid-size airports San Antonio, TX, US 113 3425 0.971 0.849 0.151 68.3
SAW Middle East and Africa Major airports Istanbul, TR 36 8472 0.632 0.892 0.109 29.8
SCL Latin America Mid-size airports Santiago, CL 65 4996 0.98 0.875 0.125 41
SDF North America Regional airports Louisvile, KY, US 173 2090 0.946 0.824 0.176 75.5
SDJ Asia Pacific Regional airports Sendai, JP 4 1639 0.901 0.94 0.06 36.9
SDQ Latin America Regional airports Santo Domingo, DO 235 1335 0.742 0.797 0.203 69.5
SDU Latin America Mid-size airports Rio De Janeiro, RJ, BR 92 3665 0.982 0.861 0.139 36.5
SEA North America Global hubs Seatle, WA, US 126 15981 0.984 0.842 0.158 55.6
SFO North America Global hubs San Francisco, CA, US 330 16646 0.985 0.7 0.3 68.7
SGN Asia Pacific Major airports Ho Chi Minh City, VN 291 9401 0.522 0.763 0.238 46
SHA Asia Pacific Global hubs Shanghai, CN 377 10893 0.919 0.503 0.497 67.8
SHE Asia Pacific Mid-size airports Shenyang, CN 342 4910 0.916 0.672 0.328 68.9
SIN Asia Pacific Global hubs Singapore, SG 195 14544 0.998 0.815 0.185 48.8
SJC North America Mid-size airports San Jose, CA, US 189 4608 0.992 0.816 0.184 48.6
SJD Latin America Regional airports San Jose Cabo, MX 181 1755 0.741 0.82 0.18 43.7
SJU Latin America Mid-size airports San Juan, PR 194 5626 0.653 0.816 0.185 55.7
SJW Asia Pacific Regional airports Shijiazhuang, CN 357 3030 0.922 0.625 0.375 65.8
SKG Europe Regional airports Thessaloniki, GR 240 1799 0.762 0.796 0.205 30.7
SLC North America Major airports Salt Lake City, UT, US 93 9811 0.987 0.86 0.141 75.5
SMF North America Mid-size airports Sacramento, CA, US 214 3959 0.992 0.807 0.194 53.9
SNA North America Mid-size airports Santa Ana, CA, US 150 3630 1 0.835 0.166 53.9
SOF Europe Regional airports Sofia, BG 61 2068 0.618 0.876 0.124 35.1
SSA Latin America Mid-size airports Salvador, BA, BR 102 2157 0.99 0.854 0.146 41.2
SSH Middle East and Africa Regional airports Sharm el Sheikh, EG 331 611 0.647 0.699 0.301 44.9
STL North America Mid-size airports Saint Louis, MO, US 182 7072 0.954 0.82 0.18 59.9
STN Europe Regional airports London, EN, GB 283 6698 0.987 0.769 0.231 33.6
STR Europe Mid-size airports Stutgart, DE 120 3858 0.788 0.847 0.153 35
SVG Europe Regional airports Stavanger, NO 51 1730 0.998 0.885 0.116 45.4
SVO Europe Major airports Moscow, RU 37 10687 0.959 0.891 0.109 48.9
SVQ Europe Regional airports Sevila, SP, ES 74 1505 0.996 0.871 0.129 43.6
SWA Asia Pacific Regional airports Jieyang, CN 366 1643 0.956 0.598 0.402 75.1
SXF Europe Regional airports Berlin, DE 153 3541 0.959 0.834 0.167 36.6
SYD Asia Pacific Global hubs Sydney, NSW, AU 156 12942 0.979 0.832 0.168 41.3
SYX Asia Pacific Mid-size airports Sanya, CN 363 4607 0.946 0.605 0.395 83.9
SZX Asia Pacific Global hubs Shenzhen, CN 365 12835 0.921 0.603 0.397 79.2
TAO Asia Pacific Major airports Qingdao, CN 362 7156 0.913 0.607 0.393 56.6
TFN Europe Regional airports Tenerife, CI, ES 7 2109 0.996 0.928 0.072 37.4
TFS Europe Regional airports Tenerife, CI, ES 278 2619 0.981 0.771 0.229 39.5
TLS Europe Mid-size airports Toulouse, FR 255 3549 0.586 0.786 0.215 46
TLV Middle East and Africa Mid-size airports Tel Aviv-Yafo, IL 323 4713 0.624 0.716 0.284 53.2
TNA Asia Pacific Mid-size airports Jinan, CN 352 4478 0.887 0.64 0.36 64
TPA North America Mid-size airports Tampa, FL, US 197 7242 0.993 0.815 0.186 75.8
TPE Asia Pacific Major airports Taipei, TW 358 9013 0.89 0.622 0.378 37.3
TRD Europe Regional airports Trondheim, NO 82 1992 0.996 0.867 0.133 38.5
TRV Asia Pacific Regional airports Thiruvananthapuram, . 55 1262 0.809 0.883 0.118 45.6
TSA Asia Pacific Regional airports Taipei, TW 189 1833 0.92 0.816 0.184 34.7
TSE Asia Pacific Regional airports Astana, KZ 49 1647 0.594 0.886 0.114 53
TSN Asia Pacific Mid-size airports Tianjin, CN 361 6746 0.794 0.612 0.388 81.2
TUL North America Regional airports Tulsa, OK, US 162 1361 0.999 0.83 0.17 69.2
TUN Middle East and Africa Regional airports Tunis, TN 381 1968 0.748 0.456 0.544 83.4
TUS North America Regional airports Tucson, AZ, US 161 1639 0.99 0.83 0.17 74.7
TXL Europe Major airports Berlin, DE 343 7356 0.719 0.667 0.333 35.4
TYN Asia Pacific Mid-size airports Taiyuan, CN 332 3817 0.877 0.696 0.304 67.4
UIO Latin America Regional airports Quito, EC 90 1873 0.614 0.865 0.135 102.5
UKB Asia Pacific Regional airports Kobe, JP 2 870 0.96 0.942 0.058 31.6
URC Asia Pacific Mid-size airports Urumqi, CN 273 6871 0.93 0.773 0.227 58.3
USM Asia Pacific Regional airports Koh Samui, TH 142 1256 0.936 0.837 0.163 46.8
VCE Europe Mid-size airports Venice, IT 203 3344 0.998 0.812 0.188 39.2
VCP Latin America Mid-size airports Campinas, SP, BR 75 3893 0.994 0.87 0.13 39.1
VIE Europe Major airports Vienna, AT 234 9070 0.896 0.798 0.203 37.4
VIX Latin America Regional airports Vitoria, ES, BR 72 1038 1 0.872 0.128 42.3
VLC Europe Regional airports Valencia, SP, ES 68 2195 0.991 0.874 0.126 44.3
VNO Europe Regional airports Vilnius, LT 17 1578 0.756 0.907 0.093 38.2
WAW Europe Mid-size airports Warsaw, PL 313 5902 0.809 0.73 0.27 34.6
WLG Asia Pacific Regional airports Welington, NZ 259 3585 0.834 0.784 0.216 41.1
WNZ Asia Pacific Regional airports Wenzhou, CN 382 2890 0.965 0.439 0.561 65.5
WUH Asia Pacific Major airports Wuhan, CN 368 7426 0.874 0.594 0.406 71.9
WUX Asia Pacific Regional airports Wuxi, CN 386 2054 0.952 0.387 0.613 84.8
XIY Asia Pacific Major airports Xian, CN 304 13072 0.926 0.742 0.258 57.3
XMN Asia Pacific Major airports Xiamen, CN 387 7637 0.578 0.369 0.631 73.5
XNN Asia Pacific Regional airports Xining, CN 80 1966 0.922 0.868 0.132 65.1
YEG North America Regional airports Edmonton, AB, CA 69 3451 0.927 0.874 0.127 50.9
YHZ North America Regional airports Halifax, NS, CA 204 2741 0.944 0.812 0.189 68.6
YNT Asia Pacific Regional airports Yantai, CN 364 2267 0.933 0.604 0.396 61.5
YOW North America Regional airports Otawa, ON, CA 187 2994 0.973 0.817 0.183 58.7
YTZ North America Regional airports Toronto, ON, CA 277 2509 0.965 0.772 0.228 40.9
YUL North America Mid-size airports Montreal, QC, CA 248 7909 0.988 0.791 0.21 54.9
YVR North America Major airports Vancouver, BC, CA 122 9677 0.937 0.845 0.155 46.3
YWG North America Regional airports Winnipeg, MB, CA 114 2486 0.718 0.849 0.151 50.6
YYC North America Mid-size airports Calgary, AB, CA 109 6984 0.981 0.851 0.149 46.2
YYZ North America Global hubs Toronto, ON, CA 324 17012 0.949 0.71 0.29 56.6
ZAG Europe Regional airports Zagreb, HR 196 1435 0.89 0.815 0.185 36.1
ZRH Europe Major airports Zurich, CH 244 9871 0.978 0.794 0.206 33
ZUH Asia Pacific Regional airports Zhuhai, CN 379 2883 0.888 0.467 0.533 88.5
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<style>
body {
font-family: 'Source Sans Pro', sans-serif;
font-size: 12px;
color: #696969;
}
div.controls {
float: right;
margin-right: 128px;
}
label {
font-size: 14px;
}
.axis path, .axis line {
fill: none;
stroke: #dcdcdc;
stroke-dasharray: 2, 3;
shape-rendering: crispEdges;
}
.axis text {
font-size: 10px;
fill: #6b6b6b;
}
.title {
font-size: 14px;
fill: #6b6b6b;
}
.legendText {
fill: #6b6b6b;
}
.shadow {
text-shadow: 2px 2px 2px #fff, -2px -2px 2px #fff, -2px 2px 2px #fff, 2px -2px 2px #fff, -2px 0px 2px #fff, 2px 0px 2px #fff;
}
circle {
fill-opacity: 0.55;
}
</style>
</head>
<body>
<div class="controls">
<input id="logCheckbox" type="checkbox" value="logscale"></input>
<label for="logscale">Log scale</label>
</div>
<script>
var w = 960;
var h = 460;
var margin = {top: 5, right: 60, bottom: 30, left: 60};
var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h)
// colour scale for regions
var colours = d3.scaleOrdinal()
.domain(["Asia Pacific", "North America", "Europe", "Latin America", "Middle East and Africa"])
.range(["#E01A25", "#2074A0", "#10A66E", "#66489F", "#EFB605"]);
var xScale = d3.scaleLinear()
// var xScale = d3.scaleLog()
.range([margin.left, w - margin.left - margin.right]);
var yScale = d3.scaleLinear()
.range([h - margin.bottom, margin.top]);
var xAxis = d3.axisBottom()
.scale(xScale)
.tickFormat(d3.format(","))
.tickSize(-(h - (margin.top+margin.bottom)))
.ticks(10);
var yAxis = d3.axisLeft()
.scale(yScale)
.tickFormat(d3.format(".0%"))
.tickSize(-(w - (margin.left+margin.right)))
.ticks(5);
// load data
d3.csv("delays_1704.csv", prepare, function(data) {
dataset = data;
// xScale.domain([400, 40000])
xScale.domain([0, d3.max(dataset, function(d) { return d.flights; })]);
yScale.domain([0, d3.max(dataset, function(d) { return d.delay; })]);
svg.append("g")
.attr("class", "axis x")
.attr("transform", "translate(0," + (h - margin.bottom) + ")")
.call(xAxis)
svg.append("g")
.attr("class", "axis y")
.attr("transform", "translate(" + margin.left + ",0)")
.call(yAxis)
svg.selectAll("circle")
.data(data)
.enter()
.append("circle")
.attr("cx", function(d) { return xScale(d.flights); })
.attr("cy", function(d) { return yScale(d.delay); })
.attr("r", 3.5)
.style("fill", function(d) { return colours(d.region); });
svg.append("g")
.append("text")
.attr("class", "x title shadow")
.attr("text-anchor", "end")
.attr("transform", "translate(" + (w - margin.right - 5) + "," + (h - margin.bottom - 7) + ")")
.text("x-axis title here")
svg.append("g")
.append("text")
.attr("class", "y title shadow")
.attr("text-anchor", "end")
.attr("transform", "translate(" + (margin.left+15) + "," + (margin.top+5) + ") rotate(-90)")
.text("y-axis title here")
// legend
var legendMargin = {top:12, right:5, bottom:10, left:5};
var legendW = 160;
var legendH = 200;
var svgLegend = svg.append("svg")
.attr("width", legendW)
.attr("height", legendH)
.attr("x", w - margin.right - legendW)
.attr("y", margin.top);
var legendContainer = svgLegend.append("g")
.attr("class", "legendContainer")
.attr("transform", "translate(" + legendMargin.left + "," + legendMargin.top + ")");
var rectSize = 10;
var rowHeight = 20;
var maxWidth = 125;
var legend = legendContainer.selectAll(".legendSquare")
.data(colours.range())
.enter()
.append("g")
.attr("class", "legendSquare")
.attr("transform", function(d, i) {
return "translate(0," + (i*rowHeight) + ")";
})
// append squares to legend
legend.append("rect")
.attr("width", rectSize)
.attr("height", rectSize)
.style("fill", function(d) { return d; })
// append text to legend
legend.append("text")
.attr("transform", "translate(20," + rectSize/2 + ")")
.attr("class", "legendText shadow")
.attr("dy", ".35em")
.text(function(d, i) { return colours.domain()[i]; })
d3.select("#logCheckbox").on("click", function() {
if(this.checked) {
xScale = d3.scaleLog()
.domain([400,40000])
.range([margin.left, w - margin.left - margin.right]);
} else {
xScale = d3.scaleLinear()
.domain([0, d3.max(dataset, function(d) { return d.flights; })])
.range([margin.left, w - margin.left - margin.right]);
}
xAxis.scale(xScale);
d3.select("g.axis.x")
.transition()
.duration(500)
.call(xAxis);
d3.selectAll("circle")
.transition()
.delay(400)
.duration(600)
.attr("cx", function(d) { return xScale(d.flights); })
})
})
function prepare(d) {
d.code = d.airport_code;
d.city = d.airport_city;
d.region = d.region;
d.flights = +d.flights;
d.delay = +d.delayed_15min;
return d;
}
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment