@cdc/core 4.25.11 → 4.26.2
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/.claude/agents/qa-test-developer.md +126 -0
- package/CLAUDE.local.md +67 -0
- package/_stories/Gallery.Charts.stories.tsx +300 -0
- package/_stories/Gallery.DataBite.stories.tsx +79 -0
- package/_stories/Gallery.Maps.stories.tsx +239 -0
- package/_stories/Gallery.WaffleChart.stories.tsx +187 -0
- package/_stories/PageART.stories.tsx +193 -0
- package/_stories/PageBRFSS.stories.tsx +294 -0
- package/_stories/PageCancerRegistries.stories.tsx +199 -0
- package/_stories/PageEasternEquineEncephalitis.stories.tsx +216 -0
- package/_stories/PageExcessiveAlcoholUse.stories.tsx +201 -0
- package/_stories/PageMaternalMortality.stories.tsx +193 -0
- package/_stories/PageOralHealth.stories.tsx +201 -0
- package/_stories/PageRespiratory.stories.tsx +332 -0
- package/_stories/PageSmokingTobacco.stories.tsx +200 -0
- package/_stories/PageStateDiabetesProfiles.stories.tsx +201 -0
- package/_stories/PageWastewater.stories.tsx +477 -0
- package/_stories/VegaImport.stories.tsx +401 -0
- package/_stories/vega-fixtures/bars-with-line.json +444 -0
- package/_stories/vega-fixtures/bars.json +58 -0
- package/_stories/vega-fixtures/combo-bar-rolling-mean.json +88 -0
- package/_stories/vega-fixtures/combo.json +68 -0
- package/_stories/vega-fixtures/grouped-horizontal-bars.json +83 -0
- package/_stories/vega-fixtures/grouped-horizontal-bars2.json +231 -0
- package/_stories/vega-fixtures/horizontal-bar.json +427 -0
- package/_stories/vega-fixtures/horizontal-bars-with-bad-colors.json +197 -0
- package/_stories/vega-fixtures/horizontal-bars2.json +58 -0
- package/_stories/vega-fixtures/lines.json +227 -0
- package/_stories/vega-fixtures/measles-bars.json +348 -0
- package/_stories/vega-fixtures/measles-map.json +11101 -0
- package/_stories/vega-fixtures/measles-stacked-bars.json +2147 -0
- package/_stories/vega-fixtures/multi-dataset.json +255 -0
- package/_stories/vega-fixtures/no-data.json +14 -0
- package/_stories/vega-fixtures/pie-chart.json +94 -0
- package/_stories/vega-fixtures/repeat-spec.json +47 -0
- package/_stories/vega-fixtures/stacked-area.json +222 -0
- package/_stories/vega-fixtures/stacked-bar-with-rect.json +3412 -0
- package/_stories/vega-fixtures/stacked-bars-with-line.json +364 -0
- package/_stories/vega-fixtures/stacked-bars.json +212 -0
- package/_stories/vega-fixtures/stacked-horizontal-bars.json +140 -0
- package/_stories/vega-fixtures/warning-combo.json +59 -0
- package/_stories/vega-fixtures/warning-scatter-and-line.json +1182 -0
- package/assets/icon-chart-area.svg +1 -0
- package/assets/icon-chart-radar.svg +23 -0
- package/assets/icon-magnifying-glass.svg +5 -0
- package/assets/icon-warming-stripes.svg +13 -0
- package/assets/logo2.svg +31 -0
- package/components/AdvancedEditor/AdvancedEditor.tsx +4 -0
- package/components/AdvancedEditor/EmbedEditor.tsx +513 -0
- package/components/ComboBox/ComboBox.tsx +345 -0
- package/components/ComboBox/combobox.styles.css +185 -0
- package/components/ComboBox/index.ts +1 -0
- package/components/CustomColorsEditor/CustomColorsEditor.tsx +3 -10
- package/components/DataTable/DataTable.tsx +132 -58
- package/components/DataTable/data-table.css +216 -215
- package/components/DataTable/helpers/getSeriesName.ts +6 -0
- package/components/DataTable/helpers/mapCellMatrix.tsx +14 -6
- package/components/EditorPanel/ColumnsEditor.tsx +37 -19
- package/components/EditorPanel/DataTableEditor.tsx +51 -25
- package/components/EditorPanel/EditorPanel.styles.css +16 -0
- package/components/EditorPanel/EditorPanel.tsx +144 -0
- package/components/EditorPanel/EditorPanelDispatch.tsx +75 -0
- package/components/EditorPanel/FieldSetWrapper.tsx +66 -23
- package/components/EditorPanel/Inputs.tsx +33 -7
- package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +14 -6
- package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +240 -175
- package/components/EditorPanel/VizFilterEditor/components/FilterOrder.tsx +33 -29
- package/components/EditorPanel/sections/VisualSection.tsx +169 -0
- package/components/Filters/Filters.tsx +31 -5
- package/components/Filters/helpers/getNestedOptions.ts +2 -1
- package/components/Filters/helpers/handleSorting.ts +1 -1
- package/components/Layout/components/Sidebar/components/sidebar.styles.scss +84 -2
- package/components/Layout/components/Visualization/index.tsx +27 -1
- package/components/Layout/components/Visualization/visualizations.scss +7 -0
- package/components/Legend/Legend.Gradient.tsx +1 -1
- package/components/MediaControls.tsx +53 -28
- package/components/_stories/CustomColorsEditor.stories.tsx +37 -0
- package/components/_stories/DataTable.stories.tsx +1 -0
- package/components/ui/Icon.tsx +3 -1
- package/components/ui/Title/index.tsx +30 -2
- package/components/ui/Title/title.styles.css +42 -0
- package/data/colorPalettes.ts +18 -5
- package/data/mapColorPalettes.ts +10 -0
- package/devTemplate/dev.js +235 -0
- package/devTemplate/index.html +30 -0
- package/devTemplate/preview.html +1503 -0
- package/devTemplate/sidebar.css +151 -0
- package/dist/cove-main.css +2803 -4448
- package/dist/cove-main.css.map +1 -1
- package/generateViteConfig.js +118 -2
- package/helpers/DataTransform.ts +1 -5
- package/helpers/addValuesToFilters.ts +6 -1
- package/helpers/cove/date.ts +33 -1
- package/helpers/cove/string.ts +29 -0
- package/helpers/coveUpdateWorker.ts +21 -12
- package/helpers/embed/embedCodeGenerator.ts +80 -0
- package/helpers/embed/embedHelper.js +158 -0
- package/helpers/embed/filterUtils.ts +121 -0
- package/helpers/embed/index.ts +21 -0
- package/helpers/embed/urlValidation.ts +119 -0
- package/helpers/filterVizData.ts +6 -1
- package/helpers/getFileExtension.ts +0 -6
- package/helpers/getUniqueValues.ts +19 -0
- package/helpers/hashObj.ts +25 -0
- package/helpers/isRightAlignedTableValue.js +5 -0
- package/helpers/metrics/helpers.ts +1 -0
- package/helpers/metrics/types.ts +3 -0
- package/helpers/palettes/colorDistributions.ts +1 -1
- package/helpers/palettes/utils.ts +12 -12
- package/helpers/parseCsvWithQuotes.ts +15 -14
- package/helpers/pivotData.ts +2 -2
- package/helpers/prepareScreenshot.ts +288 -0
- package/helpers/queryStringUtils.ts +29 -0
- package/helpers/testing.ts +44 -0
- package/helpers/tests/DataTransform.test.ts +125 -0
- package/helpers/tests/date.test.ts +64 -0
- package/helpers/tests/prepareScreenshot.test.ts +414 -0
- package/helpers/tests/queryStringUtils.test.ts +381 -0
- package/helpers/tests/testStandaloneBuild.ts +23 -5
- package/helpers/useDataVizClasses.ts +0 -1
- package/helpers/vegaConfig.ts +1 -1
- package/helpers/vegaConfigImport.ts +160 -0
- package/helpers/ver/4.26.1.ts +80 -0
- package/helpers/ver/4.26.2.ts +84 -0
- package/helpers/ver/tests/4.26.1.test.ts +105 -0
- package/helpers/ver/tests/4.26.2.test.ts +298 -0
- package/helpers/viewports.ts +2 -0
- package/hooks/useDataColumns.ts +63 -0
- package/hooks/useFilterManagement.ts +94 -0
- package/hooks/useLegendSeparators.ts +26 -0
- package/hooks/useListManagement.ts +192 -0
- package/package.json +29 -33
- package/styles/_button-section.scss +0 -3
- package/styles/v2/components/editor.scss +9 -9
- package/styles/v2/utils/_grid.scss +8 -3
- package/types/Annotation.ts +10 -11
- package/types/Axis.ts +1 -0
- package/types/ForecastingSeriesKey.ts +1 -0
- package/types/General.ts +2 -0
- package/types/MarkupInclude.ts +1 -0
- package/types/Palette.ts +21 -0
- package/types/Series.ts +3 -0
- package/types/Table.ts +1 -0
- package/types/Visualization.ts +7 -0
- package/types/VizFilter.ts +1 -0
- package/LICENSE +0 -201
- package/_stories/StoryRenderingTests.stories.tsx +0 -164
|
@@ -1,284 +1,285 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.bs4 .table.table-width-unset {
|
|
7
|
-
width: unset;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.collapsed+.table-container {
|
|
11
|
-
border-bottom: none;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.table-container {
|
|
15
|
-
overflow-x: auto;
|
|
16
|
-
border-right: 1px solid var(--lightGray);
|
|
17
|
-
border-left: 1px solid var(--lightGray);
|
|
18
|
-
border-bottom: 1px solid var(--lightGray);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.cdc-open-viz-module div.data-table-heading {
|
|
22
|
-
position: relative;
|
|
23
|
-
border: var(--cool-gray-10) 1px solid;
|
|
24
|
-
border-radius: 6px;
|
|
25
|
-
|
|
26
|
-
svg {
|
|
27
|
-
position: absolute;
|
|
28
|
-
height: 100%;
|
|
29
|
-
width: 15px;
|
|
30
|
-
top: 0;
|
|
31
|
-
right: 1em;
|
|
1
|
+
.cove,
|
|
2
|
+
.cdc-open-viz-module {
|
|
3
|
+
.table {
|
|
4
|
+
width: unset;
|
|
5
|
+
min-width: 100%;
|
|
32
6
|
}
|
|
33
7
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
position: relative;
|
|
8
|
+
.bs4 .table.table-width-unset {
|
|
9
|
+
width: unset;
|
|
37
10
|
}
|
|
38
|
-
}
|
|
39
11
|
|
|
40
|
-
table
|
|
41
|
-
|
|
42
|
-
th,
|
|
43
|
-
td {
|
|
44
|
-
min-width: 200px;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
table.data-table {
|
|
49
|
-
margin-bottom: 0;
|
|
50
|
-
background: #fff;
|
|
51
|
-
position: relative;
|
|
52
|
-
border: none;
|
|
53
|
-
border-collapse: collapse;
|
|
54
|
-
appearance: none;
|
|
55
|
-
table-layout: fixed;
|
|
56
|
-
|
|
57
|
-
* {
|
|
58
|
-
box-sizing: border-box;
|
|
12
|
+
.collapsed+.table-container {
|
|
13
|
+
border-bottom: none;
|
|
59
14
|
}
|
|
60
15
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
button {
|
|
67
|
-
background: none;
|
|
68
|
-
font-size: initial;
|
|
69
|
-
color: #fff;
|
|
70
|
-
border: 0;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
tr {
|
|
74
|
-
background: none;
|
|
75
|
-
}
|
|
16
|
+
.table-container {
|
|
17
|
+
overflow-x: auto;
|
|
18
|
+
border-right: 1px solid var(--lightGray);
|
|
19
|
+
border-left: 1px solid var(--lightGray);
|
|
20
|
+
border-bottom: 1px solid var(--lightGray);
|
|
76
21
|
}
|
|
77
22
|
|
|
78
|
-
|
|
79
|
-
|
|
23
|
+
div.data-table-heading {
|
|
24
|
+
position: relative;
|
|
25
|
+
border: var(--cool-gray-10) 1px solid;
|
|
26
|
+
border-radius: 6px;
|
|
80
27
|
|
|
81
|
-
|
|
82
|
-
cursor: e-resize;
|
|
83
|
-
width: 10px;
|
|
28
|
+
svg {
|
|
84
29
|
position: absolute;
|
|
30
|
+
height: 100%;
|
|
31
|
+
width: 15px;
|
|
85
32
|
top: 0;
|
|
86
|
-
|
|
87
|
-
right: 0;
|
|
88
|
-
touch-action: none;
|
|
33
|
+
right: 1em;
|
|
89
34
|
}
|
|
90
35
|
|
|
91
|
-
|
|
92
|
-
|
|
36
|
+
&:focus {
|
|
37
|
+
z-index: 2;
|
|
38
|
+
position: relative;
|
|
93
39
|
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
table.horizontal {
|
|
94
43
|
|
|
95
44
|
th,
|
|
96
45
|
td {
|
|
97
|
-
|
|
98
|
-
line-height: normal;
|
|
99
|
-
position: relative;
|
|
100
|
-
text-align: left;
|
|
101
|
-
border-right: 1px solid var(--lightGray) !important;
|
|
46
|
+
min-width: 200px;
|
|
102
47
|
}
|
|
48
|
+
}
|
|
103
49
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
50
|
+
table.data-table {
|
|
51
|
+
margin-bottom: 0;
|
|
52
|
+
background: #fff;
|
|
53
|
+
position: relative;
|
|
54
|
+
border: none;
|
|
55
|
+
border-collapse: collapse;
|
|
56
|
+
appearance: none;
|
|
57
|
+
table-layout: fixed;
|
|
110
58
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
border-right: 0;
|
|
59
|
+
* {
|
|
60
|
+
box-sizing: border-box;
|
|
114
61
|
}
|
|
115
|
-
}
|
|
116
62
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
63
|
+
thead {
|
|
64
|
+
user-select: none;
|
|
65
|
+
-moz-user-select: none;
|
|
66
|
+
user-select: none;
|
|
122
67
|
|
|
123
|
-
|
|
124
|
-
|
|
68
|
+
button {
|
|
69
|
+
background: none;
|
|
70
|
+
font-size: initial;
|
|
71
|
+
color: #fff !important;
|
|
72
|
+
border: 0;
|
|
73
|
+
}
|
|
125
74
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
75
|
+
tr {
|
|
76
|
+
background: none;
|
|
77
|
+
}
|
|
129
78
|
}
|
|
130
|
-
}
|
|
131
79
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
80
|
+
thead {
|
|
81
|
+
color: #fff !important;
|
|
82
|
+
|
|
83
|
+
.resizer {
|
|
84
|
+
cursor: e-resize;
|
|
85
|
+
width: 10px;
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: 0;
|
|
88
|
+
bottom: 0;
|
|
89
|
+
right: 0;
|
|
90
|
+
touch-action: none;
|
|
91
|
+
}
|
|
137
92
|
|
|
138
|
-
|
|
139
|
-
|
|
93
|
+
tr {
|
|
94
|
+
text-align: left;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
th,
|
|
98
|
+
td {
|
|
99
|
+
padding: 0.5em 0.7em;
|
|
100
|
+
line-height: normal;
|
|
101
|
+
position: relative;
|
|
102
|
+
text-align: left;
|
|
103
|
+
border-right: 1px solid var(--lightGray) !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
th {
|
|
107
|
+
background-color: var(--primary);
|
|
108
|
+
background-repeat: no-repeat;
|
|
109
|
+
background-position: right 0.5em center;
|
|
110
|
+
background-size: 10px 5px;
|
|
111
|
+
color: #fff !important
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
th:last-child,
|
|
115
|
+
td:last-child {
|
|
116
|
+
border-right: 0;
|
|
117
|
+
}
|
|
140
118
|
}
|
|
141
|
-
}
|
|
142
119
|
|
|
143
|
-
|
|
144
|
-
|
|
120
|
+
tr {
|
|
121
|
+
&.row-group {
|
|
122
|
+
background-color: var(--tertiary) !important;
|
|
123
|
+
font-weight: bold;
|
|
124
|
+
}
|
|
145
125
|
|
|
146
|
-
|
|
147
|
-
|
|
126
|
+
border-bottom: solid 1px #e5e5e5;
|
|
127
|
+
min-width: 100%;
|
|
148
128
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
129
|
+
/* Needed to fill content up*/
|
|
130
|
+
&:last-child {
|
|
131
|
+
border-bottom: 0;
|
|
152
132
|
}
|
|
153
133
|
}
|
|
154
134
|
|
|
155
|
-
|
|
135
|
+
th,
|
|
136
|
+
td {
|
|
137
|
+
padding: 0.3em 0.7em;
|
|
138
|
+
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
|
139
|
+
white-space: nowrap;
|
|
156
140
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
bottom: 0;
|
|
162
|
-
right: 0;
|
|
163
|
-
left: 0;
|
|
164
|
-
display: block;
|
|
165
|
-
color: inherit;
|
|
166
|
-
text-decoration: none;
|
|
167
|
-
}
|
|
141
|
+
&:last-child {
|
|
142
|
+
border-right: 0 !important;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
168
145
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
padding: 0;
|
|
172
|
-
display: inline;
|
|
173
|
-
}
|
|
146
|
+
td {
|
|
147
|
+
position: relative;
|
|
174
148
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
149
|
+
svg {
|
|
150
|
+
margin-left: 1rem;
|
|
151
|
+
|
|
152
|
+
&.legend-shape-svg {
|
|
153
|
+
display: flex;
|
|
154
|
+
margin-left: 0 !important;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
179
157
|
|
|
180
|
-
svg {
|
|
181
|
-
max-width: 13px;
|
|
182
|
-
vertical-align: baseline;
|
|
183
|
-
margin-left: 5px;
|
|
184
158
|
}
|
|
185
|
-
}
|
|
186
159
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
top: 0;
|
|
199
|
-
left: 0;
|
|
200
|
-
right: 0;
|
|
201
|
-
bottom: 0;
|
|
202
|
-
position: absolute;
|
|
203
|
-
text-align: center;
|
|
204
|
-
display: flex;
|
|
205
|
-
align-items: center;
|
|
206
|
-
justify-content: center;
|
|
207
|
-
z-index: 7;
|
|
160
|
+
td a {
|
|
161
|
+
padding: 0.3em 0.7em;
|
|
162
|
+
position: absolute;
|
|
163
|
+
top: 0;
|
|
164
|
+
bottom: 0;
|
|
165
|
+
right: 0;
|
|
166
|
+
left: 0;
|
|
167
|
+
display: block;
|
|
168
|
+
color: inherit;
|
|
169
|
+
text-decoration: none;
|
|
170
|
+
}
|
|
208
171
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
172
|
+
td div a {
|
|
173
|
+
position: relative;
|
|
174
|
+
padding: 0;
|
|
175
|
+
display: inline;
|
|
213
176
|
}
|
|
214
|
-
}
|
|
215
177
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
178
|
+
td span.table-link {
|
|
179
|
+
text-decoration: underline;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
color: #075290;
|
|
219
182
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
183
|
+
svg {
|
|
184
|
+
max-width: 13px;
|
|
185
|
+
vertical-align: baseline;
|
|
186
|
+
margin-left: 5px;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
223
189
|
|
|
224
|
-
|
|
225
|
-
|
|
190
|
+
.boxplot-td {
|
|
191
|
+
table-layout: fixed;
|
|
192
|
+
width: 200;
|
|
226
193
|
}
|
|
227
194
|
}
|
|
228
|
-
}
|
|
229
195
|
|
|
230
|
-
.data
|
|
231
|
-
|
|
232
|
-
display: flex;
|
|
233
|
-
align-items: center;
|
|
196
|
+
.no-data {
|
|
197
|
+
position: relative;
|
|
234
198
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
199
|
+
.no-data-message {
|
|
200
|
+
background: rgba(255, 255, 255, 0.5);
|
|
201
|
+
top: 0;
|
|
202
|
+
left: 0;
|
|
203
|
+
right: 0;
|
|
204
|
+
bottom: 0;
|
|
205
|
+
position: absolute;
|
|
206
|
+
text-align: center;
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
z-index: 7;
|
|
211
|
+
|
|
212
|
+
:is(h3) {
|
|
213
|
+
font-size: 1.3rem;
|
|
214
|
+
font-weight: 600;
|
|
215
|
+
margin-bottom: 0.3rem;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
239
218
|
|
|
240
|
-
|
|
241
|
-
|
|
219
|
+
tr:hover {
|
|
220
|
+
background: #fff;
|
|
242
221
|
}
|
|
243
222
|
|
|
244
|
-
|
|
245
|
-
|
|
223
|
+
th,
|
|
224
|
+
td {
|
|
225
|
+
width: 50%;
|
|
246
226
|
|
|
247
|
-
|
|
248
|
-
|
|
227
|
+
&::before {
|
|
228
|
+
content: '\00a0';
|
|
249
229
|
}
|
|
250
230
|
}
|
|
231
|
+
}
|
|
251
232
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
233
|
+
.data-table-pagination {
|
|
234
|
+
margin: 1rem 0;
|
|
235
|
+
display: flex;
|
|
236
|
+
align-items: center;
|
|
237
|
+
|
|
238
|
+
ul {
|
|
239
|
+
list-style: none;
|
|
240
|
+
margin: 0 1rem 0 0;
|
|
241
|
+
display: flex;
|
|
242
|
+
|
|
243
|
+
li+li {
|
|
244
|
+
margin-left: 0.3rem;
|
|
245
|
+
}
|
|
255
246
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
247
|
+
button {
|
|
248
|
+
background: var(--mediumGray);
|
|
249
|
+
|
|
250
|
+
&:hover {
|
|
251
|
+
background: lighten(var(--mediumGray), 5%);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
260
254
|
|
|
261
|
-
|
|
255
|
+
button.btn svg {
|
|
256
|
+
margin: 0px 0 3px 0;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
button[disabled] {
|
|
262
260
|
background: var(--mediumGray);
|
|
261
|
+
opacity: 0.3;
|
|
262
|
+
cursor: default;
|
|
263
|
+
|
|
264
|
+
&:hover {
|
|
265
|
+
background: var(--mediumGray);
|
|
266
|
+
}
|
|
263
267
|
}
|
|
264
268
|
}
|
|
265
269
|
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.btn-download {
|
|
269
|
-
color: #fff;
|
|
270
|
-
float: right;
|
|
271
|
-
text-decoration: none;
|
|
272
|
-
transition: 0.3s all;
|
|
273
|
-
margin: 1em 0;
|
|
274
270
|
|
|
275
|
-
|
|
271
|
+
.btn-download {
|
|
272
|
+
color: #fff;
|
|
273
|
+
float: right;
|
|
274
|
+
text-decoration: none;
|
|
276
275
|
transition: 0.3s all;
|
|
276
|
+
margin: 1em 0;
|
|
277
|
+
|
|
278
|
+
&:hover {
|
|
279
|
+
transition: 0.3s all;
|
|
280
|
+
}
|
|
277
281
|
}
|
|
278
|
-
}
|
|
279
282
|
|
|
280
|
-
.cove,
|
|
281
|
-
.cdc-open-viz-module {
|
|
282
283
|
.download-links a:not(:last-child) {
|
|
283
284
|
margin-right: 10px;
|
|
284
285
|
display: inline-block;
|
|
@@ -16,6 +16,12 @@ export const getSeriesName = (column: string, config: TableConfig) => {
|
|
|
16
16
|
return userDefinedSeries.name
|
|
17
17
|
}
|
|
18
18
|
if (config.runtimeSeriesLabels && config.runtimeSeriesLabels[column]) return config.runtimeSeriesLabels[column]
|
|
19
|
+
|
|
20
|
+
// For pie charts, use yAxis.label if the column is the yAxis data key
|
|
21
|
+
if (config.visualizationType === 'Pie' && column === config.yAxis?.dataKey && config.yAxis?.label) {
|
|
22
|
+
return config.yAxis.label
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
const columnIsDataKey = column === config.xAxis?.dataKey
|
|
20
26
|
const indexLabel = config.table?.indexLabel
|
|
21
27
|
return columnIsDataKey && indexLabel ? indexLabel : getLabel(column, config)
|
|
@@ -4,12 +4,18 @@ import { DataTableProps } from '../DataTable'
|
|
|
4
4
|
import { ReactNode } from 'react'
|
|
5
5
|
import { displayDataAsText } from '@cdc/core/helpers/displayDataAsText'
|
|
6
6
|
import _ from 'lodash'
|
|
7
|
-
import {
|
|
8
|
-
import { hashObj } from '@cdc/map/src/helpers'
|
|
9
|
-
import { getPatternForRow } from '@cdc/map/src/helpers/getPatternForRow'
|
|
7
|
+
import { hashObj } from '../../../helpers/hashObj'
|
|
10
8
|
|
|
11
9
|
type MapRowsProps = DataTableProps & {
|
|
12
10
|
rows: string[]
|
|
11
|
+
applyLegendToRow: (
|
|
12
|
+
rowObj: any,
|
|
13
|
+
config: any,
|
|
14
|
+
runtimeLegend: any,
|
|
15
|
+
legendMemo: any,
|
|
16
|
+
legendSpecialClassLastMemo: any
|
|
17
|
+
) => string[]
|
|
18
|
+
getPatternForRow: (rowObj: any, config: any) => any
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
const getGeoLabel = (config, row, formatLegendLocation, displayGeoName, runtimeData = null) => {
|
|
@@ -92,7 +98,9 @@ const mapCellArray = ({
|
|
|
92
98
|
setFilteredCountryCode,
|
|
93
99
|
legendMemo,
|
|
94
100
|
legendSpecialClassLastMemo,
|
|
95
|
-
runtimeLegend
|
|
101
|
+
runtimeLegend,
|
|
102
|
+
applyLegendToRow,
|
|
103
|
+
getPatternForRow
|
|
96
104
|
}: MapRowsProps): ReactNode[][] => {
|
|
97
105
|
const { allowMapZoom, geoType, type } = config.general
|
|
98
106
|
return rows.map(row =>
|
|
@@ -116,11 +124,11 @@ const mapCellArray = ({
|
|
|
116
124
|
type === 'bubble' && allowMapZoom && geoType === 'world' ? () => setFilteredCountryCode(row) : undefined
|
|
117
125
|
|
|
118
126
|
const validColor = legendColor && legendColor.length > 0 && !noColor
|
|
119
|
-
|
|
127
|
+
|
|
120
128
|
// Check for pattern information
|
|
121
129
|
const patternInfo = getPatternForRow(rowObj, config)
|
|
122
130
|
const mapId = config.runtime?.uniqueId || 'map'
|
|
123
|
-
|
|
131
|
+
|
|
124
132
|
return (
|
|
125
133
|
<div className='col-12'>
|
|
126
134
|
{validColor ? (
|
|
@@ -5,8 +5,10 @@ import { Visualization } from '../../types/Visualization'
|
|
|
5
5
|
import { UpdateFieldFunc } from '../../types/UpdateFieldFunc'
|
|
6
6
|
import { Column } from '../../types/Column'
|
|
7
7
|
import _ from 'lodash'
|
|
8
|
-
import React, { useState } from 'react'
|
|
8
|
+
import React, { useState, useMemo } from 'react'
|
|
9
9
|
import FieldSetWrapper from './FieldSetWrapper'
|
|
10
|
+
import { useDataColumns } from '../../hooks/useDataColumns'
|
|
11
|
+
import Alert from '../Alert/components/Alert'
|
|
10
12
|
|
|
11
13
|
interface ColumnsEditorProps {
|
|
12
14
|
config: Partial<Visualization>
|
|
@@ -52,19 +54,21 @@ const FieldSet: React.FC<ColumnsEditorProps & { colKey: string; controls: OpenCo
|
|
|
52
54
|
updateField(null, null, 'columns', newColumns)
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
// Extract column names from data with memoization (replaces getColumns)
|
|
58
|
+
const allColumns = useDataColumns(config.data)
|
|
59
|
+
|
|
60
|
+
// Filter out groupBy and already configured columns
|
|
61
|
+
const availableColumns = useMemo(() => {
|
|
59
62
|
const configuredColumns = Object.values(config.columns).map(col => col.name)
|
|
60
|
-
const cols =
|
|
63
|
+
const cols = allColumns.filter(key => {
|
|
61
64
|
if (config.table.groupBy === key) return false
|
|
62
65
|
if (configuredColumns.includes(key)) return false
|
|
63
66
|
return true
|
|
64
67
|
})
|
|
68
|
+
// Add current column name if it exists
|
|
65
69
|
if (config.columns[colKey]?.name) cols.push(config.columns[colKey].name)
|
|
66
70
|
return cols
|
|
67
|
-
}
|
|
71
|
+
}, [allColumns, config.table.groupBy, config.columns, colKey])
|
|
68
72
|
|
|
69
73
|
const colName = config.columns[colKey]?.name
|
|
70
74
|
|
|
@@ -82,7 +86,7 @@ const FieldSet: React.FC<ColumnsEditorProps & { colKey: string; controls: OpenCo
|
|
|
82
86
|
fieldName='name'
|
|
83
87
|
section={'columns'}
|
|
84
88
|
initial={'-Select-'}
|
|
85
|
-
options={
|
|
89
|
+
options={availableColumns}
|
|
86
90
|
updateField={(_section, _subsection, _fieldName, value) => changeName(value)}
|
|
87
91
|
/>
|
|
88
92
|
{config.type !== 'table' && (
|
|
@@ -92,7 +96,11 @@ const FieldSet: React.FC<ColumnsEditorProps & { colKey: string; controls: OpenCo
|
|
|
92
96
|
fieldName={'series'}
|
|
93
97
|
section='columns'
|
|
94
98
|
initial={'Select series'}
|
|
95
|
-
options={
|
|
99
|
+
options={
|
|
100
|
+
config.visualizationType === 'Pie'
|
|
101
|
+
? config.runtime?.seriesKeys || []
|
|
102
|
+
: config.series?.map(series => series.dataKey) || []
|
|
103
|
+
}
|
|
96
104
|
updateField={(_section, _subsection, _fieldName, value) => editColumn('series', value)}
|
|
97
105
|
/>
|
|
98
106
|
)}
|
|
@@ -147,16 +155,26 @@ const FieldSet: React.FC<ColumnsEditorProps & { colKey: string; controls: OpenCo
|
|
|
147
155
|
</li>
|
|
148
156
|
<li>
|
|
149
157
|
{config.table.showVertical && (
|
|
150
|
-
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
<>
|
|
159
|
+
<label className='checkbox'>
|
|
160
|
+
<input
|
|
161
|
+
type='checkbox'
|
|
162
|
+
checked={config.columns[colKey].dataTable ?? true}
|
|
163
|
+
onChange={event => {
|
|
164
|
+
editColumn('dataTable', event.target.checked)
|
|
165
|
+
}}
|
|
166
|
+
/>
|
|
167
|
+
<span className='edit-label'>Show in Data Table</span>
|
|
168
|
+
</label>
|
|
169
|
+
{(config.confidenceKeys?.upper === colName || config.confidenceKeys?.lower === colName) && (
|
|
170
|
+
<Alert
|
|
171
|
+
type="danger"
|
|
172
|
+
message="Confidence Interval column - required for 508 compliance"
|
|
173
|
+
showCloseButton={false}
|
|
174
|
+
iconSize={14}
|
|
175
|
+
/>
|
|
176
|
+
)}
|
|
177
|
+
</>
|
|
160
178
|
)}
|
|
161
179
|
</li>
|
|
162
180
|
{config.visualizationType === 'Pie' && (
|