question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: relative color thresholds

See original GitHub issue

Hello, I have an idea to improve the Dynamic line color feature.

Instead of setting absolute values in the color_thresholds option, it would be great to use relative values.

For example:

  color_thresholds:
    - value: 0%
      color: "#1feaea" # Blue
    - value: 50%
      color: "#ffd200" # Yellow
    - value: 100%
      color: "#f72047" # Red

Or even easier, omitting values

  color_thresholds:
    - color: "#1feaea" # Blue
    - color: "#ffd200" # Yellow
    - color: "#f72047" # Red

image

The goal is that the bottom of the graph is always blue and the top is always red, no matter what the values are.


Technically, this is easy to do in SVG:

<defs>
    <linearGradient id="my-gradient-id" x1="0" y1="1" x2="0" y2="0">
        <stop offset="0" stop-color="#1feaea"></stop>
        <stop offset="0.5" stop-color="#ffd200"></stop>
        <stop offset="1" stop-color="#f72047"></stop>
    </linearGradient>
</defs>
<rect class="line--rect" fill="url(#my-gradient-id)"></rect>

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
kalkihcommented, Oct 22, 2019

Thanks, great suggestion!

0reactions
stale[bot]commented, Apr 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this is still an active issue, please let us know!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature Request: Dynamic or "relative" threshold #3986 - GitHub
I have a use case where I have several series that are generally static over time. That is, the value changes infrequently.
Read more >
Target threshold colors attribute
Request many to many task relations ... Target threshold colors attribute ... Extend the functionality of a Wikitext field.
Read more >
Configure thresholds | Grafana documentation
Thresholds provide one method for you to conditionally style and color your visualizations based on query results. You can apply thresholds to most,...
Read more >
Measuring and Modeling the Feature Detection Threshold ...
The results are used to test the hypothesis that a uniform color space (CIELAB) will accurately model colormapped feature detection thresholds ...
Read more >
Contrast (Minimum) - : - Understanding SC 1.4.3 - W3C
This can be exacerbated if the person has a color vision deficiency that lowers the contrast even further. Providing a minimum luminance contrast...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found