livienyin/lexvlex — pull request #9 by lyzidiamond (2014-06-09 22:49:44+00:00)
Title: Dynamic stats

Updates stats dynamically. This is how it works:

- When you click a feature, that feature is passed as an argument into the `update_stats()` function.
- `update_stats()` iterates over each amenity/stat in the list and does the following:
- Skips `GEOID10` and `tract_name`
- Checks to see if there are parks in the tract. If yes, sets value of `tract_amenity` to actual tract value. If no, sets value of tract_amenity to "N/A".
- In line 73: Selects DOM element by amenity ID (the IDs match the amenity names), updates the HTML to include the stat value.