{"action":"created","comment":{"url":"https://api.github.com/repos/2gis/general/pulls/comments/109632444","pull_request_review_id":30745247,"id":109632444,"diff_hunk":"@@ -123,58 +125,59 @@ Promise.all([\n         if (resetLastGroupIndex) {\n             for (let i = 0; i < markers.length; i++) {\n                 const marker = markers[i];\n-                marker.groupIndexAfterGenerelize = undefined;\n+                marker.prevGroupIndex = undefined;\n                 marker.iconIndex = -1;\n             }\n             resetLastGroupIndex = false;\n         }\n \n         // tslint:disable-next-line\n         console.time('gen');\n-        generalize(bounds, retinaFactor, priorityGroups, atlas, markers);\n-        // tslint:disable-next-line\n-        console.timeEnd('gen');\n-\n-        const drawingOffsets = config.groups.some((g) => g.drawingOffsets);\n-\n-        if (drawingOffsets) {\n-            for (let i = 0; i < markers.length; i++) {\n-                const marker = markers[i];\n-                if (marker.iconIndex === -1 || marker.iconIndex === undefined) {\n-                    continue;\n-                }\n-\n-                if (config.groups[marker.iconIndex].drawingOffsets) {\n-                    const group = priorityGroups[marker.iconIndex];\n-                    marker.drawingOffsets = [\n-                        0,\n-                        group.safeZone,\n-                        group.margin,\n-                        group.degradation,\n-                    ];\n-                } else {\n-                    marker.drawingOffsets = [];\n+        general.generalize(bounds, retinaFactor, priorityGroups, atlas, markers).then(() => {\n+            // tslint:disable-next-line\n+            console.timeEnd('gen');","path":"demo/index.ts","position":56,"original_position":56,"commit_id":"1bd69d309c5051900e5ef06ca104390b4613ac91","original_commit_id":"1bd69d309c5051900e5ef06ca104390b4613ac91","user":{"login":"RLRR","id":4540062,"avatar_url":"https://avatars3.githubusercontent.com/u/4540062?v=3","gravatar_id":"","url":"https://api.github.com/users/RLRR","html_url":"https://github.com/RLRR","followers_url":"https://api.github.com/users/RLRR/followers","following_url":"https://api.github.com/users/RLRR/following{/other_user}","gists_url":"https://api.github.com/users/RLRR/gists{/gist_id}","starred_url":"https://api.github.com/users/RLRR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RLRR/subscriptions","organizations_url":"https://api.github.com/users/RLRR/orgs","repos_url":"https://api.github.com/users/RLRR/repos","events_url":"https://api.github.com/users/RLRR/events{/privacy}","received_events_url":"https://api.github.com/users/RLRR/received_events","type":"User","site_admin":false},"body":"Выпилим)","created_at":"2017-04-04T10:58:59Z","updated_at":"2017-04-04T10:58:59Z","html_url":"https://github.com/2gis/general/pull/1#discussion_r109632444","pull_request_url":"https://api.github.com/repos/2gis/general/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/2gis/general/pulls/comments/109632444"},"html":{"href":"https://github.com/2gis/general/pull/1#discussion_r109632444"},"pull_request":{"href":"https://api.github.com/repos/2gis/general/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/2gis/general/pulls/1","id":113921815,"html_url":"https://github.com/2gis/general/pull/1","diff_url":"https://github.com/2gis/general/pull/1.diff","patch_url":"https://github.com/2gis/general/pull/1.patch","issue_url":"https://api.github.com/repos/2gis/general/issues/1","number":1,"state":"open","locked":false,"title":"move generalization calculations to web worker","user":{"login":"RLRR","id":4540062,"avatar_url":"https://avatars3.githubusercontent.com/u/4540062?v=3","gravatar_id":"","url":"https://api.github.com/users/RLRR","html_url":"https://github.com/RLRR","followers_url":"https://api.github.com/users/RLRR/followers","following_url":"https://api.github.com/users/RLRR/following{/other_user}","gists_url":"https://api.github.com/users/RLRR/gists{/gist_id}","starred_url":"https://api.github.com/users/RLRR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RLRR/subscriptions","organizations_url":"https://api.github.com/users/RLRR/orgs","repos_url":"https://api.github.com/users/RLRR/repos","events_url":"https://api.github.com/users/RLRR/events{/privacy}","received_events_url":"https://api.github.com/users/RLRR/received_events","type":"User","site_admin":false},"body":"1. Метод `generalize` теперь возвращает промис. В промис ничего не падает, результат записывается in-place в переданный массив маркеров\r\n2. Если вызвать `generalize` до окончания работы над предыдущей задачей, вызов помещается в очередь\r\n2. Поле `groupIndexAfterGenerelize` переименовал в `prevGroupIndex`, а то слишком длинное было)\r\n3. Убрал создание объекта в методе `createBBox`, а также `pixelPosition` теперь передаётся в функции в виде двух чисел, а не массива\r\n4. Сам алгоритм перенесён без каких-либо изменений","created_at":"2017-04-03T12:45:19Z","updated_at":"2017-04-04T10:58:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a30763c969559428a646b1173bee4827d94418cf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/2gis/general/pulls/1/commits","review_comments_url":"https://api.github.com/repos/2gis/general/pulls/1/comments","review_comment_url":"https://api.github.com/repos/2gis/general/pulls/comments{/number}","comments_url":"https://api.github.com/repos/2gis/general/issues/1/comments","statuses_url":"https://api.github.com/repos/2gis/general/statuses/1bd69d309c5051900e5ef06ca104390b4613ac91","head":{"label":"2gis:web-worker","ref":"web-worker","sha":"1bd69d309c5051900e5ef06ca104390b4613ac91","user":{"login":"2gis","id":1481435,"avatar_url":"https://avatars1.githubusercontent.com/u/1481435?v=3","gravatar_id":"","url":"https://api.github.com/users/2gis","html_url":"https://github.com/2gis","followers_url":"https://api.github.com/users/2gis/followers","following_url":"https://api.github.com/users/2gis/following{/other_user}","gists_url":"https://api.github.com/users/2gis/gists{/gist_id}","starred_url":"https://api.github.com/users/2gis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2gis/subscriptions","organizations_url":"https://api.github.com/users/2gis/orgs","repos_url":"https://api.github.com/users/2gis/repos","events_url":"https://api.github.com/users/2gis/events{/privacy}","received_events_url":"https://api.github.com/users/2gis/received_events","type":"Organization","site_admin":false},"repo":{"id":86564796,"name":"general","full_name":"2gis/general","owner":{"login":"2gis","id":1481435,"avatar_url":"https://avatars1.githubusercontent.com/u/1481435?v=3","gravatar_id":"","url":"https://api.github.com/users/2gis","html_url":"https://github.com/2gis","followers_url":"https://api.github.com/users/2gis/followers","following_url":"https://api.github.com/users/2gis/following{/other_user}","gists_url":"https://api.github.com/users/2gis/gists{/gist_id}","starred_url":"https://api.github.com/users/2gis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2gis/subscriptions","organizations_url":"https://api.github.com/users/2gis/orgs","repos_url":"https://api.github.com/users/2gis/repos","events_url":"https://api.github.com/users/2gis/events{/privacy}","received_events_url":"https://api.github.com/users/2gis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/2gis/general","description":"Fast marker generalization algorithm","fork":false,"url":"https://api.github.com/repos/2gis/general","forks_url":"https://api.github.com/repos/2gis/general/forks","keys_url":"https://api.github.com/repos/2gis/general/keys{/key_id}","collaborators_url":"https://api.github.com/repos/2gis/general/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/2gis/general/teams","hooks_url":"https://api.github.com/repos/2gis/general/hooks","issue_events_url":"https://api.github.com/repos/2gis/general/issues/events{/number}","events_url":"https://api.github.com/repos/2gis/general/events","assignees_url":"https://api.github.com/repos/2gis/general/assignees{/user}","branches_url":"https://api.github.com/repos/2gis/general/branches{/branch}","tags_url":"https://api.github.com/repos/2gis/general/tags","blobs_url":"https://api.github.com/repos/2gis/general/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/2gis/general/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/2gis/general/git/refs{/sha}","trees_url":"https://api.github.com/repos/2gis/general/git/trees{/sha}","statuses_url":"https://api.github.com/repos/2gis/general/statuses/{sha}","languages_url":"https://api.github.com/repos/2gis/general/languages","stargazers_url":"https://api.github.com/repos/2gis/general/stargazers","contributors_url":"https://api.github.com/repos/2gis/general/contributors","subscribers_url":"https://api.github.com/repos/2gis/general/subscribers","subscription_url":"https://api.github.com/repos/2gis/general/subscription","commits_url":"https://api.github.com/repos/2gis/general/commits{/sha}","git_commits_url":"https://api.github.com/repos/2gis/general/git/commits{/sha}","comments_url":"https://api.github.com/repos/2gis/general/comments{/number}","issue_comment_url":"https://api.github.com/repos/2gis/general/issues/comments{/number}","contents_url":"https://api.github.com/repos/2gis/general/contents/{+path}","compare_url":"https://api.github.com/repos/2gis/general/compare/{base}...{head}","merges_url":"https://api.github.com/repos/2gis/general/merges","archive_url":"https://api.github.com/repos/2gis/general/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/2gis/general/downloads","issues_url":"https://api.github.com/repos/2gis/general/issues{/number}","pulls_url":"https://api.github.com/repos/2gis/general/pulls{/number}","milestones_url":"https://api.github.com/repos/2gis/general/milestones{/number}","notifications_url":"https://api.github.com/repos/2gis/general/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/2gis/general/labels{/name}","releases_url":"https://api.github.com/repos/2gis/general/releases{/id}","deployments_url":"https://api.github.com/repos/2gis/general/deployments","created_at":"2017-03-29T09:42:16Z","updated_at":"2017-04-04T10:07:02Z","pushed_at":"2017-04-04T10:20:44Z","git_url":"git://github.com/2gis/general.git","ssh_url":"git@github.com:2gis/general.git","clone_url":"https://github.com/2gis/general.git","svn_url":"https://github.com/2gis/general","homepage":"","size":2085,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"2gis:master","ref":"master","sha":"0d03778c9a406f078678d9dcaa987698e1b1385a","user":{"login":"2gis","id":1481435,"avatar_url":"https://avatars1.githubusercontent.com/u/1481435?v=3","gravatar_id":"","url":"https://api.github.com/users/2gis","html_url":"https://github.com/2gis","followers_url":"https://api.github.com/users/2gis/followers","following_url":"https://api.github.com/users/2gis/following{/other_user}","gists_url":"https://api.github.com/users/2gis/gists{/gist_id}","starred_url":"https://api.github.com/users/2gis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2gis/subscriptions","organizations_url":"https://api.github.com/users/2gis/orgs","repos_url":"https://api.github.com/users/2gis/repos","events_url":"https://api.github.com/users/2gis/events{/privacy}","received_events_url":"https://api.github.com/users/2gis/received_events","type":"Organization","site_admin":false},"repo":{"id":86564796,"name":"general","full_name":"2gis/general","owner":{"login":"2gis","id":1481435,"avatar_url":"https://avatars1.githubusercontent.com/u/1481435?v=3","gravatar_id":"","url":"https://api.github.com/users/2gis","html_url":"https://github.com/2gis","followers_url":"https://api.github.com/users/2gis/followers","following_url":"https://api.github.com/users/2gis/following{/other_user}","gists_url":"https://api.github.com/users/2gis/gists{/gist_id}","starred_url":"https://api.github.com/users/2gis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2gis/subscriptions","organizations_url":"https://api.github.com/users/2gis/orgs","repos_url":"https://api.github.com/users/2gis/repos","events_url":"https://api.github.com/users/2gis/events{/privacy}","received_events_url":"https://api.github.com/users/2gis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/2gis/general","description":"Fast marker generalization algorithm","fork":false,"url":"https://api.github.com/repos/2gis/general","forks_url":"https://api.github.com/repos/2gis/general/forks","keys_url":"https://api.github.com/repos/2gis/general/keys{/key_id}","collaborators_url":"https://api.github.com/repos/2gis/general/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/2gis/general/teams","hooks_url":"https://api.github.com/repos/2gis/general/hooks","issue_events_url":"https://api.github.com/repos/2gis/general/issues/events{/number}","events_url":"https://api.github.com/repos/2gis/general/events","assignees_url":"https://api.github.com/repos/2gis/general/assignees{/user}","branches_url":"https://api.github.com/repos/2gis/general/branches{/branch}","tags_url":"https://api.github.com/repos/2gis/general/tags","blobs_url":"https://api.github.com/repos/2gis/general/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/2gis/general/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/2gis/general/git/refs{/sha}","trees_url":"https://api.github.com/repos/2gis/general/git/trees{/sha}","statuses_url":"https://api.github.com/repos/2gis/general/statuses/{sha}","languages_url":"https://api.github.com/repos/2gis/general/languages","stargazers_url":"https://api.github.com/repos/2gis/general/stargazers","contributors_url":"https://api.github.com/repos/2gis/general/contributors","subscribers_url":"https://api.github.com/repos/2gis/general/subscribers","subscription_url":"https://api.github.com/repos/2gis/general/subscription","commits_url":"https://api.github.com/repos/2gis/general/commits{/sha}","git_commits_url":"https://api.github.com/repos/2gis/general/git/commits{/sha}","comments_url":"https://api.github.com/repos/2gis/general/comments{/number}","issue_comment_url":"https://api.github.com/repos/2gis/general/issues/comments{/number}","contents_url":"https://api.github.com/repos/2gis/general/contents/{+path}","compare_url":"https://api.github.com/repos/2gis/general/compare/{base}...{head}","merges_url":"https://api.github.com/repos/2gis/general/merges","archive_url":"https://api.github.com/repos/2gis/general/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/2gis/general/downloads","issues_url":"https://api.github.com/repos/2gis/general/issues{/number}","pulls_url":"https://api.github.com/repos/2gis/general/pulls{/number}","milestones_url":"https://api.github.com/repos/2gis/general/milestones{/number}","notifications_url":"https://api.github.com/repos/2gis/general/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/2gis/general/labels{/name}","releases_url":"https://api.github.com/repos/2gis/general/releases{/id}","deployments_url":"https://api.github.com/repos/2gis/general/deployments","created_at":"2017-03-29T09:42:16Z","updated_at":"2017-04-04T10:07:02Z","pushed_at":"2017-04-04T10:20:44Z","git_url":"git://github.com/2gis/general.git","ssh_url":"git@github.com:2gis/general.git","clone_url":"https://github.com/2gis/general.git","svn_url":"https://github.com/2gis/general","homepage":"","size":2085,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/2gis/general/pulls/1"},"html":{"href":"https://github.com/2gis/general/pull/1"},"issue":{"href":"https://api.github.com/repos/2gis/general/issues/1"},"comments":{"href":"https://api.github.com/repos/2gis/general/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/2gis/general/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/2gis/general/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/2gis/general/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/2gis/general/statuses/1bd69d309c5051900e5ef06ca104390b4613ac91"}}}}
{"actor":{"display_login":"RLRR"}}