codefordurham / BikeSafety

Show common areas of bike accidents to help prevent future accidents
http://bikesafety.codefordurham.com/
11 stars 6 forks source link

Provide more descriptive labels to binary type datapoints #48

Open dsummersl opened 8 years ago

dsummersl commented 8 years ago

The example we talked about at the meetup was the 'driver drunk' field. It would be better to say..."not intoxicated" instead of "no" or "intoxicated" for "yes".

We should do something similar for the following data types:

dsummersl commented 8 years ago

Points in the code that you could use to implement this:

  1. Add a new kind of function that takes the source data ('Yes', 'No'), and allows you to return some other value ('intoxicated', etc). Similar to how the 'colors' function works here: https://github.com/BikeSafety/BikeSafety/blob/master/html/includes/angular/app.js#L183 (example: https://github.com/BikeSafety/BikeSafety/blob/master/html/includes/angular/app.js#L212). Maybe call the key convertData or something else that communicates the transformation...
  2. Modify the Legend code, so that it calls this transformation function (again, kinda like the color key is called): https://github.com/BikeSafety/BikeSafety/blob/master/html/includes/angular/MainMap.js#L78