Merge pull request #995 from CartoDB/14075-2buckets-bubble-legends

Use new version of turbo-carto 0.20.3
This commit is contained in:
Eneko Lakasta 2018-07-09 16:23:35 +02:00 committed by GitHub
commit 04c5b2aa36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 132 additions and 41 deletions

View File

@ -29,6 +29,7 @@ New features:
- request: 2.87.0
- semver: 5.5.0
- step: 1.0.0
- turbo-carto: 0.20.3
- yargs: 11.1.0
- Update devel deps:
- istanbul: 0.4.5

View File

@ -47,7 +47,7 @@
"semver": "5.5.0",
"step": "1.0.0",
"step-profiler": "0.3.0",
"turbo-carto": "0.20.2",
"turbo-carto": "0.20.3",
"underscore": "1.6.0",
"windshaft": "4.8.1",
"yargs": "11.1.0"

View File

@ -380,4 +380,123 @@ describe('turbo-carto regressions', function() {
});
});
describe('Buckets calculation', function () {
afterEach(function (done) {
if (this.testClient) {
this.testClient.drain(done);
} else {
done();
}
});
const scenarios = [
{
numBuckets: 1,
bucketResponse: [
{
filter: {
type: 'range',
start: 0,
end: 8
},
value: 1
}
],
},
{
numBuckets: 2,
bucketResponse: [
{
filter: {
type: 'range',
start: 0,
end: 3
},
value: 1
},
{
filter: {
type: 'range',
start: 3,
end: 8
},
value: 20
}
],
},
{
numBuckets: 3,
bucketResponse: [
{
filter: {
type: 'range',
start: 0,
end: 2
},
value: 1
},
{
filter: {
type: 'range',
start: 2,
end: 5
},
value: 10.5
},
{
filter: {
type: 'range',
start: 5,
end: 8
},
value: 20
}
],
},
];
scenarios.forEach(function (scenario) {
it('Buckets: ' + scenario.numBuckets, function (done) {
const bucketsMapConfig = makeMapconfig({ numQuantiles: scenario.numBuckets });
this.testClient = new TestClient(bucketsMapConfig);
this.testClient.getLayergroup({ response: OK_RESPONSE }, function (err, layergroup) {
const rule = layergroup.metadata.layers[0].meta.cartocss_meta.rules[0];
assert.ok(!err, err);
assert.equal(rule.buckets.length, scenario.numBuckets);
assert.deepEqual(rule.buckets, scenario.bucketResponse);
done();
});
});
});
function makeMapconfig({numQuantiles = 1}) {
return {
"version": "1.4.0",
"layers": [
{
"type": 'mapnik',
"options": {
"cartocss_version": '2.3.0',
"sql": 'SELECT * FROM populated_places_simple_reduced',
"cartocss": `#layer {\n
marker-width: ramp([labelrank], range(1, 20), quantiles(${numQuantiles}));\n
marker-fill: #EE4D5A;\n marker-fill-opacity: 0.9;\n
marker-allow-overlap: true;\n marker-line-width: 1;\n
marker-line-color: #FFFFFF;\n marker-line-opacity: 1;\n}`,
}
}
]
};
}
const OK_RESPONSE = {
status: 200,
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
};
});
});

View File

@ -35,11 +35,7 @@ abaculus@cartodb/abaculus#2.0.3-cdb10:
d3-queue "^2.0.2"
sphericalmercator "1.0.x"
abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
abbrev@1.0.x:
abbrev@1, abbrev@1.0.x:
version "1.0.9"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135"
@ -757,14 +753,10 @@ extend@~3.0.0, extend@~3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
extsprintf@1.3.0:
extsprintf@1.3.0, extsprintf@^1.2.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
extsprintf@^1.2.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
fast-deep-equal@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614"
@ -1506,7 +1498,7 @@ mimic-fn@^1.0.0:
dependencies:
brace-expansion "^1.1.7"
minimist@0.0.8:
minimist@0.0.8, minimist@~0.0.1:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
@ -1514,10 +1506,6 @@ minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
minimist@~0.0.1:
version "0.0.10"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
minimist@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.0.tgz#4dffe525dae2b864c66c2e23c6271d7afdecefce"
@ -1558,14 +1546,10 @@ mocha@3.5.3:
mkdirp "0.5.1"
supports-color "3.1.2"
moment@2.22.1:
moment@2.22.1, moment@^2.10.6:
version "2.22.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.1.tgz#529a2e9bf973f259c9643d237fda84de3a26e8ad"
moment@^2.10.6:
version "2.22.2"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66"
ms@0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
@ -2084,7 +2068,7 @@ read-pkg@^1.0.0:
normalize-package-data "^2.3.2"
path-type "^1.0.0"
readable-stream@1.1:
readable-stream@1.1, readable-stream@~1.1.9:
version "1.1.13"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.13.tgz#f6eef764f514c89e2b9e23146a75ba106756d23e"
dependencies:
@ -2114,15 +2098,6 @@ readable-stream@~1.0.2:
isarray "0.0.1"
string_decoder "~0.10.x"
readable-stream@~1.1.9:
version "1.1.14"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9"
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "0.0.1"
string_decoder "~0.10.x"
redis-commands@^1.2.0:
version "1.3.5"
resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.3.5.tgz#4495889414f1e886261180b1442e7295602d83a2"
@ -2261,11 +2236,11 @@ rimraf@~2.4.0:
dependencies:
glob "^6.0.1"
safe-buffer@5.1.1:
safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
@ -2458,11 +2433,7 @@ sshpk@^1.7.0:
jsbn "~0.1.0"
tweetnacl "~0.14.0"
"statuses@>= 1.3.1 < 2", "statuses@>= 1.4.0 < 2":
version "1.5.0"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
statuses@~1.4.0:
"statuses@>= 1.3.1 < 2", "statuses@>= 1.4.0 < 2", statuses@~1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087"
@ -2654,9 +2625,9 @@ turbo-carto@0.19.0:
postcss "5.0.19"
postcss-value-parser "3.3.0"
turbo-carto@0.20.2:
version "0.20.2"
resolved "https://registry.yarnpkg.com/turbo-carto/-/turbo-carto-0.20.2.tgz#2b737597a65c2918432f70ea414f12fbec2b6a6f"
turbo-carto@CartoDB/turbo-carto#buckets-calc:
version "0.20.3"
resolved "https://codeload.github.com/CartoDB/turbo-carto/tar.gz/c7800628361f3c9bacf27296ebd4cfe283979d79"
dependencies:
cartocolor "4.0.0"
colorbrewer "1.0.0"