influxdata / influxdata/giraffe

Customization / clean up of units

Open
#343 2 comments 0 reactions 0 assignees View on GitHub
kind/feature request team/dumplings team/ui
Dominant language
TypeScript
Stars
189
Forks
33
Avg merge
3d 15h
Merged PRs (30d)
4

Description

### Background
There's currently limited ability to change the units on a graph. There are three choices (none, si, binary) with some prefix or suffix label options. We want to give users more control of the units.

### Additional options

- Comma separation
- if `true` separate every third character with a comma starting from the beginning of the string
- Essentially turns `1000` into `1,000`
- Unit scale & Suffix/Prefix scale
- Different than y axis scale
- User would specify an array of when to "scale" up the unit by entering comma separated values instead of a single value
- For example, a time unit scale would be `[0,60, 60, 24, 30]`. You could match unit scale to suffix scale `[s,m,h,d,mo]`
- Another example would be bits:
- unit scale: `[0, 1024, 1024, 1024, 1024]`
- suffix scale: `[b, Kb, Mb, Gb, Tb]`

### Presets

- Once the above options are implemented we can also implement unit presets, which represent common combinations of options for specific units
- Example:
- `$USD`
- 2 decimal points
- comma separation true
- prefix with `$`
- unit scale with `[0,1000,1000,1000,1000]`
- suffix scale with `[,,M,B,T]` (first two are blank)
- Bytes
- 2 decimal points
- unit scale with `[0,1024,1024,1024,1024]`
- suffix scale with `[b,Kb,Mb,Gb,Tb,Pb]`

Contributor guide

Open the contributing guide

Research direction

Start by locating the graph unit-formatting implementation and the existing none, SI, and binary unit options. Review how prefix and suffix labels are currently configured, then define the behavior and acceptance criteria for comma separation, scale arrays, suffix arrays, and presets before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.