I am having a bit of a problem creating a visualization. Basically I need some lines of different thickness based on a certain value. Now I know that map() can basically do what I want and it would be great if not for one simple problem. Most values are in the range of 0-200, but there are a few exceptions where a value exceeds 2500. I want a line that is from 1-30px in width - if I use map() with min 0 and maximum 2558 then the whole thing just looks silly.
Of course I considered simply manually mapping those values but since the whole visualization is dynamic I can't really do that.
So I need some way to map values to a certain range but somehow consider the average value in that calculation too.
Here are a few of my values:
Of course I considered simply manually mapping those values but since the whole visualization is dynamic I can't really do that.
So I need some way to map values to a certain range but somehow consider the average value in that calculation too.
Here are a few of my values:
- 67
67
69
72
78
80
97
97
106
109
117
126
135
151
154
170
288
315
319
327
349
392
420
789
2327
2558
1