diff --git a/examples/data/xyData.js b/examples/data/xyData.js new file mode 100644 index 0000000000..3ecc57d928 --- /dev/null +++ b/examples/data/xyData.js @@ -0,0 +1,743 @@ +var xyData = [ + {"x": 0, "y": 1}, + {"x": 0.11865740740740742, "y": 2}, + {"x": 0.11887731481481482, "y": 3}, + {"x": 1.1845949074074074, "y": 4}, + {"x": 1.2361342592592592, "y": 5}, + {"x": 1.2718402777777778, "y": 6}, + {"x": 4.949074074074074, "y": 7}, + {"x": 4.975763888888889, "y": 8}, + {"x": 4.981296296296296, "y": 9}, + {"x": 4.984826388888888, "y": 10}, + {"x": 4.989039351851852, "y": 11}, + {"x": 4.989537037037037, "y": 12}, + {"x": 4.990486111111111, "y": 13}, + {"x": 5.005173611111111, "y": 14}, + {"x": 5.03363425925926, "y": 15}, + {"x": 5.03386574074074, "y": 16}, + {"x": 5.062141203703704, "y": 17}, + {"x": 5.070092592592593, "y": 18}, + {"x": 5.097372685185185, "y": 19}, + {"x": 5.099965277777778, "y": 20}, + {"x": 5.101469907407408, "y": 21}, + {"x": 5.114988425925926, "y": 22}, + {"x": 5.121203703703704, "y": 23}, + {"x": 5.1215625000000005, "y": 24}, + {"x": 5.12181712962963, "y": 25}, + {"x": 5.123483796296296, "y": 26}, + {"x": 5.148819444444444, "y": 27}, + {"x": 5.149039351851852, "y": 28}, + {"x": 5.224375, "y": 29}, + {"x": 5.235590277777778, "y": 30}, + {"x": 5.236493055555555, "y": 31}, + {"x": 5.241030092592593, "y": 32}, + {"x": 5.27037037037037, "y": 33}, + {"x": 5.288391203703704, "y": 34}, + {"x": 5.384409722222222, "y": 35}, + {"x": 5.98425925925926, "y": 36}, + {"x": 5.998784722222222, "y": 37}, + {"x": 6.013437500000001, "y": 39}, + {"x": 6.081898148148148, "y": 38}, + {"x": 6.083807870370371, "y": 40}, + {"x": 6.088784722222222, "y": 41}, + {"x": 6.0986574074074085, "y": 42}, + {"x": 6.099074074074074, "y": 43}, + {"x": 6.101342592592592, "y": 44}, + {"x": 6.116979166666667, "y": 45}, + {"x": 6.122303240740741, "y": 46}, + {"x": 6.12244212962963, "y": 47}, + {"x": 6.151770833333333, "y": 48}, + {"x": 6.216157407407407, "y": 49}, + {"x": 6.218472222222222, "y": 50}, + {"x": 6.224849537037037, "y": 51}, + {"x": 6.228564814814814, "y": 52}, + {"x": 6.231967592592593, "y": 53}, + {"x": 7.170775462962962, "y": 54}, + {"x": 7.26568287037037, "y": 55}, + {"x": 7.268298611111111, "y": 56}, + {"x": 7.310254629629629, "y": 57}, + {"x": 7.313622685185185, "y": 58}, + {"x": 7.323611111111112, "y": 59}, + {"x": 7.33269675925926, "y": 60}, + {"x": 7.333402777777778, "y": 61}, + {"x": 7.339247685185185, "y": 62}, + {"x": 7.339745370370371, "y": 63}, + {"x": 7.34443287037037, "y": 64}, + {"x": 7.348206018518518, "y": 65}, + {"x": 7.3503240740740745, "y": 66}, + {"x": 8.067395833333332, "y": 67}, + {"x": 8.123564814814815, "y": 68}, + {"x": 8.123935185185186, "y": 69}, + {"x": 8.158877314814815, "y": 70}, + {"x": 8.159236111111111, "y": 71}, + {"x": 8.159409722222222, "y": 72}, + {"x": 8.161238425925925, "y": 73}, + {"x": 8.161388888888888, "y": 74}, + {"x": 8.199756944444443, "y": 82}, + {"x": 8.220625, "y": 75}, + {"x": 8.247048611111111, "y": 76}, + {"x": 8.275636574074074, "y": 77}, + {"x": 8.283414351851851, "y": 78}, + {"x": 8.287881944444445, "y": 79}, + {"x": 9.013819444444444, "y": 80}, + {"x": 9.167962962962962, "y": 81}, + {"x": 9.171724537037036, "y": 83}, + {"x": 9.1940625, "y": 84}, + {"x": 9.208171296296296, "y": 85}, + {"x": 9.211828703703704, "y": 90}, + {"x": 9.211828703703704, "y": 86}, + {"x": 9.212685185185185, "y": 87}, + {"x": 9.241145833333333, "y": 88}, + {"x": 9.363379629629629, "y": 89}, + {"x": 9.53142361111111, "y": 91}, + {"x": 9.556863425925926, "y": 92}, + {"x": 9.562766203703704, "y": 93}, + {"x": 9.576076388888888, "y": 94}, + {"x": 10.15550925925926, "y": 95}, + {"x": 10.156967592592592, "y": 96}, + {"x": 10.15857638888889, "y": 97}, + {"x": 10.539467592592592, "y": 98}, + {"x": 10.540173611111111, "y": 99}, + {"x": 10.541944444444445, "y": 100}, + {"x": 11.989641203703703, "y": 101}, + {"x": 12.02289351851852, "y": 102}, + {"x": 12.024189814814813, "y": 103}, + {"x": 12.024837962962962, "y": 104}, + {"x": 12.047650462962961, "y": 105}, + {"x": 12.093622685185183, "y": 106}, + {"x": 12.14425925925926, "y": 107}, + {"x": 12.244027777777779, "y": 108}, + {"x": 12.244027777777779, "y": 110}, + {"x": 12.249537037037037, "y": 109}, + {"x": 12.2834375, "y": 111}, + {"x": 12.286782407407408, "y": 112}, + {"x": 12.983842592592593, "y": 113}, + {"x": 12.986550925925927, "y": 114}, + {"x": 12.993877314814815, "y": 115}, + {"x": 13.001666666666667, "y": 116}, + {"x": 13.002638888888889, "y": 117}, + {"x": 13.004247685185184, "y": 119}, + {"x": 13.015972222222222, "y": 118}, + {"x": 13.016238425925927, "y": 120}, + {"x": 13.017303240740743, "y": 121}, + {"x": 13.02925925925926, "y": 122}, + {"x": 13.033368055555556, "y": 123}, + {"x": 13.036863425925924, "y": 124}, + {"x": 13.043611111111112, "y": 125}, + {"x": 13.045578703703704, "y": 126}, + {"x": 13.04806712962963, "y": 127}, + {"x": 13.052974537037038, "y": 128}, + {"x": 13.062418981481484, "y": 129}, + {"x": 13.06273148148148, "y": 130}, + {"x": 13.063680555555557, "y": 131}, + {"x": 13.166782407407409, "y": 133}, + {"x": 13.222245370370372, "y": 132}, + {"x": 14.027303240740741, "y": 134}, + {"x": 14.05474537037037, "y": 135}, + {"x": 14.077106481481481, "y": 136}, + {"x": 14.078078703703705, "y": 137}, + {"x": 14.080995370370372, "y": 138}, + {"x": 14.082141203703705, "y": 139}, + {"x": 14.091828703703705, "y": 140}, + {"x": 14.107013888888888, "y": 141}, + {"x": 14.116782407407408, "y": 142}, + {"x": 14.117199074074074, "y": 143}, + {"x": 14.229872685185185, "y": 144}, + {"x": 14.248414351851851, "y": 145}, + {"x": 14.260740740740742, "y": 146}, + {"x": 14.274363425925925, "y": 147}, + {"x": 14.331550925925926, "y": 148}, + {"x": 14.34224537037037, "y": 149}, + {"x": 14.35462962962963, "y": 150}, + {"x": 14.354756944444444, "y": 151}, + {"x": 14.357268518518518, "y": 152}, + {"x": 14.364097222222222, "y": 153}, + {"x": 14.368414351851852, "y": 154}, + {"x": 14.371678240740742, "y": 155}, + {"x": 14.434571759259258, "y": 156}, + {"x": 14.566458333333335, "y": 157}, + {"x": 14.978518518518518, "y": 158}, + {"x": 15.020347222222222, "y": 159}, + {"x": 15.094652777777776, "y": 161}, + {"x": 15.112372685185186, "y": 162}, + {"x": 15.152337962962962, "y": 160}, + {"x": 15.188298611111113, "y": 163}, + {"x": 15.189224537037036, "y": 164}, + {"x": 15.250810185185186, "y": 166}, + {"x": 15.252060185185186, "y": 165}, + {"x": 16.021689814814817, "y": 168}, + {"x": 16.0491087962963, "y": 169}, + {"x": 16.08934027777778, "y": 170}, + {"x": 16.094849537037035, "y": 171}, + {"x": 16.096770833333334, "y": 172}, + {"x": 16.11363425925926, "y": 173}, + {"x": 16.11383101851852, "y": 174}, + {"x": 16.115127314814814, "y": 175}, + {"x": 16.1203125, "y": 167}, + {"x": 16.12855324074074, "y": 176}, + {"x": 16.155266203703704, "y": 177}, + {"x": 16.266261574074075, "y": 178}, + {"x": 16.278958333333332, "y": 179}, + {"x": 16.285868055555557, "y": 180}, + {"x": 16.287349537037038, "y": 181}, + {"x": 18.976122685185185, "y": 182}, + {"x": 18.976122685185185, "y": 183}, + {"x": 18.986203703703705, "y": 184}, + {"x": 19.021157407407408, "y": 185}, + {"x": 19.1305787037037, "y": 186}, + {"x": 19.15502314814815, "y": 187}, + {"x": 19.156319444444446, "y": 188}, + {"x": 19.163935185185185, "y": 189}, + {"x": 19.167719907407406, "y": 190}, + {"x": 19.178483796296295, "y": 191}, + {"x": 19.182372685185182, "y": 192}, + {"x": 19.190439814814816, "y": 193}, + {"x": 19.193877314814817, "y": 194}, + {"x": 19.198229166666668, "y": 195}, + {"x": 19.237175925925925, "y": 196}, + {"x": 19.240624999999998, "y": 197}, + {"x": 19.25116898148148, "y": 198}, + {"x": 19.976423611111112, "y": 199}, + {"x": 19.97696759259259, "y": 200}, + {"x": 19.986018518518517, "y": 201}, + {"x": 19.990497685185186, "y": 202}, + {"x": 20.01568287037037, "y": 203}, + {"x": 20.070613425925927, "y": 204}, + {"x": 20.071527777777778, "y": 205}, + {"x": 20.100983796296298, "y": 206}, + {"x": 20.10775462962963, "y": 207}, + {"x": 20.107939814814817, "y": 208}, + {"x": 20.112685185185185, "y": 209}, + {"x": 20.11796296296296, "y": 217}, + {"x": 20.161979166666665, "y": 210}, + {"x": 20.17480324074074, "y": 211}, + {"x": 20.174918981481483, "y": 212}, + {"x": 20.20747685185185, "y": 213}, + {"x": 20.259189814814814, "y": 214}, + {"x": 20.259618055555553, "y": 215}, + {"x": 20.262349537037036, "y": 216}, + {"x": 20.383831018518517, "y": 218}, + {"x": 20.968101851851852, "y": 219}, + {"x": 20.98203703703704, "y": 220}, + {"x": 20.99011574074074, "y": 221}, + {"x": 21.077453703703704, "y": 222}, + {"x": 21.091481481481484, "y": 223}, + {"x": 21.10333333333333, "y": 224}, + {"x": 21.130405092592593, "y": 225}, + {"x": 21.19959490740741, "y": 226}, + {"x": 21.20447916666667, "y": 227}, + {"x": 21.212511574074075, "y": 228}, + {"x": 21.265162037037037, "y": 229}, + {"x": 21.267268518518517, "y": 230}, + {"x": 21.29888888888889, "y": 231}, + {"x": 21.29917824074074, "y": 232}, + {"x": 21.300555555555555, "y": 233}, + {"x": 21.304907407407406, "y": 234}, + {"x": 21.30604166666667, "y": 240}, + {"x": 22.014560185185186, "y": 235}, + {"x": 22.015833333333333, "y": 236}, + {"x": 22.022048611111114, "y": 237}, + {"x": 22.037939814814816, "y": 241}, + {"x": 22.051215277777775, "y": 238}, + {"x": 22.055011574074072, "y": 239}, + {"x": 23.105902777777775, "y": 242}, + {"x": 25.9809375, "y": 243}, + {"x": 27.03896990740741, "y": 244}, + {"x": 27.222557870370366, "y": 245}, + {"x": 27.2331712962963, "y": 246}, + {"x": 27.251435185185183, "y": 247}, + {"x": 28.036041666666666, "y": 248}, + {"x": 28.041006944444447, "y": 249}, + {"x": 28.049872685185182, "y": 250}, + {"x": 28.167523148148145, "y": 251}, + {"x": 29.24621527777778, "y": 252}, + {"x": 29.247476851851854, "y": 253}, + {"x": 29.264270833333338, "y": 254}, + {"x": 29.26914351851852, "y": 255}, + {"x": 30.071562500000002, "y": 256}, + {"x": 30.090046296296293, "y": 257}, + {"x": 30.167858796296297, "y": 258}, + {"x": 30.170312499999998, "y": 259}, + {"x": 30.18841435185185, "y": 260}, + {"x": 30.207465277777775, "y": 261}, + {"x": 30.21366898148148, "y": 262}, + {"x": 30.228333333333335, "y": 263}, + {"x": 30.235150462962963, "y": 264}, + {"x": 30.242222222222225, "y": 265}, + {"x": 30.273599537037033, "y": 266}, + {"x": 30.27371527777778, "y": 267}, + {"x": 33.02337962962962, "y": 268}, + {"x": 33.028310185185184, "y": 269}, + {"x": 33.02965277777778, "y": 270}, + {"x": 33.031655092592594, "y": 271}, + {"x": 33.0474537037037, "y": 272}, + {"x": 33.05450231481481, "y": 273}, + {"x": 33.05675925925926, "y": 274}, + {"x": 33.06655092592593, "y": 275}, + {"x": 33.07001157407407, "y": 276}, + {"x": 33.07560185185185, "y": 277}, + {"x": 33.21767361111111, "y": 278}, + {"x": 33.225081018518516, "y": 279}, + {"x": 33.2310300925926, "y": 280}, + {"x": 33.23287037037037, "y": 281}, + {"x": 33.23829861111111, "y": 282}, + {"x": 33.240266203703705, "y": 283}, + {"x": 33.2412962962963, "y": 284}, + {"x": 33.261493055555555, "y": 285}, + {"x": 33.518668981481476, "y": 286}, + {"x": 34.01717592592592, "y": 290}, + {"x": 34.01717592592592, "y": 287}, + {"x": 34.02030092592592, "y": 288}, + {"x": 34.02030092592592, "y": 291}, + {"x": 34.14474537037037, "y": 289}, + {"x": 34.96983796296296, "y": 292}, + {"x": 34.972488425925924, "y": 293}, + {"x": 34.984409722222225, "y": 294}, + {"x": 35.118553240740745, "y": 295}, + {"x": 35.213287037037034, "y": 296}, + {"x": 35.21407407407408, "y": 297}, + {"x": 35.218159722222225, "y": 298}, + {"x": 35.243668981481484, "y": 299}, + {"x": 35.24715277777778, "y": 300}, + {"x": 36.02373842592593, "y": 301}, + {"x": 36.09935185185185, "y": 302}, + {"x": 36.09946759259259, "y": 303}, + {"x": 36.11346064814815, "y": 304}, + {"x": 37.19096064814814, "y": 305}, + {"x": 37.19597222222222, "y": 306}, + {"x": 37.20306712962962, "y": 307}, + {"x": 37.20490740740741, "y": 308}, + {"x": 37.208564814814814, "y": 309}, + {"x": 37.21886574074074, "y": 310}, + {"x": 37.21975694444444, "y": 311}, + {"x": 37.270439814814814, "y": 312}, + {"x": 37.272071759259255, "y": 313}, + {"x": 37.27533564814815, "y": 314}, + {"x": 40.12321759259259, "y": 315}, + {"x": 40.13621527777778, "y": 316}, + {"x": 40.188541666666666, "y": 317}, + {"x": 40.19028935185185, "y": 318}, + {"x": 40.19543981481481, "y": 320}, + {"x": 40.20871527777778, "y": 322}, + {"x": 40.21480324074074, "y": 323}, + {"x": 40.21894675925926, "y": 324}, + {"x": 40.21894675925926, "y": 325}, + {"x": 40.2240625, "y": 327}, + {"x": 40.2240625, "y": 326}, + {"x": 40.227604166666666, "y": 328}, + {"x": 40.227604166666666, "y": 329}, + {"x": 40.23909722222222, "y": 331}, + {"x": 40.23909722222222, "y": 332}, + {"x": 40.24525462962963, "y": 343}, + {"x": 40.24570601851852, "y": 333}, + {"x": 40.24855324074074, "y": 334}, + {"x": 40.24961805555555, "y": 335}, + {"x": 40.25143518518518, "y": 337}, + {"x": 40.25157407407408, "y": 338}, + {"x": 40.25409722222222, "y": 339}, + {"x": 40.25686342592592, "y": 341}, + {"x": 40.26166666666667, "y": 342}, + {"x": 40.32011574074074, "y": 319}, + {"x": 40.322939814814816, "y": 321}, + {"x": 40.35635416666667, "y": 330}, + {"x": 40.3749537037037, "y": 336}, + {"x": 40.37943287037037, "y": 340}, + {"x": 41.22336805555556, "y": 344}, + {"x": 41.22625, "y": 345}, + {"x": 41.23767361111111, "y": 346}, + {"x": 42.13510416666667, "y": 351}, + {"x": 42.182939814814816, "y": 347}, + {"x": 42.197175925925926, "y": 352}, + {"x": 42.239143518518524, "y": 348}, + {"x": 42.26459490740741, "y": 349}, + {"x": 42.27060185185185, "y": 350}, + {"x": 42.37271990740741, "y": 353}, + {"x": 43.00752314814815, "y": 356}, + {"x": 43.01260416666667, "y": 357}, + {"x": 43.02207175925926, "y": 358}, + {"x": 43.024791666666665, "y": 354}, + {"x": 43.050497685185185, "y": 355}, + {"x": 43.11667824074075, "y": 360}, + {"x": 43.18917824074074, "y": 359}, + {"x": 43.238252314814815, "y": 361}, + {"x": 44.00144675925926, "y": 362}, + {"x": 44.02211805555555, "y": 363}, + {"x": 44.02373842592593, "y": 364}, + {"x": 44.02640046296296, "y": 365}, + {"x": 44.02998842592593, "y": 366}, + {"x": 44.03875, "y": 367}, + {"x": 44.11216435185185, "y": 368}, + {"x": 44.1180787037037, "y": 369}, + {"x": 44.12475694444444, "y": 370}, + {"x": 44.12777777777777, "y": 371}, + {"x": 44.154386574074074, "y": 373}, + {"x": 44.156412037037036, "y": 374}, + {"x": 44.17255787037036, "y": 375}, + {"x": 44.18305555555555, "y": 376}, + {"x": 44.18512731481482, "y": 377}, + {"x": 44.192708333333336, "y": 378}, + {"x": 44.19475694444444, "y": 379}, + {"x": 44.21083333333333, "y": 380}, + {"x": 44.22140046296297, "y": 381}, + {"x": 44.23320601851852, "y": 382}, + {"x": 44.236793981481476, "y": 383}, + {"x": 44.25287037037037, "y": 372}, + {"x": 44.27430555555555, "y": 384}, + {"x": 47.26002314814815, "y": 386}, + {"x": 47.27430555555555, "y": 385}, + {"x": 47.976851851851855, "y": 390}, + {"x": 48.02554398148149, "y": 388}, + {"x": 48.0666087962963, "y": 391}, + {"x": 48.073379629629635, "y": 389}, + {"x": 48.09791666666666, "y": 392}, + {"x": 48.10035879629629, "y": 387}, + {"x": 48.10378472222222, "y": 393}, + {"x": 48.105069444444446, "y": 395}, + {"x": 48.1059837962963, "y": 396}, + {"x": 48.136377314814816, "y": 397}, + {"x": 48.15631944444445, "y": 398}, + {"x": 48.19546296296296, "y": 399}, + {"x": 48.19748842592592, "y": 400}, + {"x": 48.22359953703704, "y": 401}, + {"x": 48.229456018518526, "y": 394}, + {"x": 48.23023148148149, "y": 402}, + {"x": 48.253182870370374, "y": 403}, + {"x": 48.26292824074074, "y": 404}, + {"x": 48.26418981481481, "y": 405}, + {"x": 48.26475694444445, "y": 406}, + {"x": 48.96293981481481, "y": 407}, + {"x": 48.99736111111111, "y": 408}, + {"x": 49.019652777777786, "y": 409}, + {"x": 49.02620370370371, "y": 410}, + {"x": 49.13222222222222, "y": 411}, + {"x": 49.219768518518514, "y": 412}, + {"x": 49.22177083333333, "y": 413}, + {"x": 49.23712962962963, "y": 414}, + {"x": 49.313182870370376, "y": 415}, + {"x": 49.35679398148148, "y": 416}, + {"x": 49.35771990740741, "y": 417}, + {"x": 50.124664351851855, "y": 418}, + {"x": 50.13916666666666, "y": 419}, + {"x": 50.14174768518519, "y": 420}, + {"x": 50.14953703703703, "y": 421}, + {"x": 50.164479166666666, "y": 422}, + {"x": 50.198263888888896, "y": 423}, + {"x": 50.28319444444444, "y": 424}, + {"x": 50.2908912037037, "y": 425}, + {"x": 51.077708333333334, "y": 426}, + {"x": 51.082152777777786, "y": 427}, + {"x": 51.08707175925926, "y": 428}, + {"x": 51.13728009259259, "y": 429}, + {"x": 51.15009259259259, "y": 430}, + {"x": 51.15459490740741, "y": 431}, + {"x": 51.16606481481481, "y": 432}, + {"x": 51.16731481481481, "y": 434}, + {"x": 51.16865740740741, "y": 433}, + {"x": 51.17233796296296, "y": 435}, + {"x": 51.172731481481485, "y": 436}, + {"x": 51.23976851851851, "y": 437}, + {"x": 54.012453703703706, "y": 438}, + {"x": 54.17393518518518, "y": 439}, + {"x": 54.179803240740746, "y": 441}, + {"x": 54.18097222222223, "y": 440}, + {"x": 54.18165509259259, "y": 442}, + {"x": 54.203668981481485, "y": 443}, + {"x": 54.211435185185174, "y": 444}, + {"x": 54.212777777777774, "y": 445}, + {"x": 54.26846064814814, "y": 446}, + {"x": 54.271932870370364, "y": 447}, + {"x": 54.27431712962962, "y": 448}, + {"x": 54.279259259259256, "y": 449}, + {"x": 54.28219907407407, "y": 450}, + {"x": 54.284317129629635, "y": 451}, + {"x": 54.28547453703703, "y": 452}, + {"x": 55.10513888888889, "y": 453}, + {"x": 55.1100462962963, "y": 454}, + {"x": 55.14313657407408, "y": 455}, + {"x": 55.14377314814815, "y": 456}, + {"x": 55.15925925925925, "y": 457}, + {"x": 55.16072916666666, "y": 458}, + {"x": 55.171527777777776, "y": 459}, + {"x": 55.179155092592595, "y": 460}, + {"x": 55.19203703703704, "y": 461}, + {"x": 55.192245370370365, "y": 462}, + {"x": 55.23136574074075, "y": 465}, + {"x": 55.24445601851852, "y": 463}, + {"x": 55.24474537037037, "y": 466}, + {"x": 55.2507986111111, "y": 464}, + {"x": 55.27368055555556, "y": 467}, + {"x": 55.288402777777776, "y": 468}, + {"x": 55.29034722222223, "y": 469}, + {"x": 55.992534722222224, "y": 470}, + {"x": 56.01023148148149, "y": 471}, + {"x": 56.01670138888889, "y": 472}, + {"x": 56.0169675925926, "y": 473}, + {"x": 56.16721064814815, "y": 474}, + {"x": 56.16734953703704, "y": 475}, + {"x": 56.17737268518519, "y": 476}, + {"x": 56.18854166666667, "y": 477}, + {"x": 56.20337962962963, "y": 478}, + {"x": 56.257696759259254, "y": 479}, + {"x": 56.26146990740741, "y": 480}, + {"x": 56.268541666666664, "y": 481}, + {"x": 56.26922453703704, "y": 482}, + {"x": 56.29325231481482, "y": 483}, + {"x": 56.29556712962963, "y": 484}, + {"x": 57.03556712962962, "y": 485}, + {"x": 57.04908564814815, "y": 486}, + {"x": 57.14697916666666, "y": 487}, + {"x": 57.188738425925926, "y": 489}, + {"x": 57.192766203703705, "y": 488}, + {"x": 57.194340277777776, "y": 490}, + {"x": 57.21177083333333, "y": 491}, + {"x": 57.24444444444444, "y": 492}, + {"x": 57.24495370370371, "y": 493}, + {"x": 57.25449074074074, "y": 494}, + {"x": 57.259212962962955, "y": 495}, + {"x": 57.27570601851852, "y": 496}, + {"x": 57.29340277777778, "y": 497}, + {"x": 57.30298611111112, "y": 498}, + {"x": 57.30700231481481, "y": 499}, + {"x": 57.3444212962963, "y": 500}, + {"x": 57.34554398148148, "y": 501}, + {"x": 57.34583333333333, "y": 502}, + {"x": 57.36053240740741, "y": 503}, + {"x": 57.363391203703706, "y": 504}, + {"x": 57.38009259259258, "y": 505}, + {"x": 57.60109953703704, "y": 506}, + {"x": 57.601446759259254, "y": 507}, + {"x": 57.60363425925926, "y": 508}, + {"x": 57.632025462962964, "y": 509}, + {"x": 57.66608796296296, "y": 510}, + {"x": 57.668692129629626, "y": 511}, + {"x": 57.67320601851852, "y": 512}, + {"x": 57.673541666666665, "y": 513}, + {"x": 57.67429398148149, "y": 514}, + {"x": 57.678020833333335, "y": 515}, + {"x": 57.68199074074074, "y": 516}, + {"x": 57.68590277777778, "y": 517}, + {"x": 58.02234953703704, "y": 518}, + {"x": 58.028252314814814, "y": 519}, + {"x": 58.03413194444445, "y": 520}, + {"x": 58.04130787037037, "y": 521}, + {"x": 58.04155092592592, "y": 522}, + {"x": 58.041805555555555, "y": 523}, + {"x": 58.04373842592593, "y": 524}, + {"x": 58.05251157407408, "y": 525}, + {"x": 58.05256944444444, "y": 526}, + {"x": 58.05267361111112, "y": 527}, + {"x": 58.05356481481481, "y": 528}, + {"x": 58.05380787037038, "y": 529}, + {"x": 58.06038194444444, "y": 530}, + {"x": 58.0693287037037, "y": 531}, + {"x": 58.189050925925926, "y": 532}, + {"x": 58.18930555555556, "y": 533}, + {"x": 61.17611111111111, "y": 534}, + {"x": 61.241585648148146, "y": 535}, + {"x": 62.183946759259264, "y": 536}, + {"x": 62.185405092592596, "y": 537}, + {"x": 62.209270833333335, "y": 538}, + {"x": 62.20989583333333, "y": 539}, + {"x": 62.233530092592595, "y": 540}, + {"x": 62.236365740740744, "y": 541}, + {"x": 63.29304398148148, "y": 542}, + {"x": 63.29359953703704, "y": 543}, + {"x": 63.298402777777774, "y": 544}, + {"x": 63.332997685185184, "y": 545}, + {"x": 63.34577546296296, "y": 546}, + {"x": 64.00445601851852, "y": 547}, + {"x": 64.16237268518519, "y": 548}, + {"x": 64.18708333333333, "y": 554}, + {"x": 65.1253587962963, "y": 549}, + {"x": 65.14224537037036, "y": 550}, + {"x": 65.25122685185185, "y": 551}, + {"x": 65.25295138888889, "y": 552}, + {"x": 65.25324074074074, "y": 553}, + {"x": 68.01609953703704, "y": 555}, + {"x": 68.09793981481482, "y": 556}, + {"x": 68.13961805555556, "y": 559}, + {"x": 68.13975694444444, "y": 560}, + {"x": 68.15559027777778, "y": 557}, + {"x": 68.16447916666667, "y": 561}, + {"x": 68.18199074074074, "y": 558}, + {"x": 68.2383912037037, "y": 562}, + {"x": 68.28217592592593, "y": 563}, + {"x": 68.28284722222223, "y": 564}, + {"x": 69.02196759259259, "y": 565}, + {"x": 69.02864583333333, "y": 566}, + {"x": 69.02986111111112, "y": 567}, + {"x": 69.23931712962964, "y": 568}, + {"x": 69.27535879629629, "y": 569}, + {"x": 69.37412037037038, "y": 570}, + {"x": 69.38678240740741, "y": 571}, + {"x": 69.41064814814814, "y": 572}, + {"x": 70.03819444444444, "y": 573}, + {"x": 70.04175925925925, "y": 574}, + {"x": 70.05416666666666, "y": 575}, + {"x": 70.06733796296295, "y": 576}, + {"x": 70.09094907407406, "y": 577}, + {"x": 70.15497685185186, "y": 579}, + {"x": 70.16422453703704, "y": 578}, + {"x": 70.18064814814815, "y": 580}, + {"x": 70.22144675925925, "y": 581}, + {"x": 70.22166666666666, "y": 582}, + {"x": 70.22738425925927, "y": 583}, + {"x": 70.23267361111111, "y": 584}, + {"x": 70.24391203703705, "y": 585}, + {"x": 70.25283564814815, "y": 586}, + {"x": 70.25510416666667, "y": 587}, + {"x": 70.28466435185186, "y": 588}, + {"x": 70.28953703703704, "y": 589}, + {"x": 70.31696759259259, "y": 590}, + {"x": 70.31849537037037, "y": 591}, + {"x": 70.33501157407407, "y": 592}, + {"x": 70.33902777777777, "y": 593}, + {"x": 70.34006944444444, "y": 594}, + {"x": 70.42503472222222, "y": 595}, + {"x": 70.42680555555556, "y": 596}, + {"x": 70.44644675925926, "y": 597}, + {"x": 70.45475694444444, "y": 598}, + {"x": 70.45616898148148, "y": 599}, + {"x": 71.0357986111111, "y": 600}, + {"x": 75.3571875, "y": 601}, + {"x": 75.35828703703704, "y": 602}, + {"x": 76.51193287037037, "y": 603}, + {"x": 76.51206018518518, "y": 604}, + {"x": 77.12263888888889, "y": 605}, + {"x": 77.13378472222222, "y": 606}, + {"x": 77.13755787037037, "y": 607}, + {"x": 77.1396412037037, "y": 608}, + {"x": 77.14496527777779, "y": 609}, + {"x": 77.14599537037037, "y": 610}, + {"x": 77.1570949074074, "y": 611}, + {"x": 77.16494212962962, "y": 612}, + {"x": 77.18026620370371, "y": 613}, + {"x": 77.3159837962963, "y": 614}, + {"x": 77.37674768518518, "y": 615}, + {"x": 77.55534722222222, "y": 616}, + {"x": 78.99820601851853, "y": 619}, + {"x": 79.11762731481481, "y": 620}, + {"x": 79.12521990740741, "y": 617}, + {"x": 79.1413888888889, "y": 621}, + {"x": 79.14237268518518, "y": 618}, + {"x": 79.17225694444444, "y": 622}, + {"x": 79.17305555555555, "y": 623}, + {"x": 79.17936342592593, "y": 624}, + {"x": 79.22321759259259, "y": 625}, + {"x": 79.22354166666666, "y": 626}, + {"x": 79.23240740740741, "y": 627}, + {"x": 79.23945601851851, "y": 628}, + {"x": 79.25369212962963, "y": 629}, + {"x": 79.25386574074074, "y": 630}, + {"x": 79.93778935185186, "y": 631}, + {"x": 79.97611111111111, "y": 632}, + {"x": 79.99424768518519, "y": 633}, + {"x": 81.99048611111111, "y": 634}, + {"x": 81.99410879629629, "y": 635}, + {"x": 81.99410879629629, "y": 642}, + {"x": 82.04340277777779, "y": 636}, + {"x": 82.05616898148148, "y": 637}, + {"x": 82.06153935185185, "y": 638}, + {"x": 82.06153935185185, "y": 643}, + {"x": 82.13497685185185, "y": 639}, + {"x": 82.13942129629629, "y": 670}, + {"x": 82.18469907407406, "y": 640}, + {"x": 82.1977199074074, "y": 641}, + {"x": 82.24810185185184, "y": 645}, + {"x": 82.2661574074074, "y": 644}, + {"x": 82.3237037037037, "y": 646}, + {"x": 82.33268518518518, "y": 647}, + {"x": 82.53008101851852, "y": 648}, + {"x": 82.53047453703704, "y": 649}, + {"x": 82.53075231481482, "y": 650}, + {"x": 82.54238425925926, "y": 651}, + {"x": 82.54476851851851, "y": 652}, + {"x": 82.55049768518518, "y": 653}, + {"x": 83.02902777777778, "y": 654}, + {"x": 83.03571759259259, "y": 655}, + {"x": 83.04855324074074, "y": 656}, + {"x": 83.04891203703704, "y": 657}, + {"x": 83.05005787037037, "y": 658}, + {"x": 83.05269675925926, "y": 659}, + {"x": 83.05664351851853, "y": 660}, + {"x": 83.10878472222221, "y": 661}, + {"x": 83.11568287037036, "y": 662}, + {"x": 83.12524305555556, "y": 663}, + {"x": 83.13849537037036, "y": 664}, + {"x": 83.14521990740741, "y": 665}, + {"x": 83.1987962962963, "y": 666}, + {"x": 83.22462962962963, "y": 667}, + {"x": 83.23881944444445, "y": 668}, + {"x": 83.25212962962964, "y": 669}, + {"x": 83.26116898148148, "y": 686}, + {"x": 83.26412037037036, "y": 671}, + {"x": 83.26777777777778, "y": 672}, + {"x": 83.28392361111112, "y": 673}, + {"x": 83.28497685185185, "y": 674}, + {"x": 83.28509259259259, "y": 675}, + {"x": 83.2856712962963, "y": 676}, + {"x": 83.30789351851853, "y": 677}, + {"x": 83.31175925925926, "y": 678}, + {"x": 83.31184027777778, "y": 679}, + {"x": 83.31230324074073, "y": 680}, + {"x": 83.31854166666666, "y": 681}, + {"x": 84.00105324074075, "y": 682}, + {"x": 84.04512731481482, "y": 683}, + {"x": 84.04746527777779, "y": 684}, + {"x": 84.06408564814815, "y": 685}, + {"x": 84.09783564814815, "y": 687}, + {"x": 84.09950231481481, "y": 688}, + {"x": 84.09987268518519, "y": 689}, + {"x": 84.10638888888889, "y": 690}, + {"x": 84.11269675925926, "y": 691}, + {"x": 84.13108796296295, "y": 692}, + {"x": 84.13152777777778, "y": 693}, + {"x": 84.13189814814815, "y": 694}, + {"x": 84.13362268518519, "y": 695}, + {"x": 84.1371875, "y": 696}, + {"x": 84.15493055555557, "y": 697}, + {"x": 84.15887731481482, "y": 698}, + {"x": 84.16054398148148, "y": 699}, + {"x": 84.1663425925926, "y": 700}, + {"x": 84.17012731481482, "y": 701}, + {"x": 84.18499999999999, "y": 702}, + {"x": 84.98777777777777, "y": 703}, + {"x": 85.01167824074074, "y": 704}, + {"x": 85.0584375, "y": 705}, + {"x": 85.07670138888888, "y": 706}, + {"x": 85.08421296296295, "y": 707}, + {"x": 85.0842824074074, "y": 708}, + {"x": 85.12005787037036, "y": 709}, + {"x": 85.15402777777778, "y": 710}, + {"x": 85.21219907407406, "y": 711}, + {"x": 85.21737268518518, "y": 712}, + {"x": 85.23116898148147, "y": 713}, + {"x": 85.24401620370371, "y": 714}, + {"x": 85.26747685185185, "y": 715}, + {"x": 85.26870370370371, "y": 716}, + {"x": 85.43259259259258, "y": 717}, + {"x": 85.43829861111111, "y": 718}, + {"x": 85.9661111111111, "y": 719}, + {"x": 85.99626157407408, "y": 720}, + {"x": 86.11556712962964, "y": 721}, + {"x": 86.11601851851852, "y": 722}, + {"x": 86.11814814814814, "y": 723}, + {"x": 86.11865740740741, "y": 724}, + {"x": 89.20109953703702, "y": 725}, + {"x": 89.26359953703702, "y": 726}, + {"x": 90.01363425925926, "y": 727}, + {"x": 90.01685185185185, "y": 728}, + {"x": 90.1408912037037, "y": 729}, + {"x": 90.14288194444445, "y": 730}, + {"x": 90.15513888888889, "y": 731}, + {"x": 90.15708333333333, "y": 732}, + {"x": 91.11555555555555, "y": 733}, + {"x": 91.12600694444446, "y": 734}, + {"x": 91.94760416666666, "y": 735}, + {"x": 91.95476851851852, "y": 736}, + {"x": 91.99403935185184, "y": 737}, + {"x": 91.99560185185184, "y": 738}, + {"x": 92.01460648148147, "y": 739}, + {"x": 93.12917824074073, "y": 740}, + {"x": 96.14953703703704, "y": 741} +] diff --git a/examples/landing/basicChart.js b/examples/landing/basicChart.js new file mode 100644 index 0000000000..ead791aa8a --- /dev/null +++ b/examples/landing/basicChart.js @@ -0,0 +1,22 @@ +function makeBasicChart() { + // These scales are Plottable wrappers for a d3.scale object. + // Like D3 scales, they manage a mapping from data to visual properties; pixel positions in this case + // Unlike D3 scales, they automatically set their domain and range, and have event handling to update dependent components on changes + var xScale = new Plottable.LinearScale(); + var yScale = new Plottable.LinearScale(); + + // The Axes and LineRenderer are all Components, meaning they take up visual space and are placed by the layout engine + var xAxis = new Plottable.XAxis(xScale, "bottom"); + var yAxis = new Plottable.YAxis(yScale, "left"); + var renderer = new Plottable.LineRenderer(xyData, xScale, yScale); + + // Now we'll make a Table to organize the layout of the components. The first row will have a yAxis and renderer; the second will + // only have the xAxis, and it will be aligned to the column of the renderer. + // The yAxis is fixed-width and the xAxis is fixed-height, so the renderer will naturally expand to take up all free space + var chart = new Plottable.Table([ + [yAxis, renderer], + [null, xAxis ] + ]); + + chart.renderTo("#basicChart"); +} diff --git a/examples/landing/customProjectors.js b/examples/landing/customProjectors.js new file mode 100644 index 0000000000..8be808c576 --- /dev/null +++ b/examples/landing/customProjectors.js @@ -0,0 +1,37 @@ +function customProjectorChart(data) { + var xScale = new Plottable.LinearScale().domain([-5, 100]); + var yScale = new Plottable.LogScale().domain([0.5, 100000]); + + var xAxis = new Plottable.XAxis(xScale, "bottom"); + var yAxis = new Plottable.YAxis(yScale, "left"); + + var renderer = new Plottable.CircleRenderer(data, xScale, yScale); + + // By calling renderer.project(attribute=x, accessor="day_delta", scale=xScale), we tell the renderer to set the "x" + // attribute on data using the given accessor and scale. In general, an accessor is a function that takes in a data + // object and returns a piece of data. String arguments are automagically converted into key functions, as follows: + // project(attr, "day_delta", scale) => project(attr, function(d) { return d.day_delta; }, scale). + // Renderer.project is a core part of the API, and sets up bindings between the data, the scale, and the renderer. + // These bindings handle event propogation, updating, and scale auto-domaining. + renderer.project("x", "day_delta", xScale); + + function linesChangedAccessor(d) { return d.additions + d.deletions; } + renderer.project("y", linesChangedAccessor, yScale); + + function additionsOverLinesChanged(d) { + if (d.deletions + d.additions === 0) { + return 0.5; + } + return d.additions / (d.deletions + d.additions); + } + // This scale interpolates between red for commits with mostly deletions, and green for commits with mostly additions. + var colorScale = new Plottable.InterpolatedColorScale(["#FF0000", "#008B00"]); + renderer.project("fill", additionsOverLinesChanged, colorScale); + + var chart = new Plottable.StandardChart() + .xAxis(xAxis).yAxis(yAxis) + .center(renderer) + .xLabel("days since start of project") + .yLabel("Total lines changed by commit") + .renderTo("#customProjectors"); +} diff --git a/examples/landing/landing.html b/examples/landing/landing.html new file mode 100644 index 0000000000..779ae08007 --- /dev/null +++ b/examples/landing/landing.html @@ -0,0 +1,109 @@ + + + + + + + + + Plottable.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fork me on GitHub + + +
+ + +

Plottable.js

+

A library for concisely creating powerful, flexible, interactive charts. Built on D3.js.

+ + + + + + + + + + + + +
+ + + + + diff --git a/examples/landing/layout.js b/examples/landing/layout.js new file mode 100644 index 0000000000..b7ff643dc0 --- /dev/null +++ b/examples/landing/layout.js @@ -0,0 +1,35 @@ +function layoutChart(data) { + // The two subplots will share an xScale, but have two seperate yScales for their data + var xScale = new Plottable.LinearScale(); + var yScaleCommits = new Plottable.LinearScale(); + var yScaleLOC = new Plottable.LinearScale(); + + var xAxis = new Plottable.XAxis(xScale, "bottom"); + var yAxisCommits = new Plottable.YAxis(yScaleCommits, "left"); + var yAxisLOC = new Plottable.YAxis(yScaleLOC, "right"); + + // A DataSource is a Plottable object that maintains data and metadata, and updates dependents when it changes + // In the previous example, we implicitly created a DataSource by putting the data directly into the Renderer constructor + var gitDataSource = new Plottable.DataSource(data); + var commitsRenderer = new Plottable.LineRenderer(gitDataSource, xScale, yScaleCommits); + var locRenderer = new Plottable.LineRenderer(gitDataSource, xScale, yScaleLOC); + + commitsRenderer.project("x", "day_delta", xScale); + locRenderer .project("x", "day_delta", xScale); + + commitsRenderer.project("y", "commit_number", yScaleCommits); + locRenderer .project("y", "lines_of_code", yScaleLOC); + + var commitsTitle = new Plottable.TitleLabel("# of Commits Over Time"); + var locTitle = new Plottable.TitleLabel("# of Lines Of Code Over Time"); + + var chart = new Plottable.Table([ + [null , commitsTitle , null ], + [yAxisCommits, commitsRenderer, null ], + [null , locTitle , null ], + [null , locRenderer , yAxisLOC ], + [null , xAxis , null ] + ]); + + chart.renderTo("#layout"); +} diff --git a/examples/landing/plugins.js b/examples/landing/plugins.js new file mode 100644 index 0000000000..df38660eb0 --- /dev/null +++ b/examples/landing/plugins.js @@ -0,0 +1,32 @@ +function pluginsChart(gitData) { + var xScale = new Plottable.LinearScale().domain([-0.03, 1.03]); + var yScale = new Plottable.LogScale().domain([0.9, 100000]); + var colorScale = new Plottable.ColorScale("category10"); + + // The Axes and LineRenderer are all Components, meaning they take up visual space and are placed by the layout engine + var xAxis = new Plottable.XAxis(xScale, "bottom"); + var yAxis = new Plottable.YAxis(yScale, "left"); + + + var linesChanged = function(d) { return d.additions + d.deletions; }; + var percentAdditions = function(d) { + return (linesChanged(d) === 0) ? 0.5 : d.additions / linesChanged(d); + } + var renderer = new Plottable.CircleRenderer(gitData, xScale, yScale) + .project("x", percentAdditions, xScale) + .project("y", linesChanged, yScale) + .project("fill", "name", colorScale) + var gridlines = new Plottable.Gridlines(xScale, yScale); + var legend = new Plottable.Legend(colorScale).xOffset(-80).minimumWidth(200); + var center = renderer.merge(gridlines).merge(legend); + + // Now we'll make a Table to organize the layout of the components. The first row will have a yAxis and renderer; the second will + // only have the xAxis, and it will be aligned to the column of the renderer. + // The yAxis is fixed-width and the xAxis is fixed-height, so the renderer will naturally expand to take up all free space + var chart = new Plottable.Table([ + [yAxis, center ], + [null, xAxis ] + ]); + + chart.renderTo("#plugins"); +}