@cdc/chart 4.23.4 → 4.23.6

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 (42) hide show
  1. package/dist/cdcchart.js +54845 -51755
  2. package/examples/feature/__data__/planet-example-data.json +14 -32
  3. package/examples/feature/__data__/planet-logaritmic-data.json +56 -0
  4. package/examples/feature/area/area-chart-category.json +240 -0
  5. package/examples/feature/bar/example-bar-chart.json +544 -22
  6. package/examples/feature/bar/new.json +561 -0
  7. package/examples/feature/bar/planet-chart-logaritmic-config.json +170 -0
  8. package/examples/feature/boxplot/valid-boxplot.csv +17 -0
  9. package/examples/feature/combo/right-issues.json +190 -0
  10. package/examples/feature/filters/filter-testing.json +37 -3
  11. package/examples/feature/forecasting/combo-forecasting.json +245 -0
  12. package/examples/feature/forecasting/forecasting.json +5325 -0
  13. package/examples/feature/forecasting/index.json +203 -0
  14. package/examples/feature/forecasting/random_data.csv +366 -0
  15. package/examples/feature/line/line-chart.json +3 -3
  16. package/examples/feature/test-highlight/test-highlight-2.json +789 -0
  17. package/examples/feature/test-highlight/test-highlight-vertical.json +561 -0
  18. package/examples/feature/test-highlight/test-highlight.json +100 -0
  19. package/examples/feature/tests-non-numerics/stacked-vertical-bar-example-nonnumerics.json +1 -2
  20. package/examples/gallery/bar-chart-horizontal/horizontal-highlight.json +345 -0
  21. package/examples/gallery/line/line.json +173 -1
  22. package/index.html +14 -8
  23. package/package.json +2 -2
  24. package/src/CdcChart.jsx +342 -25
  25. package/src/components/AreaChart.jsx +32 -40
  26. package/src/components/BarChart.jsx +147 -25
  27. package/src/components/DataTable.jsx +30 -12
  28. package/src/components/DeviationBar.jsx +32 -32
  29. package/src/components/EditorPanel.jsx +1902 -1126
  30. package/src/components/Forecasting.jsx +147 -0
  31. package/src/components/Legend.jsx +193 -243
  32. package/src/components/LineChart.jsx +4 -9
  33. package/src/components/LinearChart.jsx +263 -285
  34. package/src/components/Series.jsx +518 -0
  35. package/src/components/SparkLine.jsx +3 -3
  36. package/src/data/initial-state.js +24 -5
  37. package/src/hooks/useHighlightedBars.js +154 -0
  38. package/src/hooks/useMinMax.js +128 -0
  39. package/src/hooks/useReduceData.js +31 -57
  40. package/src/hooks/useRightAxis.js +8 -2
  41. package/src/hooks/useScales.js +196 -0
  42. /package/examples/feature/area/{area-chart.json → area-chart-date.json} +0 -0
@@ -1,68 +1,50 @@
1
1
  [
2
2
  {
3
3
  "name": "Jupiter",
4
- "Radius": "100",
4
+ "Radius": "1000",
5
5
  "Diameter": "22",
6
6
  "distance": "0"
7
7
  },
8
8
  {
9
9
  "name": "Saturn",
10
- "Radius": "90",
10
+ "Radius": "900",
11
11
  "Diameter": "18",
12
12
  "distance": "0"
13
13
  },
14
14
  {
15
15
  "name": "Uranus",
16
- "Radius": "100",
17
- "Diameter": "8",
16
+ "Radius": "1000",
17
+ "Diameter": "18",
18
18
  "distance": "40"
19
19
  },
20
20
  {
21
21
  "name": "Neptune",
22
- "Radius": "70",
23
- "Diameter": "7",
22
+ "Radius": "700",
23
+ "Diameter": "18",
24
24
  "distance": "0"
25
25
  },
26
- {
27
- "name": "Earth",
28
- "Radius": "60",
29
- "Diameter": "2",
30
- "distance": "20"
31
- },
32
- {
33
- "name": "Earth",
34
- "Radius": "60",
35
- "Diameter": "2",
36
- "distance": "40"
37
- },
38
- {
39
- "name": "Earth",
40
- "Radius": "60",
41
- "Diameter": "2",
42
- "distance": "60"
43
- },
44
26
  {
45
27
  "name": "Venus",
46
- "Radius": "50",
47
- "Diameter": "2",
28
+ "Radius": "500",
29
+ "Diameter": "18",
48
30
  "distance": "0"
49
31
  },
50
32
  {
51
33
  "name": "Mars",
52
- "Radius": "-40",
53
- "Diameter": "1",
34
+ "Radius": "400",
35
+ "Diameter": "18",
54
36
  "distance": "0"
55
37
  },
56
38
  {
57
39
  "name": "Mercury",
58
- "Radius": "30",
59
- "Diameter": "0.7",
40
+ "Radius": "300",
41
+ "Diameter": "22",
60
42
  "distance": "0"
61
43
  },
62
44
  {
63
45
  "name": "Pluto",
64
- "Radius": "20",
65
- "Diameter": "0.3",
46
+ "Radius": "200",
47
+ "Diameter": "-22",
66
48
  "distance": "0"
67
49
  }
68
50
  ]
@@ -0,0 +1,56 @@
1
+ [
2
+ {
3
+ "name": "Jupiter",
4
+ "Radius": "10000",
5
+ "Diameter": "22",
6
+ "distance": "0"
7
+ },
8
+ {
9
+ "name": "Saturn",
10
+ "Radius": "9000",
11
+ "Diameter": "18",
12
+ "distance": "0"
13
+ },
14
+ {
15
+ "name": "Uranus",
16
+ "Radius": "100",
17
+ "Diameter": "8",
18
+ "distance": "40"
19
+ },
20
+ {
21
+ "name": "Neptune",
22
+ "Radius": "700",
23
+ "Diameter": "7",
24
+ "distance": "0"
25
+ },
26
+ {
27
+ "name": "Earth",
28
+ "Radius": "600",
29
+ "Diameter": "2",
30
+ "distance": "20"
31
+ },
32
+ {
33
+ "name": "Venus",
34
+ "Radius": "500",
35
+ "Diameter": "2",
36
+ "distance": "0"
37
+ },
38
+ {
39
+ "name": "Mars",
40
+ "Radius": "400",
41
+ "Diameter": "1",
42
+ "distance": "0"
43
+ },
44
+ {
45
+ "name": "Mercury",
46
+ "Radius": "3000",
47
+ "Diameter": "0.7",
48
+ "distance": "0"
49
+ },
50
+ {
51
+ "name": "Pluto",
52
+ "Radius": "2000",
53
+ "Diameter": "0.3",
54
+ "distance": "0"
55
+ }
56
+ ]
@@ -0,0 +1,240 @@
1
+ {
2
+ "type": "chart",
3
+ "title": "Example Area Chart",
4
+ "showTitle": true,
5
+ "theme": "theme-blue",
6
+ "animate": false,
7
+ "fontSize": "medium",
8
+ "lineDatapointStyle": "hover",
9
+ "barHasBorder": "false",
10
+ "isLollipopChart": false,
11
+ "lollipopShape": "circle",
12
+ "lollipopColorStyle": "two-tone",
13
+ "visualizationSubType": "regular",
14
+ "barStyle": "",
15
+ "roundingStyle": "standard",
16
+ "tipRounding": "top",
17
+ "padding": {
18
+ "left": 5,
19
+ "right": 5
20
+ },
21
+ "yAxis": {
22
+ "hideAxis": false,
23
+ "displayNumbersOnBar": false,
24
+ "hideLabel": false,
25
+ "hideTicks": false,
26
+ "size": "150",
27
+ "gridLines": false,
28
+ "enablePadding": false,
29
+ "min": "",
30
+ "max": "",
31
+ "labelColor": "#333",
32
+ "tickLabelColor": "#333",
33
+ "tickColor": "#333",
34
+ "rightHideAxis": true,
35
+ "rightAxisSize": 0,
36
+ "rightLabel": "",
37
+ "rightLabelOffsetSize": 0,
38
+ "rightAxisLabelColor": "#333",
39
+ "rightAxisTickLabelColor": "#333",
40
+ "rightAxisTickColor": "#333",
41
+ "numTicks": "",
42
+ "axisPadding": 0,
43
+ "tickRotation": 0,
44
+ "isLegendValue": false,
45
+ "label": "Y Axis Example Label"
46
+ },
47
+ "boxplot": {
48
+ "plots": [],
49
+ "borders": "true",
50
+ "firstQuartilePercentage": 25,
51
+ "thirdQuartilePercentage": 75,
52
+ "boxWidthPercentage": 40,
53
+ "plotOutlierValues": false,
54
+ "plotNonOutlierValues": true,
55
+ "legend": {
56
+ "showHowToReadText": false,
57
+ "howToReadText": ""
58
+ },
59
+ "labels": {
60
+ "q1": "Lower Quartile",
61
+ "q2": "q2",
62
+ "q3": "Upper Quartile",
63
+ "q4": "q4",
64
+ "minimum": "Minimum",
65
+ "maximum": "Maximum",
66
+ "mean": "Mean",
67
+ "median": "Median",
68
+ "sd": "Standard Deviation",
69
+ "iqr": "Interquartile Range",
70
+ "total": "Total",
71
+ "outliers": "Outliers",
72
+ "values": "Values",
73
+ "lowerBounds": "Lower Bounds",
74
+ "upperBounds": "Upper Bounds"
75
+ }
76
+ },
77
+ "topAxis": {
78
+ "hasLine": false
79
+ },
80
+ "isLegendValue": false,
81
+ "barThickness": 0.35,
82
+ "barHeight": 25,
83
+ "barSpace": 20,
84
+ "heights": {
85
+ "vertical": 300,
86
+ "horizontal": 750
87
+ },
88
+ "xAxis": {
89
+ "type": "date",
90
+ "showTargetLabel": true,
91
+ "targetLabel": "Target",
92
+ "hideAxis": false,
93
+ "hideLabel": false,
94
+ "hideTicks": false,
95
+ "size": "50",
96
+ "tickRotation": 0,
97
+ "min": "",
98
+ "max": "",
99
+ "labelColor": "#333",
100
+ "tickLabelColor": "#333",
101
+ "tickColor": "#333",
102
+ "numTicks": "9",
103
+ "labelOffset": 65,
104
+ "axisPadding": 0,
105
+ "target": 0,
106
+ "isLegendValue": false,
107
+ "dataKey": "Date",
108
+ "label": "X Axis Example Label",
109
+ "dateParseFormat": "%m/%d/%Y",
110
+ "dateDisplayFormat": "%m/%d/%Y"
111
+ },
112
+ "table": {
113
+ "label": "Data Type by Date",
114
+ "expanded": false,
115
+ "limitHeight": false,
116
+ "height": "",
117
+ "caption": "",
118
+ "showDownloadUrl": true,
119
+ "showDataTableLink": true,
120
+ "show": true,
121
+ "download": true
122
+ },
123
+ "orientation": "vertical",
124
+ "legend": {
125
+ "behavior": "isolate",
126
+ "singleRow": false,
127
+ "colorCode": "",
128
+ "reverseLabelOrder": false,
129
+ "description": "",
130
+ "dynamicLegend": false,
131
+ "dynamicLegendDefaultText": "Show All",
132
+ "dynamicLegendItemLimit": 5,
133
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
134
+ "dynamicLegendChartMessage": "Select Options from the Legend",
135
+ "position": "right",
136
+ "label": "Type of Data"
137
+ },
138
+ "exclusions": {
139
+ "active": true,
140
+ "keys": []
141
+ },
142
+ "palette": "qualitative-bold",
143
+ "isPaletteReversed": false,
144
+ "twoColor": {
145
+ "palette": "monochrome-1",
146
+ "isPaletteReversed": false
147
+ },
148
+ "labels": false,
149
+ "dataFormat": {
150
+ "commas": true,
151
+ "prefix": "",
152
+ "suffix": " units",
153
+ "abbreviated": true,
154
+ "bottomSuffix": "",
155
+ "bottomPrefix": "",
156
+ "bottomAbbreviated": false,
157
+ "useFormat": true
158
+ },
159
+ "confidenceKeys": {},
160
+ "visual": {
161
+ "border": true,
162
+ "accent": true,
163
+ "background": true
164
+ },
165
+ "filterBehavior": "dropdown",
166
+ "highlightedBarValues": [],
167
+ "series": [
168
+ {
169
+ "dataKey": "Radius",
170
+ "type": "Area Chart"
171
+ }
172
+ ],
173
+ "dataDescription": {
174
+ "horizontal": false,
175
+ "series": false
176
+ },
177
+ "dataFileName": "valid-area-chart.json",
178
+ "dataFileSourceType": "file",
179
+ "formattedData": [
180
+ {
181
+ "Data 1": "900",
182
+ "Data 2": "135",
183
+ "Data 3": "300",
184
+ "Data 4": "95",
185
+ "Data 5": "120",
186
+ "Data 6": "310",
187
+ "Date": "1/15/2016"
188
+ },
189
+ {
190
+ "Data 1": "4000",
191
+ "Data 2": "90",
192
+ "Data 3": "240",
193
+ "Data 4": "60",
194
+ "Data 5": "160",
195
+ "Data 6": "2000",
196
+ "Date": "2/15/2016"
197
+ },
198
+ {
199
+ "Data 1": "500",
200
+ "Data 2": "300",
201
+ "Data 3": "290",
202
+ "Data 4": "100",
203
+ "Data 5": "200",
204
+ "Data 6": "250",
205
+ "Date": "3/15/2016"
206
+ },
207
+ {
208
+ "Data 1": "1200",
209
+ "Data 2": "160",
210
+ "Data 3": "230",
211
+ "Data 4": "180",
212
+ "Data 5": "160",
213
+ "Data 6": "220",
214
+ "Date": "4/15/2016"
215
+ },
216
+ {
217
+ "Data 1": "8000",
218
+ "Data 2": "350",
219
+ "Data 3": "300",
220
+ "Data 4": "150",
221
+ "Data 5": "130",
222
+ "Data 6": "100",
223
+ "Date": "5/15/2016"
224
+ },
225
+ {
226
+ "Data 1": "9000",
227
+ "Data 2": "220",
228
+ "Data 3": "320",
229
+ "Data 4": "100",
230
+ "Data 5": "220",
231
+ "Data 6": "300",
232
+ "Date": "6/15/2016"
233
+ }
234
+ ],
235
+ "height": 300,
236
+ "dataUrl": "/examples/feature/__data__/planet-example-data-max-increase.json",
237
+ "visualizationType": "Area Chart",
238
+ "description": "This example shows a bar chart created in the visualization editor in WCMS",
239
+ "dataCutoff": "0"
240
+ }