influxdata / influxdata/giraffe

Configuration: default values should be consistent and easy to find for all graph types

Open
#447 0 comments 0 reactions 0 assignees View on GitHub
refactor team/dumplings team/ui
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.