Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c09cda84a3 | ||
|
|
bd36ea1829 | ||
|
|
01a47925e0 | ||
|
|
dd8a70eb95 | ||
|
|
013bdba4ff | ||
|
|
c1acc54d55 | ||
|
|
5f3fb6e5f7 | ||
|
|
cb53d140e3 |
8
NEWS.md
8
NEWS.md
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## 2.53.5
|
||||
|
||||
Released 2016-06-29
|
||||
|
||||
Bug fixes:
|
||||
- Uses node list so identical nodes are not de-duplicated and can be used with different ids #528.
|
||||
|
||||
|
||||
## 2.53.4
|
||||
|
||||
Released 2016-06-28
|
||||
|
||||
@@ -85,7 +85,7 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param
|
||||
sourceId2Node[rootNode.params.id] = rootNode;
|
||||
}
|
||||
|
||||
analysis.getSortedNodes().forEach(function(node) {
|
||||
analysis.getNodes().forEach(function(node) {
|
||||
if (node.params && node.params.id) {
|
||||
sourceId2Node[node.params.id] = node;
|
||||
}
|
||||
@@ -232,7 +232,7 @@ DataviewBackend.prototype.search = function (mapConfigProvider, user, params, ca
|
||||
sourceId2Node[rootNode.params.id] = rootNode;
|
||||
}
|
||||
|
||||
analysis.getSortedNodes().forEach(function(node) {
|
||||
analysis.getNodes().forEach(function(node) {
|
||||
if (node.params && node.params.id) {
|
||||
sourceId2Node[node.params.id] = node;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ AnalysisMapConfigAdapter.prototype.getMapConfig = function(user, requestMapConfi
|
||||
sourceId2Query[rootNode.params.id] = rootNode;
|
||||
}
|
||||
|
||||
analysis.getSortedNodes().forEach(function(node) {
|
||||
analysis.getNodes().forEach(function(node) {
|
||||
if (node.params && node.params.id) {
|
||||
sourceId2Query[node.params.id] = node;
|
||||
}
|
||||
|
||||
2
npm-shrinkwrap.json
generated
2
npm-shrinkwrap.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "windshaft-cartodb",
|
||||
"version": "2.53.4",
|
||||
"version": "2.53.5",
|
||||
"dependencies": {
|
||||
"body-parser": {
|
||||
"version": "1.14.2",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "windshaft-cartodb",
|
||||
"version": "2.53.4",
|
||||
"version": "2.53.5",
|
||||
"description": "A map tile server for CartoDB",
|
||||
"keywords": [
|
||||
"cartodb"
|
||||
|
||||
107
test/acceptance/analysis/regressions.js
Normal file
107
test/acceptance/analysis/regressions.js
Normal file
@@ -0,0 +1,107 @@
|
||||
require('../../support/test_helper');
|
||||
|
||||
var assert = require('../../support/assert');
|
||||
var TestClient = require('../../support/test-client');
|
||||
|
||||
describe('analysis-layers error cases', function() {
|
||||
it('should handle missing analysis nodes for layers', function(done) {
|
||||
var mapConfig = {
|
||||
"version": "1.5.0",
|
||||
"layers": [
|
||||
{
|
||||
"type": "cartodb",
|
||||
"options": {
|
||||
"cartocss": TestClient.CARTOCSS.POINTS,
|
||||
"cartocss_version": "2.1.1",
|
||||
"interactivity": [],
|
||||
"source": {
|
||||
"id": "a4"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "cartodb",
|
||||
"options": {
|
||||
"cartocss": TestClient.CARTOCSS.POINTS,
|
||||
"cartocss_version": "2.1.0",
|
||||
"interactivity": [],
|
||||
"source": {
|
||||
"id": "b1"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"dataviews": {
|
||||
"74493a30-4679-4b72-a60c-b6f808b57c98": {
|
||||
"type": "histogram",
|
||||
"source": {
|
||||
"id": "b0"
|
||||
},
|
||||
"options": {
|
||||
"column": "customer_value",
|
||||
"bins": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
"analyses": [
|
||||
{
|
||||
"id": "a4",
|
||||
"type": "intersection",
|
||||
"params": {
|
||||
"source": {
|
||||
"id": "a3",
|
||||
"type": "buffer",
|
||||
"params": {
|
||||
"source": {
|
||||
"id": "a2",
|
||||
"type": "centroid",
|
||||
"params": {
|
||||
"source": {
|
||||
"id": "b1",
|
||||
"type": "kmeans",
|
||||
"params": {
|
||||
"source": {
|
||||
"id": "b0",
|
||||
"type": "source",
|
||||
"params": {
|
||||
"query": "SELECT * FROM populated_places_simple_reduced"
|
||||
}
|
||||
},
|
||||
"clusters": 5
|
||||
}
|
||||
},
|
||||
"category_column": "cluster_no"
|
||||
}
|
||||
},
|
||||
"radius": 200000
|
||||
}
|
||||
},
|
||||
"target": {
|
||||
"id": "customer_home_locations",
|
||||
"type": "source",
|
||||
"params": {
|
||||
"query": "SELECT * FROM populated_places_simple_reduced"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var testClient = new TestClient(mapConfig, 1234);
|
||||
|
||||
testClient.getLayergroup(function(err, layergroupResult) {
|
||||
assert.ok(!err, err);
|
||||
|
||||
assert.ok(layergroupResult);
|
||||
assert.ok(layergroupResult.metadata);
|
||||
var analyses = layergroupResult.metadata.analyses;
|
||||
assert.ok(analyses);
|
||||
assert.equal(analyses.length, 1);
|
||||
assert.equal(Object.keys(analyses[0].nodes).length, 5);
|
||||
|
||||
testClient.drain(done);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -633,3 +633,18 @@ GRANT SELECT ON TABLE analysis_rent_listings TO :PUBLICUSER;
|
||||
|
||||
--
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON cdb_analysis_catalog TO :TESTUSER;
|
||||
|
||||
create schema cdb_crankshaft;
|
||||
GRANT USAGE ON SCHEMA cdb_crankshaft TO :TESTUSER;
|
||||
CREATE TYPE kmeans_type as (cartodb_id numeric, cluster_no numeric);
|
||||
CREATE OR REPLACE FUNCTION cdb_crankshaft.CDB_KMeans(query text, no_clusters integer,no_init integer default 20)
|
||||
RETURNS setof kmeans_type as $$
|
||||
DECLARE r kmeans_type;
|
||||
BEGIN
|
||||
FOR r IN EXECUTE format('select cartodb_id, ceil(random() * 10) AS cluster_no from (%s) _cdb_query', query) loop
|
||||
RETURN NEXT r;
|
||||
END LOOP;
|
||||
RETURN;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
GRANT ALL ON FUNCTION cdb_crankshaft.CDB_KMeans(text, integer, integer) TO :TESTUSER;
|
||||
|
||||
@@ -33,6 +33,39 @@ module.exports.RESPONSE = {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.CARTOCSS = {
|
||||
POINTS: [
|
||||
'#layer{',
|
||||
' marker-placement: point;',
|
||||
' marker-allow-overlap: true;',
|
||||
' marker-line-opacity: 0.2;',
|
||||
' marker-line-width: 0.5;',
|
||||
' marker-opacity: 1;',
|
||||
' marker-width: 5;',
|
||||
' marker-fill: red;',
|
||||
'}'
|
||||
].join('\n'),
|
||||
|
||||
LINES: [
|
||||
'#lines {',
|
||||
' line-color: black;',
|
||||
' line-width: 1;',
|
||||
' line-opacity: 1;',
|
||||
'}'
|
||||
].join('\n'),
|
||||
|
||||
POLYGONS: [
|
||||
'#layer {',
|
||||
' polygon-fill: red;',
|
||||
' polygon-opacity: 0.6;',
|
||||
' polygon-opacity: 0.7;',
|
||||
' line-color: #FFF;',
|
||||
' line-width: 0.5;',
|
||||
' line-opacity: 1;',
|
||||
'}'
|
||||
].join('\n')
|
||||
};
|
||||
|
||||
TestClient.prototype.getWidget = function(widgetName, params, callback) {
|
||||
var self = this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user