Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change dataset trigger has potential bug if map has been zoomed out while county/state still selected #13

Open
DanielJWood opened this issue Aug 2, 2018 · 0 comments
Assignees

Comments

@DanielJWood
Copy link
Contributor

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.

        if (zoomNational == true) {          
          var us_data = BigData.state_data[0]["values"][0]
          for (var key in us_data) {
              if (us_data.hasOwnProperty(key)) { 
                  if (+us_data[key] == NaN || +us_data[key] == 0){
                    us_data[key = us_data[key]]
                  }else {
                    us_data[key] = +us_data[key]
                  }
              }
          }                    
          updateTable(us_data,type)
        } else if (zoomCounty == true) {
          console.log('here')
          updateTable(d3.select("g.counties").selectAll("path.selected").datum(),type)
        } else if (zoomState == true) {
          updateTable(d3.select("path#" + selectedState.properties.abbr).datum(),type)
        }

Solution to this would be to look for what is selected. Following psuedo code:

if a county is selected
-> updateTable(countyID,type)
else if state is selected 
-> updateTable(stateID,type)
else
-> updateTable(national,type)

Alternatively, an easier solution would be to remove the "zoom out" button at bottom right.

@DanielJWood DanielJWood added the bug label Aug 2, 2018
@DanielJWood DanielJWood self-assigned this Aug 2, 2018
@DanielJWood DanielJWood added webview 2 Second Priority labels Sep 26, 2018
@DanielJWood DanielJWood removed 2 Second Priority labels Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant