gazetteerhk / census_explorer

Explore Hong Kong's neighborhoods through visualizations of census data
http://gazetteer.hk
MIT License
42 stars 12 forks source link

Issue33 #34

Closed hupili closed 10 years ago

hupili commented 10 years ago

33 , tested.

BTW, I tried to get back the previous three test Apps and can not fit into current CensusAPI. Is it a bit over specified? i.e. some operations like joinData or joinGroups only apply to a type of applications. Should we make a thin service only to stablize interface and leave manipulation to Apps?

hxu commented 10 years ago

Yes, you are correct. I originally thought that maybe the CensusAPI service should automatically unpack data, but then decided it would be too complex, so the functions you mention are mostly there for apps to use.

For the original examples that you had, I think I need to also extend hkChoropleth to handle custom scales, since measures like the median cannot automatically be calculated from the data. I will work on this today and restore the original three examples to show how it can be accomplished.

hupili commented 10 years ago

@hxu , median can be calculated by the API. Just to note, after calculation, the value only contains the frequency of that category. The real "median" we want to present is the row. However, rows are english strings. So we used a simple technique to map them into numeric levels. Note that row identifiers start with cell name, so the index of sorted version can be directly used to plot.

//TODO: // Try to find better curving function to make the colorscheme visually clearer.

This also looks application specific. Since rows in different tables were bin-packed with different criterion, only App developers can get a proper curving by trials.

hxu commented 10 years ago

I've implemented a much more extensible choropleth and one of the original examples in ab2238182f2d36c. It works, but it needs a bit of cleaning up and documentation, so I'll continue to work on this.