{"action":"opened","issue":{"url":"https://api.github.com/repos/tinker10/D3-Labeler/issues/8","labels_url":"https://api.github.com/repos/tinker10/D3-Labeler/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/tinker10/D3-Labeler/issues/8/comments","events_url":"https://api.github.com/repos/tinker10/D3-Labeler/issues/8/events","html_url":"https://github.com/tinker10/D3-Labeler/issues/8","id":75672283,"number":8,"title":"optimization via map","user":{"login":"SoundLogic","id":661942,"avatar_url":"https://avatars.githubusercontent.com/u/661942?v=3","gravatar_id":"","url":"https://api.github.com/users/SoundLogic","html_url":"https://github.com/SoundLogic","followers_url":"https://api.github.com/users/SoundLogic/followers","following_url":"https://api.github.com/users/SoundLogic/following{/other_user}","gists_url":"https://api.github.com/users/SoundLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/SoundLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SoundLogic/subscriptions","organizations_url":"https://api.github.com/users/SoundLogic/orgs","repos_url":"https://api.github.com/users/SoundLogic/repos","events_url":"https://api.github.com/users/SoundLogic/events{/privacy}","received_events_url":"https://api.github.com/users/SoundLogic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-12T17:13:29Z","updated_at":"2015-05-12T17:13:29Z","closed_at":null,"body":"Do you think it would make sense to create a map to simplify identification of overlapping labels? The idea I had was to calculate the overlapping area using the number of squares in a grid system which could be as finely grained as pixels, based on the width and height, or could be broken up into larger sections for optimization.\r\n\r\n![label_overlap_topology](https://cloud.githubusercontent.com/assets/661942/7593320/460e0f70-f8a7-11e4-8b81-1fadf3a28bf3.png)\r\n\r\nTo further clarify, the map would be based on the number of labels that overlap at any particular x,y value in the grid. The initial map would only need to be created once and then could be updated as labels are moved. The benefit would be avoiding an iteration over every label for every label we're evaluating - rather you could consider only the (x,y) values to identify the overlapping area. \r\n\r\nI can put together a PR request, but just wanted to discuss the idea first - maybe I'm missing something? Let me know if I can further clarify.\r\n\r\nThanks for this library! It is very useful :+1:  "}}