Skip to content

Add Single Stat component

There's an issue in CE to add Gauge / single value chart types to gitlab-ui: https://gitlab.com/gitlab-org/gitlab-ce/issues/57084. This is similar to the Singlestat panel in Grafana. This issue is to track the addition of the 'callout' component.

A version of this idea already exists in the security dashboard, but is not yet reusable.

Proposal:

  • Transfer the single stat component from the security dashboard (this issue).
  • Update the security dashboard to use the new gitlab-ui component.

UI:
Screenshot_2019-02-20_at_13.50.36

I'm interested in feedback on:

  • Naming
    • Is Callout the best name for this? This seems to be our internal name, not sure if it's ubiquitous. Update: Let's use single stat - #174 (comment 143215324)
  • API. Some options/ideas:
    1. Define colors by thresholds passed to the component. Most similar to Grafana's api.
    2. Define colors by a state prop (low, medium, high, critical). The security dashboard uses it like this.
    3. Pass colors in as variables. More flexible, but more work/code required for whoever uses it, and potential duplication if all use cases are similar.

Other things to consider:

  • We may want to support overlaying the values on top of another graph.
Edited by Tristan Read