influxdata / influxdata/giraffe
Configuration: default values should be consistent and easy to find for all graph types
- Dominant language
- TypeScript
- Stars
- 189
- Forks
- 33
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 4
Description
Currently, configuration default values are all over the place for the different graph types. They are also implemented inconsistently. Some are in an object called **LAYER_DEFAULTS** in the file **giraffe > src > constants > index.ts** while others are implemented by their respective graph type's component. This makes it hard to find and enforce sensible defaults.
Proposal: all defaults should be in one spot so that they can be easily seen and compared. **LAYER_DEFAULTS** should hold all the default values and no defaults should be implemented by a graph type's component. **LAYER_DEFAULTS** should possibly be moved into its own file **defaults.ts**
--
**UPDATE on Feb 9, 2022:**
`` uses a `config`, which is the interface between the user and Giraffe. From `config`, a `spec` is created for almost of the different graph types (or layers).
Ensure the following:
- `config` should be validated
- `config` should be set with default values
- `spec` should be created only after the first two steps have been done
Contributor guide
Research direction
Start by inspecting giraffe/src/constants/index.ts and the LAYER_DEFAULTS object, then trace how graph-type components currently apply defaults and how turns config into spec. Consolidate the defaults in one location, validate and default config before creating spec, and confirm that graph components no longer implement separate defaults.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization, frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100