citruspi / RHoKTheHood

A system for visualizing census data over the City of Rochester.
https://rhokthehood.com
MIT License
4 stars 2 forks source link

Allow for non-linear scaling when displaying datasets #3

Closed thequbit closed 10 years ago

thequbit commented 10 years ago

Allow for non-linear steps for shading data.

thequbit commented 10 years ago

If the data set has a large range, but the largest difference is more than, say, twice the range/count displaying the data using a linear scale of coloring won't produce a visually appealing result.

Taking the data set: [0,1,2,400].

If you split this into four equal size groups of colors:

light blue: 0 -> max/4 -1
medium blue: max/4 -> ((max/4)*2) -1
blue: ((max/4)*2) -> ((max/4)*3) -1
dark blue: ((max/4)*3) -> INF

This would result in a color set that would look like: ['light blue','light blue','light blue','dark blue']

What you would really want is to produce some kind of non-linear scale to produce: ['light blue','medium blue','blue','dark blue']

I believe D3 should have this ability built in ... If you look at this line ...

https://github.com/citruspi/RHokTheHood/blob/master/static/js/script.js#L136

... I think you should be able to set that to something other than linear() and get the result I have described above.

citruspi commented 10 years ago

@thequbit,

I already mentioned this in IRC, but I figured I'd put it here so that other people can comment.

I believe that doing this would be akin to skewing the data - we would be modifying the way the data is seen, giving it values which aren't accurate.

I think that a better approach would be to have a bigger scale with a more "visually appealing" color range which is defined on a legend.

For that reason, I'm closing this issue for now. After we implement the legend, if you think that it's still an issue, we can look into it again.

— @citruspi