@cdc/chart 4.22.11 → 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 (38) hide show
  1. package/dist/495.js +3 -0
  2. package/dist/703.js +1 -0
  3. package/dist/cdcchart.js +723 -6
  4. package/examples/box-plot-data.json +71 -0
  5. package/examples/box-plot.csv +5 -0
  6. package/examples/{private/yaxis-test.json → box-plot.json} +47 -56
  7. package/examples/gallery/bar-chart-vertical/combo-line-chart.json +3 -1
  8. package/examples/gallery/bar-chart-vertical/vertical-bar-chart.json +85 -16
  9. package/examples/new-data.csv +17 -0
  10. package/examples/newdata.json +90 -0
  11. package/package.json +3 -2
  12. package/src/CdcChart.tsx +150 -94
  13. package/src/components/BarChart.tsx +156 -226
  14. package/src/components/BoxPlot.js +92 -0
  15. package/src/components/DataTable.tsx +28 -12
  16. package/src/components/EditorPanel.js +151 -104
  17. package/src/components/Filters.js +131 -0
  18. package/src/components/Legend.js +8 -1
  19. package/src/components/LineChart.tsx +64 -13
  20. package/src/components/LinearChart.tsx +120 -81
  21. package/src/components/PairedBarChart.tsx +1 -1
  22. package/src/components/PieChart.tsx +12 -2
  23. package/src/components/useIntersectionObserver.tsx +9 -7
  24. package/src/data/initial-state.js +14 -8
  25. package/src/hooks/useReduceData.ts +8 -5
  26. package/src/index.html +51 -51
  27. package/src/scss/DataTable.scss +1 -1
  28. package/src/scss/main.scss +53 -22
  29. package/examples/private/filters.json +0 -170
  30. package/examples/private/line-test-data.json +0 -22
  31. package/examples/private/line-test-two.json +0 -210
  32. package/examples/private/line-test.json +0 -102
  33. package/examples/private/new.json +0 -48800
  34. package/examples/private/newtest.csv +0 -101
  35. package/examples/private/shawn.json +0 -1106
  36. package/examples/private/test.json +0 -10124
  37. package/examples/private/yaxis-testing.csv +0 -27
  38. package/examples/private/yaxis.json +0 -28
@@ -0,0 +1,71 @@
1
+ [
2
+ {
3
+ "x": "Group 1",
4
+ "min": -3.529439249291613,
5
+ "firstQuartile": 2.498913996933074,
6
+ "median": 6,
7
+ "thirdQuartile": 6.517816161082865,
8
+ "max": 12.546169407307552,
9
+ "outliers": [
10
+ -4.222649440089676,
11
+ -3.7995254226812145,
12
+ 12.669680018702707
13
+ ]
14
+ },
15
+ {
16
+ "x": "Group 2",
17
+ "min": -2.961278855962981,
18
+ "firstQuartile": 3.1553763355078277,
19
+ "median": 5.31642875968012,
20
+ "thirdQuartile": 7.233146463155033,
21
+ "max": 13.349801654625843,
22
+ "outliers": [
23
+ -4.5962772985737645,
24
+ 14.42798091207488,
25
+ 14.832072412460995
26
+ ]
27
+ },
28
+ {
29
+ "x": "Group 3",
30
+ "min": -0.784362943544294,
31
+ "firstQuartile": 5.600233888319485,
32
+ "median": 7.606034555385235,
33
+ "thirdQuartile": 9.85663177622867,
34
+ "max": 16.24122860809245,
35
+ "outliers": [
36
+ -2.0568265981730285,
37
+ -2.036299998010181,
38
+ -1.634595257757523,
39
+ -0.9751707921193091,
40
+ -0.9256799494292718,
41
+ -0.813852054679872,
42
+ 16.255225428689318,
43
+ 19.221712546396496
44
+ ]
45
+ },
46
+ {
47
+ "x": "Group 4",
48
+ "min": -3.4976011611041598,
49
+ "firstQuartile": 2.362493132101971,
50
+ "median": 4.364242960871863,
51
+ "thirdQuartile": 6.269222660906058,
52
+ "max": 12.129316954112188,
53
+ "outliers": [
54
+ -5.912277243480174,
55
+ -4.535668956980487,
56
+ -4.255719319016919,
57
+ -4.175200716132927,
58
+ -4.1021204775116455,
59
+ -3.7913796362224352,
60
+ -3.6909919981778567,
61
+ -3.6261129831962697,
62
+ 12.169135739844744,
63
+ 12.1724073804239,
64
+ 12.191268834215071,
65
+ 12.236896118210165,
66
+ 12.34513716605812,
67
+ 12.826785108558722,
68
+ 13.048968511771164
69
+ ]
70
+ }
71
+ ]
@@ -0,0 +1,5 @@
1
+ x,min,firstQuartile,median,thirdQuartile,max,outliers
2
+ Group 1,-3.529439249291613,2.498913996933074,6,6.517816161082865,12.546169407307552,-4.222649440089676,-3.7995254226812145,12.669680018702707,,,,,,,,,,,,
3
+ Group 2,-2.961278855962981,3.1553763355078277,5.31642875968012,7.233146463155033,13.349801654625843,-4.5962772985737645,14.42798091207488,14.832072412460995,,,,,,,,,,,,
4
+ Group 3,-0.784362943544294,5.600233888319485,7.606034555385235,9.85663177622867,16.24122860809245,-2.0568265981730285,-2.036299998010181,-1.634595257757523,-0.9751707921193091,-0.9256799494292718,-0.813852054679872,16.255225428689318,19.221712546396496,,,,,,,
5
+ Group 4,-3.4976011611041598,2.362493132101971,4.364242960871863,6.269222660906058,12.129316954112188,-5.912277243480174,-4.535668956980487,-4.255719319016919,-4.175200716132927,-4.1021204775116455,-3.7913796362224352,-3.6909919981778567,-3.6261129831962697,12.169135739844744,12.1724073804239,12.191268834215071,12.236896118210165,12.34513716605812,12.826785108558722,13.048968511771164
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "type": "chart",
3
- "title": "Combo Chart (With Right Axis)",
3
+ "title": "Example Box Plot",
4
4
  "theme": "theme-blue",
5
5
  "animate": false,
6
6
  "fontSize": "medium",
@@ -18,55 +18,55 @@
18
18
  "right": 5
19
19
  },
20
20
  "yAxis": {
21
+ "dataKey": "Value",
21
22
  "hideAxis": false,
22
23
  "displayNumbersOnBar": false,
23
24
  "hideLabel": false,
24
25
  "hideTicks": false,
25
- "gridLines": false,
26
+ "size": 50,
27
+ "gridLines": true,
26
28
  "min": "",
27
29
  "max": "",
28
- "rightHideAxis": false,
29
- "rightAxisSize": "88",
30
- "rightLabelOffsetSize": "80",
31
- "label": "Left Axis (Value)",
32
- "rightSeries": "tot_tests_18_older",
33
- "rightLabel": "Right Axis (Value)",
34
- "rightHideLabel": false,
35
- "rightHideTicks": false,
36
- "rightNumTicks": "6",
37
- "rightAxisLabelColor": "purple",
38
- "rightAxisTickLabelColor": "purple",
39
- "rightAxisTickColor": "purple",
40
- "labelColor": "orange",
41
- "tickLabelColor": "orange",
42
- "tickColor": "orange"
30
+ "labelColor": "#333",
31
+ "tickLabelColor": "#333",
32
+ "tickColor": "#333",
33
+ "rightHideAxis": true,
34
+ "rightAxisSize": 50,
35
+ "rightLabelOffsetSize": 0,
36
+ "rightAxisLabelColor": "#333",
37
+ "rightAxisTickLabelColor": "#333",
38
+ "rightAxisTickColor": "#333",
39
+ "isLegendValue": false,
40
+ "numTicks": "",
41
+ "label": "Observations"
43
42
  },
43
+ "boxplot": [],
44
44
  "topAxis": {
45
- "hasLine": true
45
+ "hasLine": false
46
46
  },
47
47
  "barThickness": 0.35,
48
48
  "barHeight": 25,
49
49
  "height": 300,
50
50
  "xAxis": {
51
- "type": "date",
51
+ "type": "categorical",
52
52
  "hideAxis": false,
53
53
  "hideLabel": false,
54
54
  "hideTicks": false,
55
- "size": "100",
56
- "tickRotation": 30,
55
+ "size": 75,
56
+ "tickRotation": 0,
57
57
  "min": "",
58
58
  "max": "",
59
- "label": "Date/Category Axis",
60
- "dataKey": "week",
61
- "dateParseFormat": "%m/%d/%Y",
62
- "dateDisplayFormat": "%m/%d/%Y",
63
- "labelColor": "blue",
64
- "tickLabelColor": "blue",
65
- "tickColor": "blue"
59
+ "labelColor": "#333",
60
+ "tickLabelColor": "#333",
61
+ "tickColor": "#333",
62
+ "isLegendValue": false,
63
+ "numTicks": "",
64
+ "dataKey": "Group_Category",
65
+ "label": "Groups"
66
66
  },
67
67
  "table": {
68
68
  "label": "Data Table",
69
- "expanded": false,
69
+ "expanded": true,
70
70
  "limitHeight": false,
71
71
  "height": "",
72
72
  "caption": "",
@@ -76,6 +76,7 @@
76
76
  "legend": {
77
77
  "behavior": "isolate",
78
78
  "position": "right",
79
+ "singleRow": false,
79
80
  "colorCode": "",
80
81
  "reverseLabelOrder": false,
81
82
  "description": "",
@@ -83,21 +84,20 @@
83
84
  "dynamicLegendDefaultText": "Show All",
84
85
  "dynamicLegendItemLimit": 5,
85
86
  "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
86
- "dynamicLegendChartMessage": "Select Options from the Legend",
87
- "hide": false
87
+ "dynamicLegendChartMessage": "Select Options from the Legend"
88
88
  },
89
89
  "exclusions": {
90
90
  "active": false,
91
91
  "keys": []
92
92
  },
93
- "palette": "qualitative-bold",
93
+ "palette": "qualitative1",
94
94
  "isPaletteReversed": false,
95
95
  "labels": false,
96
96
  "dataFormat": {
97
97
  "commas": false,
98
98
  "prefix": "",
99
99
  "suffix": "",
100
- "roundTo": "0"
100
+ "useFormat": false
101
101
  },
102
102
  "confidenceKeys": {},
103
103
  "visual": {
@@ -105,29 +105,20 @@
105
105
  "accent": true,
106
106
  "background": true
107
107
  },
108
- "dataUrl": "/examples/private/yaxis.json",
109
- "visualizationType": "Combo",
108
+ "dataUrl": "/examples/newdata.json",
109
+ "visualizationType": "Box Plot",
110
+ "description": "Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.",
111
+ "dataDescription": {
112
+ "horizontal": false,
113
+ "series": false,
114
+ "singleRow": false,
115
+ "xKey": "Group_Category",
116
+ "valueKey": "Value"
117
+ },
110
118
  "series": [
111
119
  {
112
- "dataKey": "tot_tests_0_12",
113
- "type": "Bar",
114
- "axis": "Left"
115
- },
116
- {
117
- "dataKey": "tot_tests_13_17",
118
- "type": "Bar",
119
- "axis": "Left"
120
- },
121
- {
122
- "dataKey": "tot_tests_18_older",
123
- "type": "Line",
124
- "axis": "Left"
125
- },
126
- {
127
- "dataKey": "0_12_positivity_rate",
128
- "type": "Line",
129
- "axis": "Right"
120
+ "dataKey": "Value",
121
+ "type": "Bar"
130
122
  }
131
- ],
132
- "dataCutoff": "0.5"
133
- }
123
+ ]
124
+ }
@@ -4,6 +4,7 @@
4
4
  "theme": "theme-purple",
5
5
  "fontSize": "medium",
6
6
  "height": "332",
7
+ "animate": true,
7
8
  "padding": {
8
9
  "left": 5,
9
10
  "right": 5
@@ -131,7 +132,8 @@
131
132
  },
132
133
  {
133
134
  "dataKey": "Monthly-Goal",
134
- "type": "Line"
135
+ "type": "dashed-md",
136
+ "axis": "Left"
135
137
  }
136
138
  ]
137
139
  }
@@ -2,93 +2,162 @@
2
2
  "type": "chart",
3
3
  "title": "Example Bar Chart",
4
4
  "theme": "theme-blue",
5
+ "animate": false,
5
6
  "fontSize": "medium",
6
- "height": 300,
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",
7
16
  "padding": {
8
17
  "left": 5,
9
18
  "right": 5
10
19
  },
11
20
  "yAxis": {
12
- "size": "76",
13
- "gridLines": false,
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": "",
14
40
  "label": "Y Axis Example Label"
15
41
  },
42
+ "topAxis": {
43
+ "hasLine": false
44
+ },
16
45
  "barThickness": "0.6",
46
+ "barHeight": 25,
47
+ "height": 300,
17
48
  "xAxis": {
49
+ "type": "categorical",
50
+ "hideAxis": false,
51
+ "hideLabel": false,
52
+ "hideTicks": false,
18
53
  "size": "59",
19
54
  "tickRotation": 0,
55
+ "min": "",
56
+ "max": "",
57
+ "labelColor": "#333",
58
+ "tickLabelColor": "#333",
59
+ "tickColor": "#333",
60
+ "isLegendValue": false,
61
+ "numTicks": "",
20
62
  "dataKey": "Date",
21
63
  "label": "X Axis Example Label"
22
64
  },
23
65
  "table": {
24
66
  "label": "Data Type by Date",
25
- "expanded": true
67
+ "expanded": false,
68
+ "limitHeight": false,
69
+ "height": "",
70
+ "caption": "",
71
+ "show": true,
72
+ "download": true
26
73
  },
74
+ "orientation": "vertical",
27
75
  "legend": {
28
76
  "behavior": "isolate",
29
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",
30
87
  "label": "Type of Data"
31
88
  },
89
+ "exclusions": {
90
+ "active": false,
91
+ "keys": []
92
+ },
32
93
  "palette": "qualitative-bold",
94
+ "isPaletteReversed": false,
33
95
  "labels": false,
34
96
  "dataFormat": {
97
+ "commas": false,
98
+ "prefix": "",
35
99
  "suffix": " units"
36
100
  },
37
101
  "confidenceKeys": {},
102
+ "visual": {
103
+ "border": true,
104
+ "accent": true,
105
+ "background": true
106
+ },
38
107
  "data": [
39
108
  {
40
109
  "Date": "1/15/2016",
41
- "Data 1": "90",
110
+ "Data 1": "900",
42
111
  "Data 2": "135",
43
112
  "Data 3": "300",
44
113
  "Data 4": "95",
45
114
  "Data 5": "120",
46
- "Data 6": "310"
115
+ "Data 6": "3100"
47
116
  },
48
117
  {
49
118
  "Date": "2/15/2016",
50
- "Data 1": "40",
119
+ "Data 1": "4000",
51
120
  "Data 2": "90",
52
121
  "Data 3": "240",
53
122
  "Data 4": "60",
54
123
  "Data 5": "160",
55
- "Data 6": "200"
124
+ "Data 6": "2000"
56
125
  },
57
126
  {
58
127
  "Date": "3/15/2016",
59
- "Data 1": "50",
128
+ "Data 1": "5000",
60
129
  "Data 2": "300",
61
130
  "Data 3": "290",
62
131
  "Data 4": "100",
63
132
  "Data 5": "200",
64
- "Data 6": "250"
133
+ "Data 6": "2500"
65
134
  },
66
135
  {
67
136
  "Date": "4/15/2016",
68
- "Data 1": "120",
137
+ "Data 1": "12000",
69
138
  "Data 2": "160",
70
139
  "Data 3": "230",
71
140
  "Data 4": "180",
72
141
  "Data 5": "160",
73
- "Data 6": "220"
142
+ "Data 6": "2200"
74
143
  },
75
144
  {
76
145
  "Date": "5/15/2016",
77
- "Data 1": "80",
146
+ "Data 1": "8000",
78
147
  "Data 2": "350",
79
148
  "Data 3": "300",
80
149
  "Data 4": "150",
81
150
  "Data 5": "130",
82
- "Data 6": "100"
151
+ "Data 6": "1000"
83
152
  },
84
153
  {
85
154
  "Date": "6/15/2016",
86
- "Data 1": "90",
155
+ "Data 1": "9000",
87
156
  "Data 2": "220",
88
157
  "Data 3": "320",
89
158
  "Data 4": "100",
90
159
  "Data 5": "220",
91
- "Data 6": "300"
160
+ "Data 6": "3000"
92
161
  }
93
162
  ],
94
163
  "visualizationType": "Bar",
@@ -0,0 +1,17 @@
1
+ Group_Category,Value
2
+ category one,21
3
+ category one,19
4
+ category one,23
5
+ category one,24
6
+ category two,18
7
+ category two,10
8
+ category two,12
9
+ category two,19
10
+ category three,30
11
+ category three,35
12
+ category three,36
13
+ category three,40
14
+ category four,50
15
+ category four,54
16
+ category four,42
17
+ category four,159
@@ -0,0 +1,90 @@
1
+ [
2
+ {
3
+ "Group_Category": "category one",
4
+ "Value": "21"
5
+ },
6
+ {
7
+ "Group_Category": "category one",
8
+ "Value": "19"
9
+ },
10
+ {
11
+ "Group_Category": "category one",
12
+ "Value": "23"
13
+ },
14
+ {
15
+ "Group_Category": "category one",
16
+ "Value": "24"
17
+ },
18
+ {
19
+ "Group_Category": "category two",
20
+ "Value": "18"
21
+ },
22
+ {
23
+ "Group_Category": "category two",
24
+ "Value": "10"
25
+ },
26
+ {
27
+ "Group_Category": "category two",
28
+ "Value": "12"
29
+ },
30
+ {
31
+ "Group_Category": "category two",
32
+ "Value": "19"
33
+ },
34
+ {
35
+ "Group_Category": "category three",
36
+ "Value": "30"
37
+ },
38
+ {
39
+ "Group_Category": "category three",
40
+ "Value": "35"
41
+ },
42
+ {
43
+ "Group_Category": "category three",
44
+ "Value": "36"
45
+ },
46
+ {
47
+ "Group_Category": "category three",
48
+ "Value": "40"
49
+ },
50
+ {
51
+ "Group_Category": "category four",
52
+ "Value": "30"
53
+ },
54
+ {
55
+ "Group_Category": "category four",
56
+ "Value": "40"
57
+ },
58
+ {
59
+ "Group_Category": "category four",
60
+ "Value": "50"
61
+ },
62
+ {
63
+ "Group_Category": "category four",
64
+ "Value": "50"
65
+ },
66
+ {
67
+ "Group_Category": "category four",
68
+ "Value": "85"
69
+ },
70
+ {
71
+ "Group_Category": "category four",
72
+ "Value": "82"
73
+ },
74
+ {
75
+ "Group_Category": "category four",
76
+ "Value": "43"
77
+ },
78
+ {
79
+ "Group_Category": "category four",
80
+ "Value": "42"
81
+ },
82
+ {
83
+ "Group_Category": "category four",
84
+ "Value": "41"
85
+ },
86
+ {
87
+ "Group_Category": "category four",
88
+ "Value": "21"
89
+ }
90
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdc/chart",
3
- "version": "4.22.11",
3
+ "version": "4.23.1",
4
4
  "description": "React component for visualizing tabular data in various types of charts",
5
5
  "main": "dist/cdcchart",
6
6
  "scripts": {
@@ -29,6 +29,7 @@
29
29
  "@visx/mock-data": "^1.0.0",
30
30
  "@visx/scale": "^1.0.0",
31
31
  "@visx/shape": "^1.0.0",
32
+ "@visx/stats": "^2.17.0",
32
33
  "@visx/tooltip": "^1.1.0",
33
34
  "chroma-js": "^2.1.2",
34
35
  "d3-array": "^2.8.0",
@@ -50,5 +51,5 @@
50
51
  "resolutions": {
51
52
  "@types/react": "17.x"
52
53
  },
53
- "gitHead": "9768d1ea0e2383044977d988e33531bcdfe33ea6"
54
+ "gitHead": "58163844cc9ce2c379235413b19f49679eab4bef"
54
55
  }