fix: gradient for color thresholds - #1361
Conversation
da5a819 to
16b2e31
Compare
16b2e31 to
47aabd5
Compare
47aabd5 to
fc1a471
Compare
|
@fran68 Here:
What do you think? Also, I am a bit unsure about may be an offset should be 100? |
fc1a471 to
52934d7
Compare
|
@ildar170975 But I dont know how to deal with that logarithmic thing. Is there ever a scale value which is negative? |
7535bd5 to
b4c7d3b
Compare
|
We can discuss it in our chat. |
This logic: stands for a case when "max = min". Now, regarding NEGATIVE values (offset <0). Regarding logarithmic values. I think this PR is ready and can be merged. What do you think? |

IMO this should fix the problem with the color thresholds. In function computeGradient in src/graph.js the thresholds are evaluated as real values. When displaying the graph the gradient course is distorted since the margins at top and bottom affect the gradient offset. So the offset of the gradient needs to be adapted by considering the margin.
This might fix
#1080
#1108
#1137
#723
Before:


After applying the patch:

