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.
- UI: https://gitlab.com/gitlab-org/gitlab-ee/issues/6954
- Code: https://gitlab.com/gitlab-org/gitlab-ee/blob/28ec88f6a6a84feac8ba8392440249566ed900af/ee/app/assets/javascripts/security_dashboard/components/vulnerability_count.vue
Proposal:
- Transfer the single stat component from the security dashboard (this issue).
- Update the security dashboard to use the new gitlab-ui component.
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:
- Define colors by thresholds passed to the component. Most similar to Grafana's api.
- Define colors by a state prop (
low,medium,high,critical). The security dashboard uses it like this. - 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
