@cdc/chart 4.22.10 → 4.23.1
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/README.md +5 -5
- package/dist/495.js +3 -0
- package/dist/703.js +1 -0
- package/dist/cdcchart.js +723 -6
- package/examples/age-adjusted-rates.json +1486 -1218
- package/examples/box-plot-data.json +71 -0
- package/examples/box-plot.csv +5 -0
- package/examples/{private/yaxis-test.json → box-plot.json} +46 -54
- package/examples/case-rate-example-config.json +1 -1
- package/examples/covid-confidence-example-config.json +33 -33
- package/examples/covid-example-config.json +34 -34
- package/examples/covid-example-data-confidence.json +30 -30
- package/examples/covid-example-data.json +20 -20
- package/examples/cutoff-example-config.json +36 -36
- package/examples/cutoff-example-data.json +36 -36
- package/examples/date-exclusions-config.json +1 -1
- package/examples/dynamic-legends.json +124 -124
- package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart-with-numbers-on-bar.json +191 -197
- package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart.json +230 -240
- package/examples/gallery/bar-chart-horizontal/horizontal-stacked.json +239 -247
- package/examples/gallery/bar-chart-vertical/combo-line-chart.json +138 -136
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart-categorical.json +79 -79
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart-stacked.json +80 -80
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart-with-confidence.json +67 -67
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart.json +179 -110
- package/examples/gallery/lollipop/lollipop-style-horizontal.json +215 -219
- package/examples/gallery/paired-bar/paired-bar-chart.json +195 -195
- package/examples/horizontal-chart.json +35 -35
- package/examples/horizontal-stacked-bar-chart.json +34 -34
- package/examples/line-chart.json +75 -75
- package/examples/new-data.csv +17 -0
- package/examples/newdata.json +90 -0
- package/examples/paired-bar-data.json +16 -14
- package/examples/paired-bar-example.json +48 -48
- package/examples/paired-bar-formatted.json +36 -36
- package/examples/planet-chart-horizontal-example-config.json +33 -33
- package/examples/planet-combo-example-config.json +34 -31
- package/examples/planet-example-config.json +35 -33
- package/examples/planet-example-data.json +56 -56
- package/examples/planet-pie-example-config.json +28 -28
- package/examples/stacked-vertical-bar-example.json +1 -1
- package/examples/temp-example-config.json +61 -54
- package/examples/temp-example-data.json +1 -1
- package/package.json +3 -2
- package/src/CdcChart.tsx +449 -434
- package/src/components/BarChart.tsx +383 -497
- package/src/components/BoxPlot.js +92 -0
- package/src/components/DataTable.tsx +182 -197
- package/src/components/EditorPanel.js +1068 -722
- package/src/components/Filters.js +131 -0
- package/src/components/Legend.js +286 -329
- package/src/components/LineChart.tsx +143 -81
- package/src/components/LinearChart.tsx +432 -451
- package/src/components/PairedBarChart.tsx +197 -213
- package/src/components/PieChart.tsx +105 -151
- package/src/components/SparkLine.js +179 -201
- package/src/components/useIntersectionObserver.tsx +19 -20
- package/src/context.tsx +3 -3
- package/src/data/initial-state.js +44 -17
- package/src/hooks/useActiveElement.js +13 -13
- package/src/hooks/useChartClasses.js +34 -28
- package/src/hooks/useColorPalette.ts +56 -63
- package/src/hooks/useLegendClasses.js +18 -10
- package/src/hooks/useReduceData.ts +64 -77
- package/src/hooks/useRightAxis.js +25 -0
- package/src/hooks/useTopAxis.js +6 -0
- package/src/index.html +19 -19
- package/src/index.tsx +13 -16
- package/src/scss/DataTable.scss +6 -5
- package/src/scss/editor-panel.scss +71 -69
- package/src/scss/main.scss +188 -114
- package/src/scss/variables.scss +1 -1
- package/examples/private/line-test-data.json +0 -22
- package/examples/private/line-test-two.json +0 -216
- package/examples/private/line-test.json +0 -102
- package/examples/private/newtest.csv +0 -101
- package/examples/private/shawn.json +0 -1296
- package/examples/private/test.json +0 -10124
- package/examples/private/yaxis-testing.csv +0 -27
- package/examples/private/yaxis.json +0 -28
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
2
|
+
"type": "chart",
|
|
3
|
+
"title": "Bar Chart with Confidence Intervals",
|
|
4
|
+
"theme": "theme-green",
|
|
5
|
+
"fontSize": "medium",
|
|
6
|
+
"height": 300,
|
|
7
|
+
"padding": {
|
|
8
|
+
"left": 5,
|
|
9
|
+
"right": 5
|
|
10
|
+
},
|
|
11
|
+
"yAxis": {
|
|
12
|
+
"size": "75",
|
|
13
|
+
"gridLines": true,
|
|
14
|
+
"label": "Y-Axis Example Label"
|
|
15
|
+
},
|
|
16
|
+
"barThickness": 0.35,
|
|
17
|
+
"xAxis": {
|
|
18
|
+
"size": "50",
|
|
19
|
+
"tickRotation": 0,
|
|
20
|
+
"dataKey": "Date",
|
|
21
|
+
"label": "X-Axis Sample Label"
|
|
22
|
+
},
|
|
23
|
+
"table": {
|
|
24
|
+
"label": "Data Table",
|
|
25
|
+
"expanded": true
|
|
26
|
+
},
|
|
27
|
+
"legend": {
|
|
28
|
+
"behavior": "isolate",
|
|
29
|
+
"position": "right"
|
|
30
|
+
},
|
|
31
|
+
"palette": "qualitative-bold",
|
|
32
|
+
"labels": false,
|
|
33
|
+
"dataFormat": {},
|
|
34
|
+
"confidenceKeys": {
|
|
35
|
+
"upper": "high",
|
|
36
|
+
"lower": "low"
|
|
37
|
+
},
|
|
38
|
+
"data": [
|
|
39
|
+
{
|
|
40
|
+
"Data": "data1",
|
|
41
|
+
"Date": "1/12/2016",
|
|
42
|
+
"Value": "212",
|
|
43
|
+
"high": "220",
|
|
44
|
+
"low": "200"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"Data": "data2",
|
|
48
|
+
"Date": "1/13/2016",
|
|
49
|
+
"Value": "213",
|
|
50
|
+
"high": "230",
|
|
51
|
+
"low": "205"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"Data": "data3",
|
|
55
|
+
"Date": "1/14/2016",
|
|
56
|
+
"Value": "214",
|
|
57
|
+
"high": "240",
|
|
58
|
+
"low": "210"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"visualizationType": "Bar",
|
|
62
|
+
"series": [
|
|
63
|
+
{
|
|
64
|
+
"dataKey": "Value",
|
|
65
|
+
"type": "Bar"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
@@ -1,111 +1,180 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
2
|
+
"type": "chart",
|
|
3
|
+
"title": "Example Bar Chart",
|
|
4
|
+
"theme": "theme-blue",
|
|
5
|
+
"animate": false,
|
|
6
|
+
"fontSize": "medium",
|
|
7
|
+
"lineDatapointStyle": "hover",
|
|
8
|
+
"barHasBorder": "false",
|
|
9
|
+
"isLollipopChart": false,
|
|
10
|
+
"lollipopShape": "circle",
|
|
11
|
+
"lollipopColorStyle": "two-tone",
|
|
12
|
+
"visualizationSubType": "regular",
|
|
13
|
+
"barStyle": "",
|
|
14
|
+
"roundingStyle": "standard",
|
|
15
|
+
"tipRounding": "top",
|
|
16
|
+
"padding": {
|
|
17
|
+
"left": 5,
|
|
18
|
+
"right": 5
|
|
19
|
+
},
|
|
20
|
+
"yAxis": {
|
|
21
|
+
"hideAxis": false,
|
|
22
|
+
"displayNumbersOnBar": false,
|
|
23
|
+
"hideLabel": false,
|
|
24
|
+
"hideTicks": false,
|
|
25
|
+
"size": "150",
|
|
26
|
+
"gridLines": true,
|
|
27
|
+
"min": "",
|
|
28
|
+
"max": "",
|
|
29
|
+
"labelColor": "#333",
|
|
30
|
+
"tickLabelColor": "#333",
|
|
31
|
+
"tickColor": "#333",
|
|
32
|
+
"rightHideAxis": true,
|
|
33
|
+
"rightAxisSize": 0,
|
|
34
|
+
"rightLabelOffsetSize": 0,
|
|
35
|
+
"rightAxisLabelColor": "#333",
|
|
36
|
+
"rightAxisTickLabelColor": "#333",
|
|
37
|
+
"rightAxisTickColor": "#333",
|
|
38
|
+
"isLegendValue": false,
|
|
39
|
+
"numTicks": "",
|
|
40
|
+
"label": "Y Axis Example Label"
|
|
41
|
+
},
|
|
42
|
+
"topAxis": {
|
|
43
|
+
"hasLine": false
|
|
44
|
+
},
|
|
45
|
+
"barThickness": "0.6",
|
|
46
|
+
"barHeight": 25,
|
|
47
|
+
"height": 300,
|
|
48
|
+
"xAxis": {
|
|
49
|
+
"type": "categorical",
|
|
50
|
+
"hideAxis": false,
|
|
51
|
+
"hideLabel": false,
|
|
52
|
+
"hideTicks": false,
|
|
53
|
+
"size": "59",
|
|
54
|
+
"tickRotation": 0,
|
|
55
|
+
"min": "",
|
|
56
|
+
"max": "",
|
|
57
|
+
"labelColor": "#333",
|
|
58
|
+
"tickLabelColor": "#333",
|
|
59
|
+
"tickColor": "#333",
|
|
60
|
+
"isLegendValue": false,
|
|
61
|
+
"numTicks": "",
|
|
62
|
+
"dataKey": "Date",
|
|
63
|
+
"label": "X Axis Example Label"
|
|
64
|
+
},
|
|
65
|
+
"table": {
|
|
66
|
+
"label": "Data Type by Date",
|
|
67
|
+
"expanded": false,
|
|
68
|
+
"limitHeight": false,
|
|
69
|
+
"height": "",
|
|
70
|
+
"caption": "",
|
|
71
|
+
"show": true,
|
|
72
|
+
"download": true
|
|
73
|
+
},
|
|
74
|
+
"orientation": "vertical",
|
|
75
|
+
"legend": {
|
|
76
|
+
"behavior": "isolate",
|
|
77
|
+
"position": "right",
|
|
78
|
+
"singleRow": false,
|
|
79
|
+
"colorCode": "",
|
|
80
|
+
"reverseLabelOrder": false,
|
|
81
|
+
"description": "",
|
|
82
|
+
"dynamicLegend": false,
|
|
83
|
+
"dynamicLegendDefaultText": "Show All",
|
|
84
|
+
"dynamicLegendItemLimit": 5,
|
|
85
|
+
"dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
|
|
86
|
+
"dynamicLegendChartMessage": "Select Options from the Legend",
|
|
87
|
+
"label": "Type of Data"
|
|
88
|
+
},
|
|
89
|
+
"exclusions": {
|
|
90
|
+
"active": false,
|
|
91
|
+
"keys": []
|
|
92
|
+
},
|
|
93
|
+
"palette": "qualitative-bold",
|
|
94
|
+
"isPaletteReversed": false,
|
|
95
|
+
"labels": false,
|
|
96
|
+
"dataFormat": {
|
|
97
|
+
"commas": false,
|
|
98
|
+
"prefix": "",
|
|
99
|
+
"suffix": " units"
|
|
100
|
+
},
|
|
101
|
+
"confidenceKeys": {},
|
|
102
|
+
"visual": {
|
|
103
|
+
"border": true,
|
|
104
|
+
"accent": true,
|
|
105
|
+
"background": true
|
|
106
|
+
},
|
|
107
|
+
"data": [
|
|
108
|
+
{
|
|
109
|
+
"Date": "1/15/2016",
|
|
110
|
+
"Data 1": "900",
|
|
111
|
+
"Data 2": "135",
|
|
112
|
+
"Data 3": "300",
|
|
113
|
+
"Data 4": "95",
|
|
114
|
+
"Data 5": "120",
|
|
115
|
+
"Data 6": "3100"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"Date": "2/15/2016",
|
|
119
|
+
"Data 1": "4000",
|
|
120
|
+
"Data 2": "90",
|
|
121
|
+
"Data 3": "240",
|
|
122
|
+
"Data 4": "60",
|
|
123
|
+
"Data 5": "160",
|
|
124
|
+
"Data 6": "2000"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"Date": "3/15/2016",
|
|
128
|
+
"Data 1": "5000",
|
|
129
|
+
"Data 2": "300",
|
|
130
|
+
"Data 3": "290",
|
|
131
|
+
"Data 4": "100",
|
|
132
|
+
"Data 5": "200",
|
|
133
|
+
"Data 6": "2500"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"Date": "4/15/2016",
|
|
137
|
+
"Data 1": "12000",
|
|
138
|
+
"Data 2": "160",
|
|
139
|
+
"Data 3": "230",
|
|
140
|
+
"Data 4": "180",
|
|
141
|
+
"Data 5": "160",
|
|
142
|
+
"Data 6": "2200"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"Date": "5/15/2016",
|
|
146
|
+
"Data 1": "8000",
|
|
147
|
+
"Data 2": "350",
|
|
148
|
+
"Data 3": "300",
|
|
149
|
+
"Data 4": "150",
|
|
150
|
+
"Data 5": "130",
|
|
151
|
+
"Data 6": "1000"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"Date": "6/15/2016",
|
|
155
|
+
"Data 1": "9000",
|
|
156
|
+
"Data 2": "220",
|
|
157
|
+
"Data 3": "320",
|
|
158
|
+
"Data 4": "100",
|
|
159
|
+
"Data 5": "220",
|
|
160
|
+
"Data 6": "3000"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"visualizationType": "Bar",
|
|
164
|
+
"series": [
|
|
165
|
+
{
|
|
166
|
+
"dataKey": "Data 1",
|
|
167
|
+
"type": "Bar"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"dataKey": "Data 2",
|
|
171
|
+
"type": "Bar"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"dataKey": "Data 3",
|
|
175
|
+
"type": "Bar"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"description": "This example shows a bar chart created in the visualization editor in WCMS",
|
|
179
|
+
"dataCutoff": "0"
|
|
180
|
+
}
|