@cdc/chart 4.22.10 → 4.22.11

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 (72) hide show
  1. package/README.md +5 -5
  2. package/dist/cdcchart.js +4 -4
  3. package/examples/age-adjusted-rates.json +1486 -1218
  4. package/examples/case-rate-example-config.json +1 -1
  5. package/examples/covid-confidence-example-config.json +33 -33
  6. package/examples/covid-example-config.json +34 -34
  7. package/examples/covid-example-data-confidence.json +30 -30
  8. package/examples/covid-example-data.json +20 -20
  9. package/examples/cutoff-example-config.json +36 -36
  10. package/examples/cutoff-example-data.json +36 -36
  11. package/examples/date-exclusions-config.json +1 -1
  12. package/examples/dynamic-legends.json +124 -124
  13. package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart-with-numbers-on-bar.json +191 -197
  14. package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart.json +230 -240
  15. package/examples/gallery/bar-chart-horizontal/horizontal-stacked.json +239 -247
  16. package/examples/gallery/bar-chart-vertical/combo-line-chart.json +136 -136
  17. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-categorical.json +79 -79
  18. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-stacked.json +80 -80
  19. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-with-confidence.json +67 -67
  20. package/examples/gallery/bar-chart-vertical/vertical-bar-chart.json +110 -110
  21. package/examples/gallery/lollipop/lollipop-style-horizontal.json +215 -219
  22. package/examples/gallery/paired-bar/paired-bar-chart.json +195 -195
  23. package/examples/horizontal-chart.json +35 -35
  24. package/examples/horizontal-stacked-bar-chart.json +34 -34
  25. package/examples/line-chart.json +75 -75
  26. package/examples/paired-bar-data.json +16 -14
  27. package/examples/paired-bar-example.json +48 -48
  28. package/examples/paired-bar-formatted.json +36 -36
  29. package/examples/planet-chart-horizontal-example-config.json +33 -33
  30. package/examples/planet-combo-example-config.json +34 -31
  31. package/examples/planet-example-config.json +35 -33
  32. package/examples/planet-example-data.json +56 -56
  33. package/examples/planet-pie-example-config.json +28 -28
  34. package/examples/private/filters.json +170 -0
  35. package/examples/private/line-test-data.json +21 -21
  36. package/examples/private/line-test-two.json +209 -215
  37. package/examples/private/line-test.json +101 -101
  38. package/examples/private/new.json +48800 -0
  39. package/examples/private/shawn.json +1105 -1295
  40. package/examples/private/test.json +10123 -10123
  41. package/examples/private/yaxis-test.json +4 -3
  42. package/examples/private/yaxis.json +26 -26
  43. package/examples/stacked-vertical-bar-example.json +1 -1
  44. package/examples/temp-example-config.json +61 -54
  45. package/examples/temp-example-data.json +1 -1
  46. package/package.json +2 -2
  47. package/src/CdcChart.tsx +339 -380
  48. package/src/components/BarChart.tsx +425 -469
  49. package/src/components/DataTable.tsx +164 -195
  50. package/src/components/EditorPanel.js +1009 -710
  51. package/src/components/Legend.js +279 -329
  52. package/src/components/LineChart.tsx +90 -79
  53. package/src/components/LinearChart.tsx +376 -434
  54. package/src/components/PairedBarChart.tsx +197 -213
  55. package/src/components/PieChart.tsx +95 -151
  56. package/src/components/SparkLine.js +179 -201
  57. package/src/components/useIntersectionObserver.tsx +17 -20
  58. package/src/context.tsx +3 -3
  59. package/src/data/initial-state.js +37 -16
  60. package/src/hooks/useActiveElement.js +13 -13
  61. package/src/hooks/useChartClasses.js +34 -28
  62. package/src/hooks/useColorPalette.ts +56 -63
  63. package/src/hooks/useLegendClasses.js +18 -10
  64. package/src/hooks/useReduceData.ts +62 -78
  65. package/src/hooks/useRightAxis.js +25 -0
  66. package/src/hooks/useTopAxis.js +6 -0
  67. package/src/index.html +45 -45
  68. package/src/index.tsx +13 -16
  69. package/src/scss/DataTable.scss +5 -4
  70. package/src/scss/editor-panel.scss +71 -69
  71. package/src/scss/main.scss +157 -114
  72. package/src/scss/variables.scss +1 -1
@@ -1,220 +1,216 @@
1
1
  {
2
- "type": "chart",
3
- "title": "Lollipop Style Horizontal Bar Chart - Number of Spills Occurring in the Home",
4
- "theme": "theme-blue",
5
- "fontSize": "medium",
6
- "lineDatapointStyle": "hover",
7
- "barHasBorder": "false",
8
- "isLollipopChart": true,
9
- "lollipopShape": "circle",
10
- "lollipopColorStyle": "two-tone",
11
- "visualizationSubType": "horizontal",
12
- "padding": {
13
- "left": 5,
14
- "right": 5
15
- },
16
- "yAxis": {
17
- "hideAxis": true,
18
- "hideLabel": false,
19
- "hideTicks": false,
20
- "size": "13",
21
- "gridLines": false,
22
- "type": "chart",
23
- "title": "Lollipop Style Horizontal Bar Chart",
24
- "theme": "theme-blue",
25
- "fontSize": "medium",
26
- "lineDatapointStyle": "hover",
27
- "barHasBorder": "false",
28
- "isLollipopChart": false,
29
- "lollipopShape": "circle",
30
- "lollipopColorStyle": "two-tone",
31
- "visualizationSubType": "horizontal",
32
- "padding": {
33
- "left": 5,
34
- "right": 5
35
- },
36
- "yAxis": {
37
- "size": 50,
38
- "gridLines": false
39
- },
40
- "barThickness": 0.35,
41
- "height": 260,
42
- "xAxis": {
43
- "type": "categorical",
44
- "size": 75,
45
- "tickRotation": 0,
46
- "dataKey": "Vehicle"
47
- },
48
- "table": {
49
- "label": "Data Table",
50
- "expanded": true,
51
- "show": true
52
- },
53
- "legend": {
54
- "behavior": "isolate",
55
- "position": "right"
56
- },
57
- "exclusions": {
58
- "active": false,
59
- "keys": []
60
- },
61
- "palette": "qualitative-bold",
62
- "labels": false,
63
- "dataFormat": {},
64
- "confidenceKeys": {},
65
- "data": [
66
- {
67
- "Group": "Combined Total of Group A",
68
- "Vehicle": "100",
69
- "Home": "120",
70
- "Work": "140",
71
- "Office": "120"
72
- },
73
- {
74
- "Group": "Combined Total of Group B",
75
- "Vehicle": "150",
76
- "Home": "140",
77
- "Work": "100",
78
- "Office": "90"
79
- },
80
- {
81
- "Group": "Combined Total of Group C",
82
- "Vehicle": "90",
83
- "Home": "90",
84
- "Work": "80",
85
- "Office": "80"
86
- },
87
- {
88
- "Group": "Combined Total of Group D",
89
- "Vehicle": "70",
90
- "Home": "60",
91
- "Work": "50",
92
- "Office": "70"
93
- }
94
- ],
95
- "dataFileName": "CSV_Source_Example_for_Horizontal_Bar_viz-cdcwp1619811744363.csv",
96
- "dataFileSourceType": "file",
97
- "visualizationType": "Bar",
98
- "runtime": {
99
- "seriesLabels": {
100
- "Vehicle": "Vehicle"
101
- },
102
- "seriesLabelsAll": [
103
- "Vehicle"
104
- ],
105
- "originalXAxis": {
106
- "type": "categorical",
107
- "size": 75,
108
- "tickRotation": 0,
109
- "dataKey": "Vehicle"
110
- },
111
- "seriesKeys": [
112
- "Vehicle"
113
- ],
114
- "xAxis": {
115
- "size": 50,
116
- "gridLines": false
117
- },
118
- "yAxis": {
119
- "type": "categorical",
120
- "size": 75,
121
- "tickRotation": 0,
122
- "dataKey": "Vehicle"
123
- },
124
- "horizontal": true,
125
- "uniqueId": 1651765968212,
126
- "editorErrorMessage": ""
127
- },
128
- "description": "Subtext can be added here for options like citing data sources or insight into reading the bar chart.",
129
- "series": [
130
- {
131
- "dataKey": "Vehicle",
132
- "type": "Bar"
133
- }
134
- ],
135
- "barHeight": 25,
136
- "barPadding": 40,
137
- "labelPlacement": "Below Bar",
138
- "displayNumbersOnBar": true,
139
- "numTicks": "9",
140
- "label": "Number of Accidents"
141
- },
142
- "barThickness": 0.35,
143
- "height": 212,
144
- "xAxis": {
145
- "type": "categorical",
146
- "hideAxis": true,
147
- "hideLabel": true,
148
- "hideTicks": true,
149
- "size": "16",
150
- "tickRotation": 0,
151
- "max": "160",
152
- "dataKey": "Group"
153
- },
154
- "table": {
155
- "label": "Data Table",
156
- "expanded": false,
157
- "show": true
158
- },
159
- "orientation": "horizontal",
160
- "legend": {
161
- "behavior": "isolate",
162
- "position": "right",
163
- "hide": true,
164
- "label": "Accident Location",
165
- "reverseLabelOrder": false
166
- },
167
- "exclusions": {
168
- "active": false,
169
- "keys": []
170
- },
171
- "palette": "qualitative-bold",
172
- "isPaletteReversed": false,
173
- "labels": false,
174
- "dataFormat": {},
175
- "confidenceKeys": {},
176
- "data": [
177
- {
178
- "Group": "Combined Total of Group A",
179
- "Vehicle": "100",
180
- "Home": "120",
181
- "Work": "140",
182
- "Office": "120"
183
- },
184
- {
185
- "Group": "Combined Total of Group B",
186
- "Vehicle": "150",
187
- "Home": "140",
188
- "Work": "100",
189
- "Office": "90"
190
- },
191
- {
192
- "Group": "Combined Total of Group C",
193
- "Vehicle": "90",
194
- "Home": "90",
195
- "Work": "80",
196
- "Office": "80"
197
- },
198
- {
199
- "Group": "Combined Total of Group D",
200
- "Vehicle": "70",
201
- "Home": "60",
202
- "Work": "50",
203
- "Office": "70"
204
- }
205
- ],
206
- "dataFileName": "CSV_Source_Example_for_Horizontal_Bar_viz-cdcwp1619811744363.csv",
207
- "dataFileSourceType": "file",
208
- "visualizationType": "Bar",
209
- "description": "Subtext can be added here for options like citing data sources or insight into reading the bar chart.",
210
- "series": [
211
- {
212
- "dataKey": "Home",
213
- "type": "Bar"
214
- }
215
- ],
216
- "barHeight": 6,
217
- "barPadding": 47,
218
- "filters": [],
219
- "lollipopSize": "medium"
220
- }
2
+ "type": "chart",
3
+ "title": "Lollipop Style Horizontal Bar Chart - Number of Spills Occurring in the Home",
4
+ "theme": "theme-blue",
5
+ "fontSize": "medium",
6
+ "lineDatapointStyle": "hover",
7
+ "barHasBorder": "false",
8
+ "isLollipopChart": true,
9
+ "lollipopShape": "circle",
10
+ "lollipopColorStyle": "two-tone",
11
+ "visualizationSubType": "horizontal",
12
+ "padding": {
13
+ "left": 5,
14
+ "right": 5
15
+ },
16
+ "yAxis": {
17
+ "hideAxis": true,
18
+ "hideLabel": false,
19
+ "hideTicks": false,
20
+ "size": "13",
21
+ "gridLines": false,
22
+ "type": "chart",
23
+ "title": "Lollipop Style Horizontal Bar Chart",
24
+ "theme": "theme-blue",
25
+ "fontSize": "medium",
26
+ "lineDatapointStyle": "hover",
27
+ "barHasBorder": "false",
28
+ "isLollipopChart": false,
29
+ "lollipopShape": "circle",
30
+ "lollipopColorStyle": "two-tone",
31
+ "visualizationSubType": "horizontal",
32
+ "padding": {
33
+ "left": 5,
34
+ "right": 5
35
+ },
36
+ "yAxis": {
37
+ "size": 50,
38
+ "gridLines": false
39
+ },
40
+ "barThickness": 0.35,
41
+ "height": 260,
42
+ "xAxis": {
43
+ "type": "categorical",
44
+ "size": 75,
45
+ "tickRotation": 0,
46
+ "dataKey": "Vehicle"
47
+ },
48
+ "table": {
49
+ "label": "Data Table",
50
+ "expanded": true,
51
+ "show": true
52
+ },
53
+ "legend": {
54
+ "behavior": "isolate",
55
+ "position": "right"
56
+ },
57
+ "exclusions": {
58
+ "active": false,
59
+ "keys": []
60
+ },
61
+ "palette": "qualitative-bold",
62
+ "labels": false,
63
+ "dataFormat": {},
64
+ "confidenceKeys": {},
65
+ "data": [
66
+ {
67
+ "Group": "Combined Total of Group A",
68
+ "Vehicle": "100",
69
+ "Home": "120",
70
+ "Work": "140",
71
+ "Office": "120"
72
+ },
73
+ {
74
+ "Group": "Combined Total of Group B",
75
+ "Vehicle": "150",
76
+ "Home": "140",
77
+ "Work": "100",
78
+ "Office": "90"
79
+ },
80
+ {
81
+ "Group": "Combined Total of Group C",
82
+ "Vehicle": "90",
83
+ "Home": "90",
84
+ "Work": "80",
85
+ "Office": "80"
86
+ },
87
+ {
88
+ "Group": "Combined Total of Group D",
89
+ "Vehicle": "70",
90
+ "Home": "60",
91
+ "Work": "50",
92
+ "Office": "70"
93
+ }
94
+ ],
95
+ "dataFileName": "CSV_Source_Example_for_Horizontal_Bar_viz-cdcwp1619811744363.csv",
96
+ "dataFileSourceType": "file",
97
+ "visualizationType": "Bar",
98
+ "runtime": {
99
+ "seriesLabels": {
100
+ "Vehicle": "Vehicle"
101
+ },
102
+ "seriesLabelsAll": ["Vehicle"],
103
+ "originalXAxis": {
104
+ "type": "categorical",
105
+ "size": 75,
106
+ "tickRotation": 0,
107
+ "dataKey": "Vehicle"
108
+ },
109
+ "seriesKeys": ["Vehicle"],
110
+ "xAxis": {
111
+ "size": 50,
112
+ "gridLines": false
113
+ },
114
+ "yAxis": {
115
+ "type": "categorical",
116
+ "size": 75,
117
+ "tickRotation": 0,
118
+ "dataKey": "Vehicle"
119
+ },
120
+ "horizontal": true,
121
+ "uniqueId": 1651765968212,
122
+ "editorErrorMessage": ""
123
+ },
124
+ "description": "Subtext can be added here for options like citing data sources or insight into reading the bar chart.",
125
+ "series": [
126
+ {
127
+ "dataKey": "Vehicle",
128
+ "type": "Bar"
129
+ }
130
+ ],
131
+ "barHeight": 25,
132
+ "barPadding": 40,
133
+ "labelPlacement": "Below Bar",
134
+ "displayNumbersOnBar": true,
135
+ "numTicks": "9",
136
+ "label": "Number of Accidents"
137
+ },
138
+ "barThickness": 0.35,
139
+ "height": 212,
140
+ "xAxis": {
141
+ "type": "categorical",
142
+ "hideAxis": true,
143
+ "hideLabel": true,
144
+ "hideTicks": true,
145
+ "size": "16",
146
+ "tickRotation": 0,
147
+ "max": "160",
148
+ "dataKey": "Group"
149
+ },
150
+ "table": {
151
+ "label": "Data Table",
152
+ "expanded": false,
153
+ "show": true
154
+ },
155
+ "orientation": "horizontal",
156
+ "legend": {
157
+ "behavior": "isolate",
158
+ "position": "right",
159
+ "hide": true,
160
+ "label": "Accident Location",
161
+ "reverseLabelOrder": false
162
+ },
163
+ "exclusions": {
164
+ "active": false,
165
+ "keys": []
166
+ },
167
+ "palette": "qualitative-bold",
168
+ "isPaletteReversed": false,
169
+ "labels": false,
170
+ "dataFormat": {},
171
+ "confidenceKeys": {},
172
+ "data": [
173
+ {
174
+ "Group": "Combined Total of Group A",
175
+ "Vehicle": "100",
176
+ "Home": "120",
177
+ "Work": "140",
178
+ "Office": "120"
179
+ },
180
+ {
181
+ "Group": "Combined Total of Group B",
182
+ "Vehicle": "150",
183
+ "Home": "140",
184
+ "Work": "100",
185
+ "Office": "90"
186
+ },
187
+ {
188
+ "Group": "Combined Total of Group C",
189
+ "Vehicle": "90",
190
+ "Home": "90",
191
+ "Work": "80",
192
+ "Office": "80"
193
+ },
194
+ {
195
+ "Group": "Combined Total of Group D",
196
+ "Vehicle": "70",
197
+ "Home": "60",
198
+ "Work": "50",
199
+ "Office": "70"
200
+ }
201
+ ],
202
+ "dataFileName": "CSV_Source_Example_for_Horizontal_Bar_viz-cdcwp1619811744363.csv",
203
+ "dataFileSourceType": "file",
204
+ "visualizationType": "Bar",
205
+ "description": "Subtext can be added here for options like citing data sources or insight into reading the bar chart.",
206
+ "series": [
207
+ {
208
+ "dataKey": "Home",
209
+ "type": "Bar"
210
+ }
211
+ ],
212
+ "barHeight": 6,
213
+ "barPadding": 47,
214
+ "filters": [],
215
+ "lollipopSize": "medium"
216
+ }