@cdc/chart 4.23.4 → 4.23.5

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 (31) hide show
  1. package/dist/cdcchart.js +52384 -50875
  2. package/examples/feature/__data__/planet-example-data.json +2 -19
  3. package/examples/feature/__data__/planet-logaritmic-data.json +56 -0
  4. package/examples/feature/area/area-chart-category.json +240 -0
  5. package/examples/feature/bar/example-bar-chart.json +544 -22
  6. package/examples/feature/bar/planet-chart-logaritmic-config.json +170 -0
  7. package/examples/feature/boxplot/valid-boxplot.csv +17 -0
  8. package/examples/feature/filters/filter-testing.json +37 -3
  9. package/examples/feature/forecasting/random_data.csv +366 -0
  10. package/examples/feature/line/line-chart.json +2 -2
  11. package/examples/feature/test-highlight/test-highlight-2.json +789 -0
  12. package/examples/feature/test-highlight/test-highlight-vertical.json +561 -0
  13. package/examples/feature/test-highlight/test-highlight.json +100 -0
  14. package/examples/feature/tests-non-numerics/stacked-vertical-bar-example-nonnumerics.json +1 -2
  15. package/examples/gallery/bar-chart-horizontal/horizontal-highlight.json +345 -0
  16. package/index.html +8 -8
  17. package/package.json +2 -2
  18. package/src/CdcChart.jsx +294 -14
  19. package/src/components/AreaChart.jsx +27 -20
  20. package/src/components/BarChart.jsx +85 -25
  21. package/src/components/DeviationBar.jsx +32 -32
  22. package/src/components/EditorPanel.jsx +1105 -184
  23. package/src/components/Legend.jsx +39 -3
  24. package/src/components/LineChart.jsx +1 -8
  25. package/src/components/LinearChart.jsx +121 -270
  26. package/src/data/initial-state.js +18 -3
  27. package/src/hooks/useHighlightedBars.js +154 -0
  28. package/src/hooks/useMinMax.js +92 -0
  29. package/src/hooks/useReduceData.js +31 -57
  30. package/src/hooks/useScales.js +202 -0
  31. /package/examples/feature/area/{area-chart.json → area-chart-date.json} +0 -0
@@ -0,0 +1,345 @@
1
+ {
2
+ "type": "chart",
3
+ "title": "Example Horizontal Bar Chart",
4
+ "showTitle": true,
5
+ "theme": "theme-teal",
6
+ "animate": false,
7
+ "fontSize": "small",
8
+ "lineDatapointStyle": "hover",
9
+ "barHasBorder": "false",
10
+ "isLollipopChart": false,
11
+ "lollipopShape": "circle",
12
+ "lollipopColorStyle": "two-tone",
13
+ "visualizationSubType": "horizontal",
14
+ "barStyle": "",
15
+ "roundingStyle": "standard",
16
+ "tipRounding": "top",
17
+ "padding": {
18
+ "left": 5,
19
+ "right": 5
20
+ },
21
+ "yAxis": {
22
+ "hideAxis": false,
23
+ "displayNumbersOnBar": false,
24
+ "hideLabel": false,
25
+ "hideTicks": false,
26
+ "size": 50,
27
+ "gridLines": false,
28
+ "enablePadding": false,
29
+ "min": "",
30
+ "max": "",
31
+ "labelColor": "#333",
32
+ "tickLabelColor": "#333",
33
+ "tickColor": "#333",
34
+ "rightHideAxis": true,
35
+ "rightAxisSize": 50,
36
+ "rightLabel": "",
37
+ "rightLabelOffsetSize": 0,
38
+ "rightAxisLabelColor": "#333",
39
+ "rightAxisTickLabelColor": "#333",
40
+ "rightAxisTickColor": "#333",
41
+ "numTicks": "",
42
+ "axisPadding": 0,
43
+ "tickRotation": 0,
44
+ "type": "chart",
45
+ "title": "Example Horizontal Bar Chart",
46
+ "theme": "theme-teal",
47
+ "fontSize": "small",
48
+ "lineDatapointStyle": "hover",
49
+ "barHasBorder": "false",
50
+ "padding": {
51
+ "left": 5,
52
+ "right": 5
53
+ },
54
+ "yAxis": {
55
+ "size": 50,
56
+ "gridLines": false,
57
+ "label": "X-Axis Example Label",
58
+ "numTicks": "10"
59
+ },
60
+ "barThickness": "0.7",
61
+ "height": 560,
62
+ "xAxis": {
63
+ "type": "categorical",
64
+ "size": "0",
65
+ "tickRotation": 0,
66
+ "dataKey": "Group",
67
+ "label": ""
68
+ },
69
+ "table": {
70
+ "label": "Data Table",
71
+ "expanded": true,
72
+ "download": false,
73
+ "show": true
74
+ },
75
+ "legend": {
76
+ "behavior": "isolate",
77
+ "position": "right",
78
+ "label": "Type of Data"
79
+ },
80
+ "exclusions": {
81
+ "active": false,
82
+ "keys": []
83
+ },
84
+ "palette": "qualitative-soft",
85
+ "labels": false,
86
+ "dataFormat": {},
87
+ "confidenceKeys": {},
88
+ "data": [
89
+ {
90
+ "Group": "Combined Total of Group A",
91
+ "Vehicle": "100",
92
+ "Home": "120",
93
+ "Work": "140",
94
+ "Office": "120"
95
+ },
96
+ {
97
+ "Group": "Combined Total of Group B",
98
+ "Vehicle": "150",
99
+ "Home": "140",
100
+ "Work": "100",
101
+ "Office": "90"
102
+ },
103
+ {
104
+ "Group": "Combined Total of Group C",
105
+ "Vehicle": "90",
106
+ "Home": "90",
107
+ "Work": "80",
108
+ "Office": "80"
109
+ },
110
+ {
111
+ "Group": "Combined Total of Group D",
112
+ "Vehicle": "70",
113
+ "Home": "60",
114
+ "Work": "50",
115
+ "Office": "70"
116
+ }
117
+ ],
118
+ "visualizationType": "Bar",
119
+ "visualizationSubType": "horizontal",
120
+ "series": [
121
+ {
122
+ "dataKey": "Vehicle",
123
+ "type": "Bar"
124
+ },
125
+ {
126
+ "dataKey": "Home",
127
+ "type": "Bar"
128
+ },
129
+ {
130
+ "dataKey": "Work",
131
+ "type": "Bar"
132
+ },
133
+ {
134
+ "dataKey": "Office",
135
+ "type": "Bar"
136
+ }
137
+ ],
138
+ "description": "This example shows a horizontal bar chart created in the visualization editor in WCMS",
139
+ "runtime": {
140
+ "seriesLabels": {
141
+ "Vehicle": "Vehicle",
142
+ "Home": "Home",
143
+ "Work": "Work",
144
+ "Office": "Office"
145
+ },
146
+ "seriesLabelsAll": [
147
+ "Vehicle",
148
+ "Home",
149
+ "Work",
150
+ "Office"
151
+ ],
152
+ "originalXAxis": {
153
+ "type": "categorical",
154
+ "size": "0",
155
+ "tickRotation": 0,
156
+ "dataKey": "Group",
157
+ "label": ""
158
+ },
159
+ "seriesKeys": [
160
+ "Vehicle",
161
+ "Home",
162
+ "Work",
163
+ "Office"
164
+ ],
165
+ "xAxis": {
166
+ "size": 50,
167
+ "gridLines": false,
168
+ "label": "X-Axis Example Label",
169
+ "numTicks": "10"
170
+ },
171
+ "yAxis": {
172
+ "type": "categorical",
173
+ "size": "0",
174
+ "tickRotation": 0,
175
+ "dataKey": "Group",
176
+ "label": ""
177
+ },
178
+ "horizontal": true,
179
+ "uniqueId": 1644353484184,
180
+ "editorErrorMessage": ""
181
+ },
182
+ "barPadding": 40,
183
+ "barHeight": 25,
184
+ "labelPlacement": "Below Bar",
185
+ "label": "Accidents"
186
+ },
187
+ "boxplot": {
188
+ "plots": [],
189
+ "borders": "true",
190
+ "firstQuartilePercentage": 25,
191
+ "thirdQuartilePercentage": 75,
192
+ "boxWidthPercentage": 40,
193
+ "plotOutlierValues": false,
194
+ "plotNonOutlierValues": true,
195
+ "legend": {
196
+ "showHowToReadText": false,
197
+ "howToReadText": ""
198
+ },
199
+ "labels": {
200
+ "q1": "Lower Quartile",
201
+ "q2": "q2",
202
+ "q3": "Upper Quartile",
203
+ "q4": "q4",
204
+ "minimum": "Minimum",
205
+ "maximum": "Maximum",
206
+ "mean": "Mean",
207
+ "median": "Median",
208
+ "sd": "Standard Deviation",
209
+ "iqr": "Interquartile Range",
210
+ "total": "Total",
211
+ "outliers": "Outliers",
212
+ "values": "Values",
213
+ "lowerBounds": "Lower Bounds",
214
+ "upperBounds": "Upper Bounds"
215
+ }
216
+ },
217
+ "topAxis": {
218
+ "hasLine": false
219
+ },
220
+ "isLegendValue": false,
221
+ "barThickness": "0.7",
222
+ "barHeight": 25,
223
+ "barSpace": 15,
224
+ "heights": {
225
+ "vertical": 300,
226
+ "horizontal": 236.8
227
+ },
228
+ "xAxis": {
229
+ "type": "categorical",
230
+ "showTargetLabel": true,
231
+ "targetLabel": "Target",
232
+ "hideAxis": false,
233
+ "hideLabel": false,
234
+ "hideTicks": false,
235
+ "size": "0",
236
+ "tickRotation": 0,
237
+ "min": "",
238
+ "max": "",
239
+ "labelColor": "#333",
240
+ "tickLabelColor": "#333",
241
+ "tickColor": "#333",
242
+ "numTicks": "",
243
+ "labelOffset": 65,
244
+ "axisPadding": 0,
245
+ "target": 0,
246
+ "dataKey": "Group",
247
+ "label": ""
248
+ },
249
+ "table": {
250
+ "label": "Data Table",
251
+ "expanded": true,
252
+ "limitHeight": false,
253
+ "height": "",
254
+ "caption": "",
255
+ "showDownloadUrl": false,
256
+ "showDataTableLink": true,
257
+ "download": false,
258
+ "show": true
259
+ },
260
+ "orientation": "horizontal",
261
+ "legend": {
262
+ "behavior": "isolate",
263
+ "singleRow": false,
264
+ "colorCode": "",
265
+ "reverseLabelOrder": false,
266
+ "description": "",
267
+ "dynamicLegend": false,
268
+ "dynamicLegendDefaultText": "Show All",
269
+ "dynamicLegendItemLimit": 5,
270
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
271
+ "dynamicLegendChartMessage": "Select Options from the Legend",
272
+ "position": "right",
273
+ "label": "Location"
274
+ },
275
+ "exclusions": {
276
+ "active": false,
277
+ "keys": []
278
+ },
279
+ "palette": "qualitative-soft",
280
+ "isPaletteReversed": false,
281
+ "twoColor": {
282
+ "palette": "monochrome-1",
283
+ "isPaletteReversed": false
284
+ },
285
+ "labels": false,
286
+ "dataFormat": {
287
+ "commas": false,
288
+ "prefix": "",
289
+ "suffix": "",
290
+ "abbreviated": false,
291
+ "bottomSuffix": "",
292
+ "bottomPrefix": "",
293
+ "bottomAbbreviated": false
294
+ },
295
+ "confidenceKeys": {},
296
+ "visual": {
297
+ "border": true,
298
+ "accent": true,
299
+ "background": true
300
+ },
301
+ "filterBehavior": "Filter Change",
302
+ "highlightedBarValues": [],
303
+ "height": 560,
304
+ "data": [
305
+ {
306
+ "Group": "Group A Survey Results",
307
+ "Vehicle": "100",
308
+ "Home": "120",
309
+ "Work": "140",
310
+ "Office": "120"
311
+ },
312
+ {
313
+ "Group": "Group B Survey Results",
314
+ "Vehicle": "150",
315
+ "Home": "140",
316
+ "Work": "100",
317
+ "Office": "90"
318
+ },
319
+ {
320
+ "Group": "Group C Survey Results",
321
+ "Vehicle": "90",
322
+ "Home": "90",
323
+ "Work": "80",
324
+ "Office": "80"
325
+ },
326
+ {
327
+ "Group": "Group D Survey Results",
328
+ "Vehicle": "70",
329
+ "Home": "60",
330
+ "Work": "50",
331
+ "Office": "70"
332
+ }
333
+ ],
334
+ "visualizationType": "Bar",
335
+ "series": [
336
+ {
337
+ "dataKey": "Vehicle",
338
+ "type": "Bar"
339
+ }
340
+ ],
341
+ "description": "This example shows a horizontal bar chart created in the visualization editor in WCMS",
342
+ "barPadding": 40,
343
+ "dataFileName": "3-CSV_Source_Example_for_Horizontal_Bar_viz - Fixed.csv",
344
+ "dataFileSourceType": "file"
345
+ }
package/index.html CHANGED
@@ -34,9 +34,13 @@
34
34
  -->
35
35
 
36
36
  <!-- GENERIC CHART TYPES -->
37
+ <div class="react-container" data-config="/examples/feature/filters/filter-testing.json"></div>
37
38
  <!-- <div class="react-container" data-config="/examples/feature/pie/planet-pie-example-config.json"></div> -->
38
- <div class="react-container" data-config="/examples/feature/line/line-chart.json"></div>
39
- <!-- <div class="react-container" data-config="/examples/feature/area/area-chart.json"></div> -->
39
+ <!-- <div class="react-container" data-config="/examples/feature/line/line-chart.json"></div> -->
40
+ <!-- <div class="react-container" data-config="/examples/feature/test-highlight/test-highlight.json"></div> -->
41
+ <!-- <div class="react-container" data-config="/examples/feature/test-highlight/test-highlight-vertical.json"></div> -->
42
+ <!-- <div class="react-container" data-config="/examples/feature/area/area-chart-category.json"></div> -->
43
+ <!-- <div class="react-container" data-config="/examples/feature/area/area-chart-date.json"></div> -->
40
44
  <!-- <div class="react-container" data-config="/examples/feature/scatterplot/scatterplot.json"></div> -->
41
45
  <!-- <div class="react-container" data-config="/examples/feature/deviation/planet-deviation-config.json"></div> -->
42
46
  <!-- <div class="react-container" data-config="/examples/feature/boxplot/boxplot.json"></div> -->
@@ -55,16 +59,12 @@
55
59
  <!-- SPARKLINE -->
56
60
  <!-- <div class="react-container" data-config="/examples/feature/sparkline/example-sparkline.json"></div> -->
57
61
 
58
- <!-- TESTS FILTERS -->
59
- <!-- <div class="react-container" data-config="/examples/feature/filters/filter-testing.json"></div> -->
60
- <!-- <div class="react-container" data-config="/examples/private/dev-bar.json"></div> -->
61
-
62
62
  <!-- TESTS DATE EXCLUSIONS -->
63
63
  <!-- <div class="react-container" data-config="/examples/feature/tests-date-exclusions/date-exclusions-config.json"></div> -->
64
64
  <!-- <div class="react-container" data-config="/examples/feature/tests-case-rate/case-rate-example-config.json"></div> -->
65
65
 
66
66
  <!-- TESTS BIG SMALL-->
67
- <!-- <div class="react-container" data-config="/examples/feature/tests-big-small/big-small-test-line.json"></div> -->
67
+ <!-- <div class="react-container" data-config="/examples/feature/tests-big-small/big-small-test-line.json"></div> -->
68
68
  <!-- <div class="react-container" data-config="/examples/feature/tests-big-small/big-small-test-bar.json"></div> -->
69
69
  <!-- <div class="react-container" data-config="/examples/feature/tests-big-small/big-small-test-negative.json"></div> -->
70
70
  <!-- <div class="react-container" data-config="/examples/feature/tests-big-small/line-chart-max-increase.json"></div> -->
@@ -74,7 +74,7 @@
74
74
  <!-- <div class="react-container" data-config="/examples/feature/tests-non-numerics/example-combo-bar-nonnumeric.json"></div> -->
75
75
  <!-- <div class="react-container" data-config="/examples/feature/tests-non-numerics/example-bar-chart-nonnumeric.json"></div> -->
76
76
  <!-- <div class="react-container" data-config="/examples/feature/tests-non-numerics/sparkline-chart-nonnumeric.json"></div> -->
77
- <!-- <div class="react-container" data-config="/examples/feature/tests-non-numerics/stacked-vertical-bar-example-nonnumerics.json"></div> -->
77
+ <div class="react-container" data-config="/examples/feature/tests-non-numerics/stacked-vertical-bar-example-nonnumerics.json"></div>
78
78
 
79
79
  <!-- TESTS CUTOFF -->
80
80
  <!-- <div class="react-container" data-config="/examples/feature/tests-cutoff/cutoff-example-config.json"></div> -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdc/chart",
3
- "version": "4.23.4",
3
+ "version": "4.23.5",
4
4
  "description": "React component for visualizing tabular data in various types of charts",
5
5
  "moduleName": "CdcChart",
6
6
  "main": "dist/cdcchart",
@@ -57,7 +57,7 @@
57
57
  "react": "^18.2.0",
58
58
  "react-dom": "^18.2.0"
59
59
  },
60
- "gitHead": "dcd395d76f70b2d113f2b4c6fe50a52522655cd1",
60
+ "gitHead": "34add3436994ca3cf13e51f313add4d70377f53e",
61
61
  "devDependencies": {
62
62
  "resize-observer-polyfill": "^1.5.1"
63
63
  }