@cdc/chart 4.25.7 → 4.25.10

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 (95) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/dist/cdcchart.js +39551 -37016
  3. package/examples/feature/__data__/planet-example-data.json +0 -30
  4. package/examples/grouped-bar-test.json +400 -0
  5. package/examples/private/d.json +382 -0
  6. package/examples/private/example-2.json +49784 -0
  7. package/examples/private/f2.json +1 -0
  8. package/examples/private/f4.json +1577 -0
  9. package/examples/private/forecast.json +1180 -0
  10. package/examples/private/lollipop.json +468 -0
  11. package/examples/private/new.json +48756 -0
  12. package/examples/private/pie-chart-legend.json +904 -0
  13. package/examples/suppressed_tooltip.json +480 -0
  14. package/index.html +10 -22
  15. package/package.json +25 -7
  16. package/src/CdcChart.tsx +10 -4
  17. package/src/CdcChartComponent.tsx +188 -32
  18. package/src/_stories/Chart.Anchors.stories.tsx +2 -2
  19. package/src/_stories/Chart.BoxPlot.stories.tsx +1 -1
  20. package/src/_stories/Chart.CI.stories.tsx +1 -1
  21. package/src/_stories/Chart.CustomColors.stories.tsx +1 -1
  22. package/src/_stories/Chart.DynamicSeries.stories.tsx +2 -2
  23. package/src/_stories/Chart.Filters.stories.tsx +2 -2
  24. package/src/_stories/Chart.Legend.Gradient.stories.tsx +2 -2
  25. package/src/_stories/Chart.Patterns.stories.tsx +19 -0
  26. package/src/_stories/Chart.ScatterPlot.stories.tsx +1 -1
  27. package/src/_stories/Chart.stories.tsx +8 -5
  28. package/src/_stories/Chart.tooltip.stories.tsx +1 -1
  29. package/src/_stories/ChartAnnotation.stories.tsx +1 -1
  30. package/src/_stories/ChartAxisLabels.stories.tsx +2 -2
  31. package/src/_stories/ChartAxisTitles.stories.tsx +2 -2
  32. package/src/_stories/ChartEditor.stories.tsx +60 -60
  33. package/src/_stories/ChartLine.Suppression.stories.tsx +1 -1
  34. package/src/_stories/ChartLine.Symbols.stories.tsx +1 -1
  35. package/src/_stories/ChartPrefixSuffix.stories.tsx +2 -2
  36. package/src/_stories/_mock/stacked-pattern-test.json +520 -0
  37. package/src/components/Annotations/components/AnnotationDraggable.tsx +1 -0
  38. package/src/components/Annotations/components/AnnotationDropdown.tsx +1 -1
  39. package/src/components/BarChart/components/BarChart.Horizontal.tsx +170 -25
  40. package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +139 -6
  41. package/src/components/BarChart/components/BarChart.StackedVertical.tsx +215 -73
  42. package/src/components/BarChart/components/BarChart.Vertical.tsx +172 -23
  43. package/src/components/BarChart/helpers/index.ts +43 -4
  44. package/src/components/BarChart/helpers/lollipopColors.ts +27 -0
  45. package/src/components/BarChart/helpers/useBarChart.ts +25 -3
  46. package/src/components/BoxPlot/BoxPlot.Vertical.tsx +2 -1
  47. package/src/components/Brush/BrushChart.tsx +65 -10
  48. package/src/components/Brush/BrushController.tsx +37 -5
  49. package/src/components/Brush/types.tsx +8 -0
  50. package/src/components/DeviationBar.jsx +9 -6
  51. package/src/components/EditorPanel/EditorPanel.tsx +364 -39
  52. package/src/components/EditorPanel/EditorPanelContext.ts +3 -0
  53. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +2 -2
  54. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +414 -0
  55. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +30 -54
  56. package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +115 -120
  57. package/src/components/EditorPanel/components/Panels/index.tsx +3 -1
  58. package/src/components/EditorPanel/components/Panels/panelVisual.styles.css +0 -8
  59. package/src/components/EditorPanel/helpers/updateFieldRankByValue.ts +49 -48
  60. package/src/components/Forecasting/Forecasting.tsx +36 -6
  61. package/src/components/ForestPlot/ForestPlot.tsx +11 -7
  62. package/src/components/ForestPlot/ForestPlotProps.ts +1 -1
  63. package/src/components/Legend/Legend.Component.tsx +110 -2
  64. package/src/components/Legend/Legend.tsx +3 -1
  65. package/src/components/Legend/helpers/createFormatLabels.tsx +230 -171
  66. package/src/components/LegendWrapper.tsx +1 -1
  67. package/src/components/LineChart/components/LineChart.BumpCircle.tsx +27 -26
  68. package/src/components/LineChart/components/LineChart.Circle.tsx +2 -2
  69. package/src/components/LineChart/index.tsx +2 -2
  70. package/src/components/LinearChart.tsx +26 -9
  71. package/src/components/PairedBarChart.jsx +6 -4
  72. package/src/components/PieChart/PieChart.tsx +170 -54
  73. package/src/components/Sankey/components/Sankey.tsx +7 -1
  74. package/src/components/ScatterPlot/ScatterPlot.jsx +32 -4
  75. package/src/data/initial-state.js +315 -292
  76. package/src/helpers/buildForecastPaletteMappings.ts +112 -0
  77. package/src/helpers/buildForecastPaletteOptions.ts +109 -0
  78. package/src/helpers/getColorScale.ts +72 -8
  79. package/src/helpers/getNewRuntime.ts +1 -1
  80. package/src/helpers/getTransformedData.ts +1 -1
  81. package/src/hooks/useChartHoverAnalytics.tsx +44 -0
  82. package/src/hooks/useReduceData.ts +105 -70
  83. package/src/hooks/useTooltip.tsx +58 -16
  84. package/src/index.jsx +6 -3
  85. package/src/scss/main.scss +12 -0
  86. package/src/store/chart.reducer.ts +1 -1
  87. package/src/test/CdcChart.test.jsx +8 -3
  88. package/src/types/ChartConfig.ts +30 -6
  89. package/src/types/ChartContext.ts +1 -0
  90. package/vite.config.js +1 -1
  91. package/vitest.config.ts +16 -0
  92. package/src/coreStyles_chart.scss +0 -3
  93. package/src/helpers/configHelpers.ts +0 -28
  94. package/src/helpers/generateColorsArray.ts +0 -8
  95. package/src/hooks/useColorPalette.js +0 -76
@@ -0,0 +1,382 @@
1
+ {
2
+ "annotations": [],
3
+ "type": "chart",
4
+ "debugSvg": false,
5
+ "chartMessage": {
6
+ "noData": "No Data Available"
7
+ },
8
+ "title": "Example Deviation Bar Chart",
9
+ "showTitle": false,
10
+ "showDownloadMediaButton": false,
11
+ "theme": "theme-blue",
12
+ "animate": false,
13
+ "fontSize": "small",
14
+ "lineDatapointStyle": "hover",
15
+ "lineDatapointColor": "Same as Line",
16
+ "barHasBorder": "true",
17
+ "isLollipopChart": false,
18
+ "lollipopShape": "circle",
19
+ "lollipopColorStyle": "two-tone",
20
+ "visualizationSubType": "regular",
21
+ "barStyle": "",
22
+ "roundingStyle": "standard",
23
+ "tipRounding": "top",
24
+ "isResponsiveTicks": false,
25
+ "general": {
26
+ "annotationDropdownText": "Annotations",
27
+ "showMissingDataLabel": true,
28
+ "showSuppressedSymbol": true,
29
+ "showZeroValueData": true,
30
+ "hideNullValue": true,
31
+ "showZeroValueDataLabel": true
32
+ },
33
+ "padding": {
34
+ "left": 5,
35
+ "right": 5
36
+ },
37
+ "preliminaryData": [],
38
+ "yAxis": {
39
+ "hideAxis": false,
40
+ "displayNumbersOnBar": true,
41
+ "hideLabel": false,
42
+ "hideTicks": false,
43
+ "size": "50",
44
+ "gridLines": false,
45
+ "enablePadding": false,
46
+ "min": "",
47
+ "max": "",
48
+ "labelColor": "#1c1d1f",
49
+ "tickLabelColor": "#1c1d1f",
50
+ "tickColor": "#1c1d1f",
51
+ "rightHideAxis": true,
52
+ "rightAxisSize": 50,
53
+ "rightLabel": "",
54
+ "rightLabelOffsetSize": 0,
55
+ "rightAxisLabelColor": "#1c1d1f",
56
+ "rightAxisTickLabelColor": "#1c1d1f",
57
+ "rightAxisTickColor": "#1c1d1f",
58
+ "numTicks": "",
59
+ "axisPadding": 0,
60
+ "scalePadding": 10,
61
+ "tickRotation": 0,
62
+ "anchors": [],
63
+ "shoMissingDataLabel": true,
64
+ "showMissingDataLine": true,
65
+ "categories": [],
66
+ "label": "Percent of Coverage",
67
+ "maxValue": "100",
68
+ "labelOffset": "0",
69
+ "type": "__​undefined__"
70
+ },
71
+ "boxplot": {
72
+ "plots": [],
73
+ "borders": "true",
74
+ "plotOutlierValues": false,
75
+ "plotNonOutlierValues": true,
76
+ "labels": {
77
+ "q1": "Lower Quartile",
78
+ "q2": "q2",
79
+ "q3": "Upper Quartile",
80
+ "q4": "q4",
81
+ "minimum": "Minimum",
82
+ "maximum": "Maximum",
83
+ "mean": "Mean",
84
+ "median": "Median",
85
+ "sd": "Standard Deviation",
86
+ "iqr": "Interquartile Range",
87
+ "total": "Total",
88
+ "outliers": "Outliers",
89
+ "values": "Values",
90
+ "count": "Count",
91
+ "lowerBounds": "Lower Bounds",
92
+ "upperBounds": "Upper Bounds"
93
+ },
94
+ "firstQuartilePercentage": 25,
95
+ "thirdQuartilePercentage": 75,
96
+ "boxWidthPercentage": 40,
97
+ "legend": {
98
+ "showHowToReadText": false,
99
+ "howToReadText": ""
100
+ }
101
+ },
102
+ "topAxis": {
103
+ "hasLine": false
104
+ },
105
+ "isLegendValue": true,
106
+ "barThickness": 0.35,
107
+ "barHeight": 25,
108
+ "barSpace": 15,
109
+ "heights": {
110
+ "vertical": 300,
111
+ "horizontal": 246
112
+ },
113
+ "xAxis": {
114
+ "sortDates": false,
115
+ "anchors": [],
116
+ "type": "categorical",
117
+ "showTargetLabel": true,
118
+ "targetLabel": "Target Coverage",
119
+ "hideAxis": false,
120
+ "hideLabel": false,
121
+ "hideTicks": false,
122
+ "size": "75",
123
+ "tickRotation": "0",
124
+ "min": "",
125
+ "max": "100",
126
+ "labelColor": "#1c1d1f",
127
+ "tickLabelColor": "#1c1d1f",
128
+ "tickColor": "#1c1d1f",
129
+ "numTicks": "",
130
+ "labelOffset": 0,
131
+ "axisPadding": 0,
132
+ "target": "50",
133
+ "maxTickRotation": 0,
134
+ "padding": 5,
135
+ "showYearsOnce": false,
136
+ "sortByRecentDate": false,
137
+ "brushActive": false,
138
+ "dataKey": "Department",
139
+ "label": "Department",
140
+ "tickWidthMax": 34,
141
+ "axisBBox": 0
142
+ },
143
+ "table": {
144
+ "label": "Data Table",
145
+ "expanded": false,
146
+ "limitHeight": false,
147
+ "height": "",
148
+ "caption": "",
149
+ "showDownloadUrl": false,
150
+ "showDataTableLink": true,
151
+ "showDownloadLinkBelow": true,
152
+ "indexLabel": "Department",
153
+ "download": true,
154
+ "showVertical": true,
155
+ "dateDisplayFormat": "",
156
+ "showMissingDataLabel": true,
157
+ "showSuppressedSymbol": true,
158
+ "collapsible": true,
159
+ "show": true
160
+ },
161
+ "orientation": "horizontal",
162
+ "color": "pinkpurple",
163
+ "columns": {},
164
+ "legend": {
165
+ "hide": false,
166
+ "behavior": "isolate",
167
+ "axisAlign": true,
168
+ "singleRow": false,
169
+ "colorCode": "",
170
+ "reverseLabelOrder": true,
171
+ "description": "",
172
+ "dynamicLegend": false,
173
+ "dynamicLegendDefaultText": "Show All",
174
+ "dynamicLegendItemLimit": 5,
175
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
176
+ "dynamicLegendChartMessage": "Select Options from the Legend",
177
+ "label": "Departmental Coverage Outcome",
178
+ "lineMode": false,
179
+ "verticalSorted": false,
180
+ "highlightOnHover": false,
181
+ "hideSuppressedLabels": false,
182
+ "hideSuppressionLink": false,
183
+ "seriesHighlight": [],
184
+ "style": "circles",
185
+ "subStyle": "linear blocks",
186
+ "groupBy": "",
187
+ "shape": "circle",
188
+ "tickRotation": "",
189
+ "order": "dataColumn",
190
+ "hideBorder": {
191
+ "side": false,
192
+ "topBottom": true
193
+ },
194
+ "position": "right",
195
+ "orderedValues": [],
196
+ "showLegendValuesTooltip": false,
197
+ "unified": true
198
+ },
199
+ "brush": {
200
+ "height": 25,
201
+ "active": false,
202
+ "data": []
203
+ },
204
+ "exclusions": {
205
+ "active": false,
206
+ "keys": []
207
+ },
208
+ "palette": "qualitative-bold",
209
+ "isPaletteReversed": false,
210
+ "twoColor": {
211
+ "palette": "complementary-1reverse",
212
+ "isPaletteReversed": true
213
+ },
214
+ "labels": false,
215
+ "dataFormat": {
216
+ "commas": false,
217
+ "prefix": "",
218
+ "suffix": "%",
219
+ "abbreviated": false,
220
+ "bottomSuffix": "",
221
+ "bottomPrefix": "",
222
+ "bottomAbbreviated": false
223
+ },
224
+ "confidenceKeys": {},
225
+ "visual": {
226
+ "border": true,
227
+ "accent": true,
228
+ "background": true,
229
+ "verticalHoverLine": false,
230
+ "horizontalHoverLine": false,
231
+ "lineDatapointSymbol": "none",
232
+ "maximumShapeAmount": 7
233
+ },
234
+ "useLogScale": false,
235
+ "filterBehavior": "Filter Change",
236
+ "highlightedBarValues": [],
237
+ "series": [
238
+ {
239
+ "dataKey": "Score",
240
+ "type": "Deviation Bar",
241
+ "tooltip": true,
242
+ "axis": "Left"
243
+ }
244
+ ],
245
+ "tooltips": {
246
+ "opacity": 90,
247
+ "singleSeries": false,
248
+ "dateDisplayFormat": ""
249
+ },
250
+ "forestPlot": {
251
+ "startAt": 0,
252
+ "colors": {
253
+ "line": "",
254
+ "shape": ""
255
+ },
256
+ "lineOfNoEffect": {
257
+ "show": true
258
+ },
259
+ "type": "",
260
+ "pooledResult": {
261
+ "diamondHeight": 5,
262
+ "column": ""
263
+ },
264
+ "estimateField": "",
265
+ "estimateRadius": "",
266
+ "shape": "square",
267
+ "rowHeight": 20,
268
+ "description": {
269
+ "show": true,
270
+ "text": "description",
271
+ "location": 0
272
+ },
273
+ "result": {
274
+ "show": true,
275
+ "text": "result",
276
+ "location": 100
277
+ },
278
+ "radius": {
279
+ "min": 2,
280
+ "max": 10,
281
+ "scalingColumn": ""
282
+ },
283
+ "regression": {
284
+ "lower": 0,
285
+ "upper": 0,
286
+ "estimateField": 0
287
+ },
288
+ "leftWidthOffset": 0,
289
+ "rightWidthOffset": 0,
290
+ "showZeroLine": false,
291
+ "leftLabel": "",
292
+ "rightLabel": ""
293
+ },
294
+ "area": {
295
+ "isStacked": false
296
+ },
297
+ "sankey": {
298
+ "title": {
299
+ "defaultColor": "black"
300
+ },
301
+ "iterations": 1,
302
+ "rxValue": 0.9,
303
+ "overallSize": {
304
+ "width": 900,
305
+ "height": 700
306
+ },
307
+ "margin": {
308
+ "margin_y": 25,
309
+ "margin_x": 0
310
+ },
311
+ "nodeSize": {
312
+ "nodeWidth": 26,
313
+ "nodeHeight": 40
314
+ },
315
+ "nodePadding": 55,
316
+ "nodeFontColor": "black",
317
+ "nodeColor": {
318
+ "default": "#ff8500",
319
+ "inactive": "#808080"
320
+ },
321
+ "linkColor": {
322
+ "default": "#ffc900",
323
+ "inactive": "#D3D3D3"
324
+ },
325
+ "opacity": {
326
+ "nodeOpacityDefault": 1,
327
+ "nodeOpacityInactive": 0.1,
328
+ "LinkOpacityDefault": 1,
329
+ "LinkOpacityInactive": 0.1
330
+ },
331
+ "storyNodeFontColor": "#006778",
332
+ "storyNodeText": [],
333
+ "nodeValueStyle": {
334
+ "textBefore": "(",
335
+ "textAfter": ")"
336
+ },
337
+ "data": []
338
+ },
339
+ "suppressedData": [],
340
+ "datasets": {},
341
+ "visualizationType": "Deviation Bar",
342
+ "data": [
343
+ {
344
+ "Department": "A",
345
+ "Score": "65"
346
+ },
347
+ {
348
+ "Department": "B",
349
+ "Score": "35"
350
+ },
351
+ {
352
+ "Department": "C",
353
+ "Score": "25"
354
+ },
355
+ {
356
+ "Department": "D",
357
+ "Score": "48"
358
+ },
359
+ {
360
+ "Department": "E",
361
+ "Score": "85"
362
+ },
363
+ {
364
+ "Department": "F",
365
+ "Score": "90"
366
+ }
367
+ ],
368
+ "dataFileName": "deviation-sample-current.csv",
369
+ "dataFileSourceType": "file",
370
+ "dataDescription": {
371
+ "horizontal": false,
372
+ "series": false
373
+ },
374
+ "validated": 4.23,
375
+ "dynamicMarginTop": 0,
376
+ "version": "4.25.8",
377
+ "allowLineToBarGraph": "__​undefined__",
378
+ "filters": [],
379
+ "migrations": {
380
+ "addColorMigration": true
381
+ }
382
+ }