@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.
Files changed (80) hide show
  1. package/README.md +5 -5
  2. package/dist/495.js +3 -0
  3. package/dist/703.js +1 -0
  4. package/dist/cdcchart.js +723 -6
  5. package/examples/age-adjusted-rates.json +1486 -1218
  6. package/examples/box-plot-data.json +71 -0
  7. package/examples/box-plot.csv +5 -0
  8. package/examples/{private/yaxis-test.json → box-plot.json} +46 -54
  9. package/examples/case-rate-example-config.json +1 -1
  10. package/examples/covid-confidence-example-config.json +33 -33
  11. package/examples/covid-example-config.json +34 -34
  12. package/examples/covid-example-data-confidence.json +30 -30
  13. package/examples/covid-example-data.json +20 -20
  14. package/examples/cutoff-example-config.json +36 -36
  15. package/examples/cutoff-example-data.json +36 -36
  16. package/examples/date-exclusions-config.json +1 -1
  17. package/examples/dynamic-legends.json +124 -124
  18. package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart-with-numbers-on-bar.json +191 -197
  19. package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart.json +230 -240
  20. package/examples/gallery/bar-chart-horizontal/horizontal-stacked.json +239 -247
  21. package/examples/gallery/bar-chart-vertical/combo-line-chart.json +138 -136
  22. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-categorical.json +79 -79
  23. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-stacked.json +80 -80
  24. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-with-confidence.json +67 -67
  25. package/examples/gallery/bar-chart-vertical/vertical-bar-chart.json +179 -110
  26. package/examples/gallery/lollipop/lollipop-style-horizontal.json +215 -219
  27. package/examples/gallery/paired-bar/paired-bar-chart.json +195 -195
  28. package/examples/horizontal-chart.json +35 -35
  29. package/examples/horizontal-stacked-bar-chart.json +34 -34
  30. package/examples/line-chart.json +75 -75
  31. package/examples/new-data.csv +17 -0
  32. package/examples/newdata.json +90 -0
  33. package/examples/paired-bar-data.json +16 -14
  34. package/examples/paired-bar-example.json +48 -48
  35. package/examples/paired-bar-formatted.json +36 -36
  36. package/examples/planet-chart-horizontal-example-config.json +33 -33
  37. package/examples/planet-combo-example-config.json +34 -31
  38. package/examples/planet-example-config.json +35 -33
  39. package/examples/planet-example-data.json +56 -56
  40. package/examples/planet-pie-example-config.json +28 -28
  41. package/examples/stacked-vertical-bar-example.json +1 -1
  42. package/examples/temp-example-config.json +61 -54
  43. package/examples/temp-example-data.json +1 -1
  44. package/package.json +3 -2
  45. package/src/CdcChart.tsx +449 -434
  46. package/src/components/BarChart.tsx +383 -497
  47. package/src/components/BoxPlot.js +92 -0
  48. package/src/components/DataTable.tsx +182 -197
  49. package/src/components/EditorPanel.js +1068 -722
  50. package/src/components/Filters.js +131 -0
  51. package/src/components/Legend.js +286 -329
  52. package/src/components/LineChart.tsx +143 -81
  53. package/src/components/LinearChart.tsx +432 -451
  54. package/src/components/PairedBarChart.tsx +197 -213
  55. package/src/components/PieChart.tsx +105 -151
  56. package/src/components/SparkLine.js +179 -201
  57. package/src/components/useIntersectionObserver.tsx +19 -20
  58. package/src/context.tsx +3 -3
  59. package/src/data/initial-state.js +44 -17
  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 +64 -77
  65. package/src/hooks/useRightAxis.js +25 -0
  66. package/src/hooks/useTopAxis.js +6 -0
  67. package/src/index.html +19 -19
  68. package/src/index.tsx +13 -16
  69. package/src/scss/DataTable.scss +6 -5
  70. package/src/scss/editor-panel.scss +71 -69
  71. package/src/scss/main.scss +188 -114
  72. package/src/scss/variables.scss +1 -1
  73. package/examples/private/line-test-data.json +0 -22
  74. package/examples/private/line-test-two.json +0 -216
  75. package/examples/private/line-test.json +0 -102
  76. package/examples/private/newtest.csv +0 -101
  77. package/examples/private/shawn.json +0 -1296
  78. package/examples/private/test.json +0 -10124
  79. package/examples/private/yaxis-testing.csv +0 -27
  80. package/examples/private/yaxis.json +0 -28
@@ -1,68 +1,68 @@
1
1
  {
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
- }
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
- "type": "chart",
3
- "title": "Example Bar Chart",
4
- "theme": "theme-blue",
5
- "fontSize": "medium",
6
- "height": 300,
7
- "padding": {
8
- "left": 5,
9
- "right": 5
10
- },
11
- "yAxis": {
12
- "size": "76",
13
- "gridLines": false,
14
- "label": "Y Axis Example Label"
15
- },
16
- "barThickness": "0.6",
17
- "xAxis": {
18
- "size": "59",
19
- "tickRotation": 0,
20
- "dataKey": "Date",
21
- "label": "X Axis Example Label"
22
- },
23
- "table": {
24
- "label": "Data Type by Date",
25
- "expanded": true
26
- },
27
- "legend": {
28
- "behavior": "isolate",
29
- "position": "right",
30
- "label": "Type of Data"
31
- },
32
- "palette": "qualitative-bold",
33
- "labels": false,
34
- "dataFormat": {
35
- "suffix": " units"
36
- },
37
- "confidenceKeys": {},
38
- "data": [
39
- {
40
- "Date": "1/15/2016",
41
- "Data 1": "90",
42
- "Data 2": "135",
43
- "Data 3": "300",
44
- "Data 4": "95",
45
- "Data 5": "120",
46
- "Data 6": "310"
47
- },
48
- {
49
- "Date": "2/15/2016",
50
- "Data 1": "40",
51
- "Data 2": "90",
52
- "Data 3": "240",
53
- "Data 4": "60",
54
- "Data 5": "160",
55
- "Data 6": "200"
56
- },
57
- {
58
- "Date": "3/15/2016",
59
- "Data 1": "50",
60
- "Data 2": "300",
61
- "Data 3": "290",
62
- "Data 4": "100",
63
- "Data 5": "200",
64
- "Data 6": "250"
65
- },
66
- {
67
- "Date": "4/15/2016",
68
- "Data 1": "120",
69
- "Data 2": "160",
70
- "Data 3": "230",
71
- "Data 4": "180",
72
- "Data 5": "160",
73
- "Data 6": "220"
74
- },
75
- {
76
- "Date": "5/15/2016",
77
- "Data 1": "80",
78
- "Data 2": "350",
79
- "Data 3": "300",
80
- "Data 4": "150",
81
- "Data 5": "130",
82
- "Data 6": "100"
83
- },
84
- {
85
- "Date": "6/15/2016",
86
- "Data 1": "90",
87
- "Data 2": "220",
88
- "Data 3": "320",
89
- "Data 4": "100",
90
- "Data 5": "220",
91
- "Data 6": "300"
92
- }
93
- ],
94
- "visualizationType": "Bar",
95
- "series": [
96
- {
97
- "dataKey": "Data 1",
98
- "type": "Bar"
99
- },
100
- {
101
- "dataKey": "Data 2",
102
- "type": "Bar"
103
- },
104
- {
105
- "dataKey": "Data 3",
106
- "type": "Bar"
107
- }
108
- ],
109
- "description": "This example shows a bar chart created in the visualization editor in WCMS",
110
- "dataCutoff": "0"
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
+ }