@cdc/chart 4.22.11 → 4.23.2

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 (65) hide show
  1. package/dist/cdcchart.js +54569 -16
  2. package/examples/Barchart_with_negative.json +34 -0
  3. package/examples/box-plot-data.json +71 -0
  4. package/examples/box-plot.csv +5 -0
  5. package/examples/box-plot.json +124 -0
  6. package/examples/dynamic-legends.json +1 -1
  7. package/examples/example-bar-chart-nonnumeric.json +36 -0
  8. package/examples/example-bar-chart.json +33 -0
  9. package/examples/example-combo-bar-nonnumeric.json +105 -0
  10. package/examples/gallery/bar-chart-vertical/combo-line-chart.json +3 -1
  11. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-categorical.json +1 -1
  12. package/examples/gallery/bar-chart-vertical/vertical-bar-chart.json +86 -17
  13. package/examples/gallery/paired-bar/paired-bar-chart.json +65 -13
  14. package/examples/line-chart-nonnumeric.json +32 -0
  15. package/examples/line-chart.json +21 -63
  16. package/examples/new-data.csv +17 -0
  17. package/examples/newdata.json +90 -0
  18. package/examples/planet-combo-example-config.json +143 -20
  19. package/examples/planet-example-data-nonnumeric.json +56 -0
  20. package/examples/planet-example-data.json +2 -2
  21. package/examples/planet-pie-example-config-nonnumeric.json +30 -0
  22. package/examples/scatterplot-continuous.csv +17 -0
  23. package/examples/{private/yaxis-test.json → scatterplot.json} +53 -50
  24. package/examples/sparkline-chart-nonnumeric.json +76 -0
  25. package/examples/stacked-vertical-bar-example-negative.json +154 -0
  26. package/examples/stacked-vertical-bar-example-nonnumerics.json +154 -0
  27. package/{src/index.html → index.html} +18 -11
  28. package/package.json +29 -22
  29. package/src/{CdcChart.tsx → CdcChart.jsx} +193 -119
  30. package/src/components/BarChart.jsx +517 -0
  31. package/src/components/BoxPlot.jsx +88 -0
  32. package/src/components/{DataTable.tsx → DataTable.jsx} +125 -32
  33. package/src/components/{EditorPanel.js → EditorPanel.jsx} +376 -115
  34. package/src/components/Filters.jsx +125 -0
  35. package/src/components/Legend.jsx +303 -0
  36. package/src/components/{LineChart.tsx → LineChart.jsx} +87 -22
  37. package/src/components/{LinearChart.tsx → LinearChart.jsx} +172 -113
  38. package/src/components/{PairedBarChart.tsx → PairedBarChart.jsx} +46 -79
  39. package/src/components/{PieChart.tsx → PieChart.jsx} +29 -34
  40. package/src/components/ScatterPlot.jsx +48 -0
  41. package/src/components/{SparkLine.js → SparkLine.jsx} +49 -18
  42. package/src/components/useIntersectionObserver.jsx +29 -0
  43. package/src/data/initial-state.js +44 -8
  44. package/src/hooks/{useColorPalette.ts → useColorPalette.js} +10 -28
  45. package/src/hooks/{useReduceData.ts → useReduceData.js} +27 -13
  46. package/src/hooks/useRightAxis.js +3 -1
  47. package/src/index.jsx +16 -0
  48. package/src/scss/DataTable.scss +23 -1
  49. package/src/scss/main.scss +83 -32
  50. package/vite.config.js +4 -0
  51. package/examples/private/filters.json +0 -170
  52. package/examples/private/line-test-data.json +0 -22
  53. package/examples/private/line-test-two.json +0 -210
  54. package/examples/private/line-test.json +0 -102
  55. package/examples/private/new.json +0 -48800
  56. package/examples/private/newtest.csv +0 -101
  57. package/examples/private/shawn.json +0 -1106
  58. package/examples/private/test.json +0 -10124
  59. package/examples/private/yaxis-testing.csv +0 -27
  60. package/examples/private/yaxis.json +0 -28
  61. package/src/components/BarChart.tsx +0 -579
  62. package/src/components/Legend.js +0 -284
  63. package/src/components/useIntersectionObserver.tsx +0 -27
  64. package/src/index.tsx +0 -18
  65. /package/src/{context.tsx → ConfigContext.jsx} +0 -0
@@ -1,170 +0,0 @@
1
- {
2
- "type": "chart",
3
- "title": "Combo Chart (With Right Axis)",
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": 50,
26
- "gridLines": false,
27
- "min": "",
28
- "max": "",
29
- "labelColor": "orange",
30
- "tickLabelColor": "orange",
31
- "tickColor": "orange",
32
- "rightHideAxis": true,
33
- "rightAxisSize": "88",
34
- "rightLabelOffsetSize": "80",
35
- "rightAxisLabelColor": "purple",
36
- "rightAxisTickLabelColor": "purple",
37
- "rightAxisTickColor": "purple",
38
- "isLegendValue": false,
39
- "numTicks": "",
40
- "label": "Left Axis (Value)",
41
- "rightSeries": "tot_tests_18_older",
42
- "rightLabel": "",
43
- "rightHideLabel": false,
44
- "rightHideTicks": false,
45
- "rightNumTicks": "6"
46
- },
47
- "topAxis": {
48
- "hasLine": false
49
- },
50
- "barThickness": 0.35,
51
- "barHeight": 25,
52
- "height": 300,
53
- "xAxis": {
54
- "type": "date",
55
- "hideAxis": false,
56
- "hideLabel": false,
57
- "hideTicks": false,
58
- "size": "100",
59
- "tickRotation": 30,
60
- "min": "",
61
- "max": "",
62
- "labelColor": "blue",
63
- "tickLabelColor": "blue",
64
- "tickColor": "blue",
65
- "isLegendValue": false,
66
- "numTicks": "",
67
- "label": "Date/Category Axis",
68
- "dataKey": "week",
69
- "dateParseFormat": "%m/%d/%Y",
70
- "dateDisplayFormat": "%m/%d/%Y"
71
- },
72
- "table": {
73
- "label": "Data Table",
74
- "expanded": false,
75
- "limitHeight": false,
76
- "height": "",
77
- "caption": "",
78
- "show": true
79
- },
80
- "orientation": "vertical",
81
- "legend": {
82
- "behavior": "isolate",
83
- "position": "bottom",
84
- "singleRow": false,
85
- "colorCode": "",
86
- "reverseLabelOrder": false,
87
- "description": "",
88
- "dynamicLegend": false,
89
- "dynamicLegendDefaultText": "Show All",
90
- "dynamicLegendItemLimit": 5,
91
- "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
92
- "dynamicLegendChartMessage": "Select Options from the Legend",
93
- "hide": false
94
- },
95
- "exclusions": {
96
- "active": false,
97
- "keys": []
98
- },
99
- "palette": "qualitative-bold",
100
- "isPaletteReversed": false,
101
- "labels": false,
102
- "dataFormat": {
103
- "commas": false,
104
- "prefix": "",
105
- "suffix": "",
106
- "roundTo": "0"
107
- },
108
- "confidenceKeys": {},
109
- "visual": {
110
- "border": true,
111
- "accent": true,
112
- "background": true
113
- },
114
- "dataUrl": "/examples/private/yaxis.json",
115
- "visualizationType": "Combo",
116
- "series": [
117
- {
118
- "dataKey": "tot_tests_0_12",
119
- "type": "Bar",
120
- "axis": "Left"
121
- },
122
- {
123
- "dataKey": "tot_tests_13_17",
124
- "type": "Bar",
125
- "axis": "Left"
126
- },
127
- {
128
- "dataKey": "0_12_positivity_rate",
129
- "type": "Bar",
130
- "axis": "Left"
131
- }
132
- ],
133
- "dataCutoff": "0.5",
134
- "filters": [
135
- {
136
- "values": [
137
- "5/21/2022",
138
- "5/28/2022",
139
- "6/4/2022",
140
- "6/11/2022",
141
- "6/18/2022",
142
- "6/25/2022",
143
- "7/2/2022",
144
- "7/9/2022",
145
- "7/16/2022",
146
- "7/23/2022",
147
- "7/30/2022",
148
- "8/6/2022",
149
- "8/13/2022",
150
- "8/20/2022",
151
- "8/27/2022",
152
- "9/3/2022",
153
- "9/10/2022",
154
- "9/17/2022",
155
- "9/24/2022",
156
- "10/1/2022",
157
- "10/8/2022",
158
- "10/15/2022",
159
- "10/22/2022",
160
- "10/29/2022",
161
- "11/5/2022",
162
- "11/12/2022"
163
- ],
164
- "active": "5/21/2022",
165
- "order": "asc",
166
- "columnName": "week",
167
- "label": "Week"
168
- }
169
- ]
170
- }
@@ -1,22 +0,0 @@
1
- [
2
- {
3
- "Number": "11.0",
4
- "Date": "9/1/2022"
5
- },
6
- {
7
- "Number": "12.2",
8
- "Date": "9/2/2022"
9
- },
10
- {
11
- "Number": "13.6",
12
- "Date": "9/4/2022"
13
- },
14
- {
15
- "Number": "",
16
- "Date": "9/5/2022"
17
- },
18
- {
19
- "Number": "6.4",
20
- "Date": "9/6/2022"
21
- }
22
- ]
@@ -1,210 +0,0 @@
1
- {
2
- "type": "chart",
3
- "title": "Planet Radius (Bar Example)",
4
- "theme": "theme-blue",
5
- "fontSize": "medium",
6
- "lineDatapointStyle": "always show",
7
- "barHasBorder": "false",
8
- "isLollipopChart": false,
9
- "lollipopShape": "circle",
10
- "lollipopColorStyle": "two-tone",
11
- "visualizationSubType": "stacked",
12
- "barStyle": "",
13
- "roundingStyle": "standard",
14
- "tipRounding": "top",
15
- "padding": {
16
- "left": 5,
17
- "right": 5
18
- },
19
- "yAxis": {
20
- "hideAxis": false,
21
- "displayNumbersOnBar": false,
22
- "hideLabel": false,
23
- "hideTicks": false,
24
- "size": 50,
25
- "gridLines": false,
26
- "min": "",
27
- "max": "",
28
- "type": "chart",
29
- "title": "Planet Radius (Bar Example)",
30
- "theme": "theme-blue",
31
- "fontSize": "medium",
32
- "lineDatapointStyle": "always show",
33
- "barHasBorder": "false",
34
- "isLollipopChart": false,
35
- "lollipopShape": "circle",
36
- "lollipopColorStyle": "two-tone",
37
- "visualizationSubType": "stacked",
38
- "barStyle": "",
39
- "roundingStyle": "standard",
40
- "tipRounding": "top",
41
- "padding": {
42
- "left": 5,
43
- "right": 5
44
- },
45
- "yAxis": {
46
- "hideAxis": false,
47
- "displayNumbersOnBar": false,
48
- "hideLabel": false,
49
- "hideTicks": false,
50
- "size": 50,
51
- "gridLines": false,
52
- "min": "",
53
- "max": "",
54
- "label": "Measurement (1000km)"
55
- },
56
- "barThickness": 0.35,
57
- "barHeight": 25,
58
- "height": 585,
59
- "xAxis": {
60
- "type": "categorical",
61
- "hideAxis": false,
62
- "hideLabel": false,
63
- "hideTicks": false,
64
- "size": 75,
65
- "tickRotation": 30,
66
- "min": "",
67
- "max": "",
68
- "label": "Planet",
69
- "dataKey": "name"
70
- },
71
- "table": {
72
- "label": "Data Table",
73
- "expanded": false,
74
- "show": true
75
- },
76
- "orientation": "horizontal",
77
- "legend": {
78
- "behavior": "isolate",
79
- "position": "right",
80
- "reverseLabelOrder": false,
81
- "hide": false
82
- },
83
- "exclusions": {
84
- "active": false,
85
- "keys": []
86
- },
87
- "palette": "qualitative-bold",
88
- "isPaletteReversed": false,
89
- "labels": false,
90
- "dataFormat": {
91
- "commas": false,
92
- "prefix": "",
93
- "suffix": "km",
94
- "roundTo": 1
95
- },
96
- "confidenceKeys": {},
97
- "dataUrl": "/examples/planet-example-data.json",
98
- "visualizationType": "Bar",
99
- "series": [
100
- {
101
- "dataKey": "Radius"
102
- },
103
- {
104
- "dataKey": "Diameter"
105
- }
106
- ],
107
- "dataCutoff": "0.5",
108
- "runtime": {
109
- "seriesLabels": {
110
- "Radius": "Radius",
111
- "Diameter": "Diameter"
112
- },
113
- "seriesLabelsAll": ["Radius", "Diameter"],
114
- "originalXAxis": {
115
- "type": "categorical",
116
- "hideAxis": false,
117
- "hideLabel": false,
118
- "hideTicks": false,
119
- "size": 75,
120
- "tickRotation": 30,
121
- "min": "",
122
- "max": "",
123
- "label": "Planet",
124
- "dataKey": "name"
125
- },
126
- "seriesKeys": ["Radius", "Diameter"],
127
- "xAxis": {
128
- "hideAxis": false,
129
- "displayNumbersOnBar": false,
130
- "hideLabel": false,
131
- "hideTicks": false,
132
- "size": 50,
133
- "gridLines": false,
134
- "min": "",
135
- "max": "",
136
- "label": "Measurement (1000km)"
137
- },
138
- "yAxis": {
139
- "type": "categorical",
140
- "hideAxis": false,
141
- "hideLabel": false,
142
- "hideTicks": false,
143
- "size": 75,
144
- "tickRotation": 30,
145
- "min": "",
146
- "max": "",
147
- "label": "Planet",
148
- "dataKey": "name"
149
- },
150
- "horizontal": true,
151
- "uniqueId": 1663785202233,
152
- "editorErrorMessage": ""
153
- },
154
- "barPadding": 40,
155
- "labelPlacement": "Below Bar"
156
- },
157
- "barThickness": 0.35,
158
- "barHeight": 25,
159
- "height": 585,
160
- "xAxis": {
161
- "type": "categorical",
162
- "hideAxis": false,
163
- "hideLabel": false,
164
- "hideTicks": false,
165
- "size": 75,
166
- "tickRotation": 30,
167
- "min": "",
168
- "max": "",
169
- "label": "Planet",
170
- "dataKey": "name"
171
- },
172
- "table": {
173
- "label": "Data Table",
174
- "expanded": false,
175
- "show": true
176
- },
177
- "orientation": "horizontal",
178
- "legend": {
179
- "behavior": "isolate",
180
- "position": "right",
181
- "reverseLabelOrder": false,
182
- "hide": false
183
- },
184
- "exclusions": {
185
- "active": false,
186
- "keys": []
187
- },
188
- "palette": "qualitative-bold",
189
- "isPaletteReversed": false,
190
- "labels": false,
191
- "dataFormat": {
192
- "commas": false,
193
- "prefix": "",
194
- "suffix": "km",
195
- "roundTo": 1
196
- },
197
- "confidenceKeys": {},
198
- "dataUrl": "/examples/planet-example-data.json",
199
- "visualizationType": "Line",
200
- "series": [
201
- {
202
- "dataKey": "Radius"
203
- },
204
- {
205
- "dataKey": "Diameter"
206
- }
207
- ],
208
- "dataCutoff": "0.5",
209
- "barPadding": 40
210
- }
@@ -1,102 +0,0 @@
1
- {
2
- "type": "chart",
3
- "title": "",
4
- "theme": "theme-blue",
5
- "fontSize": "medium",
6
- "lineDatapointStyle": "hover",
7
- "barHasBorder": "false",
8
- "isLollipopChart": false,
9
- "lollipopShape": "circle",
10
- "lollipopColorStyle": "two-tone",
11
- "visualizationSubType": "regular",
12
- "barStyle": "",
13
- "roundingStyle": "standard",
14
- "tipRounding": "top",
15
- "padding": {
16
- "left": 5,
17
- "right": 5
18
- },
19
- "yAxis": {
20
- "hideAxis": false,
21
- "displayNumbersOnBar": false,
22
- "hideLabel": false,
23
- "hideTicks": false,
24
- "size": 50,
25
- "gridLines": false,
26
- "min": "",
27
- "max": "",
28
- "label": "Number"
29
- },
30
- "barThickness": 0.35,
31
- "barHeight": 25,
32
- "height": 300,
33
- "xAxis": {
34
- "type": "date",
35
- "hideAxis": false,
36
- "hideLabel": false,
37
- "hideTicks": false,
38
- "size": 75,
39
- "tickRotation": 0,
40
- "min": "",
41
- "max": "",
42
- "dataKey": "Date",
43
- "dateParseFormat": "%m/%d/%Y",
44
- "dateDisplayFormat": "%m/%d/%Y"
45
- },
46
- "table": {
47
- "label": "Data Table",
48
- "expanded": true,
49
- "limitHeight": false,
50
- "height": "",
51
- "show": true
52
- },
53
- "orientation": "vertical",
54
- "legend": {
55
- "behavior": "isolate",
56
- "position": "right",
57
- "reverseLabelOrder": false
58
- },
59
- "exclusions": {
60
- "active": false,
61
- "keys": []
62
- },
63
- "palette": "qualitative-bold",
64
- "isPaletteReversed": false,
65
- "labels": false,
66
- "dataFormat": {
67
- "commas": false,
68
- "prefix": "",
69
- "suffix": ""
70
- },
71
- "confidenceKeys": {},
72
- "datasets": {},
73
- "visualizationType": "Line",
74
- "data": [
75
- {
76
- "Number": "11.0",
77
- "Date": "9/1/2022"
78
- },
79
- {
80
- "Number": "12.2",
81
- "Date": "9/2/2022"
82
- },
83
- {
84
- "Number": "13.6",
85
- "Date": "9/4/2022"
86
- },
87
- {
88
- "Number": "",
89
- "Date": "9/5/2022"
90
- },
91
- {
92
- "Number": "6.4",
93
- "Date": "9/6/2022"
94
- }
95
- ],
96
- "series": [
97
- {
98
- "dataKey": "Number",
99
- "type": "Bar"
100
- }
101
- ]
102
- }