@cdc/chart 4.24.9 → 4.24.10
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.
- package/LICENSE +201 -0
- package/dist/cdcchart.js +43919 -40370
- package/index.html +1 -1
- package/package.json +2 -2
- package/src/CdcChart.tsx +129 -108
- package/src/_stories/Chart.Legend.Gradient.stories.tsx +33 -0
- package/src/_stories/Chart.stories.tsx +28 -0
- package/src/_stories/ChartAxisLabels.stories.tsx +20 -0
- package/src/_stories/ChartAxisTitles.stories.tsx +53 -0
- package/src/_stories/ChartPrefixSuffix.stories.tsx +151 -0
- package/src/_stories/_mock/horizontal_bar.json +257 -0
- package/src/_stories/_mock/large_x_axis_labels.json +261 -0
- package/src/_stories/_mock/paired-bar.json +262 -0
- package/src/_stories/_mock/pie_with_data.json +255 -0
- package/src/_stories/_mock/simplified_line.json +1510 -0
- package/src/components/Annotations/components/AnnotationDraggable.tsx +0 -3
- package/src/components/Annotations/components/AnnotationDropdown.tsx +1 -1
- package/src/components/Axis/Categorical.Axis.tsx +22 -4
- package/src/components/BarChart/components/BarChart.Horizontal.tsx +95 -16
- package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +41 -17
- package/src/components/BarChart/components/BarChart.Vertical.tsx +78 -20
- package/src/components/BarChart/helpers/index.ts +23 -4
- package/src/components/BrushChart.tsx +3 -2
- package/src/components/DeviationBar.jsx +58 -8
- package/src/components/EditorPanel/EditorPanel.tsx +63 -40
- package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +8 -25
- package/src/components/EditorPanel/components/Panels/Panel.General.tsx +21 -4
- package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +297 -35
- package/src/components/EditorPanel/components/panels.scss +4 -6
- package/src/components/EditorPanel/editor-panel.scss +0 -8
- package/src/components/EditorPanel/helpers/tests/updateFieldRankByValue.test.ts +38 -0
- package/src/components/EditorPanel/helpers/updateFieldRankByValue.ts +42 -0
- package/src/components/EditorPanel/useEditorPermissions.ts +1 -0
- package/src/components/ForestPlot/ForestPlot.tsx +2 -3
- package/src/components/ForestPlot/ForestPlotProps.ts +2 -0
- package/src/components/Legend/Legend.Component.tsx +16 -16
- package/src/components/Legend/Legend.Suppression.tsx +25 -20
- package/src/components/Legend/Legend.tsx +0 -2
- package/src/components/Legend/helpers/index.ts +16 -19
- package/src/components/LegendWrapper.tsx +3 -1
- package/src/components/LineChart/components/LineChart.Circle.tsx +10 -0
- package/src/components/LinearChart.tsx +740 -562
- package/src/components/PairedBarChart.jsx +50 -10
- package/src/components/PieChart/PieChart.tsx +1 -6
- package/src/components/Regions/components/Regions.tsx +33 -19
- package/src/components/ZoomBrush.tsx +25 -6
- package/src/coreStyles_chart.scss +3 -0
- package/src/data/initial-state.js +6 -2
- package/src/helpers/configHelpers.ts +28 -0
- package/src/helpers/handleRankByValue.ts +15 -0
- package/src/helpers/sizeHelpers.ts +25 -0
- package/src/helpers/tests/handleRankByValue.test.ts +37 -0
- package/src/helpers/tests/sizeHelpers.test.ts +80 -0
- package/src/hooks/useColorPalette.js +10 -2
- package/src/hooks/useLegendClasses.ts +4 -0
- package/src/hooks/useScales.ts +31 -3
- package/src/hooks/useTooltip.tsx +9 -5
- package/src/index.jsx +1 -0
- package/src/scss/DataTable.scss +5 -4
- package/src/scss/main.scss +57 -52
- package/src/types/ChartConfig.ts +38 -16
- package/src/types/ChartContext.ts +18 -14
- package/src/_stories/Chart.Legend.Gradient.tsx +0 -19
- package/src/_stories/ChartBrush.stories.tsx +0 -19
- package/src/components/LinearChart.jsx +0 -817
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
{
|
|
2
|
+
"annotations": [],
|
|
3
|
+
"type": "chart",
|
|
4
|
+
"debugSvg": false,
|
|
5
|
+
"chartMessage": { "noData": "No Data Available" },
|
|
6
|
+
"title": "",
|
|
7
|
+
"showTitle": true,
|
|
8
|
+
"showDownloadMediaButton": false,
|
|
9
|
+
"theme": "theme-blue",
|
|
10
|
+
"animate": false,
|
|
11
|
+
"fontSize": "medium",
|
|
12
|
+
"lineDatapointStyle": "hover",
|
|
13
|
+
"lineDatapointColor": "Same as Line",
|
|
14
|
+
"barHasBorder": "false",
|
|
15
|
+
"isLollipopChart": false,
|
|
16
|
+
"lollipopShape": "circle",
|
|
17
|
+
"lollipopColorStyle": "two-tone",
|
|
18
|
+
"visualizationSubType": "regular",
|
|
19
|
+
"barStyle": "",
|
|
20
|
+
"roundingStyle": "standard",
|
|
21
|
+
"tipRounding": "top",
|
|
22
|
+
"isResponsiveTicks": false,
|
|
23
|
+
"general": {
|
|
24
|
+
"annotationDropdownText": "Annotations",
|
|
25
|
+
"showDownloadButton": false,
|
|
26
|
+
"showMissingDataLabel": true,
|
|
27
|
+
"showSuppressedSymbol": true,
|
|
28
|
+
"hideNullValue": true
|
|
29
|
+
},
|
|
30
|
+
"padding": { "left": 5, "right": 5 },
|
|
31
|
+
"preliminaryData": [],
|
|
32
|
+
"yAxis": {
|
|
33
|
+
"hideAxis": false,
|
|
34
|
+
"displayNumbersOnBar": false,
|
|
35
|
+
"hideLabel": false,
|
|
36
|
+
"hideTicks": false,
|
|
37
|
+
"size": 50,
|
|
38
|
+
"gridLines": false,
|
|
39
|
+
"enablePadding": false,
|
|
40
|
+
"min": "",
|
|
41
|
+
"max": "",
|
|
42
|
+
"labelColor": "#333",
|
|
43
|
+
"tickLabelColor": "#333",
|
|
44
|
+
"tickColor": "#333",
|
|
45
|
+
"rightHideAxis": true,
|
|
46
|
+
"rightAxisSize": 0,
|
|
47
|
+
"rightLabel": "",
|
|
48
|
+
"rightLabelOffsetSize": 0,
|
|
49
|
+
"rightAxisLabelColor": "#333",
|
|
50
|
+
"rightAxisTickLabelColor": "#333",
|
|
51
|
+
"rightAxisTickColor": "#333",
|
|
52
|
+
"numTicks": "",
|
|
53
|
+
"axisPadding": 0,
|
|
54
|
+
"scalePadding": 10,
|
|
55
|
+
"tickRotation": 0,
|
|
56
|
+
"anchors": [],
|
|
57
|
+
"shoMissingDataLabel": true,
|
|
58
|
+
"showMissingDataLine": true,
|
|
59
|
+
"categories": [],
|
|
60
|
+
"dataKey": "Age-adjusted rate"
|
|
61
|
+
},
|
|
62
|
+
"boxplot": {
|
|
63
|
+
"plots": [],
|
|
64
|
+
"borders": "true",
|
|
65
|
+
"firstQuartilePercentage": 25,
|
|
66
|
+
"thirdQuartilePercentage": 75,
|
|
67
|
+
"boxWidthPercentage": 40,
|
|
68
|
+
"plotOutlierValues": false,
|
|
69
|
+
"plotNonOutlierValues": true,
|
|
70
|
+
"legend": { "showHowToReadText": false, "howToReadText": "" },
|
|
71
|
+
"labels": {
|
|
72
|
+
"q1": "Lower Quartile",
|
|
73
|
+
"q2": "q2",
|
|
74
|
+
"q3": "Upper Quartile",
|
|
75
|
+
"q4": "q4",
|
|
76
|
+
"minimum": "Minimum",
|
|
77
|
+
"maximum": "Maximum",
|
|
78
|
+
"mean": "Mean",
|
|
79
|
+
"median": "Median",
|
|
80
|
+
"sd": "Standard Deviation",
|
|
81
|
+
"iqr": "Interquartile Range",
|
|
82
|
+
"total": "Total",
|
|
83
|
+
"outliers": "Outliers",
|
|
84
|
+
"values": "Values",
|
|
85
|
+
"lowerBounds": "Lower Bounds",
|
|
86
|
+
"upperBounds": "Upper Bounds"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"topAxis": { "hasLine": false },
|
|
90
|
+
"isLegendValue": false,
|
|
91
|
+
"barThickness": "0.37",
|
|
92
|
+
"barHeight": 25,
|
|
93
|
+
"barSpace": 15,
|
|
94
|
+
"heights": { "vertical": 300, "horizontal": 750 },
|
|
95
|
+
"xAxis": {
|
|
96
|
+
"sortDates": false,
|
|
97
|
+
"anchors": [],
|
|
98
|
+
"type": "categorical",
|
|
99
|
+
"showTargetLabel": true,
|
|
100
|
+
"targetLabel": "Target",
|
|
101
|
+
"hideAxis": false,
|
|
102
|
+
"hideLabel": false,
|
|
103
|
+
"hideTicks": false,
|
|
104
|
+
"size": 75,
|
|
105
|
+
"tickRotation": 0,
|
|
106
|
+
"min": "",
|
|
107
|
+
"max": "",
|
|
108
|
+
"labelColor": "#333",
|
|
109
|
+
"tickLabelColor": "#333",
|
|
110
|
+
"tickColor": "#333",
|
|
111
|
+
"numTicks": "",
|
|
112
|
+
"labelOffset": 65,
|
|
113
|
+
"axisPadding": 200,
|
|
114
|
+
"target": 0,
|
|
115
|
+
"maxTickRotation": 45,
|
|
116
|
+
"padding": 0,
|
|
117
|
+
"dataKey": "Race"
|
|
118
|
+
},
|
|
119
|
+
"table": {
|
|
120
|
+
"label": "Data Table",
|
|
121
|
+
"expanded": true,
|
|
122
|
+
"limitHeight": false,
|
|
123
|
+
"height": "",
|
|
124
|
+
"caption": "",
|
|
125
|
+
"showDownloadUrl": false,
|
|
126
|
+
"showDataTableLink": true,
|
|
127
|
+
"showDownloadLinkBelow": true,
|
|
128
|
+
"indexLabel": "",
|
|
129
|
+
"download": true,
|
|
130
|
+
"showVertical": true,
|
|
131
|
+
"dateDisplayFormat": "",
|
|
132
|
+
"showMissingDataLabel": true,
|
|
133
|
+
"showSuppressedSymbol": true,
|
|
134
|
+
"show": true
|
|
135
|
+
},
|
|
136
|
+
"orientation": "vertical",
|
|
137
|
+
"color": "pinkpurple",
|
|
138
|
+
"columns": {},
|
|
139
|
+
"legend": {
|
|
140
|
+
"hide": false,
|
|
141
|
+
"behavior": "isolate",
|
|
142
|
+
"axisAlign": true,
|
|
143
|
+
"singleRow": true,
|
|
144
|
+
"colorCode": "",
|
|
145
|
+
"reverseLabelOrder": false,
|
|
146
|
+
"description": "",
|
|
147
|
+
"dynamicLegend": false,
|
|
148
|
+
"dynamicLegendDefaultText": "Show All",
|
|
149
|
+
"dynamicLegendItemLimit": 5,
|
|
150
|
+
"dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
|
|
151
|
+
"dynamicLegendChartMessage": "Select Options from the Legend",
|
|
152
|
+
"label": "",
|
|
153
|
+
"lineMode": false,
|
|
154
|
+
"verticalSorted": false,
|
|
155
|
+
"highlightOnHover": false,
|
|
156
|
+
"hideSuppressedLabels": false,
|
|
157
|
+
"hideSuppressionLink": false,
|
|
158
|
+
"seriesHighlight": [],
|
|
159
|
+
"style": "circles",
|
|
160
|
+
"subStyle": "linear blocks",
|
|
161
|
+
"tickRotation": "",
|
|
162
|
+
"hideBorder": { "side": false, "topBottom": true }
|
|
163
|
+
},
|
|
164
|
+
"brush": { "height": 25, "active": false },
|
|
165
|
+
"exclusions": { "active": false, "keys": [] },
|
|
166
|
+
"palette": "qualitative-bold",
|
|
167
|
+
"isPaletteReversed": false,
|
|
168
|
+
"twoColor": { "palette": "monochrome-1", "isPaletteReversed": false },
|
|
169
|
+
"labels": false,
|
|
170
|
+
"dataFormat": {
|
|
171
|
+
"commas": false,
|
|
172
|
+
"prefix": "",
|
|
173
|
+
"suffix": "",
|
|
174
|
+
"abbreviated": false,
|
|
175
|
+
"bottomSuffix": "",
|
|
176
|
+
"bottomPrefix": "",
|
|
177
|
+
"bottomAbbreviated": false
|
|
178
|
+
},
|
|
179
|
+
"confidenceKeys": {},
|
|
180
|
+
"visual": {
|
|
181
|
+
"border": true,
|
|
182
|
+
"accent": true,
|
|
183
|
+
"background": true,
|
|
184
|
+
"verticalHoverLine": false,
|
|
185
|
+
"horizontalHoverLine": false
|
|
186
|
+
},
|
|
187
|
+
"useLogScale": false,
|
|
188
|
+
"filterBehavior": "Filter Change",
|
|
189
|
+
"highlightedBarValues": [],
|
|
190
|
+
"series": [],
|
|
191
|
+
"tooltips": { "opacity": 90, "singleSeries": false, "dateDisplayFormat": "" },
|
|
192
|
+
"forestPlot": {
|
|
193
|
+
"startAt": 0,
|
|
194
|
+
"colors": { "line": "", "shape": "" },
|
|
195
|
+
"lineOfNoEffect": { "show": true },
|
|
196
|
+
"type": "",
|
|
197
|
+
"pooledResult": { "diamondHeight": 5, "column": "" },
|
|
198
|
+
"estimateField": "",
|
|
199
|
+
"estimateRadius": "",
|
|
200
|
+
"shape": "square",
|
|
201
|
+
"rowHeight": 20,
|
|
202
|
+
"description": { "show": true, "text": "description", "location": 0 },
|
|
203
|
+
"result": { "show": true, "text": "result", "location": 100 },
|
|
204
|
+
"radius": { "min": 2, "max": 10, "scalingColumn": "" },
|
|
205
|
+
"regression": { "lower": 0, "upper": 0, "estimateField": 0 },
|
|
206
|
+
"leftWidthOffset": 0,
|
|
207
|
+
"rightWidthOffset": 0,
|
|
208
|
+
"showZeroLine": false,
|
|
209
|
+
"leftLabel": "",
|
|
210
|
+
"rightLabel": ""
|
|
211
|
+
},
|
|
212
|
+
"area": { "isStacked": false },
|
|
213
|
+
"sankey": {
|
|
214
|
+
"title": { "defaultColor": "black" },
|
|
215
|
+
"iterations": 1,
|
|
216
|
+
"rxValue": 0.9,
|
|
217
|
+
"overallSize": { "width": 900, "height": 700 },
|
|
218
|
+
"margin": { "margin_y": 25, "margin_x": 0 },
|
|
219
|
+
"nodeSize": { "nodeWidth": 26, "nodeHeight": 40 },
|
|
220
|
+
"nodePadding": 55,
|
|
221
|
+
"nodeFontColor": "black",
|
|
222
|
+
"nodeColor": { "default": "#ff8500", "inactive": "#808080" },
|
|
223
|
+
"linkColor": { "default": "#ffc900", "inactive": "#D3D3D3" },
|
|
224
|
+
"opacity": {
|
|
225
|
+
"nodeOpacityDefault": 1,
|
|
226
|
+
"nodeOpacityInactive": 0.1,
|
|
227
|
+
"LinkOpacityDefault": 1,
|
|
228
|
+
"LinkOpacityInactive": 0.1
|
|
229
|
+
},
|
|
230
|
+
"storyNodeFontColor": "#006778",
|
|
231
|
+
"storyNodeText": [],
|
|
232
|
+
"nodeValueStyle": { "textBefore": "(", "textAfter": ")" },
|
|
233
|
+
"data": []
|
|
234
|
+
},
|
|
235
|
+
"datasets": {},
|
|
236
|
+
"visualizationType": "Pie",
|
|
237
|
+
"data": [
|
|
238
|
+
{ "Race": "Hispanic or Latino", "Age-adjusted rate": "644.2" },
|
|
239
|
+
{ "Race": "Non-Hispanic American Indian", "Age-adjusted rate": "636.1" },
|
|
240
|
+
{ "Race": "Non-Hispanic Black", "Age-adjusted rate": "563.7" },
|
|
241
|
+
{ "Race": "Non-Hispanic Asian or Pacific Islander", "Age-adjusted rate": "202.5" },
|
|
242
|
+
{ "Race": "Non-Hispanic White", "Age-adjusted rate": "183.6" }
|
|
243
|
+
],
|
|
244
|
+
"dataFileName": "valid-data-chart.csv",
|
|
245
|
+
"dataFileSourceType": "file",
|
|
246
|
+
"formattedData": [
|
|
247
|
+
{ "Race": "Hispanic or Latino", "Age-adjusted rate": "644.2" },
|
|
248
|
+
{ "Race": "Non-Hispanic American Indian", "Age-adjusted rate": "636.1" },
|
|
249
|
+
{ "Race": "Non-Hispanic Black", "Age-adjusted rate": "563.7" },
|
|
250
|
+
{ "Race": "Non-Hispanic Asian or Pacific Islander", "Age-adjusted rate": "202.5" },
|
|
251
|
+
{ "Race": "Non-Hispanic White", "Age-adjusted rate": "183.6" }
|
|
252
|
+
],
|
|
253
|
+
"dataDescription": { "horizontal": false, "series": false },
|
|
254
|
+
"version": "4.24.10"
|
|
255
|
+
}
|