@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,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Average Temperature By City (Line Example)",
|
|
3
|
+
"description": "<p>Average temperature from October 1st through August 29th in:</p><ul><li>New York</li><li>San Francisco</li><li>Austin</li></ul>",
|
|
4
|
+
"dataUrl": "/examples/temp-example-data.json",
|
|
5
|
+
"visualizationType": "Line",
|
|
6
|
+
"series": [{"dataKey": "New York", "label": "NY"}, {"dataKey": "San Francisco", "label": "SF"}, {"dataKey":"Austin", "label": "AU"}],
|
|
7
|
+
"filters":[{
|
|
8
|
+
"label": "Wind",
|
|
9
|
+
"columnName": "wind"
|
|
10
|
+
},{
|
|
11
|
+
"label": "Humidity",
|
|
12
|
+
"columnName": "humidity"
|
|
13
|
+
}],
|
|
14
|
+
"seriesLabel": "City",
|
|
15
|
+
"fontSize": "large",
|
|
16
|
+
"dataFormat": {
|
|
17
|
+
"commas": false,
|
|
18
|
+
"prefix": "",
|
|
19
|
+
"suffix": "°"
|
|
20
|
+
},
|
|
21
|
+
"padding": {
|
|
22
|
+
"left": 15,
|
|
23
|
+
"right": 15
|
|
24
|
+
},
|
|
25
|
+
"yAxis": {
|
|
26
|
+
"label": "Temperature",
|
|
27
|
+
"paddingPercent": 0.15
|
|
28
|
+
},
|
|
29
|
+
"xAxis": {
|
|
30
|
+
"label": "Date",
|
|
31
|
+
"dataKey": "date",
|
|
32
|
+
"type": "date",
|
|
33
|
+
"dateParseFormat": "%Y-%m-%d",
|
|
34
|
+
"dateDisplayFormat": "%b %d",
|
|
35
|
+
"numTicks": 8,
|
|
36
|
+
"tickRotation": 50
|
|
37
|
+
},
|
|
38
|
+
"legend": {
|
|
39
|
+
"label": "Legend",
|
|
40
|
+
"above": true,
|
|
41
|
+
"left": true
|
|
42
|
+
},
|
|
43
|
+
"table": {
|
|
44
|
+
"label": "Data Table",
|
|
45
|
+
"expanded": false,
|
|
46
|
+
"download": true
|
|
47
|
+
},
|
|
48
|
+
"regions": [
|
|
49
|
+
{
|
|
50
|
+
"label": "Region",
|
|
51
|
+
"color": "black",
|
|
52
|
+
"background": "green",
|
|
53
|
+
"from": "2011-10-02",
|
|
54
|
+
"to": "2011-10-03"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"date": "2011-10-01",
|
|
4
|
+
"New York": "89.4",
|
|
5
|
+
"San Francisco": "26.7",
|
|
6
|
+
"Austin": "34.2",
|
|
7
|
+
"wind": "Include Wind",
|
|
8
|
+
"humidity": "Include Humidiy"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"date": "2011-10-02",
|
|
12
|
+
"New York": "54.0",
|
|
13
|
+
"San Francisco": "59.9",
|
|
14
|
+
"Austin": "68.7",
|
|
15
|
+
"wind": "Include Wind",
|
|
16
|
+
"humidity": "Include Humidiy"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"date": "2011-10-03",
|
|
20
|
+
"New York": "51.3",
|
|
21
|
+
"San Francisco": "53.1",
|
|
22
|
+
"Austin": "64.4",
|
|
23
|
+
"wind": "Include Wind",
|
|
24
|
+
"humidity": "Include Humidiy"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"date": "2011-10-04",
|
|
28
|
+
"New York": "34.7",
|
|
29
|
+
"San Francisco": "56.8",
|
|
30
|
+
"Austin": "98.0",
|
|
31
|
+
"wind": "Include Wind",
|
|
32
|
+
"humidity": "Include Humidiy"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "2011-10-01",
|
|
36
|
+
"New York": "32.4",
|
|
37
|
+
"San Francisco": "43.7",
|
|
38
|
+
"Austin": "54.2",
|
|
39
|
+
"wind": "Don't Include Wind",
|
|
40
|
+
"humidity": "Include Humidiy"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"date": "2011-10-02",
|
|
44
|
+
"New York": "65.0",
|
|
45
|
+
"San Francisco": "76.9",
|
|
46
|
+
"Austin": "87.7",
|
|
47
|
+
"wind": "Don't Include Wind",
|
|
48
|
+
"humidity": "Include Humidiy"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"date": "2011-10-03",
|
|
52
|
+
"New York": "53.3",
|
|
53
|
+
"San Francisco": "59.1",
|
|
54
|
+
"Austin": "69.4",
|
|
55
|
+
"wind": "Don't Include Wind",
|
|
56
|
+
"humidity": "Include Humidiy"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"date": "2011-10-04",
|
|
60
|
+
"New York": "55.7",
|
|
61
|
+
"San Francisco": "58.8",
|
|
62
|
+
"Austin": "68.0",
|
|
63
|
+
"wind": "Don't Include Wind",
|
|
64
|
+
"humidity": "Include Humidiy"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"date": "2011-10-01",
|
|
68
|
+
"New York": "63.4",
|
|
69
|
+
"San Francisco": "62.7",
|
|
70
|
+
"Austin": "72.2",
|
|
71
|
+
"wind": "Include Wind",
|
|
72
|
+
"humidity": "Don't Include Humidiy"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"date": "2011-10-02",
|
|
76
|
+
"New York": "58.0",
|
|
77
|
+
"San Francisco": "59.9",
|
|
78
|
+
"Austin": "67.7",
|
|
79
|
+
"wind": "Include Wind",
|
|
80
|
+
"humidity": "Don't Include Humidiy"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"date": "2011-10-03",
|
|
84
|
+
"New York": "53.3",
|
|
85
|
+
"San Francisco": "59.1",
|
|
86
|
+
"Austin": "69.4",
|
|
87
|
+
"wind": "Include Wind",
|
|
88
|
+
"humidity": "Don't Include Humidiy"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"date": "2011-10-04",
|
|
92
|
+
"New York": "55.7",
|
|
93
|
+
"San Francisco": "58.8",
|
|
94
|
+
"Austin": "68.0",
|
|
95
|
+
"wind": "Include Wind",
|
|
96
|
+
"humidity": "Don't Include Humidiy"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"date": "2011-10-01",
|
|
100
|
+
"New York": "63.4",
|
|
101
|
+
"San Francisco": "62.7",
|
|
102
|
+
"Austin": "87.2",
|
|
103
|
+
"wind": "Don't Include Wind",
|
|
104
|
+
"humidity": "Don't Include Humidiy"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"date": "2011-10-02",
|
|
108
|
+
"New York": "98.0",
|
|
109
|
+
"San Francisco": "59.9",
|
|
110
|
+
"Austin": "67.7",
|
|
111
|
+
"wind": "Don't Include Wind",
|
|
112
|
+
"humidity": "Don't Include Humidiy"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"date": "2011-10-03",
|
|
116
|
+
"New York": "53.3",
|
|
117
|
+
"San Francisco": "59.1",
|
|
118
|
+
"Austin": "69.4",
|
|
119
|
+
"wind": "Don't Include Wind",
|
|
120
|
+
"humidity": "Don't Include Humidiy"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"date": "2011-10-04",
|
|
124
|
+
"New York": "55.7",
|
|
125
|
+
"San Francisco": "54.8",
|
|
126
|
+
"Austin": "68.0",
|
|
127
|
+
"wind": "Don't Include Wind",
|
|
128
|
+
"humidity": "Don't Include Humidiy"
|
|
129
|
+
}
|
|
130
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/chart",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "React component for visualizing tabular data in various types of charts",
|
|
5
5
|
"main": "dist/cdcchart",
|
|
6
6
|
"scripts": {
|
|
@@ -8,9 +8,6 @@
|
|
|
8
8
|
"build": "npx webpack --mode production --env packageName=CdcChart --env folderName=chart -c ../../webpack.config.js",
|
|
9
9
|
"prepublishOnly": "lerna run --scope @cdc/chart build"
|
|
10
10
|
},
|
|
11
|
-
"files": [
|
|
12
|
-
"./dist/"
|
|
13
|
-
],
|
|
14
11
|
"repository": {
|
|
15
12
|
"type": "git",
|
|
16
13
|
"url": "git+https://github.com/CDCgov/cdc-open-viz",
|
|
@@ -21,8 +18,8 @@
|
|
|
21
18
|
"url": "https://github.com/CDCgov/cdc-open-viz/issues"
|
|
22
19
|
},
|
|
23
20
|
"license": "Apache-2.0",
|
|
24
|
-
"
|
|
25
|
-
"@cdc/core": "^1.1.
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@cdc/core": "^1.1.3",
|
|
26
23
|
"@visx/axis": "^1.0.0",
|
|
27
24
|
"@visx/curve": "^1.0.0",
|
|
28
25
|
"@visx/gradient": "^1.0.0",
|
|
@@ -33,9 +30,10 @@
|
|
|
33
30
|
"@visx/scale": "^1.0.0",
|
|
34
31
|
"@visx/shape": "^1.0.0",
|
|
35
32
|
"@visx/tooltip": "^1.1.0",
|
|
33
|
+
"chroma-js": "^2.1.2",
|
|
36
34
|
"d3-array": "^2.8.0",
|
|
37
35
|
"d3-time-format": "^3.0.0",
|
|
38
|
-
"html-react-parser": "
|
|
36
|
+
"html-react-parser": "1.4.9",
|
|
39
37
|
"js-base64": "^2.5.2",
|
|
40
38
|
"papaparse": "^5.3.0",
|
|
41
39
|
"react-accessible-accordion": "^3.3.4",
|
|
@@ -49,5 +47,8 @@
|
|
|
49
47
|
"react": ">=16.8",
|
|
50
48
|
"react-dom": ">=16"
|
|
51
49
|
},
|
|
52
|
-
"
|
|
50
|
+
"resolutions": {
|
|
51
|
+
"@types/react": "17.x"
|
|
52
|
+
},
|
|
53
|
+
"gitHead": "ff89a7aea74c533413c62ef8859cc011e6b3cbfa"
|
|
53
54
|
}
|