K-Phoen / grabana

User-friendly Go library for building Grafana dashboards
MIT License
680 stars 69 forks source link

add support for value mappings to stat panels. #223

Open AndersSoee opened 1 year ago

AndersSoee commented 1 year ago

Fixes https://github.com/K-Phoen/grabana/issues/222

Requires PR for sdk lib : https://github.com/K-Phoen/sdk/pull/22

Enables usage in the form:

        stat.ValueMappings(
            stat.RangeMapping(0, 0.9).Text("DOWN").Color("red"),
            stat.RangeMapping(1, 1).Text("UP"),
            stat.ValueMapping("UP").Color("green"),
        ),
codecov[bot] commented 1 year ago

Codecov Report

Merging #223 (15f8e87) into master (8a7600e) will increase coverage by 0.11%. The diff coverage is 100.00%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/K-Phoen/grabana/pull/223/graphs/tree.svg?width=650&height=150&src=pr&token=eJwYXNp5jD&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K%C3%A9vin+Gomez)](https://codecov.io/gh/K-Phoen/grabana/pull/223?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K%C3%A9vin+Gomez) ```diff @@ Coverage Diff @@ ## master #223 +/- ## ========================================== + Coverage 90.07% 90.18% +0.11% ========================================== Files 92 92 Lines 6934 7013 +79 ========================================== + Hits 6246 6325 +79 Misses 543 543 Partials 145 145 ``` | [Impacted Files](https://codecov.io/gh/K-Phoen/grabana/pull/223?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K%C3%A9vin+Gomez) | Coverage Δ | | |---|---|---| | [stat/stat.go](https://codecov.io/gh/K-Phoen/grabana/pull/223?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=K%C3%A9vin+Gomez#diff-c3RhdC9zdGF0Lmdv) | `100.00% <100.00%> (ø)` | |
orloffv commented 5 months ago

@K-Phoen, hi! Grabana - great product, thank you. Can you give feedback on this pull request, I need this feature