@cdc/chart 4.23.10 → 4.23.11

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 (56) hide show
  1. package/dist/cdcchart.js +30989 -29057
  2. package/examples/feature/bar/example-bar-chart.json +1 -46
  3. package/examples/feature/bar/lollipop.json +156 -0
  4. package/examples/feature/combo/planet-combo-example-config.json +99 -9
  5. package/examples/feature/dev-4261.json +399 -0
  6. package/examples/feature/forest-plot/{broken.json → linear.json} +55 -50
  7. package/examples/feature/forest-plot/logarithmic.json +306 -0
  8. package/examples/feature/line/line-points.json +340 -0
  9. package/examples/feature/regions/index.json +462 -0
  10. package/examples/gallery/bar-chart-vertical/combo-line-chart.json +181 -48
  11. package/examples/sparkline-multilple.json +846 -0
  12. package/index.html +10 -6
  13. package/package.json +3 -3
  14. package/src/CdcChart.tsx +75 -63
  15. package/src/_stories/Chart.stories.tsx +188 -0
  16. package/src/_stories/Chart.tooltip.stories.tsx +305 -0
  17. package/src/_stories/ChartBrush.stories.tsx +19 -0
  18. package/src/_stories/ChartSuppress.stories.tsx +19 -0
  19. package/src/_stories/_mock/brush_mock.json +393 -0
  20. package/src/_stories/_mock/suppress_mock.json +911 -0
  21. package/src/components/AreaChart.Stacked.jsx +4 -5
  22. package/src/components/AreaChart.jsx +6 -35
  23. package/src/components/{BarChart.Horizontal.jsx → BarChart.Horizontal.tsx} +106 -29
  24. package/src/components/{BarChart.StackedHorizontal.jsx → BarChart.StackedHorizontal.tsx} +22 -17
  25. package/src/components/{BarChart.StackedVertical.jsx → BarChart.StackedVertical.tsx} +22 -26
  26. package/src/components/{BarChart.Vertical.jsx → BarChart.Vertical.tsx} +175 -31
  27. package/src/components/BarChart.jsx +1 -1
  28. package/src/components/DeviationBar.jsx +4 -3
  29. package/src/components/EditorPanel.jsx +176 -50
  30. package/src/components/ForestPlot/ForestPlotProps.ts +11 -0
  31. package/src/components/ForestPlot/Readme.md +0 -0
  32. package/src/components/ForestPlot/index.scss +1 -0
  33. package/src/components/{ForestPlot.jsx → ForestPlot/index.tsx} +51 -31
  34. package/src/components/ForestPlotSettings.jsx +162 -113
  35. package/src/components/Legend.jsx +36 -3
  36. package/src/components/{LineChart.Circle.tsx → LineChart/LineChart.Circle.tsx} +26 -29
  37. package/src/components/LineChart/LineChartProps.ts +17 -0
  38. package/src/components/LineChart/index.scss +1 -0
  39. package/src/components/{LineChart.tsx → LineChart/index.tsx} +64 -35
  40. package/src/components/LinearChart.jsx +120 -60
  41. package/src/components/PairedBarChart.jsx +2 -2
  42. package/src/components/Series.jsx +22 -3
  43. package/src/components/ZoomBrush.tsx +168 -0
  44. package/src/data/initial-state.js +27 -12
  45. package/src/hooks/useBarChart.js +71 -7
  46. package/src/hooks/useColorScale.ts +50 -0
  47. package/src/hooks/useEditorPermissions.js +22 -4
  48. package/src/hooks/{useMinMax.js → useMinMax.ts} +75 -23
  49. package/src/hooks/{useRightAxis.js → useRightAxis.ts} +10 -2
  50. package/src/hooks/{useScales.js → useScales.ts} +64 -17
  51. package/src/hooks/useTooltip.jsx +68 -41
  52. package/src/scss/main.scss +3 -35
  53. package/src/types/ChartConfig.ts +43 -0
  54. package/src/types/ChartContext.ts +38 -0
  55. package/src/types/ChartProps.ts +7 -0
  56. package/src/types/ForestPlot.ts +60 -0
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "type": "chart",
3
+ "debugSvg": false,
4
+ "chartMessage": {
5
+ "noData": "No Data Available"
6
+ },
3
7
  "title": "Combo Bar-Line Chart",
4
8
  "showTitle": true,
9
+ "showDownloadMediaButton": false,
5
10
  "theme": "theme-purple",
6
- "animate": true,
11
+ "animate": false,
7
12
  "fontSize": "medium",
8
13
  "lineDatapointStyle": "hover",
9
14
  "barHasBorder": "false",
@@ -14,10 +19,15 @@
14
19
  "barStyle": "",
15
20
  "roundingStyle": "standard",
16
21
  "tipRounding": "top",
22
+ "isResponsiveTicks": false,
23
+ "general": {
24
+ "showDownloadButton": false
25
+ },
17
26
  "padding": {
18
27
  "left": 5,
19
28
  "right": 5
20
29
  },
30
+ "suppressedData": [],
21
31
  "yAxis": {
22
32
  "hideAxis": false,
23
33
  "displayNumbersOnBar": false,
@@ -41,6 +51,7 @@
41
51
  "numTicks": "",
42
52
  "axisPadding": 0,
43
53
  "tickRotation": 0,
54
+ "anchors": [],
44
55
  "label": "Y-Axis Label Example"
45
56
  },
46
57
  "boxplot": {
@@ -83,6 +94,8 @@
83
94
  "horizontal": 750
84
95
  },
85
96
  "xAxis": {
97
+ "sortDates": false,
98
+ "anchors": [],
86
99
  "type": "date",
87
100
  "showTargetLabel": true,
88
101
  "targetLabel": "Target",
@@ -100,10 +113,12 @@
100
113
  "labelOffset": 65,
101
114
  "axisPadding": 0,
102
115
  "target": 0,
116
+ "maxTickRotation": 0,
103
117
  "dataKey": "Date",
104
118
  "label": "X-Axis Example Label",
105
119
  "dateParseFormat": "%d/%m/%Y",
106
- "dateDisplayFormat": "%d/%m/%Y"
120
+ "dateDisplayFormat": "%d/%m/%Y",
121
+ "tickWidthMax": 91
107
122
  },
108
123
  "table": {
109
124
  "label": "Data Table",
@@ -112,11 +127,17 @@
112
127
  "height": "",
113
128
  "caption": "",
114
129
  "showDownloadUrl": false,
130
+ "showDataTableLink": true,
131
+ "indexLabel": "",
115
132
  "download": true,
133
+ "showVertical": false,
116
134
  "show": true
117
135
  },
118
136
  "orientation": "vertical",
137
+ "color": "pinkpurple",
138
+ "columns": {},
119
139
  "legend": {
140
+ "hide": false,
120
141
  "behavior": "highlight",
121
142
  "singleRow": false,
122
143
  "colorCode": "",
@@ -127,9 +148,89 @@
127
148
  "dynamicLegendItemLimit": 5,
128
149
  "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
129
150
  "dynamicLegendChartMessage": "Select Options from the Legend",
151
+ "lineMode": false,
152
+ "verticalSorted": false,
130
153
  "position": "right",
131
154
  "label": "Data Type"
132
155
  },
156
+ "brush": {
157
+ "height": 25,
158
+ "data": [
159
+ {
160
+ "Date": "1/15/2016",
161
+ "Data 1": "1000",
162
+ "Data 2": "110",
163
+ "Data 3": "100",
164
+ "Data 4": "90",
165
+ "Monthly-Goal": "100"
166
+ },
167
+ {
168
+ "Date": "2/15/2016",
169
+ "Data 1": "100",
170
+ "Data 2": "110",
171
+ "Data 3": "100",
172
+ "Data 4": "100",
173
+ "Monthly-Goal": "100"
174
+ },
175
+ {
176
+ "Date": "3/15/2016",
177
+ "Data 1": "80",
178
+ "Data 2": "90",
179
+ "Data 3": "100",
180
+ "Data 4": "120",
181
+ "Monthly-Goal": "110"
182
+ },
183
+ {
184
+ "Date": "4/15/2016",
185
+ "Data 1": "80",
186
+ "Data 2": "90",
187
+ "Data 3": "110",
188
+ "Data 4": "120",
189
+ "Monthly-Goal": "110"
190
+ },
191
+ {
192
+ "Date": "5/15/2016",
193
+ "Data 1": "70",
194
+ "Data 2": "90",
195
+ "Data 3": "110",
196
+ "Data 4": "130",
197
+ "Monthly-Goal": "120"
198
+ },
199
+ {
200
+ "Date": "6/15/2016",
201
+ "Data 1": "100",
202
+ "Data 2": "120",
203
+ "Data 3": "120",
204
+ "Data 4": "130",
205
+ "Monthly-Goal": "120"
206
+ },
207
+ {
208
+ "Date": "7/15/2016",
209
+ "Data 1": "110",
210
+ "Data 2": "140",
211
+ "Data 3": "120",
212
+ "Data 4": "130",
213
+ "Monthly-Goal": "130"
214
+ },
215
+ {
216
+ "Date": "8/15/2016",
217
+ "Data 1": "110",
218
+ "Data 2": "130",
219
+ "Data 3": "120",
220
+ "Data 4": "140",
221
+ "Monthly-Goal": "130"
222
+ },
223
+ {
224
+ "Date": "9/15/2016",
225
+ "Data 1": "120",
226
+ "Data 2": "130",
227
+ "Data 3": "120",
228
+ "Data 4": "150",
229
+ "Monthly-Goal": "140"
230
+ }
231
+ ],
232
+ "active": false
233
+ },
133
234
  "exclusions": {
134
235
  "active": false,
135
236
  "keys": []
@@ -140,7 +241,7 @@
140
241
  "palette": "monochrome-1",
141
242
  "isPaletteReversed": false
142
243
  },
143
- "labels": false,
244
+ "labels": true,
144
245
  "dataFormat": {
145
246
  "commas": false,
146
247
  "prefix": "",
@@ -154,7 +255,78 @@
154
255
  "visual": {
155
256
  "border": true,
156
257
  "accent": true,
157
- "background": true
258
+ "background": true,
259
+ "verticalHoverLine": false,
260
+ "horizontalHoverLine": false
261
+ },
262
+ "useLogScale": false,
263
+ "filterBehavior": "Filter Change",
264
+ "highlightedBarValues": [],
265
+ "series": [
266
+ {
267
+ "dataKey": "Monthly-Goal",
268
+ "type": "Line",
269
+ "axis": "Left",
270
+ "tooltip": true
271
+ },
272
+ {
273
+ "dataKey": "Data 2",
274
+ "type": "Line",
275
+ "axis": "Left",
276
+ "tooltip": true
277
+ }
278
+ ],
279
+ "tooltips": {
280
+ "opacity": 90,
281
+ "singleSeries": false
282
+ },
283
+ "forestPlot": {
284
+ "startAt": 0,
285
+ "colors": {
286
+ "line": "",
287
+ "shape": ""
288
+ },
289
+ "lineOfNoEffect": {
290
+ "show": true
291
+ },
292
+ "type": "",
293
+ "pooledResult": {
294
+ "diamondHeight": 5,
295
+ "column": ""
296
+ },
297
+ "estimateField": "",
298
+ "estimateRadius": "",
299
+ "shape": "",
300
+ "rowHeight": 20,
301
+ "description": {
302
+ "show": true,
303
+ "text": "description",
304
+ "location": 0
305
+ },
306
+ "result": {
307
+ "show": true,
308
+ "text": "result",
309
+ "location": 100
310
+ },
311
+ "radius": {
312
+ "min": 1,
313
+ "max": 8,
314
+ "scalingColumn": ""
315
+ },
316
+ "regression": {
317
+ "lower": 0,
318
+ "upper": 0,
319
+ "estimateField": 0
320
+ },
321
+ "leftWidthOffset": 0,
322
+ "rightWidthOffset": 0,
323
+ "showZeroLine": false,
324
+ "hideDateCategoryCol": false,
325
+ "leftLabel": "",
326
+ "rightLabel": ""
327
+ },
328
+ "area": {
329
+ "isStacked": false
158
330
  },
159
331
  "height": "332",
160
332
  "data": [
@@ -231,47 +403,8 @@
231
403
  "Monthly-Goal": "140"
232
404
  }
233
405
  ],
234
- "visualizationType": "Combo",
235
- "series": [
236
- {
237
- "dataKey": "Data 1",
238
- "type": "Bar"
239
- },
240
- {
241
- "dataKey": "Data 2",
242
- "type": "Bar"
243
- },
244
- {
245
- "dataKey": "Data 3",
246
- "type": "Bar"
247
- },
248
- {
249
- "dataKey": "Data 4",
250
- "type": "Bar"
251
- },
252
- {
253
- "dataKey": "Monthly-Goal",
254
- "type": "dashed-md",
255
- "axis": "Left"
256
- }
257
- ],
258
- "filters": [
259
- {
260
- "values": [
261
- "1/15/2016",
262
- "2/15/2016",
263
- "3/15/2016",
264
- "4/15/2016",
265
- "5/15/2016",
266
- "6/15/2016",
267
- "7/15/2016",
268
- "8/15/2016",
269
- "9/15/2016"
270
- ],
271
- "active": "1/15/2016",
272
- "order": "asc",
273
- "columnName": "Date",
274
- "filterBehavior": "dropdown"
275
- }
276
- ]
277
- }
406
+ "visualizationType": "Line",
407
+ "filters": [],
408
+ "validated": 4.23,
409
+ "dynamicMarginTop": 0
410
+ }