@cdc/chart 4.25.8 → 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.
- package/.claude/settings.local.json +9 -0
- package/dist/cdcchart.js +37524 -35243
- package/examples/feature/__data__/planet-example-data.json +0 -30
- package/examples/grouped-bar-test.json +400 -0
- package/examples/private/d.json +382 -0
- package/examples/private/example-2.json +49784 -0
- package/examples/private/f2.json +1 -0
- package/examples/private/f4.json +1577 -0
- package/examples/private/forecast.json +1180 -0
- package/examples/private/lollipop.json +468 -0
- package/examples/private/new.json +48756 -0
- package/examples/private/pie-chart-legend.json +904 -0
- package/examples/suppressed_tooltip.json +480 -0
- package/index.html +10 -22
- package/package.json +25 -7
- package/src/CdcChart.tsx +1 -2
- package/src/CdcChartComponent.tsx +174 -32
- package/src/_stories/Chart.Anchors.stories.tsx +2 -2
- package/src/_stories/Chart.BoxPlot.stories.tsx +1 -1
- package/src/_stories/Chart.CI.stories.tsx +1 -1
- package/src/_stories/Chart.CustomColors.stories.tsx +1 -1
- package/src/_stories/Chart.DynamicSeries.stories.tsx +2 -2
- package/src/_stories/Chart.Filters.stories.tsx +2 -2
- package/src/_stories/Chart.Legend.Gradient.stories.tsx +2 -2
- package/src/_stories/Chart.Patterns.stories.tsx +19 -0
- package/src/_stories/Chart.ScatterPlot.stories.tsx +1 -1
- package/src/_stories/Chart.stories.tsx +8 -5
- package/src/_stories/Chart.tooltip.stories.tsx +1 -1
- package/src/_stories/ChartAnnotation.stories.tsx +1 -1
- package/src/_stories/ChartAxisLabels.stories.tsx +2 -2
- package/src/_stories/ChartAxisTitles.stories.tsx +2 -2
- package/src/_stories/ChartEditor.stories.tsx +60 -60
- package/src/_stories/ChartLine.Suppression.stories.tsx +1 -1
- package/src/_stories/ChartLine.Symbols.stories.tsx +1 -1
- package/src/_stories/ChartPrefixSuffix.stories.tsx +2 -2
- package/src/_stories/_mock/stacked-pattern-test.json +520 -0
- package/src/components/Annotations/components/AnnotationDraggable.tsx +1 -0
- package/src/components/Annotations/components/AnnotationDropdown.tsx +1 -1
- package/src/components/BarChart/components/BarChart.Horizontal.tsx +159 -20
- package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +138 -5
- package/src/components/BarChart/components/BarChart.StackedVertical.tsx +215 -73
- package/src/components/BarChart/components/BarChart.Vertical.tsx +153 -21
- package/src/components/BarChart/helpers/index.ts +43 -4
- package/src/components/BarChart/helpers/lollipopColors.ts +27 -0
- package/src/components/BarChart/helpers/useBarChart.ts +25 -3
- package/src/components/BoxPlot/BoxPlot.Vertical.tsx +2 -1
- package/src/components/DeviationBar.jsx +9 -6
- package/src/components/EditorPanel/EditorPanel.tsx +364 -39
- package/src/components/EditorPanel/EditorPanelContext.ts +3 -0
- package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +414 -0
- package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +28 -20
- package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +115 -120
- package/src/components/EditorPanel/components/Panels/index.tsx +3 -1
- package/src/components/EditorPanel/components/Panels/panelVisual.styles.css +0 -8
- package/src/components/EditorPanel/helpers/updateFieldRankByValue.ts +49 -48
- package/src/components/Forecasting/Forecasting.tsx +36 -6
- package/src/components/ForestPlot/ForestPlot.tsx +11 -7
- package/src/components/ForestPlot/ForestPlotProps.ts +1 -1
- package/src/components/Legend/Legend.Component.tsx +106 -13
- package/src/components/Legend/helpers/createFormatLabels.tsx +230 -171
- package/src/components/LegendWrapper.tsx +1 -1
- package/src/components/LineChart/components/LineChart.Circle.tsx +2 -2
- package/src/components/LineChart/index.tsx +2 -2
- package/src/components/LinearChart.tsx +22 -5
- package/src/components/PairedBarChart.jsx +6 -4
- package/src/components/PieChart/PieChart.tsx +170 -54
- package/src/components/Sankey/components/Sankey.tsx +7 -1
- package/src/components/ScatterPlot/ScatterPlot.jsx +32 -4
- package/src/data/initial-state.js +315 -293
- package/src/helpers/buildForecastPaletteMappings.ts +112 -0
- package/src/helpers/buildForecastPaletteOptions.ts +109 -0
- package/src/helpers/getColorScale.ts +72 -8
- package/src/helpers/getNewRuntime.ts +1 -1
- package/src/helpers/getTransformedData.ts +1 -1
- package/src/hooks/useChartHoverAnalytics.tsx +44 -0
- package/src/hooks/useReduceData.ts +105 -70
- package/src/hooks/useTooltip.tsx +57 -15
- package/src/index.jsx +0 -2
- package/src/scss/main.scss +12 -0
- package/src/store/chart.reducer.ts +1 -1
- package/src/test/CdcChart.test.jsx +8 -3
- package/src/types/ChartConfig.ts +30 -6
- package/src/types/ChartContext.ts +1 -0
- package/vite.config.js +1 -1
- package/vitest.config.ts +16 -0
- package/src/coreStyles_chart.scss +0 -3
- package/src/helpers/configHelpers.ts +0 -28
- package/src/helpers/generateColorsArray.ts +0 -8
- package/src/hooks/useColorPalette.js +0 -76
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
{
|
|
2
|
+
"errors": [],
|
|
3
|
+
"currentViewport": "lg",
|
|
4
|
+
"id": 1,
|
|
5
|
+
"category": "Charts",
|
|
6
|
+
"label": "Bar",
|
|
7
|
+
"type": "chart",
|
|
8
|
+
"subType": "Bar",
|
|
9
|
+
"orientation": "vertical",
|
|
10
|
+
"barThickness": "0.37",
|
|
11
|
+
"visualizationSubType": "regular",
|
|
12
|
+
"xAxis": {
|
|
13
|
+
"sortDates": false,
|
|
14
|
+
"anchors": [],
|
|
15
|
+
"type": "date",
|
|
16
|
+
"showTargetLabel": true,
|
|
17
|
+
"targetLabel": "Target",
|
|
18
|
+
"hideAxis": false,
|
|
19
|
+
"hideLabel": false,
|
|
20
|
+
"hideTicks": false,
|
|
21
|
+
"size": 75,
|
|
22
|
+
"tickRotation": 0,
|
|
23
|
+
"min": "",
|
|
24
|
+
"max": "",
|
|
25
|
+
"labelColor": "#333",
|
|
26
|
+
"tickLabelColor": "#333",
|
|
27
|
+
"tickColor": "#333",
|
|
28
|
+
"numTicks": "",
|
|
29
|
+
"labelOffset": 0,
|
|
30
|
+
"axisPadding": 200,
|
|
31
|
+
"target": 0,
|
|
32
|
+
"maxTickRotation": 45,
|
|
33
|
+
"padding": 5,
|
|
34
|
+
"showYearsOnce": false,
|
|
35
|
+
"sortByRecentDate": false,
|
|
36
|
+
"brushActive": true,
|
|
37
|
+
"dataKey": "Date",
|
|
38
|
+
"dateParseFormat": "%m/%d/%Y",
|
|
39
|
+
"dateDisplayFormat": "%m/%Y",
|
|
40
|
+
"axisBBox": 29.860000610351562,
|
|
41
|
+
"tickWidthMax": 63
|
|
42
|
+
},
|
|
43
|
+
"icon": {
|
|
44
|
+
"key": null,
|
|
45
|
+
"ref": null,
|
|
46
|
+
"props": {},
|
|
47
|
+
"_owner": null
|
|
48
|
+
},
|
|
49
|
+
"content": "Use bars to show comparisons between data categories.",
|
|
50
|
+
"visualizationType": "Bar",
|
|
51
|
+
"datasets": {},
|
|
52
|
+
"activeVizButtonID": 1,
|
|
53
|
+
"data": [
|
|
54
|
+
{
|
|
55
|
+
"Date": "1/15/2016",
|
|
56
|
+
"Data 1": "ABC",
|
|
57
|
+
"Data 2": "110",
|
|
58
|
+
"Data 3": "100",
|
|
59
|
+
"Data 4": "XYZ",
|
|
60
|
+
"Monthly-Goal": "100"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"Date": "2/15/2016",
|
|
64
|
+
"Data 1": "100",
|
|
65
|
+
"Data 2": "110",
|
|
66
|
+
"Data 3": "100",
|
|
67
|
+
"Data 4": "",
|
|
68
|
+
"Monthly-Goal": "100"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"Date": "3/15/2016",
|
|
72
|
+
"Data 1": "80",
|
|
73
|
+
"Data 2": "90",
|
|
74
|
+
"Data 3": "0",
|
|
75
|
+
"Data 4": "120",
|
|
76
|
+
"Monthly-Goal": "110"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"Date": "4/15/2016",
|
|
80
|
+
"Data 1": "80",
|
|
81
|
+
"Data 2": "MRC",
|
|
82
|
+
"Data 3": "110",
|
|
83
|
+
"Data 4": "0",
|
|
84
|
+
"Monthly-Goal": "110"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"Date": "5/15/2016",
|
|
88
|
+
"Data 1": "70",
|
|
89
|
+
"Data 2": "90",
|
|
90
|
+
"Data 3": "110",
|
|
91
|
+
"Data 4": "130",
|
|
92
|
+
"Monthly-Goal": "120"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"Date": "6/15/2016",
|
|
96
|
+
"Data 1": "XYZ",
|
|
97
|
+
"Data 2": "120",
|
|
98
|
+
"Data 3": "120",
|
|
99
|
+
"Data 4": "ABC",
|
|
100
|
+
"Monthly-Goal": "120"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"Date": "7/15/2016",
|
|
104
|
+
"Data 1": "110",
|
|
105
|
+
"Data 2": "ABC",
|
|
106
|
+
"Data 3": "ABC",
|
|
107
|
+
"Data 4": "130",
|
|
108
|
+
"Monthly-Goal": "130"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"Date": "8/15/2016",
|
|
112
|
+
"Data 1": "110",
|
|
113
|
+
"Data 2": "130",
|
|
114
|
+
"Data 3": "ABC",
|
|
115
|
+
"Data 4": "140",
|
|
116
|
+
"Monthly-Goal": "130"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"Date": "9/15/2016",
|
|
120
|
+
"Data 1": "120",
|
|
121
|
+
"Data 2": "130",
|
|
122
|
+
"Data 3": "120",
|
|
123
|
+
"Data 4": "XYZ",
|
|
124
|
+
"Monthly-Goal": "140"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"dataFileName": "https://wwwdev.cdc.gov/wcms/cailin/result-7.csv",
|
|
128
|
+
"dataFileSourceType": "url",
|
|
129
|
+
"dataDescription": {
|
|
130
|
+
"horizontal": false,
|
|
131
|
+
"series": true,
|
|
132
|
+
"singleRow": true
|
|
133
|
+
},
|
|
134
|
+
"annotations": [],
|
|
135
|
+
"debugSvg": false,
|
|
136
|
+
"chartMessage": {
|
|
137
|
+
"noData": "No Data Available"
|
|
138
|
+
},
|
|
139
|
+
"title": "<em>4.25.07</em> Suppressed & Isolated Bar Chart",
|
|
140
|
+
"showTitle": true,
|
|
141
|
+
"showDownloadMediaButton": false,
|
|
142
|
+
"theme": "theme-blue",
|
|
143
|
+
"animate": false,
|
|
144
|
+
"lineDatapointStyle": "hover",
|
|
145
|
+
"lineDatapointColor": "Same as Line",
|
|
146
|
+
"barHasBorder": "true",
|
|
147
|
+
"isLollipopChart": false,
|
|
148
|
+
"lollipopShape": "circle",
|
|
149
|
+
"lollipopColorStyle": "two-tone",
|
|
150
|
+
"barStyle": "",
|
|
151
|
+
"roundingStyle": "standard",
|
|
152
|
+
"tipRounding": "top",
|
|
153
|
+
"isResponsiveTicks": false,
|
|
154
|
+
"general": {
|
|
155
|
+
"annotationDropdownText": "Annotations",
|
|
156
|
+
"showMissingDataLabel": false,
|
|
157
|
+
"showSuppressedSymbol": false,
|
|
158
|
+
"showZeroValueData": false,
|
|
159
|
+
"hideNullValue": true
|
|
160
|
+
},
|
|
161
|
+
"padding": {
|
|
162
|
+
"left": 5,
|
|
163
|
+
"right": 5
|
|
164
|
+
},
|
|
165
|
+
"preliminaryData": [
|
|
166
|
+
{
|
|
167
|
+
"type": "suppression",
|
|
168
|
+
"seriesKeys": [],
|
|
169
|
+
"label": "Suppressed",
|
|
170
|
+
"column": "",
|
|
171
|
+
"value": "ABC",
|
|
172
|
+
"style": "",
|
|
173
|
+
"displayTooltip": true,
|
|
174
|
+
"displayLegend": true,
|
|
175
|
+
"displayTable": true,
|
|
176
|
+
"symbol": "Double Asterisk",
|
|
177
|
+
"iconCode": "**",
|
|
178
|
+
"lineCode": "",
|
|
179
|
+
"hideBarSymbol": false,
|
|
180
|
+
"hideLineStyle": false,
|
|
181
|
+
"circleSize": 6,
|
|
182
|
+
"displayGray": true
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"type": "suppression",
|
|
186
|
+
"seriesKeys": [],
|
|
187
|
+
"label": "Suppressed",
|
|
188
|
+
"column": "",
|
|
189
|
+
"value": "XYZ",
|
|
190
|
+
"style": "",
|
|
191
|
+
"displayTooltip": true,
|
|
192
|
+
"displayLegend": true,
|
|
193
|
+
"displayTable": true,
|
|
194
|
+
"symbol": "Dagger",
|
|
195
|
+
"iconCode": "†",
|
|
196
|
+
"lineCode": "",
|
|
197
|
+
"hideBarSymbol": false,
|
|
198
|
+
"hideLineStyle": false,
|
|
199
|
+
"circleSize": 6,
|
|
200
|
+
"displayGray": true
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"yAxis": {
|
|
204
|
+
"hideAxis": false,
|
|
205
|
+
"displayNumbersOnBar": false,
|
|
206
|
+
"hideLabel": false,
|
|
207
|
+
"hideTicks": false,
|
|
208
|
+
"size": 50,
|
|
209
|
+
"gridLines": false,
|
|
210
|
+
"enablePadding": false,
|
|
211
|
+
"min": "",
|
|
212
|
+
"max": "",
|
|
213
|
+
"labelColor": "#333",
|
|
214
|
+
"tickLabelColor": "#333",
|
|
215
|
+
"tickColor": "#333",
|
|
216
|
+
"rightHideAxis": false,
|
|
217
|
+
"rightAxisSize": 0,
|
|
218
|
+
"rightLabel": "",
|
|
219
|
+
"rightLabelOffsetSize": 0,
|
|
220
|
+
"rightAxisLabelColor": "#333",
|
|
221
|
+
"rightAxisTickLabelColor": "#333",
|
|
222
|
+
"rightAxisTickColor": "#333",
|
|
223
|
+
"numTicks": "",
|
|
224
|
+
"axisPadding": 0,
|
|
225
|
+
"scalePadding": 10,
|
|
226
|
+
"tickRotation": 0,
|
|
227
|
+
"anchors": [],
|
|
228
|
+
"shoMissingDataLabel": true,
|
|
229
|
+
"showMissingDataLine": true,
|
|
230
|
+
"categories": []
|
|
231
|
+
},
|
|
232
|
+
"boxplot": {
|
|
233
|
+
"plots": [],
|
|
234
|
+
"borders": "true",
|
|
235
|
+
"plotOutlierValues": false,
|
|
236
|
+
"plotNonOutlierValues": true,
|
|
237
|
+
"labels": {
|
|
238
|
+
"q1": "Lower Quartile",
|
|
239
|
+
"q2": "q2",
|
|
240
|
+
"q3": "Upper Quartile",
|
|
241
|
+
"q4": "q4",
|
|
242
|
+
"minimum": "Minimum",
|
|
243
|
+
"maximum": "Maximum",
|
|
244
|
+
"mean": "Mean",
|
|
245
|
+
"median": "Median",
|
|
246
|
+
"sd": "Standard Deviation",
|
|
247
|
+
"iqr": "Interquartile Range",
|
|
248
|
+
"count": "Count",
|
|
249
|
+
"outliers": "Outliers",
|
|
250
|
+
"values": "Values",
|
|
251
|
+
"lowerBounds": "Lower Bounds",
|
|
252
|
+
"upperBounds": "Upper Bounds"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"topAxis": {
|
|
256
|
+
"hasLine": false
|
|
257
|
+
},
|
|
258
|
+
"isLegendValue": false,
|
|
259
|
+
"barHeight": 25,
|
|
260
|
+
"barSpace": 15,
|
|
261
|
+
"heights": {
|
|
262
|
+
"vertical": 300,
|
|
263
|
+
"horizontal": 750
|
|
264
|
+
},
|
|
265
|
+
"table": {
|
|
266
|
+
"label": "Data Table",
|
|
267
|
+
"expanded": false,
|
|
268
|
+
"limitHeight": false,
|
|
269
|
+
"height": "",
|
|
270
|
+
"caption": "",
|
|
271
|
+
"showDownloadUrl": false,
|
|
272
|
+
"showDataTableLink": true,
|
|
273
|
+
"showDownloadLinkBelow": true,
|
|
274
|
+
"indexLabel": "",
|
|
275
|
+
"download": true,
|
|
276
|
+
"showVertical": true,
|
|
277
|
+
"dateDisplayFormat": "",
|
|
278
|
+
"showMissingDataLabel": true,
|
|
279
|
+
"showSuppressedSymbol": true,
|
|
280
|
+
"show": true
|
|
281
|
+
},
|
|
282
|
+
"color": "pinkpurple",
|
|
283
|
+
"columns": {},
|
|
284
|
+
"legend": {
|
|
285
|
+
"hide": false,
|
|
286
|
+
"behavior": "isolate",
|
|
287
|
+
"axisAlign": true,
|
|
288
|
+
"singleRow": true,
|
|
289
|
+
"colorCode": "",
|
|
290
|
+
"reverseLabelOrder": false,
|
|
291
|
+
"description": "",
|
|
292
|
+
"dynamicLegend": false,
|
|
293
|
+
"dynamicLegendDefaultText": "Show All",
|
|
294
|
+
"dynamicLegendItemLimit": 5,
|
|
295
|
+
"dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
|
|
296
|
+
"dynamicLegendChartMessage": "Select Options from the Legend",
|
|
297
|
+
"label": "",
|
|
298
|
+
"lineMode": false,
|
|
299
|
+
"verticalSorted": false,
|
|
300
|
+
"highlightOnHover": false,
|
|
301
|
+
"hideSuppressedLabels": false,
|
|
302
|
+
"hideSuppressionLink": false,
|
|
303
|
+
"seriesHighlight": [],
|
|
304
|
+
"style": "circles",
|
|
305
|
+
"subStyle": "linear blocks",
|
|
306
|
+
"groupBy": "",
|
|
307
|
+
"shape": "circle",
|
|
308
|
+
"tickRotation": "",
|
|
309
|
+
"order": "dataColumn",
|
|
310
|
+
"hideBorder": {
|
|
311
|
+
"side": false,
|
|
312
|
+
"topBottom": true
|
|
313
|
+
},
|
|
314
|
+
"position": "right",
|
|
315
|
+
"orderedValues": [],
|
|
316
|
+
"unified": true
|
|
317
|
+
},
|
|
318
|
+
"exclusions": {
|
|
319
|
+
"active": true,
|
|
320
|
+
"keys": [],
|
|
321
|
+
"dateStart": "2016-01-01",
|
|
322
|
+
"dateEnd": "2016-05-01"
|
|
323
|
+
},
|
|
324
|
+
"palette": "qualitative-bold",
|
|
325
|
+
"isPaletteReversed": false,
|
|
326
|
+
"twoColor": {
|
|
327
|
+
"palette": "monochrome-1",
|
|
328
|
+
"isPaletteReversed": false
|
|
329
|
+
},
|
|
330
|
+
"labels": true,
|
|
331
|
+
"dataFormat": {
|
|
332
|
+
"commas": false,
|
|
333
|
+
"prefix": "",
|
|
334
|
+
"suffix": "",
|
|
335
|
+
"abbreviated": false,
|
|
336
|
+
"bottomSuffix": "",
|
|
337
|
+
"bottomPrefix": "",
|
|
338
|
+
"bottomAbbreviated": false
|
|
339
|
+
},
|
|
340
|
+
"filters": [],
|
|
341
|
+
"confidenceKeys": {},
|
|
342
|
+
"visual": {
|
|
343
|
+
"border": true,
|
|
344
|
+
"accent": true,
|
|
345
|
+
"background": true,
|
|
346
|
+
"verticalHoverLine": false,
|
|
347
|
+
"horizontalHoverLine": false,
|
|
348
|
+
"lineDatapointSymbol": "none",
|
|
349
|
+
"maximumShapeAmount": 7
|
|
350
|
+
},
|
|
351
|
+
"useLogScale": false,
|
|
352
|
+
"filterBehavior": "Filter Change",
|
|
353
|
+
"highlightedBarValues": [],
|
|
354
|
+
"series": [
|
|
355
|
+
{
|
|
356
|
+
"dataKey": "Data 1",
|
|
357
|
+
"type": "Bar",
|
|
358
|
+
"axis": "Left",
|
|
359
|
+
"tooltip": true
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"dataKey": "Data 2",
|
|
363
|
+
"type": "Bar",
|
|
364
|
+
"axis": "Left",
|
|
365
|
+
"tooltip": true
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"dataKey": "Data 3",
|
|
369
|
+
"type": "Bar",
|
|
370
|
+
"axis": "Left",
|
|
371
|
+
"tooltip": true
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"dataKey": "Data 4",
|
|
375
|
+
"type": "Bar",
|
|
376
|
+
"axis": "Left",
|
|
377
|
+
"tooltip": true
|
|
378
|
+
}
|
|
379
|
+
],
|
|
380
|
+
"tooltips": {
|
|
381
|
+
"opacity": 90,
|
|
382
|
+
"singleSeries": false,
|
|
383
|
+
"dateDisplayFormat": ""
|
|
384
|
+
},
|
|
385
|
+
"forestPlot": {
|
|
386
|
+
"startAt": 0,
|
|
387
|
+
"colors": {
|
|
388
|
+
"line": "",
|
|
389
|
+
"shape": ""
|
|
390
|
+
},
|
|
391
|
+
"lineOfNoEffect": {
|
|
392
|
+
"show": true
|
|
393
|
+
},
|
|
394
|
+
"type": "",
|
|
395
|
+
"pooledResult": {
|
|
396
|
+
"diamondHeight": 5,
|
|
397
|
+
"column": ""
|
|
398
|
+
},
|
|
399
|
+
"estimateField": "",
|
|
400
|
+
"estimateRadius": "",
|
|
401
|
+
"shape": "square",
|
|
402
|
+
"rowHeight": 20,
|
|
403
|
+
"description": {
|
|
404
|
+
"show": true,
|
|
405
|
+
"text": "description",
|
|
406
|
+
"location": 0
|
|
407
|
+
},
|
|
408
|
+
"result": {
|
|
409
|
+
"show": true,
|
|
410
|
+
"text": "result",
|
|
411
|
+
"location": 100
|
|
412
|
+
},
|
|
413
|
+
"radius": {
|
|
414
|
+
"min": 2,
|
|
415
|
+
"max": 10,
|
|
416
|
+
"scalingColumn": ""
|
|
417
|
+
},
|
|
418
|
+
"regression": {
|
|
419
|
+
"lower": 0,
|
|
420
|
+
"upper": 0,
|
|
421
|
+
"estimateField": 0
|
|
422
|
+
},
|
|
423
|
+
"leftWidthOffset": 0,
|
|
424
|
+
"rightWidthOffset": 0,
|
|
425
|
+
"showZeroLine": false,
|
|
426
|
+
"leftLabel": "",
|
|
427
|
+
"rightLabel": ""
|
|
428
|
+
},
|
|
429
|
+
"area": {
|
|
430
|
+
"isStacked": false
|
|
431
|
+
},
|
|
432
|
+
"sankey": {
|
|
433
|
+
"title": {
|
|
434
|
+
"defaultColor": "black"
|
|
435
|
+
},
|
|
436
|
+
"iterations": 1,
|
|
437
|
+
"rxValue": 0.9,
|
|
438
|
+
"overallSize": {
|
|
439
|
+
"width": 900,
|
|
440
|
+
"height": 700
|
|
441
|
+
},
|
|
442
|
+
"margin": {
|
|
443
|
+
"margin_y": 25,
|
|
444
|
+
"margin_x": 0
|
|
445
|
+
},
|
|
446
|
+
"nodeSize": {
|
|
447
|
+
"nodeWidth": 26,
|
|
448
|
+
"nodeHeight": 40
|
|
449
|
+
},
|
|
450
|
+
"nodePadding": 55,
|
|
451
|
+
"nodeFontColor": "black",
|
|
452
|
+
"nodeColor": {
|
|
453
|
+
"default": "#ff8500",
|
|
454
|
+
"inactive": "#808080"
|
|
455
|
+
},
|
|
456
|
+
"linkColor": {
|
|
457
|
+
"default": "#ffc900",
|
|
458
|
+
"inactive": "#D3D3D3"
|
|
459
|
+
},
|
|
460
|
+
"opacity": {
|
|
461
|
+
"nodeOpacityDefault": 1,
|
|
462
|
+
"nodeOpacityInactive": 0.1,
|
|
463
|
+
"LinkOpacityDefault": 1,
|
|
464
|
+
"LinkOpacityInactive": 0.1
|
|
465
|
+
},
|
|
466
|
+
"storyNodeFontColor": "#006778",
|
|
467
|
+
"storyNodeText": [],
|
|
468
|
+
"nodeValueStyle": {
|
|
469
|
+
"textBefore": "(",
|
|
470
|
+
"textAfter": ")"
|
|
471
|
+
},
|
|
472
|
+
"data": []
|
|
473
|
+
},
|
|
474
|
+
"version": "4.25.7",
|
|
475
|
+
"migrations": {
|
|
476
|
+
"addColorMigration": true
|
|
477
|
+
},
|
|
478
|
+
"dynamicMarginTop": 0,
|
|
479
|
+
"allowLineToBarGraph": "__undefined__"
|
|
480
|
+
}
|
package/index.html
CHANGED
|
@@ -48,18 +48,12 @@
|
|
|
48
48
|
<!-- GENERIC CHART TYPES -->
|
|
49
49
|
<!-- <div class="react-container" data-config="/examples/private/ari-other-conditions-1.json"></div> -->
|
|
50
50
|
<!-- <div class="react-container" data-config="/examples/private/Viral-Respiratory-Deaths-Age.json"></div> -->
|
|
51
|
-
<!--
|
|
51
|
+
<!-- <div class="react-container" data-config="/examples/private/f3.json"></div> -->
|
|
52
52
|
<!-- <div class="react-container" data-config="/examples/test.json"></div> -->
|
|
53
53
|
<!-- <div class="react-container" data-config="/examples/feature/line/line-chart.json"></div> -->
|
|
54
54
|
<!-- <div class="react-container" data-config="/examples/dev-8332.json"></div> -->
|
|
55
|
-
<!-- <div class="react-container" data-config="/examples/
|
|
55
|
+
<!-- <div class="react-container" data-config="/examples/private/pie-chart-legend.json"></div> -->
|
|
56
56
|
<!-- <div class="react-container" data-config="/examples/feature/filters/url-filter.json"></div> -->
|
|
57
|
-
<!-- <div class="react-container" data-config="/examples/feature/bar/additional-column-tooltip.json"></div> -->
|
|
58
|
-
<!-- <div class="react-container" data-config="https://cdc.gov/poxvirus/mpox/modules/data-viz/mpx-trends_1.json"></div> -->
|
|
59
|
-
<!-- <div class="react-container" data-config="/examples/feature/area/area-chart-date-apple.json"></div> -->
|
|
60
|
-
<!-- <div class="react-container" data-config="/examples/feature/forest-plot/linear.json"></div> -->
|
|
61
|
-
<!-- <div class="react-container" data-config="/examples/feature/forest-plot/logarithmic.json"></div> -->
|
|
62
|
-
<!-- <div class="react-container" data-config="/examples/feature/forest-plot/forest-plot.json"></div> -->
|
|
63
57
|
<!-- <div class="react-container" data-config="/examples/feature/pie/planet-pie-example-config.json"></div> -->
|
|
64
58
|
<!-- <div class="react-container" data-config=https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/Line_Chart_Viz.json></div> -->
|
|
65
59
|
<!-- <div class="react-container" data-config=/examples/feature/regions/index.json></div> -->
|
|
@@ -79,12 +73,9 @@
|
|
|
79
73
|
|
|
80
74
|
<!-- BAR -->
|
|
81
75
|
<!-- <div class="react-container" data-config="/examples/feature/bar/planet-example-config.json"></div> -->
|
|
82
|
-
<!-- <div class="react-container" data-config="/examples/feature/bar/planet-chart-horizontal-example-config.json"></div> -->
|
|
83
76
|
<!-- <div class="react-container" data-config="/examples/feature/bar/example-bar-chart.json"></div> -->
|
|
84
|
-
|
|
77
|
+
<div class="react-container" data-config="/examples/feature/bar/horizontal-chart-max-increase.json"></div>
|
|
85
78
|
<!-- <div class="react-container" data-config="/examples/feature/bar/horizontal-chart.json"></div> -->
|
|
86
|
-
<!-- <div class="react-container" data-config="/examples/feature/bar/horizontal-stacked-bar-chart.json"></div> -->
|
|
87
|
-
<!-- <div class="react-container" data-config="/examples/feature/bar/planet-chart-horizontal-example-config.json"></div> -->
|
|
88
79
|
|
|
89
80
|
<!-- TESTS DATA TABLE SORTING -->
|
|
90
81
|
<!-- Bar Chart with Confidence Intervals (bottom of page) -->
|
|
@@ -113,18 +104,12 @@
|
|
|
113
104
|
<!-- <div class="react-container" data-config="/examples/feature/tests-big-small/line-chart-max-increase.json"></div> -->
|
|
114
105
|
|
|
115
106
|
<!-- TESTS NONNUMERICS -->
|
|
116
|
-
<!-- <div
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
></div> -->
|
|
120
|
-
<div class="react-container" data-config="/examples/feature/tests-non-numerics/example-combo-bar-nonnumeric.json">
|
|
121
|
-
</div>
|
|
107
|
+
<!-- <div class="react-container"
|
|
108
|
+
data-config="/examples/feature/tests-non-numerics/planet-pie-example-config-nonnumeric.json"></div> -->
|
|
109
|
+
<!-- <div class="react-container" data-config="/examples/feature/tests-non-numerics/example-combo-bar-nonnumeric.json"></div> -->
|
|
122
110
|
<!-- <div class="react-container" data-config="/examples/feature/tests-non-numerics/example-bar-chart-nonnumeric.json"></div> -->
|
|
123
111
|
<!-- <div class="react-container" data-config="/examples/sparkline.json"></div> -->
|
|
124
|
-
<!-- <div
|
|
125
|
-
class="react-container"
|
|
126
|
-
data-config="/examples/feature/tests-non-numerics/sparkline-chart-nonnumeric.json"
|
|
127
|
-
></div> -->
|
|
112
|
+
<!-- <div class="react-container" data-config="/examples/feature/tests-non-numerics/sparkline-chart-nonnumeric.json"></div> -->
|
|
128
113
|
<!-- <div class="react-container" data-config="/examples/region-issue.json"></div> -->
|
|
129
114
|
<!-- <div class="react-container" data-config="/examples/feature/tests-non-numerics/stacked-vertical-bar-example-nonnumerics.json"></div> -->
|
|
130
115
|
|
|
@@ -135,6 +120,9 @@
|
|
|
135
120
|
<!-- <div class="react-container" data-config="/examples/feature/tests-covid/covid-confidence-example-config.json"></div> -->
|
|
136
121
|
<!-- <div class="react-container" data-config="/examples/feature/tests-covid/covid-example-config.json"></div> -->
|
|
137
122
|
|
|
123
|
+
<!-- TESTS TOOLTIPS -->
|
|
124
|
+
<!-- <div class="react-container" data-config="/examples/suppressed_tooltip.json"></div> -->
|
|
125
|
+
|
|
138
126
|
<!--
|
|
139
127
|
GALLERY EXAMPLES BELOW THIS LINE...
|
|
140
128
|
https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/example-data-map-cities-states.html
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/chart",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.10",
|
|
4
4
|
"description": "React component for visualizing tabular data in various types of charts",
|
|
5
5
|
"moduleName": "CdcChart",
|
|
6
6
|
"main": "dist/cdcchart",
|
|
@@ -26,40 +26,58 @@
|
|
|
26
26
|
},
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@cdc/core": "^4.25.
|
|
29
|
+
"@cdc/core": "^4.25.10",
|
|
30
30
|
"@hello-pangea/dnd": "^16.2.0",
|
|
31
31
|
"@react-spring/web": "^9.7.5",
|
|
32
|
+
"@rollup/plugin-dsv": "^3.0.2",
|
|
33
|
+
"@visx/annotation": "^3.3.0",
|
|
32
34
|
"@visx/axis": "3.12.0",
|
|
35
|
+
"@visx/brush": "^3.12.0",
|
|
33
36
|
"@visx/curve": "3.12.0",
|
|
37
|
+
"@visx/drag": "^3.12.0",
|
|
34
38
|
"@visx/event": "3.12.0",
|
|
35
39
|
"@visx/glyph": "3.12.0",
|
|
36
40
|
"@visx/gradient": "3.12.0",
|
|
41
|
+
"@visx/legend": "3.12.0",
|
|
37
42
|
"@visx/marker": "3.12.0",
|
|
38
43
|
"@visx/mock-data": "3.12.0",
|
|
44
|
+
"@visx/pattern": "^3.0.0",
|
|
45
|
+
"@visx/responsive": "^2.10.0",
|
|
39
46
|
"@visx/scale": "3.12.0",
|
|
40
47
|
"@visx/shape": "3.12.0",
|
|
41
48
|
"@visx/stats": "3.12.0",
|
|
42
49
|
"@visx/text": "3.12.0",
|
|
43
50
|
"@visx/tooltip": "3.12.0",
|
|
51
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
52
|
+
"chroma-js": "3.1.2",
|
|
44
53
|
"d3-array": "3.2.4",
|
|
45
54
|
"d3-format": "^3.1.0",
|
|
46
55
|
"d3-sankey": "^0.12.3",
|
|
47
56
|
"d3-time-format": "4.1.0",
|
|
57
|
+
"dompurify": "^3.1.5",
|
|
58
|
+
"html-react-parser": "5.2.3",
|
|
48
59
|
"js-base64": "^2.5.2",
|
|
49
|
-
"
|
|
60
|
+
"lodash": "^4.17.21",
|
|
61
|
+
"papaparse": "5.5.2",
|
|
62
|
+
"react-accessible-accordion": "^5.0.1",
|
|
50
63
|
"react-icons": "5.5.0",
|
|
51
|
-
"
|
|
64
|
+
"react-tooltip": "5.8.2-beta.3",
|
|
65
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
66
|
+
"use-debounce": "^6.0.1",
|
|
67
|
+
"vite": "^4.4.11",
|
|
68
|
+
"vite-plugin-css-injected-by-js": "^2.4.0",
|
|
69
|
+
"vite-plugin-svgr": "^2.4.0",
|
|
70
|
+
"whatwg-fetch": "3.6.20"
|
|
52
71
|
},
|
|
53
72
|
"peerDependencies": {
|
|
54
73
|
"react": "^18.2.0",
|
|
55
74
|
"react-dom": "^18.2.0"
|
|
56
75
|
},
|
|
57
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "c2db758e74ab9b9ca1667a6f9cb41dd0dccf985d",
|
|
58
77
|
"devDependencies": {
|
|
59
78
|
"@types/d3-array": "^3.2.1",
|
|
60
79
|
"@types/d3-format": "^3.0.4",
|
|
61
80
|
"@types/d3-sankey": "^0.12.4",
|
|
62
|
-
"@types/d3-time-format": "^4.0.3"
|
|
63
|
-
"resize-observer-polyfill": "^1.5.1"
|
|
81
|
+
"@types/d3-time-format": "^4.0.3"
|
|
64
82
|
}
|
|
65
83
|
}
|
package/src/CdcChart.tsx
CHANGED
|
@@ -4,11 +4,10 @@ import { ChartConfig } from './types/ChartConfig'
|
|
|
4
4
|
import { getFileExtension } from '@cdc/core/helpers/getFileExtension'
|
|
5
5
|
import { isSolrCsv, isSolrJson } from '@cdc/core/helpers/isSolr'
|
|
6
6
|
import Papa from 'papaparse'
|
|
7
|
-
import 'react-tooltip/dist/react-tooltip.css'
|
|
8
7
|
import cacheBustingString from '@cdc/core/helpers/cacheBustingString'
|
|
9
8
|
import Loading from '@cdc/core/components/Loading'
|
|
10
9
|
import _ from 'lodash'
|
|
11
|
-
import EditorContext from '
|
|
10
|
+
import EditorContext from '@cdc/core/contexts/EditorContext'
|
|
12
11
|
interface CdcChartProps {
|
|
13
12
|
configUrl?: string
|
|
14
13
|
isEditor?: boolean
|