10bestdesign / jqvmap

jQuery Vector Map Library
https://www.10bestdesign.com/jqvmap/
Other
1.82k stars 682 forks source link

Feature request: Absolute scaling #190

Open a1xon opened 8 years ago

a1xon commented 8 years ago

Hey, is it possible to add a min and max values for the scaling colors? at the moment the scale works relative but it would be pretty handy if for example the user could set the min and max values. Like: 0 -> red 100 -> green. Doesn't matter if all values are around 30. I tried to set the minValue & maxValue in the ColorScale function but this doesn't work. Any Idea? Thanks a lot guys!

manifestinteractive commented 8 years ago

Any way you can paste as a comment what you tried to do in the ColorScale function so I can understand more clearly what your are trying to accomplish ? Even if it does not work, I will be better able to understand if I see what you thought should work.

a1xon commented 8 years ago

I am so sorry. My english sucks and I am bad at describing. So I made a small drawing. Hope that helps.

absolute scaling

I don't know if I am the only one who needs this.. But imagine you prensent the GDP of different countrys and every country you present has got a average or good GDP. The average value will be displayed as a low scaleColor because it is the lowest in the data but in fact it is not bad at all.

Why this could be important in another example: If you want to display hospitals per capita it doesn't matter if a state has got 5 or 500 hospitals per 1000 inhabitants. 5 is fine, 500 is fine too. So the scale boundries would be set to 0 and 5. In this case you can see where the problems really are because the "color resolution" in the lower parts of the data is not distorted by the unimportant high values. This works in both directions.

manifestinteractive commented 8 years ago

Thanks @a1xon, that clears up the confusion. I might take a stab at this later in the week. I was playing catchup on current jqvmap issues this weekend :wink:

a1xon commented 8 years ago

You did a great job! Hats off!

wen96 commented 7 years ago

Any update on this? Would be nice to me too.