{"action":"created","issue":{"url":"https://api.github.com/repos/TerriaJS/terriajs/issues/1374","repository_url":"https://api.github.com/repos/TerriaJS/terriajs","labels_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/1374/labels{/name}","comments_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/1374/comments","events_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/1374/events","html_url":"https://github.com/TerriaJS/terriajs/issues/1374","id":138328533,"number":1374,"title":"Improve legend and colouring of ENUM columns","user":{"login":"RacingTadpole","id":1757858,"avatar_url":"https://avatars.githubusercontent.com/u/1757858?v=3","gravatar_id":"","url":"https://api.github.com/users/RacingTadpole","html_url":"https://github.com/RacingTadpole","followers_url":"https://api.github.com/users/RacingTadpole/followers","following_url":"https://api.github.com/users/RacingTadpole/following{/other_user}","gists_url":"https://api.github.com/users/RacingTadpole/gists{/gist_id}","starred_url":"https://api.github.com/users/RacingTadpole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RacingTadpole/subscriptions","organizations_url":"https://api.github.com/users/RacingTadpole/orgs","repos_url":"https://api.github.com/users/RacingTadpole/repos","events_url":"https://api.github.com/users/RacingTadpole/events{/privacy}","received_events_url":"https://api.github.com/users/RacingTadpole/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TerriaJS/terriajs/labels/C-CSV/Region%20Mapping","name":"C-CSV/Region Mapping","color":"557777"},{"url":"https://api.github.com/repos/TerriaJS/terriajs/labels/T-Bug","name":"T-Bug","color":"EE2222"},{"url":"https://api.github.com/repos/TerriaJS/terriajs/labels/Z-Medium","name":"Z-Medium","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-03T23:24:35Z","updated_at":"2016-03-04T01:28:51Z","closed_at":null,"body":"ENUM columns currently use the `ckmeans` method to find colour bins:\r\nhttps://github.com/TerriaJS/terriajs/blob/1313_csvperf/lib/Models/LegendHelper.js#L302\r\n\r\nIf the number of unique ENUM values is less than `binCount`, this gives you back the ENUM values, which is fine.\r\n\r\nHowever, there are two problems if there are lots of different ENUM values (ie. more than `binCount`):\r\n- Speed: If there are 55,000 unique values, it can take over a minute to calculate.\r\n- Interpretability:  Eg. in the below, the regions north of Sydney have the first letter \"W\", which is not on the legend, and which are coloured orange (the same as \"Q\"):\r\n![image](https://cloud.githubusercontent.com/assets/1757858/13512711/752f2662-e1f0-11e5-9c6f-0b23787458be.png)\r\n\r\nOriginally identified in #1313 .\r\n"},"comment":{"url":"https://api.github.com/repos/TerriaJS/terriajs/issues/comments/192048465","html_url":"https://github.com/TerriaJS/terriajs/issues/1374#issuecomment-192048465","issue_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/1374","id":192048465,"user":{"login":"RacingTadpole","id":1757858,"avatar_url":"https://avatars.githubusercontent.com/u/1757858?v=3","gravatar_id":"","url":"https://api.github.com/users/RacingTadpole","html_url":"https://github.com/RacingTadpole","followers_url":"https://api.github.com/users/RacingTadpole/followers","following_url":"https://api.github.com/users/RacingTadpole/following{/other_user}","gists_url":"https://api.github.com/users/RacingTadpole/gists{/gist_id}","starred_url":"https://api.github.com/users/RacingTadpole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RacingTadpole/subscriptions","organizations_url":"https://api.github.com/users/RacingTadpole/orgs","repos_url":"https://api.github.com/users/RacingTadpole/repos","events_url":"https://api.github.com/users/RacingTadpole/events{/privacy}","received_events_url":"https://api.github.com/users/RacingTadpole/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T01:28:51Z","updated_at":"2016-03-04T01:28:51Z","body":"Yes, that's an excellent list. I would slightly vary #3 to read:\r\n3) Color the most common 20 differently, color the rest the same."}}