Merge pull request #431 from CartoDB/dataviews-filters

Dataviews filters
This commit is contained in:
Raul Ochoa 2016-04-26 19:21:43 +02:00
commit 23ef1157cb
4 changed files with 37 additions and 52 deletions

View File

@ -8,6 +8,9 @@ Enhancements:
- Adds support to return multiple errors in BaseController.sendError #423
- Starts using turbo-carto dependency
Announcements:
- Upgrades windshaft to [1.17.2](https://github.com/CartoDB/Windshaft/releases/tag/1.17.2)
## 2.33.1

56
npm-shrinkwrap.json generated
View File

@ -90,7 +90,7 @@
},
"mime-types": {
"version": "2.1.10",
"from": "mime-types@>=2.1.10 <2.2.0",
"from": "mime-types@>=2.1.2 <2.2.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz",
"dependencies": {
"mime-db": {
@ -111,7 +111,7 @@
"dependencies": {
"async": {
"version": "1.5.2",
"from": "async@>=1.0.0 <2.0.0",
"from": "async@>=1.5.2 <2.0.0",
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz"
},
"request": {
@ -1291,9 +1291,9 @@
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz"
},
"windshaft": {
"version": "1.17.1",
"from": "windshaft@1.17.1",
"resolved": "https://registry.npmjs.org/windshaft/-/windshaft-1.17.1.tgz",
"version": "1.17.2",
"from": "windshaft@1.17.2",
"resolved": "https://registry.npmjs.org/windshaft/-/windshaft-1.17.2.tgz",
"dependencies": {
"abaculus": {
"version": "1.1.0-cdb4",
@ -1341,11 +1341,6 @@
}
}
},
"es6-promise": {
"version": "3.1.2",
"from": "es6-promise@>=3.1.2 <4.0.0",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.1.2.tgz"
},
"grainstore": {
"version": "1.1.1",
"from": "grainstore@1.1.1",
@ -4169,47 +4164,6 @@
}
}
},
"postcss": {
"version": "5.0.19",
"from": "postcss@>=5.0.18 <6.0.0",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-5.0.19.tgz",
"dependencies": {
"supports-color": {
"version": "3.1.2",
"from": "supports-color@>=3.1.2 <4.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz",
"dependencies": {
"has-flag": {
"version": "1.0.0",
"from": "has-flag@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz"
}
}
},
"source-map": {
"version": "0.5.5",
"from": "source-map@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.5.tgz"
},
"js-base64": {
"version": "2.1.9",
"from": "js-base64@>=2.1.9 <3.0.0",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.1.9.tgz"
}
}
},
"postcss-each": {
"version": "0.9.1",
"from": "postcss-each@>=0.9.1 <0.10.0",
"resolved": "https://registry.npmjs.org/postcss-each/-/postcss-each-0.9.1.tgz",
"dependencies": {
"postcss-simple-vars": {
"version": "1.2.0",
"from": "postcss-simple-vars@>=1.2.0 <2.0.0",
"resolved": "https://registry.npmjs.org/postcss-simple-vars/-/postcss-simple-vars-1.2.0.tgz"
}
}
},
"semver": {
"version": "5.0.3",
"from": "semver@>=5.0.3 <5.1.0",

View File

@ -26,7 +26,7 @@
"node-statsd": "~0.0.7",
"underscore" : "~1.6.0",
"dot": "~1.0.2",
"windshaft": "1.17.1",
"windshaft": "1.17.2",
"step": "~0.0.6",
"queue-async": "~1.0.7",
"request": "~2.62.0",

View File

@ -114,6 +114,34 @@ describe('histogram widgets', function() {
testClient.drain(done);
});
});
it("should expose a filtered histogram using dataviews for filtering", function(done) {
var params = {
filters: {
dataviews: {
country_places_histogram: { min: 4000000 }
}
}
};
var testClient = new TestClient(histogramMapConfig);
testClient.getWidget('country_places_histogram', params, function(err, res) {
if (err) {
return done(err);
}
var histogram = JSON.parse(res.body);
// notice min value
assert.deepEqual(histogram.bins[0], {
bin: 0,
freq: 62,
min: 4000000,
max: 9276403,
avg: 5815009.596774193
});
testClient.drain(done);
});
});
});
});