@cdc/core 4.24.3 → 4.24.5
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/assets/icon-command.svg +3 -0
- package/assets/icon-rotate-left.svg +3 -0
- package/components/AdvancedEditor.jsx +9 -0
- package/components/DataTable/DataTable.tsx +20 -15
- package/components/DataTable/DataTableStandAlone.tsx +51 -4
- package/components/DataTable/components/ChartHeader.tsx +3 -2
- package/components/DataTable/components/DataTableEditorPanel.tsx +20 -3
- package/components/DataTable/components/ExpandCollapse.tsx +22 -16
- package/components/DataTable/helpers/chartCellMatrix.tsx +3 -2
- package/components/DataTable/helpers/getChartCellValue.ts +21 -1
- package/components/DataTable/helpers/getDataSeriesColumns.ts +37 -16
- package/components/DataTable/helpers/getSeriesName.ts +2 -1
- package/components/DataTable/helpers/mapCellMatrix.tsx +2 -2
- package/components/DataTable/helpers/{customColumns.ts → removeNullColumns.ts} +3 -3
- package/components/DataTable/types/TableConfig.ts +11 -21
- package/components/EditorPanel/ColumnsEditor.tsx +304 -260
- package/components/EditorPanel/DataTableEditor.tsx +119 -48
- package/components/EditorPanel/VizFilterEditor.tsx +234 -0
- package/components/EditorWrapper/EditorWrapper.tsx +48 -0
- package/components/EditorWrapper/editor-wrapper.style.css +14 -0
- package/components/Filters.jsx +78 -61
- package/components/Layout/components/Responsive.tsx +184 -0
- package/components/Layout/components/Sidebar/components/Sidebar.tsx +47 -0
- package/components/Layout/components/Sidebar/components/sidebar.styles.scss +902 -0
- package/components/Layout/components/Sidebar/index.tsx +3 -0
- package/components/Layout/components/Visualization/index.tsx +81 -0
- package/components/Layout/components/Visualization/visualizations.scss +33 -0
- package/components/Layout/index.tsx +11 -0
- package/components/Layout/styles/editor-grid-view.scss +156 -0
- package/components/Layout/styles/editor-utils.scss +197 -0
- package/components/Layout/styles/editor.scss +144 -0
- package/components/LegendCircle.jsx +4 -3
- package/components/MediaControls.jsx +1 -1
- package/components/Table/Table.tsx +7 -5
- package/components/Table/components/Row.tsx +6 -2
- package/components/Table/types/RowType.ts +3 -0
- package/components/Waiting.jsx +11 -1
- package/components/_stories/DataTable.stories.tsx +1 -2
- package/components/_stories/EditorPanel.stories.tsx +1 -0
- package/components/createBarElement.jsx +37 -34
- package/components/elements/SkipTo.tsx +37 -5
- package/components/managers/DataDesigner.tsx +18 -18
- package/components/ui/Icon.tsx +5 -1
- package/helpers/DataTransform.ts +9 -32
- package/helpers/coveUpdateWorker.ts +21 -0
- package/helpers/footnoteSymbols.ts +11 -0
- package/helpers/useDataVizClasses.js +1 -5
- package/helpers/ver/4.23.4.ts +27 -0
- package/helpers/ver/4.24.3.ts +56 -0
- package/helpers/ver/4.24.5.ts +32 -0
- package/package.json +2 -2
- package/styles/_data-table.scss +8 -0
- package/styles/_global.scss +7 -4
- package/styles/_reset.scss +7 -6
- package/styles/_variables.scss +3 -0
- package/styles/base.scss +0 -18
- package/styles/v2/base/index.scss +1 -1
- package/styles/v2/components/ui/tooltip.scss +0 -21
- package/types/Axis.ts +4 -0
- package/types/Column.ts +1 -0
- package/types/ConfigureData.ts +8 -0
- package/types/DataDescription.ts +9 -0
- package/types/Legend.ts +1 -0
- package/types/MarkupInclude.ts +26 -0
- package/types/Runtime.ts +1 -0
- package/types/Series.ts +1 -1
- package/types/Table.ts +15 -13
- package/types/Visualization.ts +14 -10
- package/types/VizFilter.ts +13 -0
- package/helpers/coveUpdateWorker.js +0 -19
- package/helpers/ver/4.23.js +0 -10
- package/helpers/ver/4.24.3.js +0 -25
package/styles/_data-table.scss
CHANGED
|
@@ -28,6 +28,9 @@ div.data-table-heading {
|
|
|
28
28
|
z-index: 2;
|
|
29
29
|
position: relative;
|
|
30
30
|
}
|
|
31
|
+
@include breakpoint(xs) {
|
|
32
|
+
font-size: $font-small + 0.2em;
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
table.horizontal {
|
|
@@ -139,6 +142,7 @@ table.data-table {
|
|
|
139
142
|
|
|
140
143
|
td {
|
|
141
144
|
padding: 0.3em 0.7em;
|
|
145
|
+
|
|
142
146
|
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
|
143
147
|
}
|
|
144
148
|
|
|
@@ -151,6 +155,10 @@ table.data-table {
|
|
|
151
155
|
&:last-child {
|
|
152
156
|
border-right: 0 !important;
|
|
153
157
|
}
|
|
158
|
+
|
|
159
|
+
@include breakpoint(xs) {
|
|
160
|
+
font-size: $font-small;
|
|
161
|
+
}
|
|
154
162
|
}
|
|
155
163
|
tr {
|
|
156
164
|
& > * {
|
package/styles/_global.scss
CHANGED
|
@@ -38,7 +38,11 @@ strong {
|
|
|
38
38
|
border: 0 !important;
|
|
39
39
|
display: flex;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
.cdcdataviz-sr-only-focusable:focus {
|
|
42
|
+
width: fit-content;
|
|
43
|
+
margin-bottom: 0.5em;
|
|
44
|
+
margin-left: 1em;
|
|
45
|
+
}
|
|
42
46
|
.inline-icon {
|
|
43
47
|
width: 1em !important;
|
|
44
48
|
height: auto !important;
|
|
@@ -80,9 +84,9 @@ strong {
|
|
|
80
84
|
}
|
|
81
85
|
&.danger {
|
|
82
86
|
background-color: $red;
|
|
83
|
-
padding: 0em 0.6em
|
|
87
|
+
padding: 0em 0.6em 0em;
|
|
84
88
|
height: 1.6em;
|
|
85
|
-
font-size: 0.8
|
|
89
|
+
font-size: 0.8 em;
|
|
86
90
|
color: #fff;
|
|
87
91
|
&:hover {
|
|
88
92
|
background-color: darken($red, 5%);
|
|
@@ -193,4 +197,3 @@ section.footnotes {
|
|
|
193
197
|
.margin-left-href {
|
|
194
198
|
margin-left: 15px;
|
|
195
199
|
}
|
|
196
|
-
|
package/styles/_reset.scss
CHANGED
|
@@ -141,15 +141,16 @@
|
|
|
141
141
|
top: -0.5em;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
header sup {
|
|
145
|
-
/* Allow line breaks using html in the header. */
|
|
146
|
-
top: initial;
|
|
147
|
-
line-height: initial;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
144
|
sub {
|
|
151
145
|
/* Move the subscripted text down, but only
|
|
152
146
|
half as far down as the superscript moved up */
|
|
153
147
|
bottom: -0.25em;
|
|
154
148
|
}
|
|
149
|
+
|
|
150
|
+
ul > li:first-child {
|
|
151
|
+
margin-top: auto;
|
|
152
|
+
}
|
|
153
|
+
ul > li:last-of-type {
|
|
154
|
+
margin-bottom: auto;
|
|
155
|
+
}
|
|
155
156
|
}
|
package/styles/_variables.scss
CHANGED
package/styles/base.scss
CHANGED
|
@@ -82,24 +82,6 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
|
|
|
82
82
|
color-adjust: exact !important; /* Firefox 48 – 96 */
|
|
83
83
|
print-color-adjust: exact !important; /* Firefox 97+, Safari 15.4+ */
|
|
84
84
|
|
|
85
|
-
.editor-panel.cove {
|
|
86
|
-
position: absolute;
|
|
87
|
-
height: 100vh;
|
|
88
|
-
top: 0;
|
|
89
|
-
max-width: 350px;
|
|
90
|
-
width: 350px;
|
|
91
|
-
|
|
92
|
-
.editor-toggle {
|
|
93
|
-
position: absolute !important;
|
|
94
|
-
top: 10px !important;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.editor-panel {
|
|
98
|
-
position: absolute !important;
|
|
99
|
-
top: 0 !important;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
85
|
$theme: (
|
|
104
86
|
'amber': (
|
|
105
87
|
'#fbab18',
|
|
@@ -27,27 +27,6 @@
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
// editor-panel
|
|
31
|
-
.editor-panel {
|
|
32
|
-
.cove-label + .cove-tooltip {
|
|
33
|
-
top: 1px;
|
|
34
|
-
margin-left: 0.5rem;
|
|
35
|
-
font-size: 0.75rem;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.cove-accordion__button .cove-tooltip {
|
|
39
|
-
display: inline-flex;
|
|
40
|
-
right: 1.5rem;
|
|
41
|
-
line-height: inherit;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.cove-list-group__item .cove-tooltip {
|
|
45
|
-
width: 100%;
|
|
46
|
-
display: block;
|
|
47
|
-
line-height: inherit;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
30
|
// begin actual tooltip styles
|
|
52
31
|
.react-tooltip,
|
|
53
32
|
.tooltip {
|
package/types/Axis.ts
CHANGED
|
@@ -19,6 +19,8 @@ export type Axis = {
|
|
|
19
19
|
label?: string
|
|
20
20
|
labelOffset?: number
|
|
21
21
|
labelPlacement?: string
|
|
22
|
+
manual?: boolean
|
|
23
|
+
manualStep?: number
|
|
22
24
|
max?: string
|
|
23
25
|
maxTickRotation?: number
|
|
24
26
|
min?: string
|
|
@@ -35,6 +37,8 @@ export type Axis = {
|
|
|
35
37
|
sortDates?: boolean
|
|
36
38
|
sortKey?: string
|
|
37
39
|
showTargetLabel?: boolean
|
|
40
|
+
showSuppressedLine: boolean
|
|
41
|
+
showSuppressedSymbol: boolean
|
|
38
42
|
size?: number
|
|
39
43
|
target?: number
|
|
40
44
|
targetLabel?: string
|
package/types/Column.ts
CHANGED
package/types/Legend.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Runtime } from '@cdc/core/types/Runtime'
|
|
2
|
+
import { Variable } from '@cdc/markup-include/src/types/Variable'
|
|
3
|
+
import { Visualization } from './Visualization'
|
|
4
|
+
|
|
5
|
+
export type MarkupIncludeConfig = Visualization & {
|
|
6
|
+
contentEditor: {
|
|
7
|
+
// Changing the base config object creates an infinite loop, nesting it is a workaround
|
|
8
|
+
inlineHTML: string
|
|
9
|
+
markupVariables: Variable[]
|
|
10
|
+
showHeader: boolean
|
|
11
|
+
srcUrl: string
|
|
12
|
+
title: string
|
|
13
|
+
useInlineHTML: boolean
|
|
14
|
+
}
|
|
15
|
+
data?: Object[]
|
|
16
|
+
formattedData: {}
|
|
17
|
+
newViz?: boolean
|
|
18
|
+
runtime?: Runtime
|
|
19
|
+
visual: {
|
|
20
|
+
border: boolean
|
|
21
|
+
accent: boolean
|
|
22
|
+
background: boolean
|
|
23
|
+
hideBackgroundColor: boolean
|
|
24
|
+
borderColorTheme: boolean
|
|
25
|
+
}
|
|
26
|
+
}
|
package/types/Runtime.ts
CHANGED
package/types/Series.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type Series = { dataKey: string; name: string; axis: string; type: string }[]
|
|
1
|
+
export type Series = { dataKey: string; name: string; axis: string; type: string; tooltip: boolean }[]
|
package/types/Table.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
export type Table = {
|
|
2
|
+
caption?: string
|
|
2
3
|
cellMinWidth?: number
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
collapsible?: boolean
|
|
5
|
+
dateDisplayFormat?: string
|
|
6
|
+
download?: boolean
|
|
7
|
+
downloadImageButton?: boolean
|
|
8
|
+
downloadPdfButton?: boolean
|
|
9
|
+
excludeColumns?: string[]
|
|
10
|
+
expanded?: boolean
|
|
11
|
+
fontSize: 'small' | 'medium' | 'large'
|
|
12
|
+
groupBy?: string
|
|
13
|
+
height?: number
|
|
6
14
|
indexLabel?: string
|
|
7
|
-
|
|
15
|
+
label?: string
|
|
8
16
|
limitHeight?: boolean
|
|
9
|
-
|
|
10
|
-
expanded?: boolean
|
|
17
|
+
show?: boolean
|
|
11
18
|
showDataTableLink?: boolean
|
|
12
|
-
showDownloadUrl?: boolean
|
|
13
|
-
download?: boolean
|
|
14
|
-
customTableConfig?: boolean
|
|
15
|
-
excludeColumns?: string[]
|
|
16
19
|
showDownloadImgButton?: boolean
|
|
17
20
|
showDownloadPdfButton?: boolean
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
dateDisplayFormat?: string
|
|
21
|
+
showDownloadUrl?: boolean
|
|
22
|
+
showVertical?: boolean
|
|
21
23
|
}
|
package/types/Visualization.ts
CHANGED
|
@@ -5,35 +5,39 @@ import { Series } from './Series'
|
|
|
5
5
|
import { Table } from './Table'
|
|
6
6
|
import { ConfidenceInterval } from './ConfidenceInterval'
|
|
7
7
|
import { BaseVisualizationType } from './BaseVisualizationType'
|
|
8
|
+
import { ConfigureData } from './ConfigureData'
|
|
9
|
+
import { VizFilter } from './VizFilter'
|
|
10
|
+
import { FilterBehavior } from './FilterBehavior'
|
|
11
|
+
import { General } from './General'
|
|
8
12
|
|
|
9
|
-
export type Visualization = {
|
|
13
|
+
export type Visualization = ConfigureData & {
|
|
10
14
|
autoLoad: boolean
|
|
11
|
-
columns: Record<string, Column
|
|
15
|
+
columns: Record<string, Partial<Column>>
|
|
12
16
|
confidenceKeys: ConfidenceInterval
|
|
13
|
-
data: any
|
|
14
|
-
dataDescription: Object
|
|
15
17
|
dataFileName: string
|
|
16
18
|
dataFileSourceType: string
|
|
17
19
|
dataFormat: any
|
|
18
|
-
dataKey: string
|
|
19
20
|
datasets: Record<string, any>
|
|
20
21
|
editing: boolean
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
filterBehavior: FilterBehavior
|
|
23
|
+
filters: VizFilter[]
|
|
24
|
+
general: General
|
|
23
25
|
hide: any[]
|
|
24
26
|
legend: Legend
|
|
25
27
|
multiDashboards?: any[]
|
|
26
28
|
newViz: boolean
|
|
27
29
|
openModal: boolean
|
|
28
|
-
originalFormattedData: any
|
|
29
30
|
orientation: 'vertical' | 'horizontal'
|
|
31
|
+
originalFormattedData: any
|
|
30
32
|
series: Series
|
|
33
|
+
showEditorPanel: boolean
|
|
31
34
|
table: Table
|
|
35
|
+
theme: string
|
|
32
36
|
title: string
|
|
33
37
|
type: BaseVisualizationType
|
|
34
|
-
uid: string
|
|
38
|
+
uid: string // this is the actual key of the visualization object
|
|
35
39
|
usesSharedFilter: any
|
|
36
|
-
visualizationType: string
|
|
37
40
|
visualizationSubType: string
|
|
41
|
+
visualizationType: string
|
|
38
42
|
xAxis: Axis
|
|
39
43
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type VizFilter = {
|
|
2
|
+
active: string
|
|
3
|
+
columnName: string
|
|
4
|
+
filterStyle: 'tab' | 'pill' | 'tab bar' | 'dropdown'
|
|
5
|
+
label: string
|
|
6
|
+
order: 'asc' | 'desc' | 'cust'
|
|
7
|
+
orderedValues?: string[]
|
|
8
|
+
queryParameter: string
|
|
9
|
+
setByQueryParameter: string
|
|
10
|
+
showDropdown: boolean
|
|
11
|
+
type: 'url'
|
|
12
|
+
values: string[]
|
|
13
|
+
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// If config key names or position in the config have been changed with a version change,
|
|
2
|
-
// process those config entries and format old values into new
|
|
3
|
-
import update_4_23 from './ver/4.23'
|
|
4
|
-
import update_4_24_3 from './ver/4.24.3'
|
|
5
|
-
|
|
6
|
-
// 4.23.6 ------------------------------------------------------
|
|
7
|
-
const coveUpdateWorker = async config => {
|
|
8
|
-
let genConfig = config
|
|
9
|
-
|
|
10
|
-
// v4.23
|
|
11
|
-
genConfig = await update_4_23(genConfig)
|
|
12
|
-
|
|
13
|
-
// v4.24.3
|
|
14
|
-
genConfig = await update_4_24_3(genConfig)
|
|
15
|
-
|
|
16
|
-
return genConfig
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default coveUpdateWorker
|
package/helpers/ver/4.23.js
DELETED
package/helpers/ver/4.24.3.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const update_4_24_3 = async config => {
|
|
2
|
-
const ver = '4.24.3'
|
|
3
|
-
|
|
4
|
-
let newConfig = { ...config }
|
|
5
|
-
|
|
6
|
-
newConfig.validated = ver
|
|
7
|
-
|
|
8
|
-
if (newConfig.type === 'chart') {
|
|
9
|
-
if (newConfig.xAxis.sortDates) {
|
|
10
|
-
newConfig.xAxis.type = 'date-time'
|
|
11
|
-
}
|
|
12
|
-
newConfig.table.download = true
|
|
13
|
-
|
|
14
|
-
delete newConfig.xAxis.sortDates
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (newConfig.type === 'map') {
|
|
18
|
-
newConfig.table.download = true
|
|
19
|
-
newConfig.general.showDownloadButton = true
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return newConfig
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default update_4_24_3
|