Suppose there is a json document structured as follows:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"time": 1438342780,
"title": "Iran's foreign minister calls for world's nuclear weapons states to disarm",
"author": "Julian Borger",
"web_id": "world/2015/jul/31/iran-nuclear-weapons-states-disarm-israel"
},
"geometry": {
"type": "Point",
"coordinates": [
-77.26526,
38.90122
]
}
},
{
"type": "Feature",
"properties": {
"time": 1438300867,
"title": "Big bangs over the white cliffs of Dover as unique 1915 artillery gun is fired again",
"author": "Maev Kennedy",
"web_id": "world/2015/jul/31/big-bangs-over-white-cliffs-dover-unique-1915-artillery-gun-fired-again"
},
"geometry": {
"type": "Point",
"coordinates": [
1.3,
51.13333
]
}
}
]
}
If we need to extract the 'feature' array from the json and determine the total number of features for a specific date, we would aim for an output like this:
{
"date": 7/31/2015,
"number": 2
}
The current approach in handling the data involves utilizing D3.js to load the json file:
d3.json('path/to/json', function(json) {
data = json;
});
As someone fairly new to JavaScript and D3, seeking guidance on how to achieve this task efficiently. Additional information can be provided upon request. Appreciate any assistance in advance!