-
Notifications
You must be signed in to change notification settings - Fork 981
/
Copy pathcurrent_usage.md
184 lines (123 loc) · 5.16 KB
/
current_usage.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# Usage
The purpose of this doc is to keep track of the current (as of 2022-11-14) usage of the [charts plugin](../../src/plugins/charts/), as well as other packages and tools with similar purposes. See https://github.com/opensearch-project/OpenSearch-Dashboards/issues/2830 for more information on future plans.
## Lifecycle methods/services
### `ChartsPluginStart`
1. `ChartsPluginStart['theme']` used by `discover` plugin to fetch `chartsTheme` and `chartsBaseTheme` for use in styling the histogram.
### `ChartsPluginSetup`
1. `ChartsPluginSetup` declared as one of `MetricVisPluginSetupDependencies` in the `vis_type_metric` plugin, but isn't actually used.
2. `ChartsPluginSetup['colors']` used by `vis_type_tagcloud` plugin. Only the seed colors are used via `d3.scale.ordinal().range(colors.seedColors)`
3. `ChartsPluginSetup.colors` and `ChartsPluginSetup.theme` used by the `vis_type_timeseries` plugin.
1. `themeService.useChartsBaseTheme()` is used only as a fallback; otherwise theme (dark or light) is calculated from the user-specified background color
2. `colors.mappedColors` used to fetch mapped colors only if user has not specified a color for a particular series label (and there's no color specified from the server).
4. `ChartsPluginSetup.colors.createColorLookupFunction()` is used by the `vis_type_vislib` plugin, ultimately, as part of `getColorFunc()` and `getPieColorFunc()`; the former also uses fallback for default and overwritten colors from `uiState`.
5. Set as a dependency in stub plugin `vis_type_xy`, but not actually used.
## `uiSettings` in advanced settings `visualization:colorMapping`
Appears to only be used by the telemetry plugin: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/95f4fd5c6a6cd59bd555bf0ec120843ef6a93566/src/plugins/telemetry/schema/oss_plugins.json#L1363
## Static functions and components
### Color Maps
#### `ColorMap` interface
1. `region_map` plugin
2. `tile_map` plugin
3. `timeline` plugin
4. `vis_type_metric` plugin
5. `vis_type_timeline` plugin
#### `ColorSchema` interface
1. `maps_legacy` plugin
2. `region_map` plugin
3. `tile_map` plugin
4. `vis_type_metric` plugin
5. `vis_type_vislib` plugin
6. `visualizations` plugin
7. `visualize` plugin
8. `vis_builder` plugin
#### `ColorSchemas` enum
1. `region_map` plugin
2. `tile_map` plugin
3. `vis_type_metric` plugin
4. `vis_type_vislib` plugin
5. `vis_builder` plugin
#### `RawColorSchema` interface
Not used by any core plugins
#### `colorSchemas` array of objects
1. `region_map` plugin
2. `tile_map` plugin
3. `vis_type_metric` plugin
4. `vis_type_vislib` plugin
5. `vis_builder` plugin
#### `getHeatmapColors` function
1. `vis_type_metric` plugin
2. `vis_type_vislib` plugin
#### `truncatedColorMaps` object
1. `region_map` plugin
2. `tile_map` plugin
#### `truncatedColorSchemas` array of objects
1. `region_map` plugin
2. `tile_map` plugin
#### `vislibColorMaps` object
1. `vis_type_metric` plugin
### React components
These components may eventually make more sense elsewhere. See https://github.com/opensearch-project/OpenSearch-Dashboards/issues/2832 for one such proposal.
#### `ColorModes` object
1. `vis_type_metric` plugin
2. `vis_type_vislib` plugin
3. `vis_builder` plugin
#### `Rotates` object
1. `vis_type_vislib` plugin
#### `BasicOptions` component
1. `tile_map` plugin
2. `vis_type_vislib` plugin
3. `vis_builder` plugin
#### `ColorRanges` component
1. `vis_type_metric` plugin
2. `vis_type_vislib` plugin
3. `vis_builder` plugin
#### `ColorSchemaOptions` component
Accounts for customized `vis.colors` in the `uiState`. Supports setting custom colors via legend, and resetting.
1. `vis_type_metric` plugin. Doesn't actually support custom colors
2. `vis_type_vislib` plugin
3. `vis_builder` plugin (metric visualization). Doesn't support custom colors
#### `NumberInputOption` component
1. `region_map` plugin
2. `vis_type_table` plugin
3. `vis_type_vislib` plugin
#### `RangeOption` component
1. `tile_map` plugin
2. `vis_type_markdown` plugin
3. `vis_type_metric` plugin
4. `vis_type_timeseries` plugin
5. `vis_builder` plugin
#### `RequiredNumberInputOption` component
1. `vis_type_vislib` plugin
#### `SelectOption` component
1. `index_pattern_management` plugin
2. `maps_legacy` plugin
3. `region_map` plugin
4. `tile_map` plugin
5. `vis_type_table` plugin
6. `vis_type_tagcloud` plugin
7. `vis_type_timeseries` plugin
8. `vis_type_vislib` plugin
9. `vis_builder` plugin
#### `SwitchOption` component
1. `maps_legacy` plugin
2. `region_map` plugin
3. `tile_map` plugin
4. `vis_type_markdown` plugin
5. `vis_type_metric` plugin
6. `vis_type_table` plugin
7. `vis_type_tagcloud` plugin
8. `vis_type_vislib` plugin
9. `vis_builder` plugin
#### `TextInputOption` component
1. `maps_legacy` plugin
2. `vis_type_vislib` plugin
# OUI chart colors
An alternative to using color schemas and maps provided by the `charts` plugin is to use [color palettes from OUI](https://github.com/opensearch-project/oui/blob/main/src/services/color/oui_palettes.ts).
## `ouiPaletteColorBlind()`
1. `index_pattern_management` plugin
2. `vis_type_vega` plugin
3. `vis_type_vislib` plugin
## Other quantitative palettes
Not currently used
## `colorPalette`
Not currently used