Skip to content

Instantly share code, notes, and snippets.

@curran
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curran/baab51d65ffe28b1afdb to your computer and use it in GitHub Desktop.
Save curran/baab51d65ffe28b1afdb to your computer and use it in GitHub Desktop.
Incremental Data Loading

This example shows one way to load data files one by one, and re-render the visualization each time more data is fetched. This data set presents temperature in San Francisco every hour, over 26 days. The data for each day is in a separate CSV file. Here is more information about this data, and here's the script that generated these files.

This just shows how to load data incrementally. For ideas on how to make this look even smoother, see this Path Transitions article by Mike Bostock.

This example was created to address this conversation on the D3 Google Group: Is it possible to smoothly load 200MB data to remote clients' browser with D3?.

The line chart visualization code is based on a previous example: Standalone Line Chart.

timestamp temperature
2015-03-01T08:00:00.000Z 15.6979389293089
2015-03-01T09:00:00.000Z 15.4131006260337
2015-03-01T10:00:00.000Z 15.3879134762406
2015-03-01T11:00:00.000Z 15.06517827072
2015-03-01T12:00:00.000Z 14.7637191879346
2015-03-01T13:00:00.000Z 14.5614523881888
2015-03-01T14:00:00.000Z 14.2625559039613
2015-03-01T15:00:00.000Z 15.4313175673177
2015-03-01T16:00:00.000Z 16.7809310798515
2015-03-01T17:00:00.000Z 18.0883843234759
2015-03-01T18:00:00.000Z 18.8978154010575
2015-03-01T19:00:00.000Z 20.0049318444889
2015-03-01T20:00:00.000Z 21.683106870798
2015-03-01T21:00:00.000Z 23.3999516520372
2015-03-01T22:00:00.000Z 22.9248057200603
2015-03-01T23:00:00.000Z 21.4051937920733
2015-03-02T00:00:00.000Z 19.7626574558277
2015-03-02T01:00:00.000Z 17.6886791324406
2015-03-02T02:00:00.000Z 16.7438746218336
2015-03-02T03:00:00.000Z 16.5803495330694
2015-03-02T04:00:00.000Z 16.3706761103414
2015-03-02T05:00:00.000Z 16.4366313044499
2015-03-02T06:00:00.000Z 15.9669670500964
2015-03-02T07:00:00.000Z 15.8713982129251
timestamp temperature
2015-03-10T07:00:00.000Z 15.4083348764512
2015-03-10T08:00:00.000Z 15.2020985325919
2015-03-10T09:00:00.000Z 15.4392742496118
2015-03-10T10:00:00.000Z 15.3769833543558
2015-03-10T11:00:00.000Z 15.179790426809
2015-03-10T12:00:00.000Z 15.3219896504043
2015-03-10T13:00:00.000Z 15.7947960255246
2015-03-10T14:00:00.000Z 15.9135001263934
2015-03-10T15:00:00.000Z 16.1170862393859
2015-03-10T16:00:00.000Z 16.6775337671735
2015-03-10T17:00:00.000Z 17.8096576984477
2015-03-10T18:00:00.000Z 19.7597174628717
2015-03-10T19:00:00.000Z 22.3145469595442
2015-03-10T20:00:00.000Z 22.5222392196963
2015-03-10T21:00:00.000Z 20.2384328422906
2015-03-10T22:00:00.000Z 18.9519516280977
2015-03-10T23:00:00.000Z 18.8771304695174
2015-03-11T00:00:00.000Z 18.9029025637179
2015-03-11T01:00:00.000Z 18.1699588526433
2015-03-11T02:00:00.000Z 17.8007944553701
2015-03-11T03:00:00.000Z 17.2799654784903
2015-03-11T04:00:00.000Z 17.1928360985193
2015-03-11T05:00:00.000Z 17.3648053859734
2015-03-11T06:00:00.000Z 17.4545081973669
timestamp temperature
2015-03-11T07:00:00.000Z 17.2277307896261
2015-03-11T08:00:00.000Z 17.2874720650562
2015-03-11T09:00:00.000Z 17.3772934734173
2015-03-11T10:00:00.000Z 17.4451196350307
2015-03-11T11:00:00.000Z 17.6083558617484
2015-03-11T12:00:00.000Z 17.8137452976484
2015-03-11T13:00:00.000Z 17.9688475976009
2015-03-11T14:00:00.000Z 18.0848859316114
2015-03-11T15:00:00.000Z 18.5584079732555
2015-03-11T16:00:00.000Z 19.4684505423408
2015-03-11T17:00:00.000Z 20.7859255602978
2015-03-11T18:00:00.000Z 22.1951194298892
2015-03-11T19:00:00.000Z 22.6417260418412
2015-03-11T20:00:00.000Z 23.0721906032921
2015-03-11T21:00:00.000Z 23.622456824951
2015-03-11T22:00:00.000Z 23.8937534599073
2015-03-11T23:00:00.000Z 22.6597830748741
2015-03-12T00:00:00.000Z 22.2913491563757
2015-03-12T01:00:00.000Z 20.2397196985593
2015-03-12T02:00:00.000Z 19.2466897551854
2015-03-12T03:00:00.000Z 19.0098008244636
2015-03-12T04:00:00.000Z 19.0206938884585
2015-03-12T05:00:00.000Z 18.7322836853624
2015-03-12T06:00:00.000Z 18.5435670005348
timestamp temperature
2015-03-12T07:00:00.000Z 18.1627607337778
2015-03-12T08:00:00.000Z 17.7871223389415
2015-03-12T09:00:00.000Z 17.6955654645177
2015-03-12T10:00:00.000Z 17.3873352364295
2015-03-12T11:00:00.000Z 17.1238666704653
2015-03-12T12:00:00.000Z 16.8192026665139
2015-03-12T13:00:00.000Z 16.639575939114
2015-03-12T14:00:00.000Z 16.8455342954219
2015-03-12T15:00:00.000Z 18.637255151053
2015-03-12T16:00:00.000Z 20.0455727003568
2015-03-12T17:00:00.000Z 21.2928086895555
2015-03-12T18:00:00.000Z 22.7003762976255
2015-03-12T19:00:00.000Z 24.3184195597148
2015-03-12T20:00:00.000Z 26.5091068622408
2015-03-12T21:00:00.000Z 28.0718204536303
2015-03-12T22:00:00.000Z 27.0082804418554
2015-03-12T23:00:00.000Z 26.0885772686331
2015-03-13T00:00:00.000Z 25.1312514151521
2015-03-13T01:00:00.000Z 23.4405929811667
2015-03-13T02:00:00.000Z 22.1084443791134
2015-03-13T03:00:00.000Z 21.0220702978719
2015-03-13T04:00:00.000Z 19.5867282845769
2015-03-13T05:00:00.000Z 18.684573071428
2015-03-13T06:00:00.000Z 18.3109511932417
timestamp temperature
2015-03-13T07:00:00.000Z 17.3593645627832
2015-03-13T08:00:00.000Z 17.6540778602445
2015-03-13T09:00:00.000Z 17.5402882985728
2015-03-13T10:00:00.000Z 17.7566571984988
2015-03-13T11:00:00.000Z 17.7164611361958
2015-03-13T12:00:00.000Z 17.6301316905745
2015-03-13T13:00:00.000Z 17.6472166318995
2015-03-13T14:00:00.000Z 17.6122482100915
2015-03-13T15:00:00.000Z 19.4556437699662
2015-03-13T16:00:00.000Z 20.6426627558813
2015-03-13T17:00:00.000Z 22.4133830830094
2015-03-13T18:00:00.000Z 23.5925019414934
2015-03-13T19:00:00.000Z 26.0876343798864
2015-03-13T20:00:00.000Z 28.6396174586344
2015-03-13T21:00:00.000Z 29.7566121843514
2015-03-13T22:00:00.000Z 29.0373261819084
2015-03-13T23:00:00.000Z 28.5630575857811
2015-03-14T00:00:00.000Z 24.8042272359897
2015-03-14T01:00:00.000Z 22.3545158647061
2015-03-14T02:00:00.000Z 22.6575295738545
2015-03-14T03:00:00.000Z 22.6244263069631
2015-03-14T04:00:00.000Z 22.1701759214775
2015-03-14T05:00:00.000Z 22.5560468860006
2015-03-14T06:00:00.000Z 21.9634797979393
timestamp temperature
2015-03-14T07:00:00.000Z 21.3483545273819
2015-03-14T08:00:00.000Z 20.8992855864319
2015-03-14T09:00:00.000Z 20.5893140141231
2015-03-14T10:00:00.000Z 20.0866383693655
2015-03-14T11:00:00.000Z 19.9490058376083
2015-03-14T12:00:00.000Z 19.731439143203
2015-03-14T13:00:00.000Z 19.6404499334738
2015-03-14T14:00:00.000Z 19.3430640416805
2015-03-14T15:00:00.000Z 20.7448664319633
2015-03-14T16:00:00.000Z 22.5176675973162
2015-03-14T17:00:00.000Z 23.4943673185517
2015-03-14T18:00:00.000Z 25.2792535155315
2015-03-14T19:00:00.000Z 26.9607668239164
2015-03-14T20:00:00.000Z 29.0453888320273
2015-03-14T21:00:00.000Z 31.9817831801206
2015-03-14T22:00:00.000Z 33.2412790291271
2015-03-14T23:00:00.000Z 33.2359122011392
2015-03-15T00:00:00.000Z 31.2293286595873
2015-03-15T01:00:00.000Z 28.8381768446962
2015-03-15T02:00:00.000Z 26.9773236356087
2015-03-15T03:00:00.000Z 26.1865480941013
2015-03-15T04:00:00.000Z 25.4396764755933
2015-03-15T05:00:00.000Z 24.6859778663592
2015-03-15T06:00:00.000Z 24.1570999075203
timestamp temperature
2015-03-15T07:00:00.000Z 23.8667210948617
2015-03-15T08:00:00.000Z 23.1620682069993
2015-03-15T09:00:00.000Z 22.8710210133814
2015-03-15T10:00:00.000Z 22.3690920961378
2015-03-15T11:00:00.000Z 22.1092408556667
2015-03-15T12:00:00.000Z 21.866526469578
2015-03-15T13:00:00.000Z 21.5857867998426
2015-03-15T14:00:00.000Z 20.3731512163198
2015-03-15T15:00:00.000Z 20.0273713328521
2015-03-15T16:00:00.000Z 20.234877239413
2015-03-15T17:00:00.000Z 21.2181220163182
2015-03-15T18:00:00.000Z 23.6966542644006
2015-03-15T19:00:00.000Z 24.6909077095684
2015-03-15T20:00:00.000Z 25.1261389810723
2015-03-15T21:00:00.000Z 25.3106893270064
2015-03-15T22:00:00.000Z 25.4140649853361
2015-03-15T23:00:00.000Z 26.0987396012842
2015-03-16T00:00:00.000Z 24.5414384306976
2015-03-16T01:00:00.000Z 22.1549845024696
2015-03-16T02:00:00.000Z 21.1401335820546
2015-03-16T03:00:00.000Z 20.2744432903916
2015-03-16T04:00:00.000Z 19.7970245063756
2015-03-16T05:00:00.000Z 20.3945785300954
2015-03-16T06:00:00.000Z 19.7452733594083
timestamp temperature
2015-03-16T07:00:00.000Z 19.9260296390222
2015-03-16T08:00:00.000Z 19.8340213188106
2015-03-16T09:00:00.000Z 19.9881130635981
2015-03-16T10:00:00.000Z 19.9421681588957
2015-03-16T11:00:00.000Z 19.5564275208116
2015-03-16T12:00:00.000Z 19.6001716730336
2015-03-16T13:00:00.000Z 19.6734487416033
2015-03-16T14:00:00.000Z 19.8372300774286
2015-03-16T15:00:00.000Z 20.2261491598569
2015-03-16T16:00:00.000Z 20.9815858317693
2015-03-16T17:00:00.000Z 22.1197789142798
2015-03-16T18:00:00.000Z 23.1628614766342
2015-03-16T19:00:00.000Z 24.3069306128657
2015-03-16T20:00:00.000Z 24.9740334092729
2015-03-16T21:00:00.000Z 25.8378272103276
2015-03-16T22:00:00.000Z 23.7977531523086
2015-03-16T23:00:00.000Z 23.961268389386
2015-03-17T00:00:00.000Z 23.2803242364453
2015-03-17T01:00:00.000Z 22.8347407732748
2015-03-17T02:00:00.000Z 21.8437675134391
2015-03-17T03:00:00.000Z 21.5849316378074
2015-03-17T04:00:00.000Z 20.9045855962197
2015-03-17T05:00:00.000Z 19.8984477499233
2015-03-17T06:00:00.000Z 19.4037712103187
timestamp temperature
2015-03-17T07:00:00.000Z 19.6445626475747
2015-03-17T08:00:00.000Z 19.2857607133206
2015-03-17T09:00:00.000Z 18.5310520469702
2015-03-17T10:00:00.000Z 17.0064065998854
2015-03-17T11:00:00.000Z 16.055503579912
2015-03-17T12:00:00.000Z 15.9430270243922
2015-03-17T13:00:00.000Z 15.4097331778284
2015-03-17T14:00:00.000Z 15.2874305250907
2015-03-17T15:00:00.000Z 15.8092095269373
2015-03-17T16:00:00.000Z 17.4110397760449
2015-03-17T17:00:00.000Z 18.6671073394687
2015-03-17T18:00:00.000Z 20.3946401970645
2015-03-17T19:00:00.000Z 21.697462022178
2015-03-17T20:00:00.000Z 22.7233130551513
2015-03-17T21:00:00.000Z 23.8686178522254
2015-03-17T22:00:00.000Z 23.5445656303061
2015-03-17T23:00:00.000Z 23.0226037871056
2015-03-18T00:00:00.000Z 20.8210527606976
2015-03-18T01:00:00.000Z 18.1725979697587
2015-03-18T02:00:00.000Z 17.691976715502
2015-03-18T03:00:00.000Z 17.0717586009252
2015-03-18T04:00:00.000Z 17.2231642730943
2015-03-18T05:00:00.000Z 17.7285400805879
2015-03-18T06:00:00.000Z 17.5192087431361
timestamp temperature
2015-03-18T07:00:00.000Z 17.3222192295971
2015-03-18T08:00:00.000Z 17.0355849331857
2015-03-18T09:00:00.000Z 16.9282791337175
2015-03-18T10:00:00.000Z 16.5001215020209
2015-03-18T11:00:00.000Z 16.41552708515
2015-03-18T12:00:00.000Z 16.3498473843788
2015-03-18T13:00:00.000Z 16.5161417142262
2015-03-18T14:00:00.000Z 16.4570570026162
2015-03-18T15:00:00.000Z 18.3586676782007
2015-03-18T16:00:00.000Z 20.0885979769524
2015-03-18T17:00:00.000Z 21.3296090080817
2015-03-18T18:00:00.000Z 22.8407990937591
2015-03-18T19:00:00.000Z 23.7958276812315
2015-03-18T20:00:00.000Z 25.0220954338855
2015-03-18T21:00:00.000Z 25.6409309623178
2015-03-18T22:00:00.000Z 24.9731098446154
2015-03-18T23:00:00.000Z 24.4536231241038
2015-03-19T00:00:00.000Z 21.7856249828813
2015-03-19T01:00:00.000Z 19.3532877111208
2015-03-19T02:00:00.000Z 18.3853200685728
2015-03-19T03:00:00.000Z 17.596448263367
2015-03-19T04:00:00.000Z 17.6771782145923
2015-03-19T05:00:00.000Z 17.3577403669032
2015-03-19T06:00:00.000Z 17.3660621706597
timestamp temperature
2015-03-19T07:00:00.000Z 16.7638179250668
2015-03-19T08:00:00.000Z 16.7778971907747
2015-03-19T09:00:00.000Z 16.6950120614218
2015-03-19T10:00:00.000Z 16.2866385660167
2015-03-19T11:00:00.000Z 16.3461541788676
2015-03-19T12:00:00.000Z 16.2186485881488
2015-03-19T13:00:00.000Z 16.4153313401028
2015-03-19T14:00:00.000Z 16.6882147314352
2015-03-19T15:00:00.000Z 18.9016987019529
2015-03-19T16:00:00.000Z 20.396530470254
2015-03-19T17:00:00.000Z 21.7249959797009
2015-03-19T18:00:00.000Z 23.7619603965148
2015-03-19T19:00:00.000Z 26.228596514901
2015-03-19T20:00:00.000Z 28.0931051363761
2015-03-19T21:00:00.000Z 27.7555997124607
2015-03-19T22:00:00.000Z 28.4750010427446
2015-03-19T23:00:00.000Z 27.678579946064
2015-03-20T00:00:00.000Z 24.8694423666777
2015-03-20T01:00:00.000Z 21.5204557557333
2015-03-20T02:00:00.000Z 18.9802820540563
2015-03-20T03:00:00.000Z 17.7781933892546
2015-03-20T04:00:00.000Z 17.5196596904198
2015-03-20T05:00:00.000Z 17.49610482378
2015-03-20T06:00:00.000Z 17.2774288734512
timestamp temperature
2015-03-02T08:00:00.000Z 15.7950053247994
2015-03-02T09:00:00.000Z 15.6653373845648
2015-03-02T10:00:00.000Z 15.606475948572
2015-03-02T11:00:00.000Z 15.6397833170805
2015-03-02T12:00:00.000Z 15.4693163960119
2015-03-02T13:00:00.000Z 15.5821244614936
2015-03-02T14:00:00.000Z 15.5759003931982
2015-03-02T15:00:00.000Z 15.8217883223498
2015-03-02T16:00:00.000Z 16.5287007256677
2015-03-02T17:00:00.000Z 17.0558705954429
2015-03-02T18:00:00.000Z 18.5019598172837
2015-03-02T19:00:00.000Z 19.5975738973143
2015-03-02T20:00:00.000Z 20.1355157572041
2015-03-02T21:00:00.000Z 21.7814524664784
2015-03-02T22:00:00.000Z 21.7427371794051
2015-03-02T23:00:00.000Z 22.1028061676795
2015-03-03T00:00:00.000Z 20.7794082400925
2015-03-03T01:00:00.000Z 18.9382741205007
2015-03-03T02:00:00.000Z 17.744024664601
2015-03-03T03:00:00.000Z 17.0818803132421
2015-03-03T04:00:00.000Z 17.4055150242149
2015-03-03T05:00:00.000Z 16.9935154305639
2015-03-03T06:00:00.000Z 16.549814996426
2015-03-03T07:00:00.000Z 16.1926182248188
timestamp temperature
2015-03-20T07:00:00.000Z 17.1314918760911
2015-03-20T08:00:00.000Z 16.8933352525852
2015-03-20T09:00:00.000Z 16.5059224413289
2015-03-20T10:00:00.000Z 16.8319841992172
2015-03-20T11:00:00.000Z 16.7293681413502
2015-03-20T12:00:00.000Z 16.6085630440557
2015-03-20T13:00:00.000Z 16.5121606499577
2015-03-20T14:00:00.000Z 16.6938340493569
2015-03-20T15:00:00.000Z 17.8631358962877
2015-03-20T16:00:00.000Z 19.7691682740215
2015-03-20T17:00:00.000Z 20.514590162217
2015-03-20T18:00:00.000Z 21.6830080307185
2015-03-20T19:00:00.000Z 20.9170317633059
2015-03-20T20:00:00.000Z 23.5838930694458
2015-03-20T21:00:00.000Z 24.5004157047128
2015-03-20T22:00:00.000Z 23.0728888291688
2015-03-20T23:00:00.000Z 22.2708190476318
2015-03-21T00:00:00.000Z 21.3394373423804
2015-03-21T01:00:00.000Z 20.1010743049325
2015-03-21T02:00:00.000Z 18.4150717551479
2015-03-21T03:00:00.000Z 17.7483817583905
2015-03-21T04:00:00.000Z 17.6589726749868
2015-03-21T05:00:00.000Z 17.0922334804965
2015-03-21T06:00:00.000Z 17.9022626474071
timestamp temperature
2015-03-21T07:00:00.000Z 17.9134315019288
2015-03-21T08:00:00.000Z 17.9623415917395
2015-03-21T09:00:00.000Z 18.6299049947767
2015-03-21T10:00:00.000Z 18.7246461115231
2015-03-21T11:00:00.000Z 18.3452032121395
2015-03-21T12:00:00.000Z 17.9509405148159
2015-03-21T13:00:00.000Z 17.6459367384257
2015-03-21T14:00:00.000Z 18.0026108196051
2015-03-21T15:00:00.000Z 18.6413944821435
2015-03-21T16:00:00.000Z 19.3671431509997
2015-03-21T17:00:00.000Z 20.8082012083461
2015-03-21T18:00:00.000Z 22.5238576663828
2015-03-21T19:00:00.000Z 24.4214051463704
2015-03-21T20:00:00.000Z 26.2049693716955
2015-03-21T21:00:00.000Z 26.579802484894
2015-03-21T22:00:00.000Z 26.5525094442272
2015-03-21T23:00:00.000Z 23.9758724990251
2015-03-22T00:00:00.000Z 20.7705334007582
2015-03-22T01:00:00.000Z 19.5826361563267
2015-03-22T02:00:00.000Z 18.7265399946616
2015-03-22T03:00:00.000Z 18.2886029132647
2015-03-22T04:00:00.000Z 17.4904771411586
2015-03-22T05:00:00.000Z 17.1831430954037
2015-03-22T06:00:00.000Z 17.2898856656444
timestamp temperature
2015-03-22T07:00:00.000Z 17.8578100360021
2015-03-22T08:00:00.000Z 18.1992192220978
2015-03-22T09:00:00.000Z 18.13420905954
2015-03-22T10:00:00.000Z 18.5888149684944
2015-03-22T11:00:00.000Z 18.6733003026984
2015-03-22T12:00:00.000Z 19.1600833190036
2015-03-22T13:00:00.000Z 19.207095797011
2015-03-22T14:00:00.000Z 18.9847082241235
2015-03-22T15:00:00.000Z 19.4293802064908
2015-03-22T16:00:00.000Z 20.8493124700409
2015-03-22T17:00:00.000Z 21.5898145184046
2015-03-22T18:00:00.000Z 22.3397182467298
2015-03-22T19:00:00.000Z 22.7891858876349
2015-03-22T20:00:00.000Z 23.3412628564144
2015-03-22T21:00:00.000Z 23.4926420057589
2015-03-22T22:00:00.000Z 23.0962283240861
2015-03-22T23:00:00.000Z 22.2667502918227
2015-03-23T00:00:00.000Z 21.0266142557277
2015-03-23T01:00:00.000Z 20.0093349857605
2015-03-23T02:00:00.000Z 18.9851414732381
2015-03-23T03:00:00.000Z 18.5245615004214
2015-03-23T04:00:00.000Z 18.290694254732
2015-03-23T05:00:00.000Z 18.0595508666643
2015-03-23T06:00:00.000Z 18.4732789951039
timestamp temperature
2015-03-23T07:00:00.000Z 18.7258481532495
2015-03-23T08:00:00.000Z 18.5595128641976
2015-03-23T09:00:00.000Z 18.179674037842
2015-03-23T10:00:00.000Z 17.7681299392415
2015-03-23T11:00:00.000Z 17.443021321053
2015-03-23T12:00:00.000Z 17.3451205175492
2015-03-23T13:00:00.000Z 17.4374701133724
2015-03-23T14:00:00.000Z 17.8929191631296
2015-03-23T15:00:00.000Z 18.9122039984753
2015-03-23T16:00:00.000Z 19.6161969984469
2015-03-23T17:00:00.000Z 20.7299868156002
2015-03-23T18:00:00.000Z 21.7689130719553
2015-03-23T19:00:00.000Z 22.5533898355016
2015-03-23T20:00:00.000Z 22.8372668296634
2015-03-23T21:00:00.000Z 23.2014773800322
2015-03-23T22:00:00.000Z 22.5682062882985
2015-03-23T23:00:00.000Z 22.3205675513796
2015-03-24T00:00:00.000Z 20.8661118605035
2015-03-24T01:00:00.000Z 18.5360183512352
2015-03-24T02:00:00.000Z 17.5156724451801
2015-03-24T03:00:00.000Z 17.2066897483676
2015-03-24T04:00:00.000Z 17.1974604599623
2015-03-24T05:00:00.000Z 17.3377835934013
2015-03-24T06:00:00.000Z 17.28662295757
timestamp temperature
2015-03-24T07:00:00.000Z 17.4291104924263
2015-03-24T08:00:00.000Z 17.4228793012653
2015-03-24T09:00:00.000Z 17.4209561166271
2015-03-24T10:00:00.000Z 17.141757829703
2015-03-24T11:00:00.000Z 17.3048584589793
2015-03-24T12:00:00.000Z 17.337482794781
2015-03-24T13:00:00.000Z 17.7016509341158
2015-03-24T14:00:00.000Z 17.5637528905341
2015-03-24T15:00:00.000Z 18.8276163388499
2015-03-24T16:00:00.000Z 19.4404648699534
2015-03-24T17:00:00.000Z 20.5646049670802
2015-03-24T18:00:00.000Z 21.9525507884113
2015-03-24T19:00:00.000Z 21.9040221846194
2015-03-24T20:00:00.000Z 22.8197541616282
2015-03-24T21:00:00.000Z 22.2390831913042
2015-03-24T22:00:00.000Z 22.4688244906963
2015-03-24T23:00:00.000Z 21.9461828791739
2015-03-25T00:00:00.000Z 21.3218883084538
2015-03-25T01:00:00.000Z 19.9688738415096
2015-03-25T02:00:00.000Z 18.9409031033049
2015-03-25T03:00:00.000Z 18.1829931467353
2015-03-25T04:00:00.000Z 17.6071132686007
2015-03-25T05:00:00.000Z 17.4155712472229
2015-03-25T06:00:00.000Z 17.8112238813252
timestamp temperature
2015-03-25T07:00:00.000Z 18.0118371454174
2015-03-25T08:00:00.000Z 17.9925110740977
2015-03-25T09:00:00.000Z 17.9146107460869
2015-03-25T10:00:00.000Z 17.6354297651737
2015-03-25T11:00:00.000Z 17.2990959392658
2015-03-25T12:00:00.000Z 16.8942534144482
2015-03-25T13:00:00.000Z 17.0215911252788
2015-03-25T14:00:00.000Z 17.5370547200027
2015-03-25T15:00:00.000Z 19.6239569219906
2015-03-25T16:00:00.000Z 21.4284862546897
2015-03-25T17:00:00.000Z 22.5971622932944
2015-03-25T18:00:00.000Z 24.4516364021043
2015-03-25T19:00:00.000Z 26.314179825294
2015-03-25T20:00:00.000Z 27.2966725797272
2015-03-25T21:00:00.000Z 27.8594008881709
2015-03-25T22:00:00.000Z 26.98771523591
2015-03-25T23:00:00.000Z 26.1419652896808
2015-03-26T00:00:00.000Z 24.2967135065912
2015-03-26T01:00:00.000Z 21.2627783997077
2015-03-26T02:00:00.000Z 19.6223366524463
2015-03-26T03:00:00.000Z 18.9702936572059
2015-03-26T04:00:00.000Z 18.64173108115
2015-03-26T05:00:00.000Z 18.5430028446263
2015-03-26T06:00:00.000Z 18.2597209484404
timestamp temperature
2015-03-26T07:00:00.000Z 17.8251835175158
2015-03-26T08:00:00.000Z 17.4726877440558
2015-03-26T09:00:00.000Z 17.651946077925
2015-03-26T10:00:00.000Z 17.7491791888976
2015-03-26T11:00:00.000Z 17.5917881825657
2015-03-26T12:00:00.000Z 17.5239416379086
2015-03-26T13:00:00.000Z 17.5307201091079
2015-03-26T14:00:00.000Z 18.2489964460844
2015-03-26T15:00:00.000Z 20.2797517883074
2015-03-26T16:00:00.000Z 21.888709612845
2015-03-26T17:00:00.000Z 23.8693783046019
2015-03-26T18:00:00.000Z 25.6434924437705
2015-03-26T19:00:00.000Z 27.3338701714523
2015-03-26T20:00:00.000Z 30.235307632747
2015-03-26T21:00:00.000Z 31.6784014189275
2015-03-26T22:00:00.000Z 32.4243323492878
2015-03-26T23:00:00.000Z 33.1688980688728
2015-03-27T00:00:00.000Z 30.8713221141196
2015-03-27T01:00:00.000Z 26.8944097638179
2015-03-27T02:00:00.000Z 24.6128150483182
2015-03-27T03:00:00.000Z 22.889746429207
2015-03-27T04:00:00.000Z 21.7148736202902
2015-03-27T05:00:00.000Z 20.8438711038614
2015-03-27T06:00:00.000Z 19.2559699722154
timestamp temperature
2015-03-03T08:00:00.000Z 15.8164108325192
2015-03-03T09:00:00.000Z 15.6006519517566
2015-03-03T10:00:00.000Z 15.2512504746343
2015-03-03T11:00:00.000Z 14.8825820863926
2015-03-03T12:00:00.000Z 14.5792390743861
2015-03-03T13:00:00.000Z 14.4531364952958
2015-03-03T14:00:00.000Z 14.2979079398932
2015-03-03T15:00:00.000Z 15.6116212651817
2015-03-03T16:00:00.000Z 17.4525126589609
2015-03-03T17:00:00.000Z 18.4387970939595
2015-03-03T18:00:00.000Z 19.2419355908777
2015-03-03T19:00:00.000Z 21.0845921991081
2015-03-03T20:00:00.000Z 23.0731268020424
2015-03-03T21:00:00.000Z 24.6006210865458
2015-03-03T22:00:00.000Z 22.793526722969
2015-03-03T23:00:00.000Z 22.1192522313764
2015-03-04T00:00:00.000Z 20.4821553682668
2015-03-04T01:00:00.000Z 18.1927991788509
2015-03-04T02:00:00.000Z 16.7379815021445
2015-03-04T03:00:00.000Z 16.0165981710226
2015-03-04T04:00:00.000Z 16.10841838902
2015-03-04T05:00:00.000Z 16.4950916170528
2015-03-04T06:00:00.000Z 16.3099199853055
2015-03-04T07:00:00.000Z 15.9302715307446
timestamp temperature
2015-03-04T08:00:00.000Z 15.591901928502
2015-03-04T09:00:00.000Z 15.4194805034694
2015-03-04T10:00:00.000Z 15.1425671392641
2015-03-04T11:00:00.000Z 14.866808810103
2015-03-04T12:00:00.000Z 14.4852882089823
2015-03-04T13:00:00.000Z 14.2747749110722
2015-03-04T14:00:00.000Z 14.1235527620636
2015-03-04T15:00:00.000Z 15.5181564181389
2015-03-04T16:00:00.000Z 17.3575118711611
2015-03-04T17:00:00.000Z 18.6808537653965
2015-03-04T18:00:00.000Z 20.0311334750674
2015-03-04T19:00:00.000Z 22.0684348201986
2015-03-04T20:00:00.000Z 24.0431835249891
2015-03-04T21:00:00.000Z 25.7191585393307
2015-03-04T22:00:00.000Z 25.5403728629178
2015-03-04T23:00:00.000Z 25.3663043853651
2015-03-05T00:00:00.000Z 23.8845325849076
2015-03-05T01:00:00.000Z 21.2433289534299
2015-03-05T02:00:00.000Z 19.9308521974357
2015-03-05T03:00:00.000Z 19.5383930853512
2015-03-05T04:00:00.000Z 19.0915684782262
2015-03-05T05:00:00.000Z 18.3406177853686
2015-03-05T06:00:00.000Z 17.872955959366
2015-03-05T07:00:00.000Z 17.3884274213562
timestamp temperature
2015-03-05T08:00:00.000Z 16.9777821685879
2015-03-05T09:00:00.000Z 16.3609213573474
2015-03-05T10:00:00.000Z 15.9186261229673
2015-03-05T11:00:00.000Z 15.5986362410863
2015-03-05T12:00:00.000Z 15.2315146927348
2015-03-05T13:00:00.000Z 14.8973669819262
2015-03-05T14:00:00.000Z 14.5594303318591
2015-03-05T15:00:00.000Z 16.1333685077821
2015-03-05T16:00:00.000Z 17.9918738434968
2015-03-05T17:00:00.000Z 19.5907211523546
2015-03-05T18:00:00.000Z 21.0319060593634
2015-03-05T19:00:00.000Z 22.8718691946946
2015-03-05T20:00:00.000Z 25.2698778177384
2015-03-05T21:00:00.000Z 27.4879630066274
2015-03-05T22:00:00.000Z 28.236089043276
2015-03-05T23:00:00.000Z 27.5451116873313
2015-03-06T00:00:00.000Z 25.3638538087909
2015-03-06T01:00:00.000Z 23.3156242889062
2015-03-06T02:00:00.000Z 22.2530735359037
2015-03-06T03:00:00.000Z 21.0735357152997
2015-03-06T04:00:00.000Z 20.3517505042614
2015-03-06T05:00:00.000Z 19.8196686792725
2015-03-06T06:00:00.000Z 19.0925148377368
2015-03-06T07:00:00.000Z 18.2985664508575
timestamp temperature
2015-03-06T08:00:00.000Z 17.8508364807198
2015-03-06T09:00:00.000Z 17.4000169691931
2015-03-06T10:00:00.000Z 16.7319133015076
2015-03-06T11:00:00.000Z 16.1631827865457
2015-03-06T12:00:00.000Z 15.5934572723281
2015-03-06T13:00:00.000Z 15.211450971604
2015-03-06T14:00:00.000Z 15.0689414171358
2015-03-06T15:00:00.000Z 16.367470205329
2015-03-06T16:00:00.000Z 17.9629893475741
2015-03-06T17:00:00.000Z 19.5078627370754
2015-03-06T18:00:00.000Z 20.641901474649
2015-03-06T19:00:00.000Z 22.7472613222865
2015-03-06T20:00:00.000Z 25.4163233167501
2015-03-06T21:00:00.000Z 27.6832654973216
2015-03-06T22:00:00.000Z 27.4735022788294
2015-03-06T23:00:00.000Z 26.459900913493
2015-03-07T00:00:00.000Z 24.3440925577429
2015-03-07T01:00:00.000Z 21.9714532612337
2015-03-07T02:00:00.000Z 20.6843435539527
2015-03-07T03:00:00.000Z 20.2064576437821
2015-03-07T04:00:00.000Z 19.4443994675515
2015-03-07T05:00:00.000Z 18.5584287500151
2015-03-07T06:00:00.000Z 18.0770702207092
2015-03-07T07:00:00.000Z 17.7269477269236
timestamp temperature
2015-03-07T08:00:00.000Z 17.4777291909682
2015-03-07T09:00:00.000Z 17.0660976814364
2015-03-07T10:00:00.000Z 16.7217782571606
2015-03-07T11:00:00.000Z 16.4912172496744
2015-03-07T12:00:00.000Z 16.2362219421031
2015-03-07T13:00:00.000Z 16.0226068853317
2015-03-07T14:00:00.000Z 15.8818548022269
2015-03-07T15:00:00.000Z 17.3695114343758
2015-03-07T16:00:00.000Z 19.131189464469
2015-03-07T17:00:00.000Z 20.3998175623273
2015-03-07T18:00:00.000Z 21.9057543734203
2015-03-07T19:00:00.000Z 24.4315417181129
2015-03-07T20:00:00.000Z 27.0729386531602
2015-03-07T21:00:00.000Z 29.5857988437378
2015-03-07T22:00:00.000Z 30.3270177173873
2015-03-07T23:00:00.000Z 28.7560276759256
2015-03-08T00:00:00.000Z 25.5945901627476
2015-03-08T01:00:00.000Z 22.9431314131971
2015-03-08T02:00:00.000Z 21.0894430654425
2015-03-08T03:00:00.000Z 19.6866981768003
2015-03-08T04:00:00.000Z 18.5179917717446
2015-03-08T05:00:00.000Z 17.172730211594
2015-03-08T06:00:00.000Z 16.1494390323739
2015-03-08T07:00:00.000Z 15.3636214231608
timestamp temperature
2015-03-08T08:00:00.000Z 15.0966403590285
2015-03-08T09:00:00.000Z 15.0685375227995
2015-03-08T10:00:00.000Z 15.1371093940595
2015-03-08T11:00:00.000Z 15.2574305858538
2015-03-08T12:00:00.000Z 15.1529747721326
2015-03-08T13:00:00.000Z 14.9072839936425
2015-03-08T14:00:00.000Z 14.5567903260347
2015-03-08T15:00:00.000Z 15.4551514745846
2015-03-08T16:00:00.000Z 16.6441017710975
2015-03-08T17:00:00.000Z 17.9853462015078
2015-03-08T18:00:00.000Z 19.7258663035219
2015-03-08T19:00:00.000Z 21.2725360495976
2015-03-08T20:00:00.000Z 23.3875446860424
2015-03-08T21:00:00.000Z 25.0619478732697
2015-03-08T22:00:00.000Z 23.9360559437048
2015-03-08T23:00:00.000Z 23.9152919195486
2015-03-09T00:00:00.000Z 20.8123200546977
2015-03-09T01:00:00.000Z 18.0474901485824
2015-03-09T02:00:00.000Z 17.1134828398268
2015-03-09T03:00:00.000Z 16.077258392941
2015-03-09T04:00:00.000Z 15.458690098222
2015-03-09T05:00:00.000Z 15.2320830109437
2015-03-09T06:00:00.000Z 15.2381518285877
timestamp temperature
2015-03-09T07:00:00.000Z 15.2045428472596
2015-03-09T08:00:00.000Z 15.0508816671528
2015-03-09T09:00:00.000Z 15.1246584331197
2015-03-09T10:00:00.000Z 15.2543979073507
2015-03-09T11:00:00.000Z 15.4207103216155
2015-03-09T12:00:00.000Z 15.7611427930469
2015-03-09T13:00:00.000Z 15.803712717622
2015-03-09T14:00:00.000Z 15.9469050550703
2015-03-09T15:00:00.000Z 16.4880120921732
2015-03-09T16:00:00.000Z 17.1201721748713
2015-03-09T17:00:00.000Z 18.5671700591127
2015-03-09T18:00:00.000Z 19.6926504282452
2015-03-09T19:00:00.000Z 21.6833683499974
2015-03-09T20:00:00.000Z 21.5045045570597
2015-03-09T21:00:00.000Z 24.5261962838651
2015-03-09T22:00:00.000Z 24.6272401186778
2015-03-09T23:00:00.000Z 23.3112980298967
2015-03-10T00:00:00.000Z 20.9054585824794
2015-03-10T01:00:00.000Z 17.9374436855441
2015-03-10T02:00:00.000Z 16.6773892980838
2015-03-10T03:00:00.000Z 15.8224087155663
2015-03-10T04:00:00.000Z 15.4260659644662
2015-03-10T05:00:00.000Z 15.6326965139937
2015-03-10T06:00:00.000Z 15.5827135344776
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>D3 Example</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Poiret+One' rel='stylesheet' type='text/css'>
<style>
.chart-line {
fill: none;
stroke: black;
stroke-width: 1px;
}
.axis text {
font-family: 'Poiret One', cursive;
font-size: 12pt;
}
.axis .label {
font-size: 22pt;
}
.axis path, .axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
</style>
</head>
<body>
<script>
var outerWidth = 960;
var outerHeight = 500;
var margin = { left: 70, top: 5, right: 5, bottom: 60 };
var xColumn = "timestamp";
var yColumn = "temperature";
var xAxisLabelText = "Time";
var xAxisLabelOffset = 48;
var yAxisLabelText = "Temperature °C";
var yAxisLabelOffset = 40;
var innerWidth = outerWidth - margin.left - margin.right;
var innerHeight = outerHeight - margin.top - margin.bottom;
var svg = d3.select("body").append("svg")
.attr("width", outerWidth)
.attr("height", outerHeight);
var g = svg.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var path = g.append("path")
.attr("class", "chart-line");
var xAxisG = g.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + innerHeight + ")")
var xAxisLabel = xAxisG.append("text")
.style("text-anchor", "middle")
.attr("transform", "translate(" + (innerWidth / 2) + "," + xAxisLabelOffset + ")")
.attr("class", "label")
.text(xAxisLabelText);
var yAxisG = g.append("g")
.attr("class", "y axis");
var yAxisLabel = yAxisG.append("text")
.style("text-anchor", "middle")
.attr("transform", "translate(-" + yAxisLabelOffset + "," + (innerHeight / 2) + ") rotate(-90)")
.attr("class", "label")
.text(yAxisLabelText);
var xScale = d3.time.scale().range([0, innerWidth]);
var yScale = d3.scale.linear().range([innerHeight, 0]);
var xAxis = d3.svg.axis().scale(xScale).orient("bottom")
.ticks(5)
.outerTickSize(0);
var yAxis = d3.svg.axis().scale(yScale).orient("left")
.ticks(5)
.tickFormat(d3.format("s"))
.outerTickSize(0);
var line = d3.svg.line()
.x(function(d) { return xScale(d[xColumn]); })
.y(function(d) { return yScale(d[yColumn]); });
function render(data){
xScale.domain(d3.extent(data, function (d){ return d[xColumn]; }));
yScale.domain(d3.extent(data, function (d){ return d[yColumn]; }));
xAxisG.call(xAxis);
yAxisG.call(yAxis);
path.attr("d", line(data));
}
function type(d){
d.timestamp = new Date(d.timestamp);
d.temperature = +d.temperature;
return d;
}
function loadFilesOneByOne(files){
var data = [];
function loadIndividualFile(i){
if(i < files.length){
d3.csv(files[i], type, function (newData){
data = data.concat(newData);
render(data);
loadIndividualFile(i + 1);
});
}
}
loadIndividualFile(0);
}
loadFilesOneByOne(d3.range(1, 25).map(function (day){
return "day" + day + ".csv";
}));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment