{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/cartodb/issues/5493","labels_url":"https://api.github.com/repos/CartoDB/cartodb/issues/5493/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/issues/5493/comments","events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/5493/events","html_url":"https://github.com/CartoDB/cartodb/issues/5493","id":106054422,"number":5493,"title":"Suggestions for writing default CartoCSS generated by the Editor wizard","user":{"login":"makella","id":1566273,"avatar_url":"https://avatars.githubusercontent.com/u/1566273?v=3","gravatar_id":"","url":"https://api.github.com/users/makella","html_url":"https://github.com/makella","followers_url":"https://api.github.com/users/makella/followers","following_url":"https://api.github.com/users/makella/following{/other_user}","gists_url":"https://api.github.com/users/makella/gists{/gist_id}","starred_url":"https://api.github.com/users/makella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makella/subscriptions","organizations_url":"https://api.github.com/users/makella/orgs","repos_url":"https://api.github.com/users/makella/repos","events_url":"https://api.github.com/users/makella/events{/privacy}","received_events_url":"https://api.github.com/users/makella/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CartoDB/cartodb/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"alonsogarciapablo","id":390398,"avatar_url":"https://avatars.githubusercontent.com/u/390398?v=3","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},"milestone":{"url":"https://api.github.com/repos/CartoDB/cartodb/milestones/48","html_url":"https://github.com/CartoDB/cartodb/milestones/Cabra%20del%20Santo%20Cristo","labels_url":"https://api.github.com/repos/CartoDB/cartodb/milestones/48/labels","id":1262219,"number":48,"title":"Cabra del Santo Cristo","description":"- [ ] Cluster renderer torque (@fdansv)\r\n- [ ] Advanced Map creation on Import (@rtorre)\r\n- [ ] CTM (@rochoa)","creator":{"login":"fdansv","id":3707222,"avatar_url":"https://avatars.githubusercontent.com/u/3707222?v=3","gravatar_id":"","url":"https://api.github.com/users/fdansv","html_url":"https://github.com/fdansv","followers_url":"https://api.github.com/users/fdansv/followers","following_url":"https://api.github.com/users/fdansv/following{/other_user}","gists_url":"https://api.github.com/users/fdansv/gists{/gist_id}","starred_url":"https://api.github.com/users/fdansv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdansv/subscriptions","organizations_url":"https://api.github.com/users/fdansv/orgs","repos_url":"https://api.github.com/users/fdansv/repos","events_url":"https://api.github.com/users/fdansv/events{/privacy}","received_events_url":"https://api.github.com/users/fdansv/received_events","type":"User","site_admin":false},"open_issues":57,"closed_issues":0,"state":"open","created_at":"2015-08-19T09:13:00Z","updated_at":"2015-09-15T19:56:58Z","due_on":"2015-09-29T22:00:00Z","closed_at":null},"comments":8,"created_at":"2015-09-11T17:10:57Z","updated_at":"2015-09-16T06:51:38Z","closed_at":null,"body":"cc: @andrewxhill @stuartlynn @ohasselblad @ztephm @csobier \r\n\r\nThe way that the default CartoCSS is written in the Wizard can be structured in a way that is more concise and in the long run, a better way to teach people how to write it more efficiently. In addition, there are certain variables that aren't needed.\r\n\r\nBelow is CartoCSS for a simple example of adding a point layer and symbolizing by category. __Default__ is what the Editor writes and __Modified__ is what I'm suggesting. What might also be cool and a good teaching tool is to extract the attribute class name and declare color variables for the user (look under __Modified with color variables__). All three produce the same visual result.  \r\n\r\nThere are variables like `marker-allow-overlap: true;` that are ok for point features but in other places like labeling and things, we don't want to encourage people to use that (really that is meant for dev/testing and really should only be used in that capacity and changes should be made in the data to better support labeling in that example). There are other variables like that too and as I go through the different geometry and symbolization types, I will point those out.  \r\n\r\nIn __Modified__ I've removed `marker-placement: point;` and `marker-type: ellipse`.  If a user goes straight to CartoCSS the `marker-line-opacity: 1;` is also unnecessary but I can see leaving that in as a learning piece and if we modify default symbology to have line opacity, obviously this will be in there.\r\n\r\n__Default__\r\n```\r\n#continent_points {\r\n   marker-fill-opacity: 0.9;\r\n   marker-line-color: #FFF;\r\n   marker-line-width: 1;\r\n   marker-line-opacity: 1;\r\n   marker-placement: point;\r\n   marker-type: ellipse;\r\n   marker-width: 10;\r\n   marker-allow-overlap: true;\r\n}\r\n\r\n#continent_points[continent=\"Africa\"] {\r\n   marker-fill: #A6CEE3;\r\n}\r\n#continent_points[continent=\"Antarctica\"] {\r\n   marker-fill: #1F78B4;\r\n}\r\n#continent_points[continent=\"Asia\"] {\r\n   marker-fill: #B2DF8A;\r\n}\r\n#continent_points[continent=\"Australia\"] {\r\n   marker-fill: #33A02C;\r\n}\r\n#continent_points[continent=\"Europe\"] {\r\n   marker-fill: #FB9A99;\r\n}\r\n#continent_points[continent=\"North America\"] {\r\n   marker-fill: #E31A1C;\r\n}\r\n#continent_points[continent=\"Oceania\"] {\r\n   marker-fill: #FDBF6F;\r\n}\r\n#continent_points[continent=\"South America\"] {\r\n   marker-fill: #FF7F00;\r\n}\r\n```\r\n\r\n__Modified__\r\n```\r\n#continent_points {\r\n   marker-fill-opacity: 0.9;\r\n   marker-line-color: #FFF;\r\n   marker-line-width: 1;\r\n   marker-width: 10;\r\n   marker-allow-overlap: true;\r\n\r\n   [continent=\"Africa\"] {\r\n   \tmarker-fill: #A6CEE3;\r\n   }\r\n   [continent=\"Antarctica\"] {\r\n      marker-fill: #1F78B4;\r\n   }\r\n   [continent=\"Asia\"] {\r\n      marker-fill: #B2DF8A;\r\n   }\r\n   [continent=\"Australia\"] {\r\n      marker-fill: #33A02C;\r\n   }\r\n   [continent=\"Europe\"] {\r\n      marker-fill: #FB9A99;\r\n   }\r\n   [continent=\"North America\"] {\r\n      marker-fill: #E31A1C;\r\n   }\r\n   [continent=\"Oceania\"] {\r\n      marker-fill: #FDBF6F;\r\n   }\r\n   [continent=\"South America\"] {\r\n      marker-fill: #FF7F00;\r\n   }\r\n}\r\n```\r\n__Modified with color variables__\r\n```\r\n@africa: #A6CEE3;\r\n@antarctica: #1F78B4;\r\n@asia: #B2DF8A;\r\n@australia: #33A02C;\r\n@europe: #FB9A99;\r\n@northamerica: #E31A1C;\r\n@oceania: #FDBF6F;\r\n@southamerica:#FF7F00; \r\n\r\n#continent_points {\r\n   marker-fill-opacity: 0.9;\r\n   marker-line-color: #FFF;\r\n   marker-line-width: 1;\r\n   marker-width: 10;\r\n   marker-allow-overlap: true;\r\n\r\n   [continent=\"Africa\"] {\r\n   \tmarker-fill: @africa;\r\n   }\r\n   [continent=\"Antarctica\"] {\r\n      marker-fill: @antarctica;\r\n   }\r\n   [continent=\"Asia\"] {\r\n      marker-fill: @asia;\r\n   }\r\n   [continent=\"Australia\"] {\r\n      marker-fill: @australia;\r\n   }\r\n   [continent=\"Europe\"] {\r\n      marker-fill: @europe;\r\n   }\r\n   [continent=\"North America\"] {\r\n      marker-fill: @northamerica;\r\n   }\r\n   [continent=\"Oceania\"] {\r\n      marker-fill: @oceania;\r\n   }\r\n   [continent=\"South America\"] {\r\n      marker-fill: @southamerica;\r\n   }\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments/140647494","html_url":"https://github.com/CartoDB/cartodb/issues/5493#issuecomment-140647494","issue_url":"https://api.github.com/repos/CartoDB/cartodb/issues/5493","id":140647494,"user":{"login":"javisantana","id":30147,"avatar_url":"https://avatars.githubusercontent.com/u/30147?v=3","gravatar_id":"","url":"https://api.github.com/users/javisantana","html_url":"https://github.com/javisantana","followers_url":"https://api.github.com/users/javisantana/followers","following_url":"https://api.github.com/users/javisantana/following{/other_user}","gists_url":"https://api.github.com/users/javisantana/gists{/gist_id}","starred_url":"https://api.github.com/users/javisantana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javisantana/subscriptions","organizations_url":"https://api.github.com/users/javisantana/orgs","repos_url":"https://api.github.com/users/javisantana/repos","events_url":"https://api.github.com/users/javisantana/events{/privacy}","received_events_url":"https://api.github.com/users/javisantana/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T06:51:38Z","updated_at":"2015-09-16T06:51:38Z","body":"@andrewbt the project to migrate the logic is for the moment a test to see what needs to be done more than a improvement, we are focusing in the big picture"}}