{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/957","repository_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb","labels_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/957/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/957/comments","events_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/957/events","html_url":"https://github.com/CartoDB/Windshaft-cartodb/issues/957","id":323546148,"node_id":"MDU6SXNzdWUzMjM1NDYxNDg=","number":957,"title":"Use original query to compute TurboCarto ramps when points are aggregated ","user":{"login":"alonsogarciapablo","id":390398,"node_id":"MDQ6VXNlcjM5MDM5OA==","avatar_url":"https://avatars3.githubusercontent.com/u/390398?v=4","gravatar_id":"","url":"https://api.github.com/users/alonsogarciapablo","html_url":"https://github.com/alonsogarciapablo","followers_url":"https://api.github.com/users/alonsogarciapablo/followers","following_url":"https://api.github.com/users/alonsogarciapablo/following{/other_user}","gists_url":"https://api.github.com/users/alonsogarciapablo/gists{/gist_id}","starred_url":"https://api.github.com/users/alonsogarciapablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alonsogarciapablo/subscriptions","organizations_url":"https://api.github.com/users/alonsogarciapablo/orgs","repos_url":"https://api.github.com/users/alonsogarciapablo/repos","events_url":"https://api.github.com/users/alonsogarciapablo/events{/privacy}","received_events_url":"https://api.github.com/users/alonsogarciapablo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"enekid","id":623492,"node_id":"MDQ6VXNlcjYyMzQ5Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/623492?v=4","gravatar_id":"","url":"https://api.github.com/users/enekid","html_url":"https://github.com/enekid","followers_url":"https://api.github.com/users/enekid/followers","following_url":"https://api.github.com/users/enekid/following{/other_user}","gists_url":"https://api.github.com/users/enekid/gists{/gist_id}","starred_url":"https://api.github.com/users/enekid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enekid/subscriptions","organizations_url":"https://api.github.com/users/enekid/orgs","repos_url":"https://api.github.com/users/enekid/repos","events_url":"https://api.github.com/users/enekid/events{/privacy}","received_events_url":"https://api.github.com/users/enekid/received_events","type":"User","site_admin":false},"assignees":[{"login":"enekid","id":623492,"node_id":"MDQ6VXNlcjYyMzQ5Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/623492?v=4","gravatar_id":"","url":"https://api.github.com/users/enekid","html_url":"https://github.com/enekid","followers_url":"https://api.github.com/users/enekid/followers","following_url":"https://api.github.com/users/enekid/following{/other_user}","gists_url":"https://api.github.com/users/enekid/gists{/gist_id}","starred_url":"https://api.github.com/users/enekid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enekid/subscriptions","organizations_url":"https://api.github.com/users/enekid/orgs","repos_url":"https://api.github.com/users/enekid/repos","events_url":"https://api.github.com/users/enekid/events{/privacy}","received_events_url":"https://api.github.com/users/enekid/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2018-05-16T09:47:20Z","updated_at":"2018-07-24T15:30:59Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Part of https://github.com/CartoDB/product/issues/30.\r\n\r\nIt seems that, when point aggregation is enabled, TurboCarto ramps are currently computed using the aggregated query, instead of the original one. We tried to enable Default Point Aggregation in Builder, and realised that colors and legends where different when aggregation was enabled (see [this comment](https://github.com/CartoDB/product/issues/30#issuecomment-380854683) for more context).\r\n\r\nThe goal of this PR is to change this behaviour to ensure maps look the same no matter whether point aggregation is enabled or not.\r\n\r\nQuoting @rochoa (https://github.com/CartoDB/product/issues/30#issuecomment-384020382):\r\n\r\n> My understanding is that TurboCarto's ramps/legends should use the original data/query for the computation instead of the aggregated one. Why? Because legend must be valid across all zoom levels. If I zoom enough, I'll get to the original data.\r\n\r\ncc: @dgaubert @jgoizueta @ivanmalagon"},"comment":{"url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/comments/407449398","html_url":"https://github.com/CartoDB/Windshaft-cartodb/issues/957#issuecomment-407449398","issue_url":"https://api.github.com/repos/CartoDB/Windshaft-cartodb/issues/957","id":407449398,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzQ0OTM5OA==","user":{"login":"enekid","id":623492,"node_id":"MDQ6VXNlcjYyMzQ5Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/623492?v=4","gravatar_id":"","url":"https://api.github.com/users/enekid","html_url":"https://github.com/enekid","followers_url":"https://api.github.com/users/enekid/followers","following_url":"https://api.github.com/users/enekid/following{/other_user}","gists_url":"https://api.github.com/users/enekid/gists{/gist_id}","starred_url":"https://api.github.com/users/enekid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enekid/subscriptions","organizations_url":"https://api.github.com/users/enekid/orgs","repos_url":"https://api.github.com/users/enekid/repos","events_url":"https://api.github.com/users/enekid/events{/privacy}","received_events_url":"https://api.github.com/users/enekid/received_events","type":"User","site_admin":false},"created_at":"2018-07-24T15:30:59Z","updated_at":"2018-07-24T15:30:59Z","author_association":"CONTRIBUTOR","body":"Let's retake this conversation with the following example:\r\n\r\n**Dataset**\r\n\r\n| the_geom | cartodb_id | address | grade\r\n| --- | --- | --- | --- |\r\n| 0101..4440  | 1  | Gran Vía 2 | 10\r\n| 0101..4441  | 1  | Castellana 5 | 4\r\n...\r\n\r\n**Aggregation**\r\n\r\n```javascript\r\naggregation: {\r\n    placement: 'point-sample',\r\n    threshold: 1,\r\n    columns: {\r\n        grade_avg: { \"aggregate_function\": \"avg\", \"aggregated_column\": \"grade\" }\r\n    },\r\n}\r\n```\r\n\r\n**Use cases**\r\n\r\n\r\n1. Use non aggregated column in ramp\r\n\r\n```css\r\n#layer {\r\n    marker-fill: ramp([grade], (#d7191c, #fdae61, #abdda4, #2b83ba), quantiles);\r\n}\r\n```\r\n\r\n\r\n2. Use aggregated column in ramp\r\n```css\r\n#layer {\r\n    marker-fill: ramp([grade_avg], (#d7191c, #fdae61, #abdda4, #2b83ba), quantiles);\r\n}\r\n```\r\n\r\n\r\n3. Bonus: Use mix of aggregated and non-aggregated columns in turbo-carto\r\n\r\n```css\r\n#layer {\r\n    marker-fill: ramp([grade], (#d7191c, #fdae61, #abdda4, #2b83ba), quantiles);\r\n    marker-width: [grade_avg]\r\n}\r\n```\r\n\r\nDoes this make any sense? @jgoizueta "}}
{"actor":{"display_login":"enekid"}}