{"action":"created","comment":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments/68731084","id":68731084,"diff_hunk":"@@ -98,6 +101,19 @@ F.prototype._onWidgetDefinitionSynced = function (m) {\n   }\n };\n \n+F.prototype._onLayerChangeCheckWidgetAutoStyling = function (model, style) {\n+  var self = this;\n+  var currentLayerId = model.get('id');\n+  var widgetsToInvalidate = this.widgetDefinitionsCollection.where({'layer_id': currentLayerId});\n+  widgetsToInvalidate.forEach(function (widget) {\n+    var widgetModel = self._diDashboard.getWidget(widget.id);\n+    if (widgetModel) {\n+      widgetModel.cancelAutoStyle();","path":"lib/assets/javascripts/cartodb3/deep-insights-integrations.js","position":28,"original_position":28,"commit_id":"ca9ab8af6607c3b95c2bd04e4a110602aec5cd21","original_commit_id":"a261964434eb732c20b98c941de53f75b330b087","user":{"login":"viddo","id":978461,"avatar_url":"https://avatars.githubusercontent.com/u/978461?v=3","gravatar_id":"","url":"https://api.github.com/users/viddo","html_url":"https://github.com/viddo","followers_url":"https://api.github.com/users/viddo/followers","following_url":"https://api.github.com/users/viddo/following{/other_user}","gists_url":"https://api.github.com/users/viddo/gists{/gist_id}","starred_url":"https://api.github.com/users/viddo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viddo/subscriptions","organizations_url":"https://api.github.com/users/viddo/orgs","repos_url":"https://api.github.com/users/viddo/repos","events_url":"https://api.github.com/users/viddo/events{/privacy}","received_events_url":"https://api.github.com/users/viddo/received_events","type":"User","site_admin":false},"body":"I understand _what_ it does, but I was asking _why_ not handle that as a side-effect internally in DI instead? I.e. listen to layer changes on style and reset the autostyling if it's changed. \r\n\r\nIs there some use-case where the styles might change but the autostyle state should still be set (even if it's not auto-styled anymore)?\r\n\r\nBtw, wouldn't this method call break for widgets that don't have auto-styling? From [what I can see](https://github.com/CartoDB/deep-insights.js/search?utf8=%E2%9C%93&q=cancelAutostyle&type=Code) it's only category and histogram that have that behavior.","created_at":"2016-06-28T10:13:14Z","updated_at":"2016-06-28T10:13:14Z","html_url":"https://github.com/CartoDB/cartodb/pull/8252#discussion_r68731084","pull_request_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/8252","_links":{"self":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments/68731084"},"html":{"href":"https://github.com/CartoDB/cartodb/pull/8252#discussion_r68731084"},"pull_request":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/8252"}}},"pull_request":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/8252","id":75347451,"html_url":"https://github.com/CartoDB/cartodb/pull/8252","diff_url":"https://github.com/CartoDB/cartodb/pull/8252.diff","patch_url":"https://github.com/CartoDB/cartodb/pull/8252.patch","issue_url":"https://api.github.com/repos/CartoDB/cartodb/issues/8252","number":8252,"state":"open","locked":false,"title":"Autostyle invalidation on layer style change","user":{"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},"body":"Fixes #8050 \r\n\r\ncc @xavijam ","created_at":"2016-06-27T17:16:22Z","updated_at":"2016-06-28T10:13:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0aec56cf46864a53fc27b78c623b3e3b83ee8f6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/8252/commits","review_comments_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/8252/comments","review_comment_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/issues/8252/comments","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/ca9ab8af6607c3b95c2bd04e4a110602aec5cd21","head":{"label":"CartoDB:autostyle-invalidation","ref":"autostyle-invalidation","sha":"ca9ab8af6607c3b95c2bd04e4a110602aec5cd21","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":4909355,"name":"cartodb","full_name":"CartoDB/cartodb","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/cartodb","description":"Location Intelligence & Data Visualization tool","fork":false,"url":"https://api.github.com/repos/CartoDB/cartodb","forks_url":"https://api.github.com/repos/CartoDB/cartodb/forks","keys_url":"https://api.github.com/repos/CartoDB/cartodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/cartodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/cartodb/teams","hooks_url":"https://api.github.com/repos/CartoDB/cartodb/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/cartodb/events","assignees_url":"https://api.github.com/repos/CartoDB/cartodb/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/cartodb/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/cartodb/tags","blobs_url":"https://api.github.com/repos/CartoDB/cartodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/cartodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/cartodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/cartodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/cartodb/languages","stargazers_url":"https://api.github.com/repos/CartoDB/cartodb/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/cartodb/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/cartodb/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/cartodb/subscription","commits_url":"https://api.github.com/repos/CartoDB/cartodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/cartodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/cartodb/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/cartodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/cartodb/merges","archive_url":"https://api.github.com/repos/CartoDB/cartodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/cartodb/downloads","issues_url":"https://api.github.com/repos/CartoDB/cartodb/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/cartodb/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/cartodb/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/cartodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/cartodb/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/cartodb/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/cartodb/deployments","created_at":"2012-07-05T15:23:45Z","updated_at":"2016-06-27T16:14:04Z","pushed_at":"2016-06-28T10:10:11Z","git_url":"git://github.com/CartoDB/cartodb.git","ssh_url":"git@github.com:CartoDB/cartodb.git","clone_url":"https://github.com/CartoDB/cartodb.git","svn_url":"https://github.com/CartoDB/cartodb","homepage":"http://cartodb.com","size":391426,"stargazers_count":1170,"watchers_count":1170,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":293,"mirror_url":null,"open_issues_count":1002,"forks":293,"open_issues":1002,"watchers":1170,"default_branch":"master"}},"base":{"label":"CartoDB:master","ref":"master","sha":"b055abcabd414eab5aa494c9fb0d3265dc73a84b","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":4909355,"name":"cartodb","full_name":"CartoDB/cartodb","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/cartodb","description":"Location Intelligence & Data Visualization tool","fork":false,"url":"https://api.github.com/repos/CartoDB/cartodb","forks_url":"https://api.github.com/repos/CartoDB/cartodb/forks","keys_url":"https://api.github.com/repos/CartoDB/cartodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/cartodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/cartodb/teams","hooks_url":"https://api.github.com/repos/CartoDB/cartodb/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/cartodb/events","assignees_url":"https://api.github.com/repos/CartoDB/cartodb/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/cartodb/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/cartodb/tags","blobs_url":"https://api.github.com/repos/CartoDB/cartodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/cartodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/cartodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/cartodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/cartodb/languages","stargazers_url":"https://api.github.com/repos/CartoDB/cartodb/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/cartodb/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/cartodb/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/cartodb/subscription","commits_url":"https://api.github.com/repos/CartoDB/cartodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/cartodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/cartodb/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/cartodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/cartodb/merges","archive_url":"https://api.github.com/repos/CartoDB/cartodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/cartodb/downloads","issues_url":"https://api.github.com/repos/CartoDB/cartodb/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/cartodb/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/cartodb/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/cartodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/cartodb/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/cartodb/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/cartodb/deployments","created_at":"2012-07-05T15:23:45Z","updated_at":"2016-06-27T16:14:04Z","pushed_at":"2016-06-28T10:10:11Z","git_url":"git://github.com/CartoDB/cartodb.git","ssh_url":"git@github.com:CartoDB/cartodb.git","clone_url":"https://github.com/CartoDB/cartodb.git","svn_url":"https://github.com/CartoDB/cartodb","homepage":"http://cartodb.com","size":391426,"stargazers_count":1170,"watchers_count":1170,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":293,"mirror_url":null,"open_issues_count":1002,"forks":293,"open_issues":1002,"watchers":1170,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/8252"},"html":{"href":"https://github.com/CartoDB/cartodb/pull/8252"},"issue":{"href":"https://api.github.com/repos/CartoDB/cartodb/issues/8252"},"comments":{"href":"https://api.github.com/repos/CartoDB/cartodb/issues/8252/comments"},"review_comments":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/8252/comments"},"review_comment":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/8252/commits"},"statuses":{"href":"https://api.github.com/repos/CartoDB/cartodb/statuses/ca9ab8af6607c3b95c2bd04e4a110602aec5cd21"}}}}
{"actor":{"display_login":"viddo"}}