@cdc/chart 4.24.1 → 4.24.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.
- package/dist/cdcchart.js +48948 -37923
- package/examples/{private/combo.json → chart-regression-1.json} +40 -31
- package/examples/chart-regression-2.json +2360 -0
- package/examples/feature/filters/url-filter.json +1076 -0
- package/examples/feature/line/line-chart-preliminary.json +84 -37
- package/examples/feature/line/line-chart.json +2 -1
- package/examples/feature/regions/index.json +55 -5
- package/examples/feature/sankey/sankey-example-data.json +1364 -0
- package/examples/feature/sankey/sankey_chart_data.csv +20 -0
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart-stacked.json +306 -19
- package/examples/sparkline.json +868 -0
- package/index.html +128 -121
- package/package.json +4 -2
- package/src/CdcChart.tsx +73 -38
- package/src/_stories/ChartEditor.stories.tsx +15 -4
- package/src/_stories/_mock/pie_config.json +4 -3
- package/src/_stories/_mock/url_filter.json +1076 -0
- package/src/components/AreaChart/components/AreaChart.Stacked.jsx +2 -1
- package/src/components/AreaChart/components/AreaChart.jsx +2 -25
- package/src/components/BarChart/components/BarChart.Horizontal.tsx +39 -49
- package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +36 -56
- package/src/components/BarChart/components/BarChart.StackedVertical.tsx +36 -41
- package/src/components/BarChart/components/BarChart.Vertical.tsx +48 -64
- package/src/components/BoxPlot/BoxPlot.jsx +11 -9
- package/src/components/DeviationBar.jsx +3 -3
- package/src/components/EditorPanel/EditorPanel.tsx +1717 -1961
- package/src/components/EditorPanel/EditorPanelContext.ts +40 -0
- package/src/components/EditorPanel/components/Panels/Panel.BoxPlot.tsx +148 -0
- package/src/components/EditorPanel/components/{Panel.ForestPlotSettings.tsx → Panels/Panel.ForestPlotSettings.tsx} +16 -7
- package/src/components/EditorPanel/components/Panels/Panel.General.tsx +160 -0
- package/src/components/EditorPanel/components/{Panel.Regions.tsx → Panels/Panel.Regions.tsx} +6 -6
- package/src/components/EditorPanel/components/Panels/Panel.Sankey.tsx +108 -0
- package/src/components/EditorPanel/components/{Panel.Series.tsx → Panels/Panel.Series.tsx} +50 -6
- package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +338 -0
- package/src/components/EditorPanel/components/Panels/index.tsx +19 -0
- package/src/components/EditorPanel/components/panels.scss +11 -0
- package/src/components/EditorPanel/editor-panel.scss +1 -13
- package/src/components/EditorPanel/useEditorPermissions.js +44 -13
- package/src/components/Legend/Legend.Component.tsx +207 -0
- package/src/components/Legend/Legend.tsx +8 -327
- package/src/components/Legend/helpers/createFormatLabels.tsx +140 -0
- package/src/components/LineChart/LineChartProps.ts +2 -1
- package/src/components/LineChart/components/LineChart.Circle.tsx +85 -52
- package/src/components/LineChart/helpers.ts +3 -3
- package/src/components/LineChart/index.tsx +99 -23
- package/src/components/LinearChart.jsx +12 -33
- package/src/components/PairedBarChart.jsx +10 -12
- package/src/components/PieChart/PieChart.tsx +80 -27
- package/src/components/Regions/components/Regions.tsx +120 -69
- package/src/components/Sankey/index.tsx +434 -0
- package/src/components/Sankey/sankey.scss +153 -0
- package/src/components/Sankey/types/index.ts +16 -0
- package/src/components/ScatterPlot/ScatterPlot.jsx +1 -0
- package/src/components/Sparkline/{SparkLine.jsx → components/SparkLine.tsx} +14 -30
- package/src/components/Sparkline/index.scss +3 -0
- package/src/components/Sparkline/index.tsx +1 -1
- package/src/components/ZoomBrush.tsx +2 -1
- package/src/data/initial-state.js +51 -4
- package/src/helpers/computeMarginBottom.ts +4 -3
- package/src/helpers/tests/computeMarginBottom.test.ts +2 -1
- package/src/hooks/useBarChart.js +5 -2
- package/src/hooks/useHighlightedBars.js +1 -1
- package/src/hooks/useMinMax.ts +3 -3
- package/src/hooks/useScales.ts +28 -18
- package/src/hooks/useTooltip.tsx +19 -14
- package/src/scss/main.scss +8 -96
- package/src/types/ChartConfig.ts +47 -20
- package/src/types/ChartContext.ts +17 -4
- package/src/types/Label.ts +7 -0
- package/examples/private/chart-t.json +0 -3740
- package/examples/private/epi-data.csv +0 -13
- package/examples/private/epi-data.json +0 -62
- package/examples/private/epi.json +0 -403
- package/examples/private/occupancy.json +0 -109283
- package/examples/private/prod-line-config.json +0 -401
- package/examples/private/region-data.json +0 -822
- package/examples/private/region-testing.json +0 -312
- package/examples/private/scaling.json +0 -45325
- package/examples/private/testing-data.json +0 -1739
- package/examples/private/testing.json +0 -816
- package/src/components/EditorPanel/components/Panel.DateHighlighting.tsx +0 -109
- package/src/components/EditorPanel/components/Panels.tsx +0 -13
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
"chartMessage": {
|
|
5
5
|
"noData": "No Data Available"
|
|
6
6
|
},
|
|
7
|
-
"title": "<em>
|
|
7
|
+
"title": "Combo Title <em>Chart</em>",
|
|
8
8
|
"showTitle": true,
|
|
9
9
|
"showDownloadMediaButton": false,
|
|
10
10
|
"theme": "theme-blue",
|
|
11
11
|
"animate": false,
|
|
12
12
|
"fontSize": "medium",
|
|
13
13
|
"lineDatapointStyle": "hover",
|
|
14
|
-
"lineDatapointColor": "
|
|
15
|
-
"barHasBorder": "
|
|
14
|
+
"lineDatapointColor": "Same as Line",
|
|
15
|
+
"barHasBorder": "false",
|
|
16
16
|
"isLollipopChart": false,
|
|
17
17
|
"lollipopShape": "circle",
|
|
18
18
|
"lollipopColorStyle": "two-tone",
|
|
@@ -35,23 +35,24 @@
|
|
|
35
35
|
"displayNumbersOnBar": false,
|
|
36
36
|
"hideLabel": false,
|
|
37
37
|
"hideTicks": false,
|
|
38
|
-
"size": "
|
|
38
|
+
"size": "70",
|
|
39
39
|
"gridLines": false,
|
|
40
|
-
"enablePadding":
|
|
40
|
+
"enablePadding": false,
|
|
41
41
|
"min": "",
|
|
42
42
|
"max": "",
|
|
43
43
|
"labelColor": "#333",
|
|
44
44
|
"tickLabelColor": "#333",
|
|
45
45
|
"tickColor": "#333",
|
|
46
|
-
"rightHideAxis":
|
|
47
|
-
"rightAxisSize": "
|
|
46
|
+
"rightHideAxis": false,
|
|
47
|
+
"rightAxisSize": "100",
|
|
48
48
|
"rightLabel": "New Participants",
|
|
49
|
-
"rightLabelOffsetSize": "
|
|
49
|
+
"rightLabelOffsetSize": "60",
|
|
50
50
|
"rightAxisLabelColor": "#333",
|
|
51
51
|
"rightAxisTickLabelColor": "#333",
|
|
52
52
|
"rightAxisTickColor": "#333",
|
|
53
53
|
"numTicks": "",
|
|
54
54
|
"axisPadding": 0,
|
|
55
|
+
"scalePadding": 10,
|
|
55
56
|
"tickRotation": 0,
|
|
56
57
|
"anchors": [],
|
|
57
58
|
"label": "Outreach Costs"
|
|
@@ -106,27 +107,28 @@
|
|
|
106
107
|
"hideAxis": false,
|
|
107
108
|
"hideLabel": false,
|
|
108
109
|
"hideTicks": false,
|
|
109
|
-
"size": 75,
|
|
110
|
-
"tickRotation":
|
|
110
|
+
"size": "75",
|
|
111
|
+
"tickRotation": "50",
|
|
111
112
|
"min": "",
|
|
112
113
|
"max": "",
|
|
113
114
|
"labelColor": "#333",
|
|
114
115
|
"tickLabelColor": "#333",
|
|
115
116
|
"tickColor": "#333",
|
|
116
|
-
"numTicks": "",
|
|
117
|
+
"numTicks": "6",
|
|
117
118
|
"labelOffset": 65,
|
|
118
119
|
"axisPadding": 0,
|
|
119
120
|
"target": 0,
|
|
120
121
|
"maxTickRotation": 0,
|
|
121
122
|
"dataKey": "Date",
|
|
122
|
-
"label": "Date",
|
|
123
123
|
"dateParseFormat": "%m/%d/%Y",
|
|
124
124
|
"dateDisplayFormat": "%m/%Y",
|
|
125
|
-
"tickWidthMax":
|
|
125
|
+
"tickWidthMax": 91,
|
|
126
|
+
"padding": 6,
|
|
127
|
+
"label": "Date"
|
|
126
128
|
},
|
|
127
129
|
"table": {
|
|
128
130
|
"label": "Data Table",
|
|
129
|
-
"expanded":
|
|
131
|
+
"expanded": true,
|
|
130
132
|
"limitHeight": false,
|
|
131
133
|
"height": "",
|
|
132
134
|
"caption": "",
|
|
@@ -135,6 +137,7 @@
|
|
|
135
137
|
"indexLabel": "Date",
|
|
136
138
|
"download": false,
|
|
137
139
|
"showVertical": true,
|
|
140
|
+
"dateDisplayFormat": "%m/%d/%Y",
|
|
138
141
|
"show": true
|
|
139
142
|
},
|
|
140
143
|
"orientation": "vertical",
|
|
@@ -142,11 +145,11 @@
|
|
|
142
145
|
"columns": {},
|
|
143
146
|
"legend": {
|
|
144
147
|
"hide": false,
|
|
145
|
-
"behavior": "
|
|
146
|
-
"singleRow":
|
|
148
|
+
"behavior": "highlight",
|
|
149
|
+
"singleRow": true,
|
|
147
150
|
"colorCode": "",
|
|
148
151
|
"reverseLabelOrder": false,
|
|
149
|
-
"description": "Lorem ipsum dolor sit amet, <em>consectetur adipiscing elit</em>, sed do eiusmod tempor incididunt ut labore et <strong>dolore magna aliqua</strong>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <sup> 40</sup>",
|
|
152
|
+
"description": "Legend Description: Lorem ipsum dolor sit amet, <em>consectetur adipiscing elit</em>, sed do eiusmod tempor incididunt ut labore et <strong>dolore magna aliqua</strong>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <sup> 40</sup>",
|
|
150
153
|
"dynamicLegend": false,
|
|
151
154
|
"dynamicLegendDefaultText": "Show All",
|
|
152
155
|
"dynamicLegendItemLimit": 5,
|
|
@@ -155,7 +158,7 @@
|
|
|
155
158
|
"lineMode": false,
|
|
156
159
|
"verticalSorted": false,
|
|
157
160
|
"highlightOnHover": false,
|
|
158
|
-
"label": "Lorem <em>ipsum dolor</em> sit amet"
|
|
161
|
+
"label": "Legend Title: Lorem <em>ipsum dolor</em> sit amet"
|
|
159
162
|
},
|
|
160
163
|
"brush": {
|
|
161
164
|
"height": 25,
|
|
@@ -240,22 +243,27 @@
|
|
|
240
243
|
"filterBehavior": "Filter Change",
|
|
241
244
|
"highlightedBarValues": [],
|
|
242
245
|
"series": [
|
|
243
|
-
{
|
|
244
|
-
"dataKey": "New Participants",
|
|
245
|
-
"type": "dashed-md",
|
|
246
|
-
"axis": "Right",
|
|
247
|
-
"tooltip": true
|
|
248
|
-
},
|
|
249
246
|
{
|
|
250
247
|
"dataKey": "Outreach Costs",
|
|
251
248
|
"type": "Bar",
|
|
252
249
|
"axis": "Left",
|
|
253
|
-
"tooltip": true
|
|
250
|
+
"tooltip": true,
|
|
251
|
+
"name": "",
|
|
252
|
+
"lineType": "curveCardinal"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"dataKey": "New Participants",
|
|
256
|
+
"type": "Line",
|
|
257
|
+
"axis": "Right",
|
|
258
|
+
"tooltip": true,
|
|
259
|
+
"name": "",
|
|
260
|
+
"lineType": "curveLinear"
|
|
254
261
|
}
|
|
255
262
|
],
|
|
256
263
|
"tooltips": {
|
|
257
264
|
"opacity": 90,
|
|
258
|
-
"singleSeries": false
|
|
265
|
+
"singleSeries": false,
|
|
266
|
+
"dateDisplayFormat": "%m/%d"
|
|
259
267
|
},
|
|
260
268
|
"forestPlot": {
|
|
261
269
|
"startAt": 0,
|
|
@@ -273,7 +281,7 @@
|
|
|
273
281
|
},
|
|
274
282
|
"estimateField": "",
|
|
275
283
|
"estimateRadius": "",
|
|
276
|
-
"shape": "
|
|
284
|
+
"shape": "square",
|
|
277
285
|
"rowHeight": 20,
|
|
278
286
|
"description": {
|
|
279
287
|
"show": true,
|
|
@@ -355,15 +363,16 @@
|
|
|
355
363
|
],
|
|
356
364
|
"dataFileName": "https://wwwdev.cdc.gov/wcms/4.0/cdc-wp/data-presentation/data/indexed-data-files/61-bar-line-combo-2-value-axes.csv",
|
|
357
365
|
"dataFileSourceType": "url",
|
|
366
|
+
"filters": [],
|
|
358
367
|
"dataDescription": {
|
|
359
368
|
"horizontal": false,
|
|
360
369
|
"series": true,
|
|
361
370
|
"singleRow": true
|
|
362
371
|
},
|
|
363
372
|
"validated": 4.23,
|
|
364
|
-
"
|
|
373
|
+
"description": "Subtext: Lorem ipsum dolor sit amet, <em>consectetur adipiscing elit</em>, sed do eiusmod tempor incididunt ut labore et <strong>dolore magna aliqua</strong>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <sup> 40</sup>",
|
|
365
374
|
"introText": "Message: Lorem ipsum dolor sit amet, <em>consectetur adipiscing elit</em>, sed do eiusmod tempor incididunt ut labore et <strong>dolore magna aliqua</strong>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <sup> 40</sup>",
|
|
366
|
-
"
|
|
367
|
-
"
|
|
368
|
-
"
|
|
375
|
+
"superTitle": "<sup>Super</sup> Title",
|
|
376
|
+
"dynamicMarginTop": 0,
|
|
377
|
+
"footnotes": "Footnotes: Lorem ipsum dolor sit amet, <em>consectetur adipiscing elit</em>, sed do eiusmod tempor incididunt ut labore et <strong>dolore magna aliqua</strong>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <sup> 40</sup>"
|
|
369
378
|
}
|