Skip to content

Instantly share code, notes, and snippets.

@samuelleach
Created May 17, 2013 10:47
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 samuelleach/5598366 to your computer and use it in GitHub Desktop.
Save samuelleach/5598366 to your computer and use it in GitHub Desktop.
crossfilter test
{"description":"crossfilter test","endpoint":"","display":"svg","public":true,"require":[{"name":"crossfilter","url":"https://raw.github.com/square/crossfilter/master/crossfilter.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
[
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "Borough",
"startTime" : "2013-03-25T06:00:00Z",
"location" : "Hammersmith Broadway",
"comments" : "A315 Hammersmith Gyratory (Eastbound) at the junction with A219 Shepherds Bush Road - One (of four) lanes is restricted on the north side of the gyratory.",
"currentUpdate" : "Lane one (of four) is closed at the junction with Shepherds Bush Road. Traffic is flowing well past the restriction.",
"remarkTime" : "2013-05-15T13:38:12Z",
"lastModTime" : "2013-05-15T13:38:12Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "523335,178587",
"coordinatesLL" : "-.224831,51.492714"
}
},
"Streets" : {
"Street" : {
"name" : "Hammersmith Broadway",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030323023",
"Line" : {
"coordinatesEN" : "523356,178614,523335,178587",
"coordinatesLL" : "-.224519,51.492952,-.224831,51.492714"
}
}
}
}
},
"id" : "991"
},
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "Utility",
"startTime" : "2013-05-13T07:00:00Z",
"endTime" : "2013-07-10T18:00:00Z",
"location" : "Commercial Road (Tower Hamlets)",
"corridor" : "A13",
"comments" : "A13 Commercial Road (Westbound) at the junction of Hessel Street. Lane one closed to facilitate BT works.",
"currentUpdate" : "Lane restriction in place. Traffic flowing well on approach.",
"remarkTime" : "2013-05-15T14:02:40Z",
"lastModTime" : "2013-05-15T14:02:40Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "534561,181317",
"coordinatesLL" : "-.062162,51.514689"
}
},
"Streets" : {
"Street" : [
{
"name" : "Commercial Road",
"closure" : "Open",
"directions" : "West Bound",
"Link" : [
{
"toid" : "4000000030345993",
"Line" : {
"coordinatesEN" : "534504.254,181318.847,534550,181317",
"coordinatesLL" : "-.062979,51.514719,-.062321,51.514691"
}
},
{
"toid" : "4000000030345994",
"Line" : {
"coordinatesEN" : "534550,181317,534580,181316",
"coordinatesLL" : "-.062321,51.514691,-.061889,51.514675"
}
},
{
"toid" : "4000000030345995",
"Line" : {
"coordinatesEN" : "534580,181316,534631,181316",
"coordinatesLL" : "-.061889,51.514675,-.061155,51.514663"
}
}
]
},
{
"name" : "New Road",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030346005",
"Line" : {
"coordinatesEN" : "534580,181316,534571,181365",
"coordinatesLL" : "-.061889,51.514675,-.062,51.515118"
}
}
},
{
"name" : "Cannon Street Road",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030240681",
"Line" : {
"coordinatesEN" : "534595,181233,534580,181316",
"coordinatesLL" : "-.061705,51.513926,-.061889,51.514675"
}
}
},
{
"name" : "Hessel Street",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030240703",
"Line" : {
"coordinatesEN" : "534550,181317,534544,181241",
"coordinatesLL" : "-.062321,51.514691,-.062436,51.51401"
}
}
}
]
}
},
"id" : "4740"
},
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "TfL",
"startTime" : "2013-05-14T08:00:00Z",
"endTime" : "2013-07-22T15:00:00Z",
"location" : "Mitchell Way (Bromley)",
"comments" : "Mitchell Way (All Directions) at the junction of Northside Road - Various restrictions in place to facilitate the major reconstruction of Bromley North Bus Stand.",
"currentUpdate" : "Traffic is currently flowing well in the area.",
"remarkTime" : "2013-05-15T14:01:57Z",
"lastModTime" : "2013-05-15T14:01:57Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "540324,169663",
"coordinatesLL" : ".01622,51.408552"
}
},
"Streets" : {
"Street" : [
{
"name" : "Mitchell Way",
"closure" : "Open",
"directions" : "All Directions",
"Link" : [
{
"toid" : "4000000030338637",
"Line" : {
"coordinatesEN" : "540303,169672,540328,169659",
"coordinatesLL" : ".015922,51.408638,.016276,51.408515"
}
},
{
"toid" : "4000000030416043",
"Line" : {
"coordinatesEN" : "540328,169659,540321.861,169642.275",
"coordinatesLL" : ".016276,51.408515,.016181,51.408367"
}
},
{
"toid" : "4000000030338645",
"Line" : {
"coordinatesEN" : "540279,169637,540303,169672",
"coordinatesLL" : ".015563,51.40833,.015922,51.408638"
}
},
{
"toid" : "4000000030416042",
"Line" : {
"coordinatesEN" : "540321.861,169642.275,540309,169619",
"coordinatesLL" : ".016181,51.408367,.015987,51.408161"
}
}
]
},
{
"name" : "Northside Road",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030233615",
"Line" : {
"coordinatesEN" : "540328,169659,540382.524,169694.659",
"coordinatesLL" : ".016276,51.408515,.017073,51.408822"
}
}
}
]
}
},
"id" : "4854"
},
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "Emergency",
"startTime" : "2013-05-14T22:28:00Z",
"location" : "Archway Road (Haringey)",
"corridor" : "A1",
"comments" : "Archway Road (Southbound) at the junction of Southwood Avenue - Thames Water emergency works. Contra flow in operation.",
"currentUpdate" : "Due to works in southbound carriageway a contra flow is in operation. Northbound traffic to use the bus lane. Traffic is flowing well.",
"remarkTime" : "2013-05-15T13:45:52Z",
"lastModTime" : "2013-05-15T13:45:52Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "528732.428,187993.04",
"coordinatesLL" : "-.143679,51.576049"
}
},
"Streets" : {
"Street" : [
{
"name" : "Archway Road",
"closure" : "Open",
"directions" : "South Bound",
"Link" : [
{
"toid" : "4000000030357554",
"Line" : {
"coordinatesEN" : "528723.242,188003.574,528766,187949",
"coordinatesLL" : "-.143807,51.576146,-.143211,51.575646"
}
},
{
"toid" : "4000000030357553",
"Line" : {
"coordinatesEN" : "528803,187893,528766,187949",
"coordinatesLL" : "-.142697,51.575134,-.143211,51.575646"
}
},
{
"toid" : "4000000030252986",
"Line" : {
"coordinatesEN" : "528664,188043,528723.242,188003.574",
"coordinatesLL" : "-.144647,51.576514,-.143807,51.576146"
}
}
]
},
{
"name" : "Southwood Avenue",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030253003",
"Line" : {
"coordinatesEN" : "528686,187896,528766,187949",
"coordinatesLL" : "-.144384,51.575188,-.143211,51.575646"
}
}
}
]
}
},
"id" : "5529"
},
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "Utility",
"startTime" : "2013-05-15T07:00:00Z",
"location" : "Balham High Road (Wandsworth)",
"corridor" : "A24",
"comments" : "Balham High Road (Both Directions) at the junction of Ramsden Road. Temporary signals in operation to facilitate road works.",
"currentUpdate" : "Expect delays when temporary traffic lights are in use.",
"remarkTime" : "2013-05-15T13:51:34Z",
"lastModTime" : "2013-05-15T13:51:34Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "528521,173326",
"coordinatesLL" : "-.152076,51.444273"
}
},
"Streets" : {
"Street" : [
{
"name" : "Balham High Road",
"closure" : "Open",
"directions" : "Both Directions",
"Link" : [
{
"toid" : "4000000030235046",
"Line" : {
"coordinatesEN" : "528470,173226,528539.117,173361.435",
"coordinatesLL" : "-.152845,51.443386,-.151802,51.444588"
}
},
{
"toid" : "4000000031142138",
"Line" : {
"coordinatesEN" : "528539.117,173361.435,528570,173417",
"coordinatesLL" : "-.151802,51.444588,-.151338,51.44508"
}
}
]
},
{
"name" : "Hildreth Street",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030235054",
"Line" : {
"coordinatesEN" : "528573.374,173349.453,528618,173331",
"coordinatesLL" : "-.151314,51.444472,-.150679,51.444296"
}
}
},
{
"name" : "Old Dairy Mews",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030235063",
"Line" : {
"coordinatesEN" : "528459.467,173310.72,528396,173325",
"coordinatesLL" : "-.152966,51.44415,-.153874,51.444293"
}
}
},
{
"name" : "Ramsden Road",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000031165564",
"Line" : {
"coordinatesEN" : "528454,173537,528539.117,173361.435",
"coordinatesLL" : "-.152963,51.446185,-.151802,51.444588"
}
}
}
]
}
},
"id" : "5506"
},
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "TfL",
"startTime" : "2013-05-14T08:30:00Z",
"endTime" : "2013-05-17T14:30:00Z",
"location" : "Eastern Avenue (Redbridge)",
"corridor" : "A12",
"comments" : "Eastern Avenue (Westbound) at the junction of Kingfisher Avenue - Restrictions on the slip road (Kingfisher Avenue) at the George Green Tunnel to facilitate works.",
"currentUpdate" : "Traffic is flowing well.",
"remarkTime" : "2013-05-15T14:03:26Z",
"lastModTime" : "2013-05-15T14:03:26Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "540978,188374",
"coordinatesLL" : ".033093,51.576543"
}
},
"Streets" : {
"Street" : [
{
"name" : "Eastern Avenue",
"closure" : "Open",
"directions" : "East Bound",
"Link" : [
{
"toid" : "4000000030361477",
"Line" : {
"coordinatesEN" : "540704,188306,540680,188294",
"coordinatesLL" : ".029114,51.576001,.028763,51.575899"
}
},
{
"toid" : "4000000030361473",
"Line" : {
"coordinatesEN" : "540680,188294,540635,188263",
"coordinatesLL" : ".028763,51.575899,.028101,51.575631"
}
},
{
"toid" : "4000000031026427",
"Line" : {
"coordinatesEN" : "540719.804,188300.128,540709.259,188295.221",
"coordinatesLL" : ".029339,51.575944,.029185,51.575902"
}
},
{
"toid" : "4000000030156953",
"Line" : {
"coordinatesEN" : "540978,188374,540719.804,188300.128",
"coordinatesLL" : ".033093,51.576543,.029339,51.575944"
}
},
{
"toid" : "4000000030464137",
"Line" : {
"coordinatesEN" : "540704,188306,541039,188418",
"coordinatesLL" : ".029114,51.576001,.03399,51.576923"
}
},
{
"toid" : "4000000030102715",
"Line" : {
"coordinatesEN" : "541445.375,188331.367,540978,188374",
"coordinatesLL" : ".039817,51.576043,.033093,51.576543"
}
},
{
"toid" : "4000000030257686",
"Line" : {
"coordinatesEN" : "540709.259,188295.221,540633.625,188248.867",
"coordinatesLL" : ".029185,51.575902,.028076,51.575505"
}
},
{
"toid" : "4000000030156955",
"Line" : {
"coordinatesEN" : "541161,188462,541039,188418",
"coordinatesLL" : ".035768,51.577288,.03399,51.576923"
}
}
]
},
{
"name" : "Kingfisher Avenue",
"closure" : "Open",
"directions" : "All Directions",
"Link" : [
{
"toid" : "4000000030428434",
"Line" : {
"coordinatesEN" : "540699.345,188312.69,540678.355,188300.355",
"coordinatesLL" : ".029049,51.576062,.028742,51.575956"
}
},
{
"toid" : "4000000030476858",
"Line" : {
"coordinatesEN" : "540705.214,188301.455,540704,188306",
"coordinatesLL" : ".029129,51.575959,.029114,51.576001"
}
},
{
"toid" : "4000000030257853",
"Line" : {
"coordinatesEN" : "541039,188418,540936,188387",
"coordinatesLL" : ".03399,51.576923,.032492,51.576671"
}
},
{
"toid" : "4000000030361474",
"Line" : {
"coordinatesEN" : "540678.355,188300.355,540635,188263",
"coordinatesLL" : ".028742,51.575956,.028101,51.575631"
}
},
{
"toid" : "4000000030156954",
"Line" : {
"coordinatesEN" : "540936,188387,540819,188357",
"coordinatesLL" : ".032492,51.576671,.030793,51.57643"
}
},
{
"toid" : "4000000031026432",
"Line" : {
"coordinatesEN" : "540703,188296,540705.214,188301.455",
"coordinatesLL" : ".029095,51.575911,.029129,51.575959"
}
},
{
"toid" : "4000000030476859",
"Line" : {
"coordinatesEN" : "540704,188306,540699.345,188312.69",
"coordinatesLL" : ".029114,51.576001,.029049,51.576062"
}
},
{
"toid" : "4000000030257683",
"Line" : {
"coordinatesEN" : "540819,188357,540699.345,188312.69",
"coordinatesLL" : ".030793,51.57643,.029049,51.576062"
}
}
]
},
{
"name" : "Wigram Road",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030257861",
"Line" : {
"coordinatesEN" : "540988.917,188357.979,541062,188327",
"coordinatesLL" : ".033244,51.576397,.034285,51.5761"
}
}
}
]
}
},
"id" : "5417"
},
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "Utility",
"startTime" : "2013-04-06T04:00:00Z",
"endTime" : "2013-05-30T04:00:00Z",
"location" : "Buckingham Palace Road (Westminster)",
"corridor" : "Inner Ring",
"comments" : "A3214 Buckingham Palace Road (Southbound) at the junction of Eccleston Bridge - Various lane restrictions in place to facilitate telecoms works.",
"currentUpdate" : "A3214 Buckingham Palace Road remains reduced to one lane southbound, and lane one (of three) is closed on Eccleston Bridge approaching the junction. In addition, traffic on Eccleston Bridge cannot turn left into Buckingham Palace Road. Traffic is moderate on approach to the restrictions at present. Drivers are advised that delays are possible throughout the day.",
"remarkTime" : "2013-05-15T13:12:01Z",
"lastModTime" : "2013-05-15T13:12:01Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "528752.65,178889.15",
"coordinatesLL" : "-.146717,51.494222"
}
},
"Streets" : {
"Street" : [
{
"name" : "Buckingham Palace Road",
"closure" : "Open",
"directions" : "South Bound",
"Link" : [
{
"toid" : "4000000030146963",
"Line" : {
"coordinatesEN" : "528746.5,178872.8,528805.85,179007.8",
"coordinatesLL" : "-.146811,51.494076,-.145908,51.495276"
}
},
{
"toid" : "4000000030993386",
"Line" : {
"coordinatesEN" : "528743.2,178846.25,528746.5,178872.8",
"coordinatesLL" : "-.146869,51.493838,-.146811,51.494076"
}
},
{
"toid" : "4000000030146884",
"Line" : {
"coordinatesEN" : "528758,178868,528743.2,178846.25",
"coordinatesLL" : "-.146647,51.49403,-.146869,51.493838"
}
},
{
"toid" : "4000000030146883",
"Line" : {
"coordinatesEN" : "528688.6,178710.5,528743.2,178846.25",
"coordinatesLL" : "-.147704,51.49263,-.146869,51.493838"
}
},
{
"toid" : "4000000030479519",
"Line" : {
"coordinatesEN" : "528853.126,179100.046,528758,178868",
"coordinatesLL" : "-.145193,51.496094,-.146647,51.49403"
}
}
]
},
{
"name" : "Eccleston Street",
"closure" : "Open",
"directions" : "All Directions",
"Link" : [
{
"toid" : "4000000030342246",
"Line" : {
"coordinatesEN" : "528705,178892,528746.5,178872.8",
"coordinatesLL" : "-.147402,51.494258,-.146811,51.494076"
}
},
{
"toid" : "4000000030458777",
"Line" : {
"coordinatesEN" : "528746.5,178872.8,528758,178868",
"coordinatesLL" : "-.146811,51.494076,-.146647,51.49403"
}
}
]
},
{
"name" : "Belgrave Road",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030237665",
"Line" : {
"coordinatesEN" : "528758,178868,528836,178832",
"coordinatesLL" : "-.146647,51.49403,-.145538,51.493689"
}
}
}
]
}
},
"id" : "1428"
},
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "Surface Damage",
"startTime" : "2013-05-15T09:34:00Z",
"location" : "High Road (Brent)",
"comments" : "High Road (Westbound) at the junction of Cecil Avenue - There is a large pothole in the carriageway. Approach with care.",
"currentUpdate" : "There is a large pothole in the carriageway. Approach with care.",
"remarkTime" : "2013-05-15T13:39:06Z",
"lastModTime" : "2013-05-15T13:39:06Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "518604,185248",
"coordinatesLL" : "-.29071,51.553598"
}
},
"Streets" : {
"Street" : [
{
"name" : "High Road",
"closure" : "Open",
"directions" : "West Bound",
"Link" : [
{
"toid" : "4000000030138337",
"Line" : {
"coordinatesEN" : "518435.628,185250.186,518581,185243",
"coordinatesLL" : "-.293137,51.553653,-.291043,51.553558"
}
},
{
"toid" : "4000000030138349",
"Line" : {
"coordinatesEN" : "518581,185243,518718,185251",
"coordinatesLL" : "-.291043,51.553558,-.289065,51.553601"
}
}
]
},
{
"name" : "Cecil Avenue",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030222146",
"Line" : {
"coordinatesEN" : "518581,185243,518586,185172",
"coordinatesLL" : "-.291043,51.553558,-.290995,51.552919"
}
}
}
]
}
},
"id" : "5566"
},
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "Collision",
"startTime" : "2013-05-15T13:55:00Z",
"location" : "Elephant And Castle (Southwark)",
"corridor" : "Inner Ring",
"comments" : "Elephant And Castle (All Directions) at the junction of Newington Butts - Reports of a collision at this location",
"currentUpdate" : "Traffic is flowing well in the area.",
"remarkTime" : "2013-05-15T13:56:07Z",
"lastModTime" : "2013-05-15T14:05:00Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "531958.864,178934.073",
"coordinatesLL" : "-.100537,51.493886"
}
},
"Streets" : {
"Street" : [
{
"name" : "Elephant And Castle",
"closure" : "Open",
"directions" : "All Directions",
"Link" : [
{
"toid" : "5000005101111293",
"Line" : {
"coordinatesEN" : "531945.539,178872.567,531939,179026",
"coordinatesLL" : "-.100751,51.493336,-.100788,51.494717"
}
},
{
"toid" : "5000005101111292",
"Line" : {
"coordinatesEN" : "531967.868,178881.198,531953,179022",
"coordinatesLL" : "-.100427,51.493409,-.100588,51.494678"
}
}
]
},
{
"name" : "Newington Butts",
"closure" : "Open",
"directions" : "All Directions",
"Link" : [
{
"toid" : "4000000031040028",
"Line" : {
"coordinatesEN" : "531889.174,178764.076,531827.982,178697.653",
"coordinatesLL" : "-.101603,51.492374,-.102509,51.491792"
}
},
{
"toid" : "5000005101111289",
"Line" : {
"coordinatesEN" : "531967.868,178881.198,531966.267,178857.232",
"coordinatesLL" : "-.100427,51.493409,-.100459,51.493194"
}
},
{
"toid" : "4000000030238100",
"Line" : {
"coordinatesEN" : "531798,178639,531889.174,178764.076",
"coordinatesLL" : "-.102963,51.491271,-.101603,51.492374"
}
},
{
"toid" : "5000005101111290",
"Line" : {
"coordinatesEN" : "531966.267,178857.232,531938.914,178827.113",
"coordinatesLL" : "-.100459,51.493194,-.100864,51.492929"
}
},
{
"toid" : "4000000030458929",
"Line" : {
"coordinatesEN" : "531827.982,178697.653,531816.996,178683.096",
"coordinatesLL" : "-.102509,51.491792,-.102673,51.491663"
}
},
{
"toid" : "4000000030238193",
"Line" : {
"coordinatesEN" : "531938.914,178827.113,531889.174,178764.076",
"coordinatesLL" : "-.100864,51.492929,-.101603,51.492374"
}
},
{
"toid" : "5000005101111288",
"Line" : {
"coordinatesEN" : "531945.539,178872.567,531938.914,178827.113",
"coordinatesLL" : "-.100751,51.493336,-.100864,51.492929"
}
}
]
},
{
"name" : "Dante Road",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030418213",
"Line" : {
"coordinatesEN" : "531827.982,178697.653,531799,178721",
"coordinatesLL" : "-.102509,51.491792,-.102918,51.492008"
}
}
},
{
"name" : "Hampton Street",
"closure" : "Open",
"directions" : "All Directions",
"Link" : [
{
"toid" : "4000000030418283",
"Line" : {
"coordinatesEN" : "531920,178704,531938,178677",
"coordinatesLL" : "-.101182,51.491827,-.100933,51.49158"
}
},
{
"toid" : "4000000030342858",
"Line" : {
"coordinatesEN" : "531888.842,178716.424,531920,178704",
"coordinatesLL" : "-.101626,51.491946,-.101182,51.491827"
}
}
]
},
{
"name" : "Kennington Lane",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030418210",
"Line" : {
"coordinatesEN" : "531816.996,178683.096,531794.675,178651.876",
"coordinatesLL" : "-.102673,51.491663,-.103006,51.491388"
}
}
},
{
"name" : "Walworth Road",
"closure" : "Open",
"directions" : "All Directions",
"Link" : [
{
"toid" : "5000005101111287",
"Line" : {
"coordinatesEN" : "532032.352,178855.549,531966.267,178857.232",
"coordinatesLL" : "-.099508,51.493163,-.100459,51.493194"
}
},
{
"toid" : "5000005101111294",
"Line" : {
"coordinatesEN" : "531945.539,178872.567,531967.868,178881.198",
"coordinatesLL" : "-.100751,51.493336,-.100427,51.493409"
}
},
{
"toid" : "5000005101111295",
"Line" : {
"coordinatesEN" : "531967.868,178881.198,532032.352,178855.549",
"coordinatesLL" : "-.100427,51.493409,-.099508,51.493163"
}
},
{
"toid" : "5000005101111291",
"Line" : {
"coordinatesEN" : "531966.267,178857.232,531945.539,178872.567",
"coordinatesLL" : "-.100459,51.493194,-.100751,51.493336"
}
}
]
},
{
"name" : "Howell Walk",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030342960",
"Line" : {
"coordinatesEN" : "531946,178762,531920,178704",
"coordinatesLL" : "-.100786,51.492342,-.101182,51.491827"
}
}
}
]
}
},
"id" : "5594"
},
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "Obstruction",
"startTime" : "2013-05-13T17:21:00Z",
"location" : "Portsmouth Road",
"comments" : "Portsmouth Road (All Directions) at the junction of Prospect Road - Temporary signals in operation due to repairs to a carriageway void",
"currentUpdate" : "There are no reports of congestion.",
"remarkTime" : "2013-05-15T14:02:42Z",
"lastModTime" : "2013-05-15T14:02:42Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "517000,167182",
"coordinatesLL" : "-.31982,51.391544"
}
},
"Streets" : {
"Street" : [
{
"name" : "Portsmouth Road",
"closure" : "Open",
"directions" : "All Directions",
"Link" : [
{
"toid" : "4000000031254904",
"Line" : {
"coordinatesEN" : "517020.968,167190.483,517030.554,167194.604",
"coordinatesLL" : "-.319516,51.391616,-.319377,51.391651"
}
},
{
"toid" : "4000000031254905",
"Line" : {
"coordinatesEN" : "517020.968,167190.483,517030.554,167194.604",
"coordinatesLL" : "-.319516,51.391616,-.319377,51.391651"
}
},
{
"toid" : "4000000030203893",
"Line" : {
"coordinatesEN" : "517038.842,167197.911,517152,167271",
"coordinatesLL" : "-.319257,51.391679,-.317607,51.392313"
}
},
{
"toid" : "4000000031254906",
"Line" : {
"coordinatesEN" : "517030.554,167194.604,517038.842,167197.911",
"coordinatesLL" : "-.319377,51.391651,-.319257,51.391679"
}
},
{
"toid" : "4000000030094678",
"Line" : {
"coordinatesEN" : "516840.648,167101.167,517020.968,167190.483",
"coordinatesLL" : "-.322136,51.390851,-.319516,51.391616"
}
}
]
},
{
"name" : "Prospect Road",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030128672",
"Line" : {
"coordinatesEN" : "517135.971,167053.715,517038.842,167197.911",
"coordinatesLL" : "-.317909,51.390363,-.319257,51.391679"
}
}
}
]
}
},
"id" : "5337"
},
{
"status" : "Active",
"severity" : "Moderate",
"levelOfInterest" : "Medium",
"category" : "Utility",
"startTime" : "2013-05-13T14:33:00Z",
"location" : "Threadneedle Street (City Of London)",
"comments" : "Threadneedle Street (Both Directions) at the junction of Bartholomew Lane - Temporary signals in operation to facilitate repairs to a burst water main.",
"currentUpdate" : "Threadneedle Street (Both Directions) at the junction of Bartholomew Lane - Temporary signals in operation to facilitate repairs to a burst water main. Intermittent traffic queues. Expect minor delays.",
"remarkTime" : "2013-05-15T13:40:12Z",
"lastModTime" : "2013-05-15T13:40:12Z",
"CauseArea" : {
"DisplayPoint" : {
"Point" : {
"coordinatesEN" : "532820,181176",
"coordinatesLL" : "-.087294,51.513834"
}
},
"Streets" : {
"Street" : [
{
"name" : "Threadneedle Street",
"closure" : "Open",
"directions" : "Both Directions",
"Link" : [
{
"toid" : "4000000030239481",
"Line" : {
"coordinatesEN" : "532735,181137,532820,181176",
"coordinatesLL" : "-.088533,51.513503,-.087294,51.513834"
}
},
{
"toid" : "4000000031276819",
"Line" : {
"coordinatesEN" : "532820,181176,532844.255,181185.798",
"coordinatesLL" : "-.087294,51.513834,-.086941,51.513916"
}
},
{
"toid" : "4000000030344643",
"Line" : {
"coordinatesEN" : "532844.255,181185.798,532872.527,181196.379",
"coordinatesLL" : "-.086941,51.513916,-.086529,51.514004"
}
},
{
"toid" : "4000000031276811",
"Line" : {
"coordinatesEN" : "532820,181176,532844.255,181185.798",
"coordinatesLL" : "-.087294,51.513834,-.086941,51.513916"
}
}
]
},
{
"name" : "Bartholomew Lane",
"closure" : "Open",
"directions" : "All Directions",
"Link" : {
"toid" : "4000000030239506",
"Line" : {
"coordinatesEN" : "532784,181258,532820,181176",
"coordinatesLL" : "-.087781,51.514579,-.087294,51.513834"
}
}
}
]
}
},
"id" : "5319"
}
]
console.log('-----------------------')
var data = tributary.data;
console.log(data);
var disruptions = crossfilter(data);
var disruptionsByCategory = disruptions.dimension(function(d) { return d.category; });
topCategories = disruptionsByCategory.group().top(Infinity);
console.log(topCategories);
categoryKeys = _.pluck(topCategories,'key');
console.log(categoryKeys);
var filterCategory = categoryKeys[0];
disruptionsByCategory.filter(filterCategory);
console.log('There are a total of '+disruptions.size()+' disruptions.');
var n = disruptions.groupAll().reduceCount().value();
console.log("There are " + n + " disruptions of type "+filterCategory) ;
var allDisruptions = disruptionsByCategory.top(Infinity);
console.log(allDisruptions);
console.log('---- Time test -------')
console.log(allDisruptions[0].startTime);
// This should be ISO 8601 format
var format = d3.time.format("%Y-%m-%dT%H:%M:%SZ");
date = format.parse(allDisruptions[0].startTime);
console.log(date);
console.log(date.getHours());
console.log(date.getMinutes());
console.log(date.getSeconds());
console.log(date.getDay());
console.log(date.getMonth());
console.log(date.getYear());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment