[PR #342] [MERGED] Gauge threshold #341

Closed
opened 2026-03-03 16:23:58 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mum4k/termdash/pull/342
Author: @lovromazgon
Created: 12/8/2022
Status: Merged
Merged: 1/8/2023
Merged by: @mum4k

Base: develHead: gauge-threshold


📝 Commits (6)

  • f13e422 Merge pull request #317 from mum4k/release-0-16-1
  • 9954a05 Merge pull request #331 from mum4k/release_v0.17.0
  • 1aba280 add gauge threshold
  • 6e46b73 refactor drawing of gauge threshold
  • 9beb360 return error if gauge threshold is negative
  • bc37cb7 more gauge threshold tests

📊 Changes

4 files changed (+214 additions, -7 deletions)

View changed files

📝 widgets/gauge/gauge.go (+38 -5)
📝 widgets/gauge/gauge_test.go (+153 -2)
📝 widgets/gauge/gaugedemo/gaugedemo.go (+2 -0)
📝 widgets/gauge/options.go (+21 -0)

📄 Description

This PR introduces the option gauge.Threshold which allows you to draw a vertical line on a gauge representing a threshold. If the gauge is drawn with a border the threshold is drawn over the border, otherwise it's only drawn within the gauge itself. The threshold is only drawn if its value is within the gauge (greater than 0 and less than g.total).

I took the liberty to change the demo to draw a threshold on two of the gauges.
image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mum4k/termdash/pull/342 **Author:** [@lovromazgon](https://github.com/lovromazgon) **Created:** 12/8/2022 **Status:** ✅ Merged **Merged:** 1/8/2023 **Merged by:** [@mum4k](https://github.com/mum4k) **Base:** `devel` ← **Head:** `gauge-threshold` --- ### 📝 Commits (6) - [`f13e422`](https://github.com/mum4k/termdash/commit/f13e4222fa62b251e937fa2a00ffab003d814f13) Merge pull request #317 from mum4k/release-0-16-1 - [`9954a05`](https://github.com/mum4k/termdash/commit/9954a0543ed738c7ccb78ecd8eaed8e21db6ae7e) Merge pull request #331 from mum4k/release_v0.17.0 - [`1aba280`](https://github.com/mum4k/termdash/commit/1aba280365cf81571d80827f392359c2010b1d52) add gauge threshold - [`6e46b73`](https://github.com/mum4k/termdash/commit/6e46b739275ae0c6007d09981e77388ccdb369b4) refactor drawing of gauge threshold - [`9beb360`](https://github.com/mum4k/termdash/commit/9beb36080d44aca801813ab47b19a40db9f8d48f) return error if gauge threshold is negative - [`bc37cb7`](https://github.com/mum4k/termdash/commit/bc37cb70a74c634db21ba03702bb265600799b44) more gauge threshold tests ### 📊 Changes **4 files changed** (+214 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `widgets/gauge/gauge.go` (+38 -5) 📝 `widgets/gauge/gauge_test.go` (+153 -2) 📝 `widgets/gauge/gaugedemo/gaugedemo.go` (+2 -0) 📝 `widgets/gauge/options.go` (+21 -0) </details> ### 📄 Description This PR introduces the option `gauge.Threshold` which allows you to draw a vertical line on a gauge representing a threshold. If the gauge is drawn with a border the threshold is drawn over the border, otherwise it's only drawn within the gauge itself. The threshold is only drawn if its value is within the gauge (greater than 0 and less than `g.total`). I took the liberty to change the demo to draw a threshold on two of the gauges. ![image](https://user-images.githubusercontent.com/8320753/206463316-c75fdb09-cbd5-4fca-bef0-0c2fb13dbe43.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 16:23:58 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#341
No description provided.