@cdc/chart 1.3.1 → 1.3.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 +85 -0
- package/examples/age-adjusted-rates.json +1218 -0
- package/examples/case-rate-example-config.json +36 -0
- package/examples/case-rate-example-data.json +33602 -0
- package/examples/covid-confidence-example-config.json +35 -0
- package/examples/covid-example-config.json +36 -0
- package/examples/covid-example-data-confidence.json +32 -0
- package/examples/covid-example-data.json +22 -0
- package/examples/cutoff-example-config.json +36 -0
- package/examples/cutoff-example-data.json +38 -0
- package/examples/date-exclusions-config.json +62 -0
- package/examples/date-exclusions-data.json +162 -0
- package/examples/horizontal-chart.json +35 -0
- package/examples/horizontal-stacked-bar-chart.json +36 -0
- package/examples/line-chart.json +76 -0
- package/examples/paired-bar-data.json +14 -0
- package/examples/paired-bar-example.json +48 -0
- package/examples/paired-bar-formatted.json +37 -0
- package/examples/planet-chart-horizontal-example-config.json +35 -0
- package/examples/planet-combo-example-config.json +31 -0
- package/examples/planet-example-config.json +35 -0
- package/examples/planet-example-data.json +56 -0
- package/examples/planet-pie-example-config.json +28 -0
- package/examples/private/newtest.csv +101 -0
- package/examples/private/test.json +10124 -0
- package/examples/temp-example-config.json +57 -0
- package/examples/temp-example-data.json +130 -0
- package/package.json +9 -8
- package/src/CdcChart.tsx +836 -0
- package/src/components/BarChart.tsx +571 -0
- package/src/components/BarStackVertical.js +0 -0
- package/src/components/DataTable.tsx +229 -0
- package/src/components/EditorPanel.js +1319 -0
- package/src/components/LineChart.tsx +76 -0
- package/src/components/LinearChart.tsx +459 -0
- package/src/components/PairedBarChart.tsx +144 -0
- package/src/components/PieChart.tsx +189 -0
- package/src/components/SparkLine.js +206 -0
- package/src/context.tsx +5 -0
- package/src/data/initial-state.js +61 -0
- package/src/hooks/useActiveElement.js +19 -0
- package/src/hooks/useColorPalette.ts +83 -0
- package/src/hooks/useReduceData.ts +43 -0
- package/src/images/active-checkmark.svg +1 -0
- package/src/images/asc.svg +1 -0
- package/src/images/desc.svg +1 -0
- package/src/images/inactive-checkmark.svg +1 -0
- package/src/images/warning.svg +1 -0
- package/src/index.html +68 -0
- package/src/index.tsx +21 -0
- package/src/scss/DataTable.scss +23 -0
- package/src/scss/LinearChart.scss +0 -0
- package/src/scss/editor-panel.scss +693 -0
- package/src/scss/main.scss +426 -0
- package/src/scss/mixins.scss +0 -0
- package/src/scss/variables.scss +1 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Planet Radius (Combo Example)",
|
|
3
|
+
"dataUrl": "/examples/planet-example-data.json",
|
|
4
|
+
"visualizationType": "Bar",
|
|
5
|
+
"visualizationSubType": "regular",
|
|
6
|
+
"isLollipopChart": true,
|
|
7
|
+
"barHasBorder": "true",
|
|
8
|
+
"series": [{"dataKey":"Radius", "type":"Line"}],
|
|
9
|
+
"fontSize": "small",
|
|
10
|
+
"dataFormat": {
|
|
11
|
+
"roundTo": 1,
|
|
12
|
+
"commas": false,
|
|
13
|
+
"prefix": "",
|
|
14
|
+
"suffix": "km"
|
|
15
|
+
},
|
|
16
|
+
"padding": {
|
|
17
|
+
"left": 0,
|
|
18
|
+
"right": 0
|
|
19
|
+
},
|
|
20
|
+
"yAxis": {
|
|
21
|
+
"label": "Measurement (1000km)",
|
|
22
|
+
"displayNumbersOnBar": false,
|
|
23
|
+
"labelPlacement": "On Date/Category Axis"
|
|
24
|
+
},
|
|
25
|
+
"xAxis": {
|
|
26
|
+
"label": "Planet",
|
|
27
|
+
"dataKey": "name",
|
|
28
|
+
"size": 75
|
|
29
|
+
},
|
|
30
|
+
"table": {
|
|
31
|
+
"label": "Data Table",
|
|
32
|
+
"expanded": false
|
|
33
|
+
},
|
|
34
|
+
"lollipopShape": "circle"
|
|
35
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Planet Radius (Combo Example)",
|
|
3
|
+
"dataUrl": "/examples/planet-example-data.json",
|
|
4
|
+
"visualizationType": "Combo",
|
|
5
|
+
"series": [{"dataKey":"Radius", "type":"Line"}, {"dataKey":"Diameter", "type":"Bar"}],
|
|
6
|
+
"dataFormat": {
|
|
7
|
+
"roundTo": 1,
|
|
8
|
+
"commas": false,
|
|
9
|
+
"prefix": "",
|
|
10
|
+
"suffix": "km"
|
|
11
|
+
},
|
|
12
|
+
"padding": {
|
|
13
|
+
"left": 0,
|
|
14
|
+
"right": 0
|
|
15
|
+
},
|
|
16
|
+
"yAxis": {
|
|
17
|
+
"label": "Measurement (1000km)"
|
|
18
|
+
},
|
|
19
|
+
"xAxis": {
|
|
20
|
+
"label": "Planet",
|
|
21
|
+
"dataKey": "name",
|
|
22
|
+
"tickRotation": 30
|
|
23
|
+
},
|
|
24
|
+
"legend": {
|
|
25
|
+
"hide": false
|
|
26
|
+
},
|
|
27
|
+
"table": {
|
|
28
|
+
"label": "Data Table",
|
|
29
|
+
"expanded": false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Planet Radius (Bar Example)",
|
|
3
|
+
"dataUrl": "/examples/planet-example-data.json",
|
|
4
|
+
"visualizationType": "Bar",
|
|
5
|
+
"visualizationSubType": "stacked",
|
|
6
|
+
"series": [{"dataKey": "Radius"}, {"dataKey": "Diameter"}],
|
|
7
|
+
"fontSize": "medium",
|
|
8
|
+
"dataCutoff": "0.5",
|
|
9
|
+
"orientation": "horizontal",
|
|
10
|
+
"dataFormat": {
|
|
11
|
+
"roundTo": 1,
|
|
12
|
+
"commas": false,
|
|
13
|
+
"prefix": "",
|
|
14
|
+
"suffix": "km"
|
|
15
|
+
},
|
|
16
|
+
"padding": {
|
|
17
|
+
"left": 5,
|
|
18
|
+
"right": 5
|
|
19
|
+
},
|
|
20
|
+
"yAxis": {
|
|
21
|
+
"label": "Measurement (1000km)"
|
|
22
|
+
},
|
|
23
|
+
"xAxis": {
|
|
24
|
+
"label": "Planet",
|
|
25
|
+
"dataKey": "name",
|
|
26
|
+
"tickRotation": 30
|
|
27
|
+
},
|
|
28
|
+
"legend": {
|
|
29
|
+
"hide": false
|
|
30
|
+
},
|
|
31
|
+
"table": {
|
|
32
|
+
"label": "Data Table",
|
|
33
|
+
"expanded": false
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "Jupiter",
|
|
4
|
+
"Radius": "10.97",
|
|
5
|
+
"Diameter": "22",
|
|
6
|
+
"distance": "0"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "Saturn",
|
|
10
|
+
"Radius": "9.14",
|
|
11
|
+
"Diameter": "18",
|
|
12
|
+
"distance": "0"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "Uranus",
|
|
16
|
+
"Radius": "3.98",
|
|
17
|
+
"Diameter": "8",
|
|
18
|
+
"distance": "0"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "Neptune",
|
|
22
|
+
"Radius": "3.86",
|
|
23
|
+
"Diameter": "7",
|
|
24
|
+
"distance": "0"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "Earth",
|
|
28
|
+
"Radius": "1",
|
|
29
|
+
"Diameter": "2",
|
|
30
|
+
"distance": "0"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "Venus",
|
|
34
|
+
"Radius": "0.950",
|
|
35
|
+
"Diameter": "2",
|
|
36
|
+
"distance": "0"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Mars",
|
|
40
|
+
"Radius": "0.532",
|
|
41
|
+
"Diameter": "1",
|
|
42
|
+
"distance": "0"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "Mercury",
|
|
46
|
+
"Radius": "0.383",
|
|
47
|
+
"Diameter": "0.7",
|
|
48
|
+
"distance": "0"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "Pluto",
|
|
52
|
+
"Radius": "0.181",
|
|
53
|
+
"Diameter": "0.3",
|
|
54
|
+
"distance": "0"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Planet Radius (Pie Example)",
|
|
3
|
+
"dataUrl": "/examples/planet-example-data.json",
|
|
4
|
+
"visualizationType": "Pie",
|
|
5
|
+
"palette": "qualitative-soft",
|
|
6
|
+
"aspectRatio": 1,
|
|
7
|
+
"dataFormat": {
|
|
8
|
+
"roundTo": 1,
|
|
9
|
+
"commas": false,
|
|
10
|
+
"prefix": "",
|
|
11
|
+
"suffix": "km"
|
|
12
|
+
},
|
|
13
|
+
"yAxis": {
|
|
14
|
+
"label": "Radius",
|
|
15
|
+
"dataKey": "Radius"
|
|
16
|
+
},
|
|
17
|
+
"xAxis": {
|
|
18
|
+
"label": "Planet",
|
|
19
|
+
"dataKey": "name"
|
|
20
|
+
},
|
|
21
|
+
"legend": {
|
|
22
|
+
"hide": false
|
|
23
|
+
},
|
|
24
|
+
"table": {
|
|
25
|
+
"label": "Data Table",
|
|
26
|
+
"expanded": false
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
,epi_date,count,14-day Moving Daily Average
|
|
2
|
+
1,5/17/2022,1,
|
|
3
|
+
2,5/19/2022,1,
|
|
4
|
+
3,5/20/2022,1,
|
|
5
|
+
4,5/21/2022,2,
|
|
6
|
+
5,5/22/2022,2,
|
|
7
|
+
6,5/23/2022,3,
|
|
8
|
+
7,5/24/2022,1,
|
|
9
|
+
8,5/25/2022,2,
|
|
10
|
+
9,5/26/2022,1,
|
|
11
|
+
10,5/27/2022,3,
|
|
12
|
+
11,5/29/2022,1,
|
|
13
|
+
12,5/30/2022,1,
|
|
14
|
+
13,5/31/2022,7,
|
|
15
|
+
14,6/1/2022,2,2
|
|
16
|
+
15,6/2/2022,5,2.076923077
|
|
17
|
+
16,6/3/2022,5,2.384615385
|
|
18
|
+
17,6/4/2022,1,2.692307692
|
|
19
|
+
18,6/5/2022,1,2.615384615
|
|
20
|
+
19,6/6/2022,8,2.538461538
|
|
21
|
+
20,6/7/2022,5,2.923076923
|
|
22
|
+
21,6/8/2022,9,3.230769231
|
|
23
|
+
22,6/9/2022,6,3.769230769
|
|
24
|
+
23,6/10/2022,11,4.153846154
|
|
25
|
+
24,6/11/2022,6,4.769230769
|
|
26
|
+
25,6/12/2022,4,5.153846154
|
|
27
|
+
26,6/13/2022,13,5.384615385
|
|
28
|
+
27,6/14/2022,19,5.846153846
|
|
29
|
+
28,6/15/2022,15,7.153846154
|
|
30
|
+
29,6/16/2022,21,7.923076923
|
|
31
|
+
30,6/17/2022,15,9.153846154
|
|
32
|
+
31,6/18/2022,11,10.23076923
|
|
33
|
+
32,6/19/2022,5,11
|
|
34
|
+
33,6/20/2022,10,10.76923077
|
|
35
|
+
34,6/21/2022,12,11.15384615
|
|
36
|
+
35,6/22/2022,19,11.38461538
|
|
37
|
+
36,6/23/2022,27,12.38461538
|
|
38
|
+
37,6/24/2022,46,13.61538462
|
|
39
|
+
38,6/25/2022,19,16.69230769
|
|
40
|
+
39,6/26/2022,10,17.84615385
|
|
41
|
+
40,6/27/2022,64,17.61538462
|
|
42
|
+
41,6/28/2022,53,21.07692308
|
|
43
|
+
42,6/29/2022,60,24
|
|
44
|
+
43,6/30/2022,76,27
|
|
45
|
+
44,7/1/2022,89,31.69230769
|
|
46
|
+
45,7/2/2022,45,37.69230769
|
|
47
|
+
46,7/3/2022,41,40.76923077
|
|
48
|
+
47,7/4/2022,57,43.15384615
|
|
49
|
+
48,7/5/2022,97,46.61538462
|
|
50
|
+
49,7/6/2022,120,52.61538462
|
|
51
|
+
50,7/7/2022,110,59.76923077
|
|
52
|
+
51,7/8/2022,161,64.69230769
|
|
53
|
+
52,7/9/2022,101,75.61538462
|
|
54
|
+
53,7/10/2022,71,82.61538462
|
|
55
|
+
54,7/11/2022,216,83.15384615
|
|
56
|
+
55,7/12/2022,216,95.69230769
|
|
57
|
+
56,7/13/2022,217,107.6923077
|
|
58
|
+
57,7/14/2022,238,118.5384615
|
|
59
|
+
58,7/15/2022,254,130
|
|
60
|
+
59,7/16/2022,167,146.0769231
|
|
61
|
+
60,7/17/2022,100,155.7692308
|
|
62
|
+
61,7/18/2022,321,159.0769231
|
|
63
|
+
62,7/19/2022,266,176.3076923
|
|
64
|
+
63,7/20/2022,264,187.5384615
|
|
65
|
+
64,7/21/2022,238,199.3846154
|
|
66
|
+
65,7/22/2022,348,205.3076923
|
|
67
|
+
66,7/23/2022,192,224.3076923
|
|
68
|
+
67,7/24/2022,103,233.6153846
|
|
69
|
+
68,7/25/2022,423,224.9230769
|
|
70
|
+
69,7/26/2022,368,240.8461538
|
|
71
|
+
70,7/27/2022,492,252.4615385
|
|
72
|
+
71,7/28/2022,364,272
|
|
73
|
+
72,7/29/2022,404,280.4615385
|
|
74
|
+
73,7/30/2022,238,298.6923077
|
|
75
|
+
74,7/31/2022,164,309.3076923
|
|
76
|
+
75,8/1/2022,534,297.2307692
|
|
77
|
+
76,8/2/2022,461,317.8461538
|
|
78
|
+
77,8/3/2022,516,333
|
|
79
|
+
78,8/4/2022,492,354.3846154
|
|
80
|
+
79,8/5/2022,424,365.4615385
|
|
81
|
+
80,8/6/2022,192,383.3076923
|
|
82
|
+
81,8/7/2022,154,390.1538462
|
|
83
|
+
82,8/8/2022,773,369.4615385
|
|
84
|
+
83,8/9/2022,486,400.6153846
|
|
85
|
+
84,8/10/2022,663,400.1538462
|
|
86
|
+
85,8/11/2022,391,423.1538462
|
|
87
|
+
86,8/12/2022,392,422.1538462
|
|
88
|
+
87,8/13/2022,217,434
|
|
89
|
+
88,8/14/2022,136,438.0769231
|
|
90
|
+
89,8/15/2022,705,407.4615385
|
|
91
|
+
90,8/16/2022,338,426.2307692
|
|
92
|
+
91,8/17/2022,455,412.5384615
|
|
93
|
+
92,8/18/2022,368,409.6923077
|
|
94
|
+
93,8/19/2022,386,405.3846154
|
|
95
|
+
94,8/20/2022,95,420.3076923
|
|
96
|
+
95,8/21/2022,54,415.7692308
|
|
97
|
+
96,8/22/2022,706,360.4615385
|
|
98
|
+
97,8/23/2022,616,377.3846154
|
|
99
|
+
98,8/24/2022,223,373.7692308
|
|
100
|
+
99,8/25/2022,407,360.8461538
|
|
101
|
+
100,8/26/2022,106,362
|