@cdc/chart 4.25.3-6 → 4.25.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/cdcchart-1a1724a1.es.js +4886 -0
  2. package/dist/cdcchart.js +51921 -76151
  3. package/index.html +1 -1
  4. package/package.json +2 -2
  5. package/src/CdcChart.tsx +1 -22
  6. package/src/CdcChartComponent.tsx +27 -13
  7. package/src/_stories/Chart.CI.stories.tsx +33 -0
  8. package/src/_stories/Chart.Legend.Gradient.stories.tsx +6 -0
  9. package/src/_stories/Chart.stories.tsx +0 -16
  10. package/src/_stories/_mock/bar_chart_ci_labels.json +620 -0
  11. package/src/_stories/_mock/legend_groupBy_mock.json +474 -0
  12. package/src/components/BarChart/components/BarChart.Horizontal.tsx +1 -1
  13. package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +1 -1
  14. package/src/components/BarChart/components/BarChart.StackedVertical.tsx +1 -1
  15. package/src/components/BarChart/components/BarChart.Vertical.tsx +2 -2
  16. package/src/components/EditorPanel/EditorPanel.tsx +60 -24
  17. package/src/components/EditorPanel/helpers/updateFieldRankByValue.ts +4 -3
  18. package/src/components/Legend/Legend.Component.tsx +69 -58
  19. package/src/components/Legend/Legend.tsx +3 -1
  20. package/src/components/Legend/LegendGroup/LegendGroup.styles.css +40 -0
  21. package/src/components/Legend/LegendGroup/LegendGroup.tsx +103 -0
  22. package/src/components/Legend/LegendGroup/index.tsx +3 -0
  23. package/src/components/LineChart/components/LineChart.Circle.tsx +14 -9
  24. package/src/components/LineChart/index.tsx +18 -7
  25. package/src/components/LinearChart.tsx +38 -30
  26. package/src/data/initial-state.js +1 -1
  27. package/src/helpers/dataHelpers.ts +10 -0
  28. package/src/helpers/sizeHelpers.ts +23 -0
  29. package/src/hooks/useBarChart.ts +2 -1
  30. package/src/hooks/useScales.ts +2 -8
  31. package/src/store/chart.actions.ts +1 -1
  32. package/src/types/ChartConfig.ts +2 -1
@@ -0,0 +1,474 @@
1
+ {
2
+ "annotations": [],
3
+ "type": "chart",
4
+ "debugSvg": false,
5
+ "chartMessage": {
6
+ "noData": "No Data Available"
7
+ },
8
+ "title": "Legend Group in Bar Chart",
9
+ "showTitle": true,
10
+ "showDownloadMediaButton": false,
11
+ "theme": "theme-blue",
12
+ "animate": false,
13
+ "fontSize": "medium",
14
+ "lineDatapointStyle": "hover",
15
+ "lineDatapointColor": "Same as Line",
16
+ "barHasBorder": "false",
17
+ "isLollipopChart": false,
18
+ "lollipopShape": "circle",
19
+ "lollipopColorStyle": "two-tone",
20
+ "visualizationSubType": "regular",
21
+ "barStyle": "flat",
22
+ "roundingStyle": "standard",
23
+ "tipRounding": "top",
24
+ "isResponsiveTicks": true,
25
+ "general": {
26
+ "annotationDropdownText": "Annotations",
27
+ "showDownloadButton": false,
28
+ "showMissingDataLabel": false,
29
+ "showSuppressedSymbol": true,
30
+ "showZeroValueData": false,
31
+ "hideNullValue": true
32
+ },
33
+ "padding": {
34
+ "left": 5,
35
+ "right": 5
36
+ },
37
+ "preliminaryData": [],
38
+ "yAxis": {
39
+ "hideAxis": false,
40
+ "displayNumbersOnBar": false,
41
+ "hideLabel": false,
42
+ "hideTicks": false,
43
+ "size": "75",
44
+ "gridLines": false,
45
+ "enablePadding": false,
46
+ "min": "0.1",
47
+ "max": "3",
48
+ "labelColor": "#333",
49
+ "tickLabelColor": "#333",
50
+ "tickColor": "#333",
51
+ "rightHideAxis": true,
52
+ "rightAxisSize": 0,
53
+ "rightLabel": "",
54
+ "rightLabelOffsetSize": 0,
55
+ "rightAxisLabelColor": "#333",
56
+ "rightAxisTickLabelColor": "#333",
57
+ "rightAxisTickColor": "#333",
58
+ "numTicks": "6",
59
+ "axisPadding": 0,
60
+ "scalePadding": 10,
61
+ "tickRotation": 0,
62
+ "anchors": [],
63
+ "shoMissingDataLabel": true,
64
+ "showMissingDataLine": true,
65
+ "categories": [],
66
+ "label": "Reported cases per 100,000 Population",
67
+ "type": "linear"
68
+ },
69
+ "boxplot": {
70
+ "plots": [],
71
+ "borders": "true",
72
+ "plotOutlierValues": false,
73
+ "plotNonOutlierValues": true,
74
+ "labels": {
75
+ "q1": "Lower Quartile",
76
+ "q2": "q2",
77
+ "q3": "Upper Quartile",
78
+ "q4": "q4",
79
+ "minimum": "Minimum",
80
+ "maximum": "Maximum",
81
+ "mean": "Mean",
82
+ "median": "Median",
83
+ "sd": "Standard Deviation",
84
+ "iqr": "Interquartile Range",
85
+ "count": "Count",
86
+ "outliers": "Outliers",
87
+ "values": "Values",
88
+ "lowerBounds": "Lower Bounds",
89
+ "upperBounds": "Upper Bounds"
90
+ }
91
+ },
92
+ "topAxis": {
93
+ "hasLine": false
94
+ },
95
+ "isLegendValue": false,
96
+ "barThickness": 0.35,
97
+ "barHeight": 25,
98
+ "barSpace": 15,
99
+ "heights": {
100
+ "vertical": 300,
101
+ "horizontal": 750
102
+ },
103
+ "xAxis": {
104
+ "sortDates": false,
105
+ "anchors": [],
106
+ "type": "categorical",
107
+ "showTargetLabel": true,
108
+ "targetLabel": "Target",
109
+ "hideAxis": false,
110
+ "hideLabel": false,
111
+ "hideTicks": false,
112
+ "size": 75,
113
+ "tickRotation": 0,
114
+ "min": "",
115
+ "max": "",
116
+ "labelColor": "#333",
117
+ "tickLabelColor": "#333",
118
+ "tickColor": "#333",
119
+ "numTicks": "",
120
+ "labelOffset": 0,
121
+ "axisPadding": 200,
122
+ "target": 0,
123
+ "maxTickRotation": 0,
124
+ "padding": 5,
125
+ "showYearsOnce": false,
126
+ "sortByRecentDate": false,
127
+ "dataKey": "Year",
128
+ "label": "Year",
129
+ "manual": true,
130
+ "axisBBox": 62.779998779296875,
131
+ "tickWidthMax": 39
132
+ },
133
+ "table": {
134
+ "label": "Data Table",
135
+ "expanded": true,
136
+ "limitHeight": false,
137
+ "height": "",
138
+ "caption": "",
139
+ "showDownloadUrl": false,
140
+ "showDataTableLink": true,
141
+ "showDownloadLinkBelow": true,
142
+ "indexLabel": "",
143
+ "download": true,
144
+ "showVertical": false,
145
+ "dateDisplayFormat": "",
146
+ "showMissingDataLabel": true,
147
+ "showSuppressedSymbol": true,
148
+ "show": true
149
+ },
150
+ "orientation": "vertical",
151
+ "color": "pinkpurple",
152
+ "columns": {},
153
+ "legend": {
154
+ "hide": false,
155
+ "behavior": "isolate",
156
+ "axisAlign": true,
157
+ "singleRow": true,
158
+ "colorCode": "",
159
+ "reverseLabelOrder": false,
160
+ "description": "",
161
+ "dynamicLegend": false,
162
+ "dynamicLegendDefaultText": "Show All",
163
+ "dynamicLegendItemLimit": 5,
164
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
165
+ "dynamicLegendChartMessage": "Select Options from the Legend",
166
+ "label": "",
167
+ "lineMode": false,
168
+ "verticalSorted": false,
169
+ "highlightOnHover": false,
170
+ "hideSuppressedLabels": false,
171
+ "hideSuppressionLink": false,
172
+ "seriesHighlight": [],
173
+ "style": "boxes",
174
+ "subStyle": "linear blocks",
175
+ "groupBy": "group",
176
+ "shape": "circle",
177
+ "tickRotation": "",
178
+ "hideBorder": {
179
+ "side": false,
180
+ "topBottom": false
181
+ },
182
+ "position": "bottom",
183
+ "subGroup": "group",
184
+ "labelAlignment": "left"
185
+ },
186
+ "brush": {
187
+ "height": 25,
188
+ "active": false
189
+ },
190
+ "exclusions": {
191
+ "active": false,
192
+ "keys": []
193
+ },
194
+ "palette": "qualitative-bold",
195
+ "isPaletteReversed": false,
196
+ "twoColor": {
197
+ "palette": "monochrome-1",
198
+ "isPaletteReversed": false
199
+ },
200
+ "labels": false,
201
+ "dataFormat": {
202
+ "commas": false,
203
+ "prefix": "",
204
+ "suffix": "",
205
+ "abbreviated": false,
206
+ "bottomSuffix": "",
207
+ "bottomPrefix": "",
208
+ "bottomAbbreviated": false,
209
+ "roundTo": "1"
210
+ },
211
+ "confidenceKeys": {},
212
+ "visual": {
213
+ "border": true,
214
+ "accent": true,
215
+ "background": true,
216
+ "verticalHoverLine": false,
217
+ "horizontalHoverLine": false,
218
+ "lineDatapointSymbol": "none",
219
+ "maximumShapeAmount": 7
220
+ },
221
+ "useLogScale": false,
222
+ "filterBehavior": "Filter Change",
223
+ "highlightedBarValues": [],
224
+ "series": [
225
+ {
226
+ "dataKey": "American Indian/Alaska Native",
227
+ "type": "Line",
228
+ "axis": "Left",
229
+ "tooltip": true
230
+ },
231
+ {
232
+ "dataKey": "Asian/Pacific Islander",
233
+ "type": "Line",
234
+ "axis": "Left",
235
+ "tooltip": true
236
+ },
237
+ {
238
+ "dataKey": "Black, non-Hispanic",
239
+ "type": "Line",
240
+ "axis": "Left",
241
+ "tooltip": true
242
+ },
243
+ {
244
+ "dataKey": "White, non-Hispanic",
245
+ "type": "Line",
246
+ "axis": "Left",
247
+ "tooltip": true
248
+ },
249
+ {
250
+ "dataKey": "Hispanic",
251
+ "type": "Line",
252
+ "axis": "Left",
253
+ "tooltip": true
254
+ }
255
+ ],
256
+ "tooltips": {
257
+ "opacity": 90,
258
+ "singleSeries": false,
259
+ "dateDisplayFormat": ""
260
+ },
261
+ "forestPlot": {
262
+ "startAt": 0,
263
+ "colors": {
264
+ "line": "",
265
+ "shape": ""
266
+ },
267
+ "lineOfNoEffect": {
268
+ "show": true
269
+ },
270
+ "type": "",
271
+ "pooledResult": {
272
+ "diamondHeight": 5,
273
+ "column": ""
274
+ },
275
+ "estimateField": "",
276
+ "estimateRadius": "",
277
+ "shape": "square",
278
+ "rowHeight": 20,
279
+ "description": {
280
+ "show": true,
281
+ "text": "description",
282
+ "location": 0
283
+ },
284
+ "result": {
285
+ "show": true,
286
+ "text": "result",
287
+ "location": 100
288
+ },
289
+ "radius": {
290
+ "min": 2,
291
+ "max": 10,
292
+ "scalingColumn": ""
293
+ },
294
+ "regression": {
295
+ "lower": 0,
296
+ "upper": 0,
297
+ "estimateField": 0
298
+ },
299
+ "leftWidthOffset": 0,
300
+ "rightWidthOffset": 0,
301
+ "showZeroLine": false,
302
+ "leftLabel": "",
303
+ "rightLabel": ""
304
+ },
305
+ "area": {
306
+ "isStacked": false
307
+ },
308
+ "sankey": {
309
+ "title": {
310
+ "defaultColor": "black"
311
+ },
312
+ "iterations": 1,
313
+ "rxValue": 0.9,
314
+ "overallSize": {
315
+ "width": 900,
316
+ "height": 700
317
+ },
318
+ "margin": {
319
+ "margin_y": 25,
320
+ "margin_x": 0
321
+ },
322
+ "nodeSize": {
323
+ "nodeWidth": 26,
324
+ "nodeHeight": 40
325
+ },
326
+ "nodePadding": 55,
327
+ "nodeFontColor": "black",
328
+ "nodeColor": {
329
+ "default": "#ff8500",
330
+ "inactive": "#808080"
331
+ },
332
+ "linkColor": {
333
+ "default": "#ffc900",
334
+ "inactive": "#D3D3D3"
335
+ },
336
+ "opacity": {
337
+ "nodeOpacityDefault": 1,
338
+ "nodeOpacityInactive": 0.1,
339
+ "LinkOpacityDefault": 1,
340
+ "LinkOpacityInactive": 0.1
341
+ },
342
+ "storyNodeFontColor": "#006778",
343
+ "storyNodeText": [],
344
+ "nodeValueStyle": {
345
+ "textBefore": "(",
346
+ "textAfter": ")"
347
+ },
348
+ "data": []
349
+ },
350
+ "errors": [],
351
+ "currentViewport": "lg",
352
+ "id": 4,
353
+ "category": "Charts",
354
+ "label": "Line",
355
+ "subType": "Line",
356
+ "icon": {
357
+ "key": null,
358
+ "ref": null,
359
+ "props": {},
360
+ "_owner": null
361
+ },
362
+ "content": "Present one or more data trends over time.",
363
+ "visualizationType": "Bar",
364
+ "datasets": {},
365
+ "activeVizButtonID": 4,
366
+ "data": [
367
+ {
368
+ "Year": "2007",
369
+ "American Indian/Alaska Native": "1.4",
370
+ "Asian/Pacific Islander": "0.9",
371
+ "group": "Main Group"
372
+ },
373
+ {
374
+ "Year": "2008",
375
+ "American Indian/Alaska Native": "1.8",
376
+ "Asian/Pacific Islander": "0.8",
377
+ "group": "Main Group"
378
+ },
379
+ {
380
+ "Year": "2009",
381
+ "American Indian/Alaska Native": "1",
382
+ "Asian/Pacific Islander": "0.7",
383
+ "group": "Main Group"
384
+ },
385
+ {
386
+ "Year": "2010",
387
+ "American Indian/Alaska Native": "1.1",
388
+ "Asian/Pacific Islander": "0.6",
389
+ "group": "Main Group"
390
+ },
391
+ {
392
+ "Year": "2011",
393
+ "Black, non-Hispanic": "1.4",
394
+ "White, non-Hispanic": "0.8",
395
+ "group": "Second Group"
396
+ },
397
+ {
398
+ "Year": "2012",
399
+ "Black, non-Hispanic": "1.1",
400
+ "White, non-Hispanic": "0.8",
401
+ "group": "Second Group"
402
+ },
403
+ {
404
+ "Year": "2013",
405
+ "White, non-Hispanic": "0.9",
406
+ "group": "Second Group"
407
+ },
408
+ {
409
+ "Year": "2014",
410
+ "White, non-Hispanic": "0.9",
411
+ "group": "Second Group"
412
+ },
413
+ {
414
+ "Year": "2015",
415
+ "American Indian/Alaska Native": "0.7",
416
+ "Hispanic": "0.3",
417
+ "group": "Third Group"
418
+ },
419
+ {
420
+ "Year": "2016",
421
+ "American Indian/Alaska Native": "0.5",
422
+ "Hispanic": "0.3",
423
+ "group": "Third Group"
424
+ },
425
+ {
426
+ "Year": "2017",
427
+ "American Indian/Alaska Native": "0.7",
428
+ "Hispanic": "0.3",
429
+ "group": "Third Group"
430
+ },
431
+ {
432
+ "Year": "2018",
433
+ "American Indian/Alaska Native": "0.9",
434
+ "Hispanic": "0.4",
435
+ "group": "Third Group"
436
+ },
437
+ {
438
+ "Year": "2019",
439
+ "American Indian/Alaska Native": "0.6",
440
+ "Hispanic": "0.4",
441
+ "group": "Third Group"
442
+ },
443
+ {
444
+ "Year": "2020",
445
+ "American Indian/Alaska Native": "0.4",
446
+ "Hispanic": "0.3",
447
+ "group": "Third Group"
448
+ },
449
+ {
450
+ "Year": "2021",
451
+ "American Indian/Alaska Native": "0.4",
452
+ "Hispanic": "0.4",
453
+ "group": "Third Group"
454
+ },
455
+ {
456
+ "Year": "2022",
457
+ "American Indian/Alaska Native": "0.4",
458
+ "Black, non-Hispanic": "1",
459
+ "group": "Fourth Group"
460
+ }
461
+ ],
462
+ "dataFileName": "chart_data 2-6.csv",
463
+ "dataFileSourceType": "file",
464
+ "dataDescription": {
465
+ "horizontal": false,
466
+ "series": false
467
+ },
468
+ "version": "4.25.1",
469
+ "dynamicMarginTop": 0,
470
+ "filters": [],
471
+ "migrations": {
472
+ "addColorMigration": true
473
+ }
474
+ }
@@ -159,7 +159,7 @@ export const BarChartHorizontal = () => {
159
159
  let yAxisTooltip = config.runtime.yAxis.label
160
160
  ? `${config.runtime.yAxis.label}: ${xAxisValue}`
161
161
  : xAxisValue
162
- const additionalColTooltip = getAdditionalColumn(hoveredBar)
162
+ const additionalColTooltip = getAdditionalColumn(bar.key, hoveredBar)
163
163
  const tooltipBody = `${config.runtime.seriesLabels[bar.key]}: ${yAxisValue}`
164
164
  const tooltip = `<ul>
165
165
  <li class="tooltip-heading"">${yAxisTooltip}</li>
@@ -76,7 +76,7 @@ const BarChartStackedHorizontal = () => {
76
76
  ? `${config.runtime.yAxis.label}: ${yAxisValue}`
77
77
  : yAxisValue
78
78
  const textWidth = getTextWidth(xAxisValue)
79
- const additionalColTooltip = getAdditionalColumn(hoveredBar)
79
+ const additionalColTooltip = getAdditionalColumn(bar.key, hoveredBar)
80
80
  const tooltipBody = `${config.runtime.seriesLabels[bar.key]}: ${xAxisValue}`
81
81
  const tooltip = `<ul>
82
82
  <li class="tooltip-heading"">${yAxisTooltip}</li>
@@ -69,7 +69,7 @@ const BarChartStackedVertical = () => {
69
69
  const xAxisTooltip = config.runtime.xAxis.label
70
70
  ? `${config.runtime.xAxis.label}: ${xAxisValue}`
71
71
  : xAxisValue
72
- const additionalColTooltip = getAdditionalColumn(hoveredBar)
72
+ const additionalColTooltip = getAdditionalColumn(bar.key, hoveredBar)
73
73
  const tooltipBody = `${config.runtime.seriesLabels[bar.key]}: ${yAxisValue}`
74
74
  const tooltip = `<ul>
75
75
  <li class="tooltip-heading"">${xAxisTooltip}</li>
@@ -65,7 +65,7 @@ export const BarChartVertical = () => {
65
65
  data = brushConfig.data
66
66
  }
67
67
 
68
- const hasConfidenceInterval = Object.keys(config.confidenceKeys).length > 0
68
+ const hasConfidenceInterval = _.every(config.confidenceKeys, key => key !== '')
69
69
 
70
70
  const _data = getBarData(config, data, hasConfidenceInterval)
71
71
  return (
@@ -322,7 +322,7 @@ export const BarChartVertical = () => {
322
322
  <Text // prettier-ignore
323
323
  display={displayBar ? 'block' : 'none'}
324
324
  opacity={transparentBar ? 0.5 : 1}
325
- x={barX + barWidth / 2}
325
+ x={hasConfidenceInterval ? barX + barWidth : barX + barWidth / 2}
326
326
  y={barY - 5}
327
327
  fill={labelColor}
328
328
  textAnchor='middle'
@@ -906,7 +906,7 @@ const EditorPanel = () => {
906
906
  return Object.keys(columns)
907
907
  }
908
908
 
909
- const getLegendStyleOptions = (option: 'style' | 'subStyle' | 'shapes'): string[] => {
909
+ const getLegendStyleOptions = (option: 'style' | 'subStyle' | 'shapes' | 'groupBy'): string[] => {
910
910
  const options: string[] = []
911
911
 
912
912
  switch (option) {
@@ -929,6 +929,9 @@ const EditorPanel = () => {
929
929
  options.push('linear blocks', 'smooth')
930
930
  }
931
931
 
932
+ break
933
+ case 'groupBy':
934
+ options.push(...getColumns())
932
935
  break
933
936
  }
934
937
  return options
@@ -962,7 +965,7 @@ const EditorPanel = () => {
962
965
  }
963
966
 
964
967
  const convertStateToConfig = () => {
965
- let strippedState = JSON.parse(JSON.stringify(config))
968
+ let strippedState = _.cloneDeep(config)
966
969
  if (false === missingRequiredSections(config)) {
967
970
  delete strippedState.newViz
968
971
  }
@@ -2698,7 +2701,7 @@ const EditorPanel = () => {
2698
2701
  </>
2699
2702
  )}
2700
2703
 
2701
- {isDateScale(config.xAxis) && (
2704
+ {(isDateScale(config.xAxis) || config?.visualizationType === 'Bump Chart') && (
2702
2705
  <>
2703
2706
  <p style={{ padding: '1.5em 0 0.5em', fontSize: '.9rem', lineHeight: '1rem' }}>
2704
2707
  Format how charts should parse and display your dates using{' '}
@@ -2909,27 +2912,26 @@ const EditorPanel = () => {
2909
2912
  </>
2910
2913
  )}
2911
2914
 
2912
- {config.xAxis.type === 'date' ||
2913
- (config.xAxis.type === 'date-time' && (
2914
- <>
2915
- <TextField
2916
- type='date'
2917
- section='exclusions'
2918
- fieldName='dateStart'
2919
- label='Start Date'
2920
- updateField={updateField}
2921
- value={config.exclusions.dateStart || ''}
2922
- />
2923
- <TextField
2924
- type='date'
2925
- section='exclusions'
2926
- fieldName='dateEnd'
2927
- label='End Date'
2928
- updateField={updateField}
2929
- value={config.exclusions.dateEnd || ''}
2930
- />
2931
- </>
2932
- ))}
2915
+ {(config.xAxis.type === 'date' || config.xAxis.type === 'date-time') && (
2916
+ <>
2917
+ <TextField
2918
+ type='date'
2919
+ section='exclusions'
2920
+ fieldName='dateStart'
2921
+ label='Start Date'
2922
+ updateField={updateField}
2923
+ value={config.exclusions.dateStart || ''}
2924
+ />
2925
+ <TextField
2926
+ type='date'
2927
+ section='exclusions'
2928
+ fieldName='dateEnd'
2929
+ label='End Date'
2930
+ updateField={updateField}
2931
+ value={config.exclusions.dateEnd || ''}
2932
+ />
2933
+ </>
2934
+ )}
2933
2935
  </>
2934
2936
  )}
2935
2937
 
@@ -3691,6 +3693,17 @@ const EditorPanel = () => {
3691
3693
  updateField={updateField}
3692
3694
  options={getLegendStyleOptions('style')}
3693
3695
  />
3696
+
3697
+ <Select
3698
+ value={config.legend.groupBy}
3699
+ section='legend'
3700
+ fieldName='groupBy'
3701
+ initial='Select'
3702
+ label='Legend Group By:'
3703
+ updateField={updateField}
3704
+ options={getLegendStyleOptions('groupBy')}
3705
+ />
3706
+
3694
3707
  <CheckBox
3695
3708
  tooltip={
3696
3709
  <Tooltip style={{ textTransform: 'none' }}>
@@ -3986,6 +3999,29 @@ const EditorPanel = () => {
3986
3999
  fieldName='description'
3987
4000
  label='Legend Description'
3988
4001
  />
4002
+ <CheckBox
4003
+ value={config.legend.unified}
4004
+ section='legend'
4005
+ fieldName='unified'
4006
+ label='Unified Legend'
4007
+ updateField={updateField}
4008
+ tooltip={
4009
+ <Tooltip style={{ textTransform: 'none' }}>
4010
+ <Tooltip.Target>
4011
+ <Icon
4012
+ display='question'
4013
+ style={{ marginLeft: '0.5rem', display: 'inline-block', whiteSpace: 'nowrap' }}
4014
+ />
4015
+ </Tooltip.Target>
4016
+ <Tooltip.Content>
4017
+ <p>
4018
+ For a chart with filters, check this option if you want the legend to contain an item for
4019
+ every series in the data set, including those that are filtered.
4020
+ </p>
4021
+ </Tooltip.Content>
4022
+ </Tooltip>
4023
+ }
4024
+ />
3989
4025
  </AccordionItemPanel>
3990
4026
  </AccordionItem>
3991
4027
  )}
@@ -30,9 +30,10 @@ export const updateFieldRankByValue = (
30
30
  newConfig.rankByValue = newValue
31
31
 
32
32
  if (config.rankByValue && !newValue) {
33
- const CIkeys: string[] = Object.values(config.confidenceKeys) as string[]
34
- const seriesKeys: string[] = config.series.map(s => s.dataKey)
35
- const keysToClean: string[] = seriesKeys.concat(CIkeys)
33
+ const CIkeys: string[] = Object.values(_.get(config, 'confidenceKeys', {})) as string[]
34
+ const seriesKeys: string[] = _.get(config, 'series', []).map((s: any) => s.dataKey)
35
+ const keysToClean: string[] = [...(seriesKeys ?? []), ...(CIkeys ?? [])]
36
+
36
37
  const cleanData = config?.xAxis?.dataKey
37
38
  ? transform.cleanData(config.data, config.xAxis.dataKey, keysToClean)
38
39
  : config.data