Skip to content

Instantly share code, notes, and snippets.

@yelper
Last active June 16, 2018 08:10
Show Gist options
  • Save yelper/307b1cef7ef792722d4cbde61099a265 to your computer and use it in GitHub Desktop.
Save yelper/307b1cef7ef792722d4cbde61099a265 to your computer and use it in GitHub Desktop.
Playing with binned representations
license: cc-by-sa-4.0
height: 1220

A juxtaposed comparison of a hexagonal binning representation, a scatterplot, and a subsampled binning representation with multiple 'data series'. The hexagons try to be smart about attenuation with number of points, and the hexagon's color is a weighted average of colors in Lab space.

To add points, click on the scatterplot and the other plots will update as well. Hold down combinations of Alt and Ctrl to create points of other colors. Add your own data (or clear the data) by changing ptData and calling updateVis().

This block is in-progress -- consider sampling the points within each bin to still show some distribution while keeping faithful to the proportion of classes within.

x y category
8.21934342154392 1.26065614257531 0
8.45671410877048 0.954304853487182 0
8.41629111947018 0.0844707892858723 0
7.48261117877294 1.19561096479492 0
8.83137664627254 0.20276899718894 0
7.89464249482347 1.04823777387467 0
8.04041391672827 0.974435370267542 0
9.55295763681889 1.38745852212487 0
8.67265611873502 0.533867458857546 0
8.60171073117138 0.160263783205764 0
8.11350121157427 0.750029216003425 0
7.84736969408639 0.593998072044116 0
8.38101020216753 0.89096675287671 0
8.53102613595695 0.246630302749234 0
9.26414219193915 0.00856225279567718 0
7.56168836652969 0.0222882998351323 0
8.32574597110277 1.0443792874818 0
7.24138273061037 0.0354976085349171 0
9.19943876968393 0.365784786104417 0
8.86804800968971 1.18885241251091 0
7.92929212344171 0.598107800781299 0
8.14152956863152 0.949123471990945 0
9.28365957637165 0.521210254335427 0
8.37474524712497 0.869774436610786 0
8.90401510502208 0.317213142525503 0
8.80666911002158 0.971145141050956 0
8.35499014684685 0.313045956472415 0
7.8929765024692 1.24457580104554 0
8.75835836359585 1.98397121244724 0
8.55522963944361 0.224322969968807 0
7.46669813851074 0.682846903507522 0
8.62083987108765 0.0540261985224584 0
7.92080631443247 0.212238963445841 0
8.86858292830611 0.212437116537709 0
8.56734347590731 0.411125130293504 0
9.09760334202128 0.333774546216235 0
8.47665482566708 0.804794690730941 0
8.12127243322223 0.471319947468082 0
7.85754688687862 0.395083278969446 0
8.57636184804317 1.10812559380414 0
9.01492163620257 0.510523524665166 0
9.58893400478119 0.449895001552997 0
7.75205711844252 1.58453935232252 0
8.29972175842542 0.0560579848415797 0
8.11850822620633 0.537338764983023 0
8.39548757196097 0.177040058389844 0
9.33982207661439 0.585683926303854 0
9.74065188857987 0.396821927843297 0
8.01624167384975 1.2217107703379 0
8.7880620628596 0.655927227528701 0
8.01058345644243 0.214789937136848 0
7.24179597096022 1.26248822245651 0
7.74520368250676 0.458741648591905 0
7.95413679970061 1.128258453032 0
8.01122468963033 0.809777288490136 0
7.59519616097898 1.09177993450447 0
7.98469536846582 0.979346832327262 0
8.60253958191272 0.0450255501415262 0
9.9635695357347 0.728876460487022 0
8.89519253634627 0.592943546976524 0
6.91522480631824 1.47072491095159 0
7.66640335036373 0.910759140441097 0
8.91068489101872 0.592876661640738 0
9.28750644026141 0.0180160052195249 0
8.82009034431922 0.70338403383933 0
8.43955495797657 0.331889311419472 0
7.35183338924621 1.67493572497256 0
8.19083159327504 1.0482850978843 0
8.94095686463786 1.36221820688109 0
8.5564150842848 0.880862488652072 0
8.11242325352155 0.939857651448498 0
8.76127627752102 1.04370484030278 0
7.23200704687664 0.158245898424507 0
9.60678789240038 1.00490504047375 0
9.11631484214787 0.156962323547793 0
9.58779058293349 0.409524477423544 0
7.86339858062187 0.947950093617887 0
8.36453354112597 0.448239735790741 0
8.72654390411048 0.659808827340846 0
9.41656871486753 0.624262682972554 0
9.06829241709139 1.15750638373365 0
8.93899944532984 0.204145426373103 0
9.01626036564939 0.0362538084115062 0
8.17523770488335 0.109077028322558 0
9.27069005039505 0.756841245945856 0
7.92146989944385 0.106586999112305 0
8.77064400884125 0.843935640728649 0
7.77591731412014 0.123659914774283 0
8.19926107126823 0.580905856512887 0
6.97230858410754 1.06993428912571 0
8.23330693042574 0.0312395075893556 0
9.07487528134463 0.756263275030597 0
7.66513470630633 0.204318765568879 0
8.35364595136723 0.588948783461277 0
7.85866256871069 1.32551845503281 0
8.74752779662282 0.299242592138139 0
8.2122777527993 1.12655661080116 0
2.04390072936385 5.53960168918573 0
3.06118070966762 5.8143162195939 0
3.14835821528375 5.46948214215699 0
1.9435877068884 4.65108684755137 0
1.50323481971054 5.4477439050269 0
2.87175068599206 4.86508177779405 0
2.29138530580201 4.88149875064686 0
2.22098434030948 5.12599528894925 0
1.65920687100941 5.54144541424534 0
1.91120337921421 4.73509122616779 0
2.23545577170998 5.18923569546498 0
2.48667563325401 5.8762554807811 0
2.11115097438608 5.27288427149186 0
1.65079959561838 4.20036623322289 0
1.94136286789044 4.33957071027352 0
1.59893212021833 4.85273795737984 0
3.40896849016638 4.12643804386386 0
3.22689815276255 4.27498121040657 0
3.0712387315405 5.61753658471009 0
1.75036596893065 4.71050568070145 0
1.97557703971415 3.77799028885857 0
1.61439789371853 4.90166219610189 0
3.31697060080929 4.31100639979392 0
2.21109368502732 4.67174013250553 0
2.43402781444705 3.92642643127255 0
2.13744401915055 4.55578474551187 0
1.86482622387838 4.49818928399136 0
2.33677443316865 5.81891751120233 0
2.72291801619518 4.95128295907464 0
2.29537897304129 4.66332372273792 0
1.36918259062392 4.8791185699618 0
3.14828079192756 4.35954322005007 0
2.44822600505446 4.03126626736291 0
2.5529381352365 4.14061111321225 0
1.84105536501236 4.97120482054914 0
2.60319717386136 4.97648310636164 0
2.64426632805049 5.12350733869493 0
2.05474576628892 4.94255863472565 0
1.98635930036588 5.52759026473818 0
2.8338258385751 4.04672369237116 0
2.81790953045006 5.79442416135748 0
2.16056871383754 4.19243860273592 0
1.92764593655866 5.62168899957344 0
3.26451171581611 4.96708144854036 0
3.22728860620774 4.54995543330235 0
2.75632249015517 4.28934559470613 0
2.01609539629769 4.37677258774148 0
1.42794782092497 4.07035120167616 0
2.66070015269593 4.84078870549457 0
2.35599015835514 5.02732196020283 0
1.94264117702676 4.880626767239 0
2.30828803860222 4.97177155909388 0
2.26237312930339 4.00677536046374 0
3.32947713797922 4.3557327506897 0
2.5424750766871 4.48648190191855 0
2.46397966446938 5.53843776719581 0
2.17880108356806 4.80192655362616 0
2.70209716886437 5.79772860364825 0
1.48770542697815 4.22268295893518 0
2.03288008190395 5.03244086909598 0
2.32612256158862 5.16685582082735 0
3.09517415810984 3.9372522606488 0
3.36068051387775 5.18586372391895 0
2.73221946593867 5.35131839359664 0
2.87173243269551 5.58239013342097 0
2.59062388915925 4.92327488454844 0
2.08583533179559 5.30074144504604 0
2.36545579808908 5.53366463938548 0
2.28407584521276 5.4067095721232 0
2.90024286149316 4.55569326798854 0
2.30115618711712 4.70897603138945 0
2.28747952291625 5.37364979377858 0
2.38709136217945 4.42567900360082 0
2.13816660750656 3.93141307781827 0
2.81163732854582 4.43424925490255 0
2.44925171097215 3.82404928877261 0
2.61993175028829 4.95756750044322 0
2.56527981838572 4.69687547421021 0
2.4971272806211 5.09475848978931 0
1.78712158331158 4.38228609750589 0
2.49423753611742 5.65057015488244 0
1.56677335087284 3.91119427112569 0
1.41546511144209 4.74811165137465 0
2.79079468220237 4.9085261598921 0
1.67537939225916 5.85533618101862 0
1.90913979695904 5.08017903878789 0
2.48184907812075 4.13917104189155 0
1.22411801111512 5.58201952233775 0
2.08874297629283 5.62128071744537 0
3.44016954633099 4.45204118054916 0
3.15035855501254 5.15950266680295 0
2.00965237127253 5.73984004077374 0
3.20674716207026 4.93441791455317 0
2.77011812286131 4.74010114997989 0
1.7027696122288 4.62726482924333 0
2.85704703571456 5.03491015501087 0
2.08264006271748 4.52532644512973 0
3.26718787063623 5.11980296824793 0
2.73490964550427 5.16473732753527 0
2.35575793802233 5.13899873596301 0
2.95459337227787 4.72484909594399 0
1.93177613291326 3.75122817958748 0
1.90102782872926 4.60576887936105 0
2.0578826085597 5.25533909491848 0
3.08363597905359 4.50675601770031 0
1.53427985314802 4.41034906337868 0
2.69512102461697 4.02536647118179 0
1.93460325606336 5.36867663043935 0
1.76298479333793 5.08212101061008 0
1.85768529303395 4.9458195397382 0
2.27961576315306 5.41236012877417 0
2.00729761795308 5.12641552065436 0
2.2532475328098 4.24483306345024 0
3.09235631332027 5.76641456204817 0
2.9824487988287 5.1770789938796 0
1.1927505118507 5.45363577919317 0
2.78725296929434 4.70776035418954 0
2.44778483750279 4.45483147922665 0
2.05105040679949 4.58529236607829 0
2.58339931818614 3.87202374752374 0
1.78891487461258 4.82541776415237 0
2.51930042256937 4.93583179192333 0
2.2836178384473 4.22605689581239 0
2.15489903248159 4.78515398066314 0
1.8152941886779 5.02736082902999 0
2.62700754684463 5.88831216443205 0
2.94256002585414 4.71096714275944 0
1.62285588153475 5.546767616164 0
1.24674336258408 4.59507957890162 0
2.92000577350725 5.27899664919977 0
2.47217916167939 5.66459550118072 0
3.07540156398798 4.3336048686273 0
2.32883694649349 3.8056665921157 0
2.20912030106516 5.3404473808878 0
2.30049736365707 4.8352902942724 0
2.69892156849604 4.78107804944267 0
2.00460786836647 4.63979143762905 0
1.75739476636461 4.60125005659655 0
3.26844669278275 3.67320180359558 0
2.77988624652091 4.60765752821362 0
2.81131433596532 4.52631775962628 0
3.24385637121553 5.37568830491466 0
1.22833730145704 4.78294578093576 0
2.38048516507483 4.44587772893181 0
2.18378121552227 5.89779743834903 0
2.40785742649938 4.93228586505642 0
2.28451567942646 5.67512209533154 0
2.83082077621003 5.24076850374668 0
1.95176025369546 4.59293619188291 0
3.02285203748504 4.01660664464037 0
9.91890297964881 3.991748578268 1
8.21372788248026 3.22655579965333 1
9.24597257673088 2.39485151051769 1
8.08880937755183 2.82511452379404 1
9.42231731953421 2.169352940523 1
9.4267309211912 2.99343364814344 1
9.39010204349157 4.08783976777031 1
8.97916025401439 3.71137411326912 1
9.60900879715999 3.13249225210679 1
9.11704752641103 3.31641695829649 1
9.75707368475337 3.2993669532371 1
9.8172220382251 3.37996899382199 1
9.88465658748492 2.56349163604781 1
7.98560526788814 3.86919089657516 1
9.63485294764918 4.90109201166731 1
9.80869830051923 3.12555523450534 1
9.19451421908167 5.07404482499212 1
8.83501021978933 3.85851284715949 1
9.17609940081545 3.43773667194388 1
9.99959919766382 3.07722535812249 1
9.15374532570884 4.34009702660603 1
9.65809751237751 4.40514115770283 1
9.00313067582684 3.78499774282518 1
8.50054796386686 4.27670162141464 1
9.66131511937262 5.5681421405122 1
8.00661009233897 5.71358016981926 1
8.09228529522627 4.58735341595734 1
9.12132643866884 3.69685923413876 1
9.28852570431529 4.18755466599602 1
9.60226646658762 4.06898660867337 1
8.76307521876456 3.79592329514656 1
8.87649590460585 4.84469648639566 1
9.27885076822133 4.58617544868185 1
8.999114556979 5.70184217243078 1
9.32765172604347 2.95053434192063 1
9.5458686109581 3.55410360788054 1
9.70308850861958 1.9332529959037 1
8.88763628488815 3.11276917572987 1
9.90784112622345 4.89105753112523 1
9.95252639214722 3.3402730153109 1
7.85816485908452 3.56546256389681 1
9.34165195660155 5.27581917469276 1
9.18567308097397 4.22321458780111 1
7.11585885067229 5.89858193722721 1
8.35466496201245 6.5174358074448 1
7.60989497267544 7.03061071316648 1
7.97158084333724 7.13115146074303 1
8.68534652656928 6.41309607448264 1
7.04846204215636 6.30784417852658 1
7.63562994633355 5.53823676208756 1
7.92140340466626 6.54495991259285 1
8.46175777200986 5.57948954302735 1
7.17661395071773 6.1228528211987 1
7.85334838159469 6.85080928963963 1
7.78193841419313 6.63075503737995 1
7.57443758271478 6.37762497402158 1
8.4644637300963 5.48471494501761 1
7.18211324440134 5.86960886512444 1
7.01452105374725 6.80181529284748 1
7.96495563220591 5.79646436150813 1
8.62964696120002 5.4137461951536 1
8.33855322240309 7.18686859282857 1
7.81860612543686 5.28652389541334 1
8.05280622286769 5.59297988786317 1
8.75865072385823 6.62452272902188 1
8.34418859474842 5.81981995246778 1
6.74471225050421 6.39795535216862 1
8.6173932327924 6.60124046714589 1
7.89743169563809 5.82254107351987 1
8.16774203815589 5.68875692784042 1
7.06950676337216 5.68982116197184 1
7.61742445919197 6.85994362989049 1
7.26852832441764 5.15619553123353 1
6.82730397567703 7.10932104391558 1
7.87583631173742 6.65131458481185 1
8.81815042719736 5.11750514645816 1
8.30201339339062 6.42438565923801 1
7.06391112411626 6.48305407535515 1
7.74019207362529 6.355619848507 1
6.9489097506003 6.60113042677027 1
7.53795966452561 6.86511978094749 1
6.6577777499977 6.12882824397823 1
6.88243468064553 6.77197475275298 1
6.81654293724043 6.99158378460304 1
8.56168175834021 5.29897885669559 1
7.34159610508258 5.53214166727173 1
8.83712760850016 7.37973904444139 1
7.27831469805616 5.31531464441033 1
6.73147824118907 6.6085559183873 1
7.62642078571837 6.41971907534393 1
7.95442051276372 5.5660082952198 1
8.01264169395273 6.63714955080432 1
8.10935322057237 7.26225851541715 1
7.82170098298585 6.03913192601987 1
8.20750201283632 6.68148234021445 1
7.96338456920563 5.22492662265063 1
7.65377854205589 5.32264065922166 1
8.86418053470349 6.89849716178907 1
7.50075685376553 6.14528026222027 1
6.58739065602017 5.4865424494418 1
7.98839314310882 5.61532063061198 1
7.02677020859375 5.34002993562166 1
7.75135328739535 6.56573416372805 1
6.96358794550306 6.66890743292231 1
7.71142222813613 5.25457728559623 1
8.35259370292186 6.6725549374102 1
7.82126448468269 6.99745009920565 1
8.64328155943552 6.13064313370366 1
8.57546476431523 5.70347554220913 1
7.38927099679187 5.86682547410679 1
6.83632071519507 6.4539511043259 1
8.49168721672971 7.17713945553244 1
7.70207126455246 5.67440439475749 1
7.20280912462595 6.4701632117477 1
6.86972835610108 6.21377742348961 1
7.6192426499863 5.7373883132745 1
7.41500798788614 7.07457287393713 1
7.9735142447853 6.34935801600285 1
5.67273203058177 2.23755344518694 1
5.79194383695721 3.16463273593947 1
5.05463449953419 2.48918937868168 1
5.66664466174353 3.02807860602945 1
4.73032446505102 2.23896808037248 1
4.31230502901465 2.83589310795459 1
5.24570512418245 1.2678290398578 1
6.61726297412486 1.59055070641041 1
6.03336449533011 3.61671073322782 1
5.16294685652797 1.95264707146087 1
6.3514796898904 2.09074412743746 1
5.06694249393653 2.29966357849775 1
6.21723677035788 2.7858095086789 1
5.25479896010651 1.84783819152561 1
5.17241982739394 3.56513300733174 1
6.10671479323358 1.52881928852116 1
5.76746452972472 1.91768527393739 1
4.82628276762524 3.70495705325036 1
5.61974299192237 1.20266152540168 1
5.67917302766955 3.69069306693003 1
4.41361342709843 1.96837745279819 1
3.39725941148046 0.772570028027387 1
4.40755484772818 3.30146633641763 1
4.51900552737844 2.38674380032821 1
6.92449035928123 1.45343222921556 1
4.98291937347793 1.65046814981054 1
4.80815625653537 1.63453561244401 1
4.30200584653352 4.01220737490252 1
6.90111885153007 1.6375898844212 1
4.1494856608399 1.51458765142823 1
5.30631926089209 1.19660185328189 1
4.95327503703572 2.34943037799512 1
7.47081349083669 2.77803481409945 1
5.59963934539027 1.85001172969033 1
5.84426281660462 2.79245349838748 1
3.1773899057334 3.02838934895794 1
6.22962743034853 2.83867724147607 1
5.38643324542353 1.13050731186579 1
5.29553323092557 0.984203988962206 1
4.43474790718882 3.18110644683615 1
5.21056030111913 1.8140980883236 1
3.10117097417449 3.81942887963209 1
6.31256025549784 4.11174241128653 1
4.10308729962822 2.91611932420398 1
5.11687965870049 2.81429149595988 1
6.00208809522817 0.620293419702052 1
5.65156301067431 1.6995307372016 1
5.93948125940037 1.56394524983715 1
5.69864047596449 0.860047162749279 1
6.56056139996982 3.42648045616625 1
3.99582950522908 1.27683628087126 1
3.91970595479154 1.36219676402859 1
6.12565243148648 0.380465087836536 1
4.66723873247585 2.42902622011405 1
6.06431162415985 1.16797972101724 1
3.69862348717769 2.09477763922234 1
4.25562683749897 1.66826074011189 1
5.49680040156432 1.34481467900386 1
4.73194982676672 3.25369526316006 1
5.34706046213207 1.93956709656323 1
7.20670749844127 1.68814098324807 1
4.90911758622406 2.42682546563634 1
5.29500103943603 1.3464801078019 1
3.70276588241366 1.9885168046193 1
4.47355003997777 1.93356366587599 1
5.9356050658515 3.20197692893747 1
4.93970455511439 2.21415416116783 1
5.02045855334554 4.59516757742759 1
6.68509176271427 1.4308869212184 1
5.01973038554945 3.70710972999526 1
5.34706250055696 3.1836734160005 1
7.28359023119666 2.75246334306476 1
3.820692088411 2.6579592029702 1
5.6773980813567 0.427096209920243 1
4.78977038557928 2.02153418800012 1
2.38121198410261 8.68339620977526 1
3.33572665884988 8.56848668591301 1
3.12335465228538 8.68965747328016 1
2.8401281289764 8.20573450068265 1
3.53499161806389 8.41549472935103 1
3.56687730458899 8.21296826793028 1
3.84837398362705 8.14429619622003 1
3.08888695591849 8.4237671477482 1
3.70176429550946 8.97076014084983 1
2.5806102330646 9.14868372799883 1
2.81889507241005 8.27752873218826 1
2.30778086424541 8.92951812694566 1
3.18851611990613 8.79395176166157 1
3.83494986287779 8.71081785494139 1
2.80828324498156 8.36349624204227 1
3.0933979752026 8.36733225318269 1
3.55193125122004 8.25252535449914 1
3.69311516814688 8.91015357299943 1
2.28029350563468 7.85654744359723 1
2.59485733778167 8.1678647265426 1
3.02811067864357 8.64279549768816 1
2.83154629775914 7.93026817556529 1
3.41016434445795 8.35540242359168 1
3.39435617837556 8.40942167000997 1
3.68049178248984 8.74876177603112 1
3.10474803338364 8.73880514598351 1
3.19303147321383 7.78438806960474 1
3.22478664576498 8.27307616015922 1
3.5631612029677 8.47602111500697 1
3.80882634619929 8.16315851869794 1
3.94267081371019 8.32699434282058 1
3.34735917013815 8.63775252897321 1
2.40522927397734 8.49349639903978 1
3.02755921037065 8.14621174937928 1
2.65749571833931 9.24316104189061 1
3.83206442857885 8.86071887308713 1
2.74421467171562 8.8944420211126 1
3.03769437893374 8.31307927271376 1
3.27468803465541 8.5390012339528 1
3.49074903551222 8.82488029035988 1
2.99003249344424 7.55055957244007 1
2.85905583867936 8.85049073425355 1
3.1255581314798 8.04708647590969 1
3.24859576349402 7.75962947151181 1
2.75295707581868 7.57580114995242 1
3.35876558909808 8.0295271199814 1
3.28762536719413 7.63840847872432 1
2.93447994095338 7.777473418382 1
2.6643956565874 8.29668974408108 1
3.03285293669424 9.02129194962227 1
3.6599193516085 8.25194779968932 1
2.87765239064213 8.82478991710636 1
3.5727554555881 8.16347953039619 1
3.44678684466234 8.53581954151147 1
2.60442475673193 8.12944716337556 1
3.16037475456484 8.87055698521353 1
2.74895013791224 8.71028468690281 1
3.46174656867883 8.06538459168572 1
2.6861077001369 8.79191988699177 1
2.19464550829466 8.77929795556087 1
3.18663050019955 7.74130877313624 1
2.43654950381196 7.91971663982489 1
2.67987225928881 7.86709411232748 1
2.73179535153033 8.61878288345699 1
2.36205311676414 8.7947577824049 1
2.95050971754566 8.39905122012463 1
2.37499535708669 7.62911868850374 1
2.90380040572002 8.38009106890693 1
2.83657734166793 7.92002440279745 1
2.70450016484404 7.66793152468829 1
3.22022544574656 7.86209954468498 1
3.38645629909408 7.96431985107792 1
2.55025085566646 8.18299814590233 1
3.23326179043584 8.55936441835083 1
3.31792512280568 8.72654239441905 1
2.8439517090159 7.61648174651884 2
2.73946629653077 7.06218750928921 2
1.76745032963022 7.83874771099716 2
1.55003211396751 8.00779028419066 2
3.19822722751567 7.24419997378783 2
2.01671110086131 7.00201360304377 2
2.34269989664022 8.05713287287831 2
2.53250202391032 8.00836546128731 2
2.18269299365854 8.04990064900701 2
3.19959344408278 7.60155455596568 2
2.4144518047578 7.87338515941027 2
2.67137571691776 7.49008088203955 2
2.71852779830649 7.63387050757563 2
1.56599529379639 7.28738736097344 2
1.70397766535762 7.75683395791977 2
2.70405272930326 7.97263642736551 2
1.79826191252297 8.49901672410009 2
2.79211948966465 7.172406673165 2
2.93911946174325 8.18246511992853 2
2.39025219227494 7.11407391784144 2
3.14554453160569 7.3326140477127 2
2.38348926755622 8.29274129387158 2
3.18138565236956 7.41556162338029 2
2.59273872451348 7.02563871271824 2
3.10920990610436 7.69099505610061 2
2.71099907377137 7.51301474540085 2
2.36322581413062 7.63502765173854 2
2.23375665451375 8.57713646060972 2
3.01217811001858 7.79501236127561 2
1.52692509306561 7.89616840939002 2
2.87423272187434 6.82342568150378 2
2.97625645602021 7.66130878419799 2
1.99518257463404 7.26400806642466 2
2.24953878922399 8.38677743294252 2
3.07839208666601 7.764182003473 2
2.85944436360303 7.87959984043505 2
2.23325110197396 8.59696246520275 2
2.94131720057985 6.9631078421461 2
1.90104223220909 7.93118097166147 2
2.57582860397521 7.18975676557548 2
2.32643666774402 7.19039270473795 2
2.44724307025805 8.26176605800022 2
2.35065004407065 7.18149811155357 2
2.18950957401737 8.45676995627868 2
2.8460556679995 8.15953286759363 2
2.84563996450097 7.27015262041901 2
3.21741762900269 8.14025721343264 2
2.95540722423229 7.53337270539584 2
1.93665994040458 8.56848748184887 2
2.71642100829264 7.41316432394926 2
2.80326433767286 7.19933254620041 2
3.23341558944367 8.18646824965696 2
2.24178786115516 7.09057405059591 2
3.09883064136204 8.30197203650882 2
2.87208150627759 7.50924632495169 2
2.61856718041282 6.94227237808616 2
3.08076054721828 7.79184760120872 2
2.0543956356427 6.89750485232375 2
1.60995366108686 7.98021160692889 2
2.21640129486299 7.14952453558326 2
1.96997898704886 7.34559402881059 2
1.73278922902622 7.05726985311174 2
2.04328820498477 7.80930655807709 2
1.72955880737968 7.29900503052844 2
3.09398936127281 7.81659646345829 2
2.10928455966124 7.67878625033964 2
2.51569642142068 7.15827108104001 2
2.08006847578617 8.37535429284613 2
2.63121762867229 7.65472441279884 2
2.80155581912409 7.92316406947428 2
2.23828370955804 7.97266230565586 2
2.81306979712889 6.9495487451759 2
2.32274794567071 7.08123688838277 2
2.245208618231 8.47115630694307 2
1.6043415399225 7.92019708431516 2
2.40466287704132 8.17547216181717 2
2.84529177039501 6.94631829299036 2
2.43436282117393 7.52468689380826 2
2.29792856481309 8.36493443932716 2
2.16941266679313 7.56372200579461 2
1.53784437021001 7.14206884434905 2
2.21638842499886 7.68894098938097 2
1.58038432994124 7.90817782924398 2
2.4159462371374 8.39818267010249 2
2.44748696860094 8.35270784877464 2
2.21400144769679 8.19979099517565 2
3.03764316336897 8.43344511172364 2
2.15941426920259 8.36692028489826 2
2.80895440847789 8.52120492292502 2
1.59478221260981 7.47182476594528 2
2.07859697991169 7.91646872419685 2
2.57119695420319 7.55764618469587 2
3.12944921680861 8.27801274715648 2
2.54459800948872 8.18488201094014 2
2.17881533976116 7.76917110446528 2
3.18641298046833 7.34408564151305 2
1.78658958194246 8.60811180486348 2
2.13511294336294 7.62131721097135 2
1.49236281396364 8.12633881007559 2
1.45553228300818 8.10433517674454 2
6.91723067130305 3.33366257910257 2
4.21195302082319 2.27580570995455 2
6.12452939405989 3.45150657404272 2
4.45373080287452 2.07632127197272 2
6.67632143352319 2.13936495948596 2
7.32500934938591 0.355525123472564 2
8.67348721969506 1.23950159135388 2
7.4348056059479 3.75196932275827 2
6.2139905912442 1.83425163897076 2
8.20478231968398 1.31659331533092 2
5.41218455496037 0.94267126271198 2
6.26672020904882 2.64687350771159 2
5.5795366756262 3.40400861092761 2
6.47185249031048 1.27719790530974 2
6.45684350189839 1.58813677166981 2
5.55158573713783 1.73456739956023 2
6.35576704729479 2.94169007675983 2
7.53260667813436 1.92187516095585 2
4.46233669839972 2.00773732763712 2
4.26604731218298 2.81546091106739 2
6.27704021716547 3.96506772277569 2
7.00283572093008 1.09034922929504 2
8.03632431530829 2.98778973158742 2
6.11079160585522 0.925908280585298 2
6.77633250649935 3.59612050043334 2
7.76214193082196 4.20201492367164 2
7.52550864195021 5.3858533225335 2
5.14792828730233 3.071920788639 2
6.94271622124217 2.68091829849116 2
6.94621902836248 4.62356824989743 2
7.02149660461974 4.08820585357016 2
6.73218380321961 2.04231572975392 2
6.8136857802972 3.33553072844212 2
4.54799202885008 2.786667240299 2
8.67509970952832 2.16781329576432 2
5.60830854221474 3.42541181303894 2
6.81887347032158 4.54839984028652 2
7.09120274482267 2.95062405723496 2
6.93901570196681 3.48457068328343 2
6.49034985508727 3.06405408819645 2
6.36744403118873 2.41316882071184 2
7.65667828402587 1.38727323144375 2
5.90326843869578 1.3858451600335 2
5.83202882333895 1.7675189918498 2
8.54401499189254 2.59618206613062 2
7.06618297163598 3.40015837787295 2
5.58954320420915 4.22574285241969 2
7.67343884167678 2.31575060840548 2
7.30461017904698 2.35903675737215 2
6.21023012837621 2.14634914809697 2
6.04089963847796 2.15364778064257 2
8.09578396010337 3.56225055698137 2
7.59016758549875 2.4643967186496 2
8.03258743910304 1.91251054578391 2
6.40163796104354 2.56535173460454 2
8.1667604115483 1.52594855443155 2
4.57131973994034 4.22510333179223 2
5.9586539587747 1.09168355238391 2
7.75619558260776 1.06225677080527 2
7.10527998660532 2.85747472481764 2
5.49501631163576 3.35044730541871 2
8.16144006098995 1.18388904120696 2
5.48615307551815 1.11711822999085 2
6.55377993350615 0.880458516710755 2
7.42509422988342 3.92666969051525 2
8.33064069507738 2.02853190900053 2
6.88231886998593 2.06077044698733 2
5.56303373358911 1.52654059238173 2
6.1121245110127 2.9567753930478 2
5.37736881014117 2.7212379108585 2
6.26814810069579 3.11308210201898 2
8.01886858709706 3.99433747375995 2
6.50090703774399 2.12943153395636 2
5.56063592102251 4.14252200600644 2
6.5160381846054 2.68316787730009 2
5.90958676439099 1.00791894719644 2
9.22383479979313 1.3406678945951 2
3.88543247765309 0.867890497812941 2
7.3472567881929 1.86675667826572 2
7.65699155342869 4.16562221437133 2
5.71522763565258 2.91629639224003 2
5.38156513077179 4.69008399406124 2
8.18133123854369 1.88984810413161 2
7.72194676567246 4.25454530533575 2
5.59727769831153 3.84570702912677 2
7.06722059075738 2.72024361577325 2
7.78368027965971 3.70371269694462 2
7.38442265932366 2.82737136008248 2
4.11398012629023 1.45099786414208 2
4.60128607762239 2.6464547140017 2
8.02623463328135 3.31362095968422 2
8.88409283009618 2.22164938279953 2
4.92823467917916 1.92845688515845 2
7.63048117660525 4.8138042095953 2
7.03084953885661 2.40284360301014 2
6.94163113095647 2.7521005207913 2
6.0855747741664 3.21731723041937 2
6.42366035135633 0.575676943389066 2
7.57394131686648 1.39686138010039 2
5.25881384484117 4.37961753331142 2
3.69269112256879 3.27106301595913 2
3.80763931695532 5.17030187343288 2
6.60229134439603 5.55036918585014 2
4.02030487265107 3.29907824889672 2
4.91827136669438 4.48062496172835 2
4.42814088099274 3.97549708646895 2
5.27780862769267 4.60437787733605 2
4.70260656120615 5.35906166392149 2
5.95712658979611 3.37182886732942 2
4.13680619348656 5.23875931282224 2
3.86691429195291 3.38654063657072 2
4.82560222334062 3.18713373723135 2
5.06915377896403 4.58265444553476 2
5.15298294121142 4.98171188802793 2
5.88843789954191 3.50506589885218 2
4.21597937197925 5.43794346187749 2
4.06886916825327 3.29426643952473 2
5.18830599862531 4.85120554998358 2
6.13144269598085 4.26254684580032 2
5.58753573007951 4.6378504038309 2
5.64153273722286 4.49631434626896 2
4.21178308326061 5.95338862728725 2
3.56166950858702 5.29379268589576 2
5.85347781871332 3.2442292230586 2
3.96473985538772 4.69283935543502 2
4.55451136747018 3.83039137103146 2
4.55798701318489 5.68047791607425 2
4.86149146692549 4.12390926846074 2
5.09571744609028 4.30492943269972 2
3.67103123575291 3.73188510247405 2
5.62059007344369 4.17641669478067 2
4.10948289995253 5.59823908223385 2
6.32142807962521 3.4218027661992 2
6.45076575365769 5.94386697048162 2
4.17764745430726 5.1994719888457 2
5.75939895140457 5.77713419293384 2
4.92128866853364 5.76363009153749 2
4.56800522937322 4.60948242404356 2
5.64752367023003 3.54173964369006 2
6.2259166262622 5.90191521521273 2
5.20788194219469 5.752358486051 2
5.03129595127684 4.98583002865971 2
5.54160249747559 6.12930684830877 2
6.51369402079026 4.43076162634763 2
4.14256374247587 4.17097947987549 2
5.97330609101234 4.83075730935334 2
5.36873848387074 5.12632836181877 2
4.53677092881678 3.72850063113586 2
3.89431148864683 5.05245044610785 2
4.90678951965699 3.46208102753299 2
5.00726701414893 4.04307671748059 2
5.10735581883832 3.26879591787743 2
5.09592975431777 4.36117187963323 2
5.56307342708339 3.38212535711588 2
4.52005840135628 4.25137756137198 2
6.00793197022307 4.71406110944843 2
4.31428164519452 4.55274914485006 2
4.16141916188199 5.91816611515178 2
5.72650840231881 5.23467514173289 2
5.38232677690928 4.55463979797588 2
5.38945678874978 3.14845203663297 2
5.10227840233393 4.95020015188317 2
6.00181091917327 4.09365882978344 2
5.69745830602054 5.8570119597386 2
4.69711645827147 5.24704381405984 2
4.44656479980815 3.90423127272376 2
4.79786178251457 3.28473047612275 2
5.98737217751801 4.21303980506022 2
4.888116333017 4.45303854555407 2
3.96480066005363 4.09986322202939 2
4.3837385508339 4.85700659203272 2
4.29144544571031 5.15549221831681 2
5.42612270225847 5.23300623910804 2
4.28516057047046 4.59131404631342 2
3.55766100807196 4.83115587184069 2
5.90841850289429 4.79025403871295 2
5.5516938861896 5.24972693539497 2
4.229560365349 3.84507115241215 2
6.5311078654239 4.68395069460012 2
3.58606109611744 3.85951984879335 2
3.97660526232046 5.14351596872306 2
6.28123527235951 4.38133149587753 2
6.3442760895941 3.58372974982289 2
4.70650135271457 5.5928811469552 2
4.36929578850794 3.95472322715919 2
5.09381382655923 5.00372312770407 2
4.13130101336825 3.56887615465967 2
4.25220711824108 4.27402354094932 2
6.24161150939509 3.11223820087987 2
6.00398971767573 5.26807676283297 2
5.06719893570693 3.47889941174272 2
6.30487456616589 5.78256131631392 2
5.12443869761951 3.66597386698107 2
5.21923974238092 5.41646822001021 2
5.97321402030576 4.74599586869559 2
5.06014565107149 3.99933745825598 2
6.20437684188405 5.10492685932088 2
4.97332229296227 4.65912657751581 2
5.45138958791544 4.24611144828436 2
9.01867141321429 4.42487538576729 3
7.81406219597354 5.03530510902336 3
9.29691808585603 4.9165042188785 3
8.28664666663164 4.65912177357386 3
8.27895548739699 5.83456715002732 3
9.73758893619479 4.57950868040057 3
7.57936451553339 5.90508755332168 3
8.64942886398921 3.98133638215315 3
9.67440239985357 5.61038703585414 3
8.76442315271208 6.15898641683172 3
8.63154757374018 4.14342447883371 3
8.33937538873886 3.33000542759597 3
6.74965862885588 4.30111526106193 3
9.42551938712766 5.47267682782407 3
9.24398209608459 3.8712347348729 3
8.13528786592257 4.71622428831693 3
8.33250445450452 6.14623098002879 3
8.6170410395736 5.32015993867536 3
7.35086991450418 5.06955419152435 3
8.25633132095077 5.57103503636568 3
8.66628918580292 5.10496013147081 3
7.56679581113737 4.63323674664072 3
8.25488088956824 6.11427450545748 3
9.22190716339223 4.90320625288312 3
9.06173981128378 3.97701445978768 3
8.22003329788178 5.87136151572516 3
8.50830370801573 4.46276284668767 3
9.54950679103225 4.50854314488745 3
8.49141393658975 5.60007937859418 3
9.75430720781634 3.22479763414891 3
8.5442714617875 5.4636150527369 3
7.63696727017762 2.7419428753651 3
9.31476947376118 4.34095490292108 3
8.09658965738928 5.29525449484669 3
7.35979932426686 4.18183286162325 3
8.58024898259417 5.46867684756029 3
8.56415511628992 5.14122823577953 3
8.80344427528205 4.275269249755 3
8.39520224755942 4.33305247948445 3
8.49412959997667 4.20691347632365 3
9.24817419559096 5.14016779084172 3
8.51243415703885 5.1251056789377 3
8.69991367113611 4.67985617925437 3
7.93829151043468 5.783944135682 3
9.83290128785164 5.03624237296565 3
8.14878204060958 4.19446902806357 3
7.72682222028379 4.14413210670945 3
7.99800160365636 5.90128288395834 3
9.80024753530599 3.91460314986076 3
8.47956701749931 4.64385324663011 3
9.64874385389586 5.14767400392105 3
8.02537413780751 4.32029193441224 3
8.37654507516321 4.77899901808269 3
8.00260284985121 3.52729479831848 3
9.29458861610147 4.04710760417737 3
9.22184155393437 5.8072684838728 3
9.87779880811374 5.11958337076589 3
8.93378796833634 4.45027321660322 3
7.7192503438767 4.91614534879736 3
9.80243366041799 5.84563913723483 3
9.45814093289497 4.93934756860462 3
7.47838170913111 5.71842041792767 3
8.84188824093887 4.56915960577078 3
7.60016468869892 5.13926271332584 3
8.76932867784591 4.69460566913082 3
7.92917813139454 4.90613386437147 3
7.20484380551698 4.97726913072703 3
9.50182460356291 4.76784687911689 3
8.3291619839321 4.78887788481089 3
8.37305436583989 4.79102905078253 3
7.08416988294565 3.88221455800105 3
8.39032698760726 5.77015659148838 3
8.90423273487226 5.12536126718367 3
8.3363791113098 4.79991135273044 3
9.21632662371747 6.80178868468575 3
9.84475291149385 4.48183979593648 3
8.3997957170542 4.7503384400445 3
7.5019603010674 3.62922840143947 3
9.32923413122231 4.96710661446589 3
9.95973886245663 6.9395567682672 3
7.72004369390055 4.24555859238969 3
8.10056669343427 6.01776841927556 3
8.69276862176722 4.98689356468487 3
8.66764366001835 5.60991580611668 3
8.53152997698736 5.22587281346114 3
7.22790396033352 4.19747087227182 3
7.94641802213753 3.15060265338532 3
7.8840222433373 5.75006518378715 3
9.45051729702208 4.70895241487389 3
9.29564036257346 6.06273373687616 3
9.72127580263057 5.75596854270043 3
9.52549354729148 3.95059363417901 3
9.40354216650864 4.37455824450866 3
8.50386878255866 5.01671087992927 3
9.74350822518019 4.03500162764368 3
8.84276399098189 5.85232555499919 3
7.96094854914656 4.525208052739 3
9.77896124474252 2.66468169496632 3
9.84963719934975 5.66481450410462 3
8.52379161743006 5.71011031845063 3
7.0915355174969 3.42087378593816 3
9.52931737025032 4.44638351343832 3
8.24934238283855 3.90065963797614 3
8.65448968646584 4.90190759681121 3
8.3315144738536 5.59492381299836 3
9.06146623749724 5.00572674206163 3
7.54704409215941 5.84942553067517 3
8.95494209970115 5.60528029785141 3
9.90001122493398 5.21576304222145 3
8.73011184399571 5.82795408886557 3
7.61728274822034 4.21845250589747 3
7.40674946944419 5.44412342668907 3
8.38851465597891 6.01127129369569 3
7.7158447696531 4.47474936116064 3
7.4784819764228 5.03621818776427 3
8.19543742497264 3.90856940574413 3
9.599069854666 3.8046391773692 3
9.63215271464998 2.9592255067063 3
9.80415531573938 5.22923298606936 3
9.10769869659676 5.36191088832907 3
9.38497920087774 3.59910072617052 3
7.94889983059342 3.9543779687511 3
7.47335039344523 4.5521798507219 3
7.98729935278978 5.59829759047688 3
9.36371932760683 6.08631592174224 3
9.3669119508778 4.75100977563968 3
7.25140738983495 5.72409674197363 3
8.05271265497308 4.16362404964211 3
8.39033946028764 6.70366420211958 3
6.87702058119616 4.83744803856274 3
9.30823137588862 4.69625809631666 3
8.77984794886865 6.40545058803572 3
7.70980972625476 6.2521909759524 3
7.46983047824065 3.98094612710418 3
8.65425528746398 4.87892804681288 3
8.71199608455348 4.6222255507308 3
8.27284817406594 2.79472627681781 3
8.64970560309211 4.82918401038406 3
7.69845035886601 3.84486425057532 3
9.59675019970798 4.86511489073818 3
2.86101436902348 5.54641140468756 3
3.28297394741349 5.06189085431885 3
4.02369910055681 6.61264923971349 3
4.89539669618782 5.80470240498421 3
3.85953925428613 5.31783432668024 3
3.51211136977276 6.19636944424656 3
5.87357169893827 6.93240244274833 3
5.49575973210608 4.827902696528 3
4.64244680015604 5.50639920234445 3
3.27584089143339 4.43437498872815 3
3.34812296605896 4.22624888726826 3
3.94522097658783 5.53934950613111 3
4.31865553558128 6.62535294786139 3
5.38877137164926 4.32453914393569 3
4.88784002820315 6.66194029797442 3
5.86643480721191 3.78070264779192 3
5.30463195014151 5.23557230584681 3
4.87172883856936 6.46851745452466 3
3.21747015348014 5.38173208708602 3
5.7427754566113 5.79838562616813 3
5.21143628067831 4.30310333040688 3
5.30676056095319 7.14216803955653 3
4.76182768093033 5.09202031629965 3
5.50746360563268 4.4525851197669 3
5.86416496624859 5.09728141371643 3
4.20020760502703 4.17879883385927 3
5.01230697119245 7.73849658865471 3
5.84503018767419 6.343346973627 3
2.89336084320335 6.34160916115872 3
4.37493004277381 6.60448462077925 3
4.7134828485181 4.47805604539258 3
4.65234765805555 4.79095218699625 3
5.62922948631763 5.44651632401292 3
4.32675719806984 5.24763675527775 3
3.4755556675989 5.90479627013452 3
5.97804182542045 7.16577750296725 3
2.12726841901918 4.08215135285999 3
3.87600499698586 4.03901183569844 3
4.24490475106981 4.53226750671266 3
3.778157825391 6.89318295332744 3
5.62297293621755 5.4244680313673 3
4.18074807914442 7.28628344454306 3
3.15069117743137 5.36280429044912 3
4.29180339826254 5.171262460398 3
4.34891951211032 6.21814678726425 3
4.76529584371585 5.94927635980053 3
3.46534320335747 4.19315456491512 3
3.73684219055535 4.14935783416979 3
4.60272396887559 6.56083751069374 3
3.84936962195534 4.0282777568657 3
5.13527862320827 5.66294367503569 3
3.12361248372388 5.05488121978156 3
5.96883682900173 6.34700489229864 3
4.30532787151093 5.53446843009413 3
3.90473206388126 3.71128338509528 3
4.13096683361379 5.07690734330883 3
5.70133237406298 4.55290050824151 3
6.07493925171222 6.3011583451792 3
4.25071992293226 6.75882092575202 3
4.94391368705641 5.26205408508948 3
5.96717420964725 6.99405617311234 3
3.11942875086091 6.61788942896975 3
4.46266480331254 7.3219582924149 3
5.38148955154976 5.72910086286373 3
4.63159599147857 6.00783682053439 3
3.46639737858499 5.53275342887857 3
3.81143359814647 5.99810053029621 3
6.00012528429119 5.4328582505914 3
4.82257925561725 6.20559095046953 3
3.03180317507301 6.4025993598386 3
5.48660624616392 5.17280771328579 3
5.77420876921828 6.08204122300724 3
5.30847794736095 3.77148797931287 3
6.34791287070244 4.72955614145531 3
4.96512627518314 6.88977264964971 3
4.36325700884941 7.03065711417075 3
5.20330172877259 4.54579290548731 3
3.82733620796312 6.07925202787753 3
5.44679388175484 5.539035284438 3
5.22398263496428 4.94857948905405 3
5.40682406720763 4.42033594381678 3
4.5088175163388 5.57841109628856 3
4.44822346811794 5.10423671670813 3
4.21075974296774 5.89811365854587 3
4.68570417490418 6.92039161631726 3
3.23974868672657 7.63397366271149 3
4.54404923322466 4.96237635143907 3
3.32288401336275 4.29441567805417 3
3.49946401651586 4.44707258115669 3
4.01460064353618 4.29518470167655 3
5.29158352636946 4.91967164329287 3
5.1124124201099 4.57457661132574 3
4.37298021949571 5.68542366651042 3
5.21796849862243 6.33749687091449 3
4.22682977804598 5.27182228572371 3
6.53298504614856 7.43833082391562 3
4.84098801899155 3.52050103041074 3
4.55610562928016 6.96177430035329 3
3.5099899878914 5.85250179750359 3
5.59236136358851 7.74307752651203 3
3.14437943179685 4.19124709681355 3
4.66733728596168 3.27991306750189 3
2.01570527101094 6.38730575554676 3
5.07179664479855 6.69537869267855 3
4.20794068367623 4.47577889408119 3
5.07963096728753 4.8170980137691 3
4.52361868948151 7.02138475056401 3
2.35408160217678 4.64450206790391 3
2.58010620732909 4.72113393110883 3
6.48162341324204 4.47407674445472 3
4.03789652188503 6.35339557604423 3
4.52603936420386 7.92052212937206 3
5.44363734312017 4.70557146491104 3
4.74731373136469 3.10360208826497 3
4.02679602004163 4.47314887931078 3
6.13090289088502 3.86537270539324 3
3.33732377083544 6.41347889820892 3
2.89568250545501 5.70515526941084 3
3.17642364942414 5.75868607011181 3
5.25385757294286 5.77291755890781 3
3.55582547509909 4.69919954514854 3
3.29741224919244 4.17832594290501 3
5.99924247163928 5.86456042541942 3
4.22929803528671 6.28138920751811 3
4.41837931074962 6.39200469878905 3
3.03954289825656 5.54488073064649 3
2.51717580749525 5.4667341903575 3
4.75086232261179 4.17260761638782 3
2.07336006726662 5.06754318286463 3
4.12695730976537 4.73497334477017 3
3.91298679667923 6.4412476656926 3
2.54454628160356 6.64815522171209 3
4.38724117503807 6.97998547493831 3
4.1896671926098 5.7978988247142 3
5.58209871875166 4.1016458731548 3
4.66490034459301 4.55678475585101 3
3.54070815188136 5.73441019730664 3
4.65083112518718 6.02826660083705 3
2.81903042011367 5.79462534821568 3
4.4844851688109 4.32418123588878 3
2.96208300715787 5.19962867343683 3
5.20070626008806 5.37551330212648 3
4.34089937770736 6.73988909250601 3
2.74261053656498 7.33193203941193 3
4.12407976506268 3.81698455034349 3
4.30082644135462 5.14306788370266 3
3.2993399444303 4.85767171647885 3
2.78749878940317 4.72438420880513 3
4.72775408941921 3.81746290375855 3
3.29446164611391 5.34781634458761 3
!function(){d3.hexbin=function(){function u(n){var r={};return n.forEach(function(n,t){var a=s.call(u,n,t)/o,e=Math.round(a),c=h.call(u,n,t)/i-(1&e?.5:0),f=Math.round(c),l=a-e;if(3*Math.abs(l)>1){var v=c-f,g=f+(f>c?-1:1)/2,m=e+(e>a?-1:1),M=c-g,d=a-m;v*v+l*l>M*M+d*d&&(f=g+(1&e?1:-1)/2,e=m)}var j=f+"-"+e,p=r[j];p?p.push(n):(p=r[j]=[n],p.i=f,p.j=e,p.x=(f+(1&e?.5:0))*i,p.y=e*o)}),d3.values(r)}function a(r){var t=0,u=0;return n.map(function(n){var a=Math.sin(n)*r,e=-Math.cos(n)*r,i=a-t,o=e-u;return t=a,u=e,[i,o]})}var e,i,o,c=1,f=1,h=r,s=t;return u.x=function(n){return arguments.length?(h=n,u):h},u.y=function(n){return arguments.length?(s=n,u):s},u.hexagon=function(n){return arguments.length<1&&(n=e),"m"+a(n).join("l")+"z"},u.centers=function(){for(var n=[],r=0,t=!1,u=0;f+e>r;r+=o,t=!t,++u)for(var a=t?i/2:0,h=0;c+i/2>a;a+=i,++h){var s=[a,r];s.i=h,s.j=u,n.push(s)}return n},u.mesh=function(){var n=a(e).slice(0,4).join("l");return u.centers().map(function(r){return"M"+r+"m"+n}).join("")},u.size=function(n){return arguments.length?(c=+n[0],f=+n[1],u):[c,f]},u.radius=function(n){return arguments.length?(e=+n,i=2*e*Math.sin(Math.PI/3),o=1.5*e,u):e},u.radius(1)};var n=d3.range(0,2*Math.PI,Math.PI/3),r=function(n){return n[0]},t=function(n){return n[1]}}();
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
display: flex;
flex-flow: row wrap;
justify-content: space-around;
}
.canvasContainer {
position: relative;
}
.canvasContainer canvas, .canvasContainer svg {
position: absolute;
top: 0;
left: 0;
}
.canvasContainer svg {
z-index: 10;
}
.canvasContainer .hexagons > path {
fill: none;
stroke: #fff;
stroke-width: 1px;
}
.axis text {
font: 10px sans-serif;
}
.axis path,
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
#scattersvg {
cursor: pointer;
}
</style>
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<!--<script src="textures.min.js"></script>-->
<script src="d3.hexbin.min.js"></script>
<script>
var margins = {top: 20, right: 20, bottom: 40, left: 20};
var thisClick = function(event) {
if (d3.event.defaultPrevented) return;
var series = 0;
if (d3.event.ctrlKey) series = 2;
if (d3.event.altKey) series++;
var point = d3.mouse(this);
var p = [point[0] - margins.left, point[1] - margins.top, series, ptId++];
ptData.push(p);
updateVis();
};
var width = 320,
height = 300;
var xd = [0, 10];
var yd = [0, 10];
var colors = d3.scale.category10().range().slice(0, 4);
var svgDefs = [
{
name: "bin",
classes: "hexbin",
title: "Weighted Average Binning"
},
{
name: "scatter",
classes: "pts",
title: "Scatterplot"
},
{
name: "binpt",
classes: "hexbin binpts",
title: "Exemplar pts (picked randomly)"
},
{
name: "binclass",
classes: "hexbin binpts",
title: "Exemplar pts (at least one of each class)"
},
{
name: "binoutlier",
classes: "hexbin binpts",
title: "Exemplar pts (explicit outliers as △)"
},
{
name: "binpie",
classes: "hexbin binpies",
title: "Binning with pies"
},
{
name: "binpiesize",
classes: "binpies",
title: "Pie glyphs (size = number)"
},
{
name: "weaving",
classes: "hexbin weaving canvasOverlay",
title: "Color weaving"
},
{
name: "weaving-prop",
classes: "hexbin weaving canvasOverlay",
title: "Color weaving in proportion"
},
{
name: "textures",
classes: "hexbin texture",
title: "Strokes"
}
];
d3.select("body").selectAll('svg')
.data(svgDefs).enter()
.append('svg')
.attr('id', function(d) { return d.name + "svg"; })
.attr('class', function(d) { return d.classes; })
.attr('width', width)
.attr('height', height);
// add a canvas element behind any elements that request them
d3.selectAll("svg.canvasOverlay").each(function() {
var thisSVG = d3.select(this);
var thisID = thisSVG.attr('id');
var thisPrefix = thisID.split("svg")[0];
var thisContainer = d3.select("body").insert("div", "#" + thisID)
.attr("id", thisPrefix + "-container")
.attr('class', 'canvasContainer')
.style('width', width + "px"); // have to define a width for this to be a placeable div
// add the svg
thisSVG.remove();
thisContainer.append(function() {
return thisSVG.node();
});
// then append a canvas element
thisContainer.append('canvas')
.attr('width', width - margins.left - margins.right)
.attr('height', height - margins.top - margins.bottom)
.style('top', margins.top + "px")
.style('left', margins.left + "px");
});
// add click interaction to the scatterplot svg
d3.select("#scattersvg").on('click', thisClick);
width = d3.select("svg").attr('width') - margins.left - margins.right;
height = d3.select("svg").attr('height') - margins.top - margins.bottom;
var x1 = d3.scale.linear()
.domain(xd)
.range([0, width]);
var y1 = d3.scale.linear()
.domain(yd)
.range([height, 0]);
var hexbin = d3.hexbin()
.size([width,height])
.radius(15);
var pie = d3.layout.pie()
.sort(d3.descending);
var arc = d3.svg.arc()
.outerRadius(8)
.innerRadius(0);
svg = d3.selectAll('svg').append('g')
.attr("transform", "translate(" + margins.left + ", " + margins.top + ")");
svg.append('g')
.attr('class', 'xaxis axis')
.attr('transform', 'translate(0,' + height + ')')
.call(d3.svg.axis().orient('bottom').scale(x1));
svg.append('g')
.attr('class', 'yaxis axis')
.call(d3.svg.axis().orient("left").scale(y1));
svg.append('g')
.attr('class', 'svg-label')
.attr('transform', 'translate(0,' + (height + 35) + ')')
.append('text')
.attr('x', width / 2)
.style('text-anchor', 'middle')
.text(function(d) { return d.title; });
// only do this for hexsvgs
var hexsvgs = d3.selectAll('svg.hexbin > g');
hexsvgs.append('clipPath')
.attr('id', 'clip')
.append('rect')
.attr('class', 'mesh')
.attr('width', width)
.attr('height', height);
var hexagon = hexsvgs.append("g")
.attr('clip-path', 'url(#clip)')
.attr("class", "hexagons");
// only do this for ptsvgs
var ptsvgs = d3.selectAll('svg.pts > g');
var points = ptsvgs.append('g').attr('class', 'points')
.attr('clip-path', 'url(#clip)');
var binptsvgs = d3.selectAll('svg.binpts > g');
var binpts_points = binptsvgs.append('g').attr('class', 'points')
.attr('clip-path', 'url(#clip)');
var binpie_pies = d3.selectAll('svg.binpies > g')
.append('g').attr('class', 'pies')
.attr('clip-path', 'url(#clip)');
var bin_lines = d3.selectAll('svg.texture > g')
.append('g').attr('class', 'lines')
.attr('clip-path', 'url(#clip)');
var attenuation = d3.scale.log().range([0,1]);
var ptSize = 3;
var hexagonRadius = 14.5;
// <http://stackoverflow.com/questions/19911514/how-can-i-click-to-add-or-drag-in-d3>
var ptData;
var updateVis = function() {
var pts = points.selectAll('circle.point')
.data(ptData, function(d) { return d[3]; });
pts.exit().remove();
pts.enter().append('circle')
.attr("class", "point")
.attr('r', ptSize)
.attr('cx', function(e) { return e[0]; })
.attr('cy', function(e) { return e[1]; })
.style('fill', function(e) { return colors[e[2]]; });
var hexbins = hexbin(ptData);
attenuation.domain([.1, d3.max(hexbins.map(function(d) { return d.length; }))]);
var hex = hexagon.selectAll("path")
.data(hexbins, function(d) { return d.i + "," + d.j });
var colorBins = 8;
var lightnessScale = d3.scale.quantize()
.range(d3.range(colorBins).map(
d3.scale.linear()
.domain([0, colorBins-1])
.range(["#ffffff", "#000000"])
.interpolate(d3.interpolateLab)))
.domain(attenuation.domain());
hex.exit().remove();
hex.enter().append("path")
.attr("d", hexbin.hexagon(hexagonRadius))
.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });
hex.style("fill",
function(d) {
var counts = [0,0,0,0];
d.forEach(function(p) {
counts[p[2]]++;
});
return counts.reduce(function(p, c, i) {
return d3.interpolateLab(p, colors[i])(c / d.length);
}, "white");
})
.style('fill-opacity', function(d) { return attenuation(d.length); });
// try to move all points in binptsvg closer to center of their respective bins
var pp = binpts_points.selectAll('g.binpts')
.data(hexbins, function(d) { return d.i + "," + d.j; });
pp.exit().remove();
var newbin = pp.enter().append('g')
.attr('class', 'binpts')
.attr('id', function(d) { return d.i + "," + d.j});
var newpp = pp.selectAll('circle.point')
.data(function(d) { return d; }, function(d) { return d[3]; });
newpp.exit().remove();
newpp.enter().append('circle')
.attr('class', 'point')
.attr('r', 2)
.attr('cx', function(d) { return d[0]})
.attr('cy', function(d) { return d[1]})
.style('fill', function(d) { return colors[d[2]]; })
.style('stroke', '#333')
.style('stroke-width', '0.5px');
// try moving points closer to the origin of their bins??
newpp.each(function(pData, i) {
pData.remove = false;
pData.selected = false;
var pt = d3.select(this);
// is bin too far from center?
var binCenter = d3.select(pt.node().parentNode).data().map(function(d) { return [d.x, d.y]})[0];
var unitpt = binCenter.map(function(d, i) { return pData[i] - d; });
var dist = Math.sqrt(unitpt.reduce(function(p, d) { return p + Math.pow(d,2); }, 0));
var distThreshold = 10;
if (dist > distThreshold) {
var newPos = unitpt.map(function(d) { return d * distThreshold / dist; });
pt.attr('cx', binCenter[0] + newPos[0])
.attr('cy', binCenter[1] + newPos[1]);
}
});
// diverge here, remove baesd on # points, or # classes
binpts_points.each(function(d, i) {
var thisSVG = d3.select(this);
var thisID = d3.select(thisSVG.node().parentNode.parentNode).attr('id');
var thisPoints = thisSVG.selectAll('g.binpts').selectAll('circle.point');
// reset point state (since it's shared because we set it all at once??)
thisPoints.each(function(d) {
d.remove = false;
d.selected = false;
d.isOutlier = false;
})
var ptThreshold = 7;
if (thisID === 'binclasssvg' || thisID == 'binoutliersvg') {
// try to select one of each class
thisPoints.forEach(function(binData, binID) {
var binPts = d3.selectAll(binData);
var binClasses = d3.set(binPts.data().map(function(d) { return d[2]; })).values();
binClasses.forEach(function(thisClass) {
var thesePoints = binPts.filter(function(d) { return d[2] == thisClass; });
// try to pick the index farthest away from everything else
var thosePoints = binPts.filter(function(d) { return d[2] != thisClass; });
var maxPt;
var maxDist = -Infinity;
// select the point that has the highest distance from everything else
thesePoints.each(function(thisPt) {
var minDist = Infinity;
thosePoints.each(function(thatPt) {
var dist = eucliDist(thisPt, thatPt);
if (dist < minDist) {
minDist = dist;
}
});
if (minDist > maxDist) {
maxDist = minDist;
maxPt = d3.select(this);
}
});
var pickedPt = maxPt.each(function(d, i) {
d.selected = true;
// also mark as outlier if this is the only point of this class in this bin
if (thesePoints.size() == 1)
d.isOutlier = true;
});
});
var shuf = shuffle(d3.range(binPts.data().length));
var order = {};
binPts.data().map(function(d) { return d[3]; })
.forEach(function(d, i) { order[d] = shuf[i]; });
// see if we can highlight any more points
binPts.sort(function(a,b) {
return a.selected ?
(b.selected ? 0 : -1) :
(b.selected ? 1 : order[a[3]] - order[b[3]]);
});
binPts.each(function(curData, curI) {
if (!curData.remove) {
binPts.each(function(d, i) {
if (eucliDist(d, curData) < ptThreshold && i != curI && !d.selected)
d.remove = true;
});
}
});
});
// finally, actually remove the subsampled points
thisPoints.filter(function(d) { return d.remove; }).remove();
// identify points that are single outliers and replace them with crosses
var cross = d3.svg.symbol().type("triangle-up").size(10);
if (thisID == 'binoutliersvg') {
thisPoints.filter(function(d) { return !!d.isOutlier; }).forEach(function(grpOutliers) {
theseOutliers = d3.selectAll(grpOutliers).each(function(d) {
var thisPt = d3.select(this);
d3.select(thisPt.node().parentNode).append('path')
.attr('class', 'outlier')
.attr('transform', 'translate('+thisPt.attr('cx')+','+thisPt.attr('cy')+')')
.attr('d', cross)
.style('fill', colors[d[2]])
.style('stroke', '#333')
.style('stroke-width', '0.5px');
thisPt.style('opacity', '0');
});
});
}
} else if (thisID === 'binptsvg') {
// subsample. just flag points, then remove all that conflict
thisPoints.forEach(function(binData, binID) {
var order = shuffle(d3.range(binData.length));
var binPts = d3.selectAll(binData);
order.forEach(function(i) {
var curPt = d3.select(binData[i]);
var curData = curPt.datum();
// if point has not already been marked to remove, remove its neighbors
if (!curData.remove) {
// select all points except the current one that are within 2px and remove them
binPts.each(function(d, thisI) {
if (eucliDist(d, curData) < ptThreshold && thisI != i)
d.remove = true;
});
}
});
});
// finally, actually remove the subsampled points
thisPoints.filter(function(d) { return d.remove; }).remove();
} else
throw "unimplemented subsampling routing for svg#" + thisID;
});
// deal with pies
var pp = binpie_pies.selectAll('g.binpie')
.data(hexbins, function(d) { return d.i + "," + d.j; })
pp.exit().remove();
var newpies = pp.enter().append('g')
.attr('class', 'binpie')
.attr('id', function(d) { return d.i + "," + d.j; })
.attr('transform', function(d) { return 'translate(' + d.x + "," + d.y + ")"});
var pieScale = d3.scale.pow().exponent(2)
.range([4, 13])
.domain(d3.extent(d3.selectAll(pp[0]).data().map(function(d) { return d.length; })));
pp.each(function(binPts) {
var thisPie = d3.select(this);
var isSize = d3.select(thisPie.node().parentNode.parentNode.parentNode).attr('id') == "binpiesizesvg";
if (isSize)
arc.outerRadius(pieScale(binPts.length));
else
arc.outerRadius(8)
// count the number of classes here
var counts = binPts.reduce(function(p, pt) {
var thisClass = pt[2];
if (!p[thisClass])
p[thisClass] = 1;
else
p[thisClass]++;
return p;
}, Array(4).fill(0));
thisPie.selectAll('.arc').remove();
var arcs = thisPie.selectAll('.arc')
.data(pie(counts))
.enter().append('g')
.attr('class', 'arc');
arcs.append('path')
.attr('d', arc)
.style('fill', function(d, i) {
return colors[i];
})
.style('opacity', function(d) { return isSize ? 1 : attenuation(binPts.length); });
// add white outline
// thisPie.append('circle')
// .attr('r', 9)
// .style('stroke', '#fff')
// // .style('stroke-width', '1.5')
// .style('fill', 'none');
});
d3.selectAll("#binpiesvg .hexagons > path")
.style('fill', function(d) {
return lightnessScale(d.length);
});
// deal with weaving
d3.selectAll("svg.weaving .hexagons > path").style("fill", "none");
d3.selectAll("svg.weaving + canvas").each(function() {
var thisCanvas = d3.select(this);
var thisID = d3.select(thisCanvas.node().parentNode).select("svg").attr('id');
var ctx = thisCanvas.node().getContext("2d");
ctx.clearRect(0, 0, width, height);
// get the generalized hexagon path
var hexAngles = d3.range(0, 2 * Math.PI, Math.PI / 3);
var hexPos = hexAngles.map(function(angle) {
var x = Math.sin(angle) * hexagonRadius;
var y = -Math.cos(angle) * hexagonRadius;
return [x,y];
})
// now, go through each bin, figure out the proportions, then fill in the hexagon
hexbins.forEach(function(binPts) {
// save original transformation (identity)
ctx.save();
// move to the bin center
ctx.translate(binPts.x, binPts.y);
// define the hexagon path
ctx.beginPath();
hexPos.forEach(function(pos, i) {
if (i == 0) ctx.moveTo(pos[0], pos[1]);
else ctx.lineTo(pos[0], pos[1]);
});
ctx.closePath();
ctx.clip();
// round to nearest full pixel
ctx.translate(binPts.x - Math.floor(binPts.x), binPts.y - Math.floor(binPts.y));
// draw rectangle of weaving, clipping will make it a hexagon
var w = Math.ceil(hexagonRadius) * 2;
ctx.translate(-w / 2, -w / 2);
// all pixels to fill; see <http://bl.ocks.org/yelper/aa0860f4d35997a3c94df34764be97b9>
var ptData = binPts.map(function(d) { return d[2]; });
if (thisID != "weavingsvg") {
ptData = ptData.concat(Array(attenuation.domain()[1] - ptData.length).fill(-1));
}
var pixelSize = 1;
for (var i = 0; i < w * w / pixelSize; i++) {
var di = i % ptData.length;
if (di === 0) shuffle(ptData);
var x = i % w;
var y = Math.floor(i / w);
// skip drawing this pixel if we're simulating proportional measurement
if (ptData[di] == -1) continue;
ctx.fillStyle = colors[ptData[di]];
ctx.fillRect(x * pixelSize, y * pixelSize, pixelSize, pixelSize);
}
// restore to origin (0,0)
ctx.restore();
});
});
// add outlines for sparse weaving
d3.selectAll("#weaving-propsvg .hexagons > path")
.attr('d', hexbin.hexagon(Math.ceil(hexagonRadius)))
.style('stroke', "#333")
.style('stroke-width', '1');
// deal with textures (try to be smart about line orientation?)
d3.selectAll("svg.texture").each(function() {
var thisCanvas = d3.select(this);
thisCanvas.selectAll("clipPath#hex")
.data([0]).enter().append('clipPath')
.attr('id', 'hex')
.append('path')
.attr('d', d3.hexbin().radius(13).hexagon());
// blank out background colors
thisCanvas.selectAll('g.hexagons path')
.style('fill', null)
.style('fill-opacity', 0)
.style('stroke', 'black')
.style('stroke-width', 0.5);
// do brain-dead thing and get max of any one class in all
var maxClass = hexbins.reduce(function(p, thishex) {
thiscount = thishex.reduce(
function(p, d) {
p[d[2]]++; return p;
}, Array(4).fill(0));
return p.map(function(d, i) {
return d > thiscount[i] ? d : thiscount[i];
});
}, Array(4).fill(0));
var freq = d3.scale.quantize()
.domain([0, d3.max(maxClass)])
.range(d3.range(1,8));
var angles = d3.range(0, Math.PI, Math.PI / 4);
var ll = bin_lines.selectAll('g.binlines')
.data(hexbins, function(d) { return d.i + "," + d.j; });
ll.exit().remove();
var newlines = ll.enter().append('g')
.attr('class', 'binlines')
.attr('id', function(d) { return d.i + "," + d.j; })
.attr('clip-path', 'url(#hex)')
.attr('transform', function(d) { return 'translate(' + d.x + "," + d.y + ")"; });
ll.each(function(thishex) {
var thisbin = d3.select(this);
var thiscount = thishex.reduce(
function(p, d) {
p[d[2]]++; return p;
}, Array(4).fill(0));
var linegrp = thisbin.selectAll('g.linegrp')
.data(thiscount);
linegrp.enter().append('g')
.attr('class', 'linegrp');
linegrp.each(function(count, i) {
// skip drawing lines if count == 0
if (count == 0) return;
var thisgrp = d3.select(this);
var x = (hexagonRadius + 10)* Math.sin(angles[i]);
var y = (hexagonRadius + 10) * Math.cos(angles[i]);
var numFreq = freq(count);
var stepSize = hexagonRadius / numFreq;
var startAtZero = numFreq % 2 == 1;
for (var k = 0; k < numFreq; k++) {
if (startAtZero) {
var pos = k % 2 == 1 ? -1 : 1;
var shift = Math.ceil(k / 2) * stepSize * pos;
var shiftx = shift * Math.cos(angles[i]);
var shifty = shift * Math.sin(angles[i]);
} else {
var pos = k % 2 == 1 ? -1 : 1;
var shift = (stepSize / 2 * pos) + Math.floor(k / 2) * stepSize * pos;
var shiftx = shift * Math.cos(angles[i]);
var shifty = shift * Math.sin(angles[i]);
}
// var pos = k % 2 == 1 ? -1 : 1;
// var shift = Math.floor(k / 2) * stepSize * pos;
thisgrp.append('line')
.attr({
'x1': x + shiftx,
'x2': -x + shiftx,
'y1': y - shifty,
'y2': -y - shifty
})
.style('stroke', colors[i])
.style('stroke-width', 2);
}
});
// var lines = thisbin.selectAll('line')
// .data(thiscount);
// lines.enter().append('line');
// lines.each(function(count, i) {
// // skip drawing lines if count == 0
// if (count == 0) return;
// var thisline = d3.select(this);
// var x = hexagonRadius * Math.sin(angles[i]);
// var y = hexagonRadius * Math.cos(angles[i]);
// var numFreq = freq(count);
// var stepSize = hexagonRadius / 2 / numFreq;
// for (var k = 0; k < numFreq; k++) {
// var pos = k % 2 == 1 ? -1 : 1;
// var shift = Math.floor(k / 2) * stepSize * pos;
// var thisx = x + shift;
// var thisy = y - shift;
// thisline.attr({
// 'x1': thisx,
// 'x2': -thisx,
// 'y1': thisy,
// 'y2': -thisy
// })
// .style('stroke', colors[i])
// .style('stroke-width', 2);
// }
// });
});
// ll.append('line')
// .attr({
// x1:-15, y1:-15,
// x2: 15, y2: 15
// })
// .style("stroke", 'red')
// .style("stroke-width", 0.5);
});
};
var ptId = 0;
d3.csv("cluster-data.csv", function(d) {
return [x1(+d.x), y1(+d.y), +d.category, ptId++];
}, function(error, rows) {
ptData = rows;
updateVis();
}
);
function eucliDist(pt1, pt2) {
return Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
}
// fisher-yates shuffling
function shuffle(arr) {
var i = arr.length;
var tmp, ri;
while (i !== 0) {
ri = Math.floor(Math.random() * i--);
tmp = arr[i];
arr[i] = arr[ri];
arr[ri] = tmp;
}
return arr;
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment