{"action":"opened","issue":{"url":"https://api.github.com/repos/UrbanInstitute/debt-interactive-map/issues/13","repository_url":"https://api.github.com/repos/UrbanInstitute/debt-interactive-map","labels_url":"https://api.github.com/repos/UrbanInstitute/debt-interactive-map/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/UrbanInstitute/debt-interactive-map/issues/13/comments","events_url":"https://api.github.com/repos/UrbanInstitute/debt-interactive-map/issues/13/events","html_url":"https://github.com/UrbanInstitute/debt-interactive-map/issues/13","id":347119028,"node_id":"MDU6SXNzdWUzNDcxMTkwMjg=","number":13,"title":"change dataset trigger has potential bug if map has been zoomed out while county/state still selected","user":{"login":"DanielJWood","id":1298194,"node_id":"MDQ6VXNlcjEyOTgxOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1298194?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielJWood","html_url":"https://github.com/DanielJWood","followers_url":"https://api.github.com/users/DanielJWood/followers","following_url":"https://api.github.com/users/DanielJWood/following{/other_user}","gists_url":"https://api.github.com/users/DanielJWood/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielJWood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielJWood/subscriptions","organizations_url":"https://api.github.com/users/DanielJWood/orgs","repos_url":"https://api.github.com/users/DanielJWood/repos","events_url":"https://api.github.com/users/DanielJWood/events{/privacy}","received_events_url":"https://api.github.com/users/DanielJWood/received_events","type":"User","site_admin":false},"labels":[{"id":722742488,"node_id":"MDU6TGFiZWw3MjI3NDI0ODg=","url":"https://api.github.com/repos/UrbanInstitute/debt-interactive-map/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":{"login":"DanielJWood","id":1298194,"node_id":"MDQ6VXNlcjEyOTgxOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1298194?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielJWood","html_url":"https://github.com/DanielJWood","followers_url":"https://api.github.com/users/DanielJWood/followers","following_url":"https://api.github.com/users/DanielJWood/following{/other_user}","gists_url":"https://api.github.com/users/DanielJWood/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielJWood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielJWood/subscriptions","organizations_url":"https://api.github.com/users/DanielJWood/orgs","repos_url":"https://api.github.com/users/DanielJWood/repos","events_url":"https://api.github.com/users/DanielJWood/events{/privacy}","received_events_url":"https://api.github.com/users/DanielJWood/received_events","type":"User","site_admin":false},"assignees":[{"login":"DanielJWood","id":1298194,"node_id":"MDQ6VXNlcjEyOTgxOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1298194?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielJWood","html_url":"https://github.com/DanielJWood","followers_url":"https://api.github.com/users/DanielJWood/followers","following_url":"https://api.github.com/users/DanielJWood/following{/other_user}","gists_url":"https://api.github.com/users/DanielJWood/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielJWood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielJWood/subscriptions","organizations_url":"https://api.github.com/users/DanielJWood/orgs","repos_url":"https://api.github.com/users/DanielJWood/repos","events_url":"https://api.github.com/users/DanielJWood/events{/privacy}","received_events_url":"https://api.github.com/users/DanielJWood/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-08-02T18:11:00Z","updated_at":"2018-08-02T18:11:00Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"There is a bug for the following section of the main.js, change dataset trigger. The `zoom` variables aren't always an indication of what is being looked at. i.e. if you click the button to zoom back out of the county/state view, your `zoom` variable will be set to `zoomNational` instead of `zoomCounty`. \r\n\r\n```\r\n        if (zoomNational == true) {          \r\n          var us_data = BigData.state_data[0][\"values\"][0]\r\n          for (var key in us_data) {\r\n              if (us_data.hasOwnProperty(key)) { \r\n                  if (+us_data[key] == NaN || +us_data[key] == 0){\r\n                    us_data[key = us_data[key]]\r\n                  }else {\r\n                    us_data[key] = +us_data[key]\r\n                  }\r\n              }\r\n          }                    \r\n          updateTable(us_data,type)\r\n        } else if (zoomCounty == true) {\r\n          console.log('here')\r\n          updateTable(d3.select(\"g.counties\").selectAll(\"path.selected\").datum(),type)\r\n        } else if (zoomState == true) {\r\n          updateTable(d3.select(\"path#\" + selectedState.properties.abbr).datum(),type)\r\n        }\r\n```\r\n\r\n\r\nSolution to this would be to look for what is selected. Following psuedo code:\r\n\r\n```\r\nif a county is selected\r\n-> updateTable(countyID,type)\r\nelse if state is selected \r\n-> updateTable(stateID,type)\r\nelse\r\n-> updateTable(national,type)\r\n```\r\n\r\nAlternatively, an easier solution would be to remove the \"zoom out\" button at bottom right. "}}
{"actor":{"display_login":"DanielJWood"}}