@cdc/core 4.24.2 → 4.24.4

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 (84) hide show
  1. package/assets/icon-command.svg +3 -0
  2. package/assets/icon-rotate-left.svg +3 -0
  3. package/assets/icon-sankey.svg +1 -0
  4. package/assets/icon-table.svg +1 -0
  5. package/components/AdvancedEditor.jsx +9 -0
  6. package/components/DataTable/DataTable.tsx +37 -13
  7. package/components/DataTable/DataTableStandAlone.tsx +15 -0
  8. package/components/DataTable/components/CellAnchor.tsx +3 -1
  9. package/components/DataTable/components/ChartHeader.tsx +48 -12
  10. package/components/DataTable/components/DataTableEditorPanel.tsx +42 -0
  11. package/components/DataTable/components/ExpandCollapse.tsx +22 -16
  12. package/components/DataTable/components/MapHeader.tsx +10 -5
  13. package/components/DataTable/helpers/chartCellMatrix.tsx +2 -2
  14. package/components/DataTable/helpers/customColumns.ts +4 -2
  15. package/components/DataTable/helpers/getChartCellValue.ts +4 -2
  16. package/components/DataTable/helpers/getDataSeriesColumns.ts +9 -1
  17. package/components/DataTable/helpers/mapCellMatrix.tsx +2 -2
  18. package/components/DataTable/types/TableConfig.ts +7 -7
  19. package/components/EditorPanel/ColumnsEditor.tsx +312 -0
  20. package/components/EditorPanel/DataTableEditor.tsx +42 -27
  21. package/components/Filters.jsx +35 -17
  22. package/components/Layout/components/Responsive.tsx +184 -0
  23. package/components/Layout/components/Sidebar/components/Sidebar.tsx +47 -0
  24. package/components/Layout/components/Sidebar/components/sidebar.styles.scss +902 -0
  25. package/components/Layout/components/Sidebar/index.tsx +3 -0
  26. package/components/Layout/components/Visualization/index.tsx +79 -0
  27. package/components/Layout/components/Visualization/visualizations.scss +33 -0
  28. package/components/Layout/index.tsx +11 -0
  29. package/components/Layout/styles/editor-grid-view.scss +156 -0
  30. package/components/Layout/styles/editor-utils.scss +197 -0
  31. package/components/Layout/styles/editor.scss +144 -0
  32. package/components/LegendCircle.jsx +4 -3
  33. package/components/MediaControls.jsx +1 -1
  34. package/components/MultiSelect/MultiSelect.tsx +39 -20
  35. package/components/MultiSelect/multiselect.styles.css +44 -27
  36. package/components/NestedDropdown/NestedDropdown.tsx +257 -0
  37. package/components/NestedDropdown/index.ts +1 -0
  38. package/components/NestedDropdown/nesteddropdown.styles.css +70 -0
  39. package/components/Table/Table.tsx +8 -6
  40. package/components/Table/components/Row.tsx +6 -2
  41. package/components/Table/types/RowType.ts +3 -0
  42. package/components/Waiting.jsx +11 -1
  43. package/components/_stories/MultiSelect.stories.tsx +10 -1
  44. package/components/_stories/NestedDropdown.stories.tsx +58 -0
  45. package/components/_stories/styles.scss +1 -0
  46. package/components/createBarElement.jsx +120 -0
  47. package/components/elements/ScreenReaderText.tsx +8 -0
  48. package/components/elements/SkipTo.tsx +46 -0
  49. package/components/managers/DataDesigner.tsx +18 -18
  50. package/components/ui/Icon.tsx +9 -1
  51. package/components/ui/Title/Title.scss +7 -1
  52. package/components/ui/Title/index.tsx +3 -3
  53. package/components/ui/Tooltip.jsx +1 -1
  54. package/data/colorPalettes.js +1 -6
  55. package/helpers/cove/accessibility.ts +23 -0
  56. package/helpers/cove/date.ts +19 -0
  57. package/helpers/{coveUpdateWorker.js → coveUpdateWorker.ts} +9 -5
  58. package/helpers/isDomainExternal.js +14 -0
  59. package/helpers/queryStringUtils.js +26 -0
  60. package/helpers/tests/updateFieldFactory.test.ts +89 -0
  61. package/helpers/updateFieldFactory.ts +38 -0
  62. package/helpers/useDataVizClasses.js +7 -7
  63. package/helpers/ver/4.24.3.ts +56 -0
  64. package/package.json +4 -3
  65. package/styles/_data-table.scss +8 -13
  66. package/styles/_global.scss +7 -4
  67. package/styles/_variables.scss +3 -0
  68. package/styles/base.scss +4 -14
  69. package/styles/v2/base/index.scss +1 -1
  70. package/styles/v2/components/ui/tooltip.scss +0 -21
  71. package/types/Axis.ts +3 -0
  72. package/types/BaseVisualizationType.ts +1 -0
  73. package/types/ConfidenceInterval.ts +1 -0
  74. package/types/ConfigureData.ts +8 -0
  75. package/types/DataDescription.ts +9 -0
  76. package/types/Legend.ts +18 -0
  77. package/types/Region.ts +10 -0
  78. package/types/Runtime.ts +2 -0
  79. package/types/Table.ts +2 -1
  80. package/types/UpdateFieldFunc.ts +1 -1
  81. package/types/Visualization.ts +19 -10
  82. package/components/DataTable/components/SkipNav.tsx +0 -7
  83. package/helpers/cove/date.js +0 -9
  84. package/helpers/ver/4.23.js +0 -10
@@ -0,0 +1,89 @@
1
+ import { updateFieldFactory } from '../updateFieldFactory'
2
+
3
+ describe('updateFieldFactory', () => {
4
+ it('should update the top level field when section and subsection are null', () => {
5
+ const config = { filterColumn: 'oldValue', filterValue: 'oldValue' }
6
+ let updatedConfig = {}
7
+ const updateConfig = newConfig => {
8
+ updatedConfig = newConfig
9
+ }
10
+
11
+ const updateField = updateFieldFactory(config, updateConfig)
12
+ updateField(null, null, 'filterColumn', 'newValue')
13
+
14
+ expect(updatedConfig).toEqual({ filterColumn: 'newValue', filterValue: '' })
15
+ })
16
+
17
+ it('should update the second level when section is not null and subsection is null', () => {
18
+ const config = { section: { filterColumn: 'oldValue', filterValue: 'oldValue' } }
19
+ let updatedConfig = {}
20
+ const updateConfig = newConfig => {
21
+ updatedConfig = newConfig
22
+ }
23
+
24
+ const updateField = updateFieldFactory(config, updateConfig)
25
+ updateField('section', null, 'filterColumn', 'newValue')
26
+
27
+ expect(updatedConfig).toEqual({ section: { filterColumn: 'newValue', filterValue: 'oldValue' } })
28
+ })
29
+
30
+ it('should add to the second level when section is an array and subsection is null', () => {
31
+ const config = { section: ['oldValue'] }
32
+ let updatedConfig = {}
33
+ const updateConfig = newConfig => {
34
+ updatedConfig = newConfig
35
+ }
36
+
37
+ const updateField = updateFieldFactory(config, updateConfig)
38
+ updateField('section', null, 'thisParamDoesNotMatter', 'newValue')
39
+
40
+ expect(updatedConfig).toEqual({ section: ['oldValue', 'newValue'] })
41
+ })
42
+
43
+ it('should update the third level when section and subsection are not null', () => {
44
+ const config = { section: { subsection: { filterColumn: 'oldValue', filterValue: 'oldValue' } } }
45
+ let updatedConfig = {}
46
+ const updateConfig = newConfig => {
47
+ updatedConfig = newConfig
48
+ }
49
+
50
+ const updateField = updateFieldFactory(config, updateConfig)
51
+ updateField('section', 'subsection', 'filterColumn', 'newValue')
52
+
53
+ expect(updatedConfig).toEqual({ section: { subsection: { filterColumn: 'newValue', filterValue: 'oldValue' } } })
54
+ })
55
+
56
+ it('should update the third level when section is an array', () => {
57
+ const config = { section: [{ filterColumn: 'oldValue', filterValue: 'oldValue' }] }
58
+ let updatedConfig = {}
59
+ const updateConfig = newConfig => {
60
+ updatedConfig = newConfig
61
+ }
62
+
63
+ const updateField = updateFieldFactory(config, updateConfig)
64
+ updateField('section', 0, 'filterColumn', 'newValue')
65
+
66
+ expect(updatedConfig).toEqual({ section: [{ filterColumn: 'newValue', filterValue: 'oldValue' }] })
67
+ })
68
+
69
+ it('should update the second level when newValue is a string and legacy is true', () => {
70
+ // test for legacy use case
71
+ // puts the newValue in two places for some reason
72
+ const config = { section: { subsection: 'oldValue' } }
73
+ let updatedConfig = {}
74
+ const updateConfig = newConfig => {
75
+ updatedConfig = newConfig
76
+ }
77
+
78
+ const updateField = updateFieldFactory(config, updateConfig, true)
79
+ updateField('section', 'subsection', 'filterColumn', 'newValue')
80
+
81
+ expect(updatedConfig).toEqual({ section: { subsection: 'newValue', filterColumn: 'newValue' } })
82
+
83
+ updateField('section', null, 'filterColumn', 'newValue2')
84
+ expect(updatedConfig).toEqual({ section: { subsection: 'oldValue', filterColumn: 'newValue2' } })
85
+
86
+ updateField('section', 'subsection', null, 'newValue2')
87
+ expect(updatedConfig).toEqual({ section: { subsection: 'newValue2', null: 'newValue2' } })
88
+ })
89
+ })
@@ -0,0 +1,38 @@
1
+ import { UpdateFieldFunc } from '../types/UpdateFieldFunc'
2
+
3
+ export const updateFieldFactory =
4
+ (config, updateConfig, legacy = false): UpdateFieldFunc<any> =>
5
+ (section, subsection, fieldName, newValue) => {
6
+ // Top level
7
+ if (null === section && null === subsection) {
8
+ const updatedConfig = { ...config, [fieldName]: newValue }
9
+
10
+ if ('filterColumn' === fieldName) {
11
+ updatedConfig.filterValue = ''
12
+ }
13
+
14
+ updateConfig(updatedConfig)
15
+ return
16
+ }
17
+
18
+ const isArray = Array.isArray(config[section])
19
+
20
+ let sectionValue = isArray ? [...config[section], newValue] : { ...config[section], [fieldName]: newValue }
21
+
22
+ if (null !== subsection) {
23
+ if (isArray) {
24
+ sectionValue = [...config[section]]
25
+ sectionValue[subsection] = { ...sectionValue[subsection], [fieldName]: newValue }
26
+ } else if (typeof newValue === 'string' && legacy) {
27
+ // supports data-bite, filter-text, markup-include, and waffle-chart.
28
+ // i'm not sure what the use case for this could be considering you should be able to
29
+ // update by not passing the subsection. Therefore I'm labeling it as legacy.
30
+ sectionValue[subsection] = newValue
31
+ } else {
32
+ sectionValue = { ...config[section], [subsection]: { ...config[section][subsection], [fieldName]: newValue } }
33
+ }
34
+ }
35
+ const updatedConfig = { ...config, [section]: sectionValue }
36
+
37
+ updateConfig(updatedConfig)
38
+ }
@@ -1,7 +1,6 @@
1
1
  export default function useDataVizClasses(config, viewport = null) {
2
2
  const { legend } = config
3
3
  let lineDatapointClass = ''
4
- let barBorderClass = ''
5
4
 
6
5
  if (config.lineDatapointStyle === 'hover') {
7
6
  lineDatapointClass = ' chart-line--hover'
@@ -9,9 +8,6 @@ export default function useDataVizClasses(config, viewport = null) {
9
8
  if (config.lineDatapointStyle === 'always show') {
10
9
  lineDatapointClass = ' chart-line--always'
11
10
  }
12
- if (config.barHasBorder === 'false') {
13
- barBorderClass = ' chart-bar--no-border'
14
- }
15
11
 
16
12
  let innerContainerClasses = ['cove-component__inner']
17
13
  let contentClasses = ['cove-component__content']
@@ -22,6 +18,10 @@ export default function useDataVizClasses(config, viewport = null) {
22
18
  if (title && showTitle) contentClasses.push('component--has-title')
23
19
  }
24
20
 
21
+ if (config.type === 'markup-include') {
22
+ contentClasses = contentClasses.filter(item => item !== 'cove-component__content')
23
+ }
24
+
25
25
  config.showTitle && contentClasses.push('component--has-title')
26
26
  config.title && config.visualizationType !== 'chart' && config.visualizationType !== 'Spark Line' && contentClasses.push('component--has-title')
27
27
  config.subtext && innerContainerClasses.push('component--has-subtext')
@@ -65,9 +65,9 @@ export default function useDataVizClasses(config, viewport = null) {
65
65
  ul: getUlClasses(),
66
66
  li: ['single-legend-item', 'legend-container__li'],
67
67
  title: ['legend-container__title'],
68
- resetButton: ['legend-container__reset-button', 'btn', 'clear'],
69
- description: ['legend-container__description']
68
+ description: ['legend-container__description'],
69
+ div: [legend?.position === 'bottom' && legend?.singleRow ? 'shape-container single-row' : 'shape-container']
70
70
  }
71
71
 
72
- return { innerContainerClasses, contentClasses, barBorderClass, lineDatapointClass, sparkLineStyles, legendClasses }
72
+ return { innerContainerClasses, contentClasses, lineDatapointClass, sparkLineStyles, legendClasses }
73
73
  }
@@ -0,0 +1,56 @@
1
+ import { ConfigRow } from '@cdc/dashboard/src/types/ConfigRow'
2
+ import _ from 'lodash'
3
+
4
+ const remapDashboardRows = config => {
5
+ if (config.type === 'dashboard') {
6
+ config.rows = config.rows.map(row => {
7
+ let newRow = undefined
8
+ if (row.columns === undefined) {
9
+ newRow = {} as ConfigRow
10
+ const newColumns = row.map(column => {
11
+ newRow.uuid = column.uuid
12
+ newRow.toggle = column.toggle
13
+ newRow.equalHeight = column.equalHeight
14
+ return _.pick(column, 'equalHeight', 'width', 'hide', 'widget', 'uuid')
15
+ })
16
+ newRow.columns = newColumns
17
+ }
18
+ return newRow ?? row
19
+ })
20
+ }
21
+ }
22
+
23
+ const chartUpdates = newConfig => {
24
+ if (newConfig.type === 'chart') {
25
+ if (newConfig.xAxis.sortDates) {
26
+ newConfig.xAxis.type = 'date-time'
27
+ }
28
+ newConfig.table.download = true
29
+
30
+ delete newConfig.xAxis.sortDates
31
+ }
32
+ }
33
+
34
+ const mapUpdates = newConfig => {
35
+ if (newConfig.type === 'map') {
36
+ newConfig.table.download = true
37
+ newConfig.general.showDownloadButton = true
38
+ // expandDataTable should be removed in the future....
39
+ newConfig.general.expandDataTable = newConfig.table.expanded
40
+ }
41
+ }
42
+
43
+ const update_4_24_3 = config => {
44
+ const ver = '4.24.3'
45
+
46
+ const newConfig = _.cloneDeep(config)
47
+
48
+ remapDashboardRows(newConfig)
49
+ chartUpdates(newConfig)
50
+ mapUpdates(newConfig)
51
+
52
+ newConfig.version = ver
53
+ return newConfig
54
+ }
55
+
56
+ export default update_4_24_3
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@cdc/core",
3
- "version": "4.24.2",
3
+ "version": "4.24.4",
4
4
  "description": "Core components, styles, hooks, and helpers, for the CDC Open Visualization project",
5
5
  "moduleName": "CdcCore",
6
6
  "main": "dist/cdccore",
7
7
  "scripts": {
8
- "test": "echo \"Error: run tests from root\" && exit 1"
8
+ "test": "vitest watch --reporter verbose --globals true",
9
+ "test:ui": "vitest --ui"
9
10
  },
10
11
  "repository": {
11
12
  "type": "git",
@@ -30,5 +31,5 @@
30
31
  "react": "^18.2.0",
31
32
  "react-dom": "^18.2.0"
32
33
  },
33
- "gitHead": "edde49c96dee146de5e3a4537880b1bcf4dbee08"
34
+ "gitHead": "1843b4632140d582af6a87606374cbd4fe25ad5c"
34
35
  }
@@ -28,10 +28,12 @@ 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 {
34
-
35
37
  th,
36
38
  td {
37
39
  min-width: 200px;
@@ -103,18 +105,6 @@ table.data-table {
103
105
  background-size: 10px 5px;
104
106
  }
105
107
 
106
- /* doesnt work
107
- th.sort-asc,
108
- td.sort-asc {
109
- background-image: url(../assets/icon-caret-filled-up.svg);
110
- }
111
-
112
- th.sort-desc,
113
- td.sort-desc {
114
- background-image: url(../assets/icon-caret-filled-down.svg);
115
- }
116
- */
117
-
118
108
  // format the white triangle sort icon in data table headers
119
109
  .sort-icon {
120
110
  fill: white;
@@ -152,6 +142,7 @@ table.data-table {
152
142
 
153
143
  td {
154
144
  padding: 0.3em 0.7em;
145
+
155
146
  border-right: 1px solid rgba(0, 0, 0, 0.1);
156
147
  }
157
148
 
@@ -164,6 +155,10 @@ table.data-table {
164
155
  &:last-child {
165
156
  border-right: 0 !important;
166
157
  }
158
+
159
+ @include breakpoint(xs) {
160
+ font-size: $font-small;
161
+ }
167
162
  }
168
163
  tr {
169
164
  & > * {
@@ -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 0.0em;
87
+ padding: 0em 0.6em 0em;
84
88
  height: 1.6em;
85
- font-size: 0.8 em;
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
-
@@ -61,3 +61,6 @@ $amber-primary: #fbab18 !default;
61
61
  $amber-secondary: #ffd54f !default;
62
62
  $amber-tertiary: #ffecb3 !default;
63
63
  $amber-quaternary: #fff7e1 !default;
64
+
65
+ /// Fonts
66
+ $font-small: 0.7em;
package/styles/base.scss CHANGED
@@ -77,20 +77,10 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
77
77
  @import 'series-list';
78
78
  @import 'typography';
79
79
 
80
- .editor-panel.cove {
81
- position: absolute;
82
- height: 100vh;
83
- top: 0;
84
- .editor-toggle {
85
- position: absolute !important;
86
- top: 10px !important;
87
- }
88
-
89
- .editor-panel {
90
- position: absolute !important;
91
- top: 0 !important;
92
- }
93
- }
80
+ // Force printing chart images
81
+ -webkit-print-color-adjust: exact !important; /* Chrome, Safari 6 – 15.3, Edge */
82
+ color-adjust: exact !important; /* Firefox 48 – 96 */
83
+ print-color-adjust: exact !important; /* Firefox 97+, Safari 15.4+ */
94
84
 
95
85
  $theme: (
96
86
  'amber': (
@@ -1,4 +1,4 @@
1
- //@import "reset"; TODO: Enable after cove refactor
1
+ // @import 'reset'; //TODO: Enable after cove refactor
2
2
  @import 'typography';
3
3
 
4
4
  @import 'general';
@@ -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,10 +19,13 @@ 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
25
27
  numTicks?: number
28
+ paddingPercent?: number
26
29
  rightAxisSize?: number
27
30
  rightHideAxis?: boolean
28
31
  rightHideLabel?: boolean
@@ -0,0 +1 @@
1
+ export type BaseVisualizationType = 'dashboard' | 'chart' | 'map' | 'data-bite' | 'waffle-chart' | 'markup-include' | 'filtered-text' | 'filter-dropdowns' | 'table' | 'navigation'
@@ -0,0 +1 @@
1
+ export type ConfidenceInterval = Record<'lower' | 'upper', number | string>
@@ -0,0 +1,8 @@
1
+ import { DataDescription } from './DataDescription'
2
+
3
+ export type ConfigureData = {
4
+ dataDescription: Partial<DataDescription>
5
+ data: Object[]
6
+ formattedData?: Object[]
7
+ dataKey: string // This is the key of the dataset in the config
8
+ }
@@ -0,0 +1,9 @@
1
+ export type DataDescription = {
2
+ series: boolean
3
+ horizontal: boolean
4
+ singleRow: boolean
5
+ seriesKey: string
6
+ xKey: string
7
+ valueKeysTallSupport: string[]
8
+ ignoredKeys: string[]
9
+ }
@@ -0,0 +1,18 @@
1
+ export type Legend = {
2
+ additionalCategories: string[]
3
+ // general legend onClick behavior
4
+ behavior: 'highlight' | 'isolate' | string
5
+ axisAlign: boolean
6
+ colorCode: string
7
+ description: string
8
+ // show or hide the legend
9
+ hide: boolean
10
+ highlightOnHover: boolean
11
+ label: string
12
+ lineMode: boolean
13
+ position: string
14
+ reverseLabelOrder: boolean
15
+ singleRow: boolean
16
+ type: string
17
+ verticalSorted: boolean
18
+ }
@@ -0,0 +1,10 @@
1
+ export type Region = {
2
+ from: string
3
+ to: string
4
+ label: string
5
+ color: string
6
+ background: string
7
+ range: 'Custom' | string
8
+ fromType: 'Fixed' | 'Previous Days'
9
+ toType: 'Fixed' | 'Last Date'
10
+ }
package/types/Runtime.ts CHANGED
@@ -26,4 +26,6 @@ export type Runtime = {
26
26
  seriesLabels: Record<string, any>
27
27
  seriesLabelsAll: string[]
28
28
  editorErrorMessage: string
29
+ lineSeriesKeys: any[]
30
+ horizontal: boolean
29
31
  }
package/types/Table.ts CHANGED
@@ -17,5 +17,6 @@ export type Table = {
17
17
  showDownloadPdfButton?: boolean
18
18
  downloadImageButton?: boolean
19
19
  downloadPdfButton?: boolean
20
- dateDisplayFormat: string
20
+ dateDisplayFormat?: string
21
+ fontSize: 'small' | 'medium' | 'large'
21
22
  }
@@ -1 +1 @@
1
- export type UpdateFieldFunc<T> = (section: string | null, subsection: string | null, fieldName: string, value: T) => void
1
+ export type UpdateFieldFunc<T> = (section: string | null, subsection: string | number | null, fieldName: string | number, value: T) => void
@@ -1,27 +1,36 @@
1
- export type Visualization = {
1
+ import { Legend } from './Legend'
2
+ import { Axis } from './Axis'
3
+ import { Column } from './Column'
4
+ import { Series } from './Series'
5
+ import { Table } from './Table'
6
+ import { ConfidenceInterval } from './ConfidenceInterval'
7
+ import { BaseVisualizationType } from './BaseVisualizationType'
8
+ import { ConfigureData } from './ConfigureData'
9
+
10
+ export type Visualization = ConfigureData & {
2
11
  autoLoad: boolean
3
- data: any
4
- dataDescription: Object
12
+ columns: Record<string, Column>
13
+ confidenceKeys: ConfidenceInterval
5
14
  dataFileName: string
6
15
  dataFileSourceType: string
7
- dataKey: string
16
+ dataFormat: any
8
17
  datasets: Record<string, any>
9
18
  editing: boolean
10
- formattedData?: Object[]
11
19
  general: any
12
20
  hide: any[]
21
+ legend: Legend
13
22
  multiDashboards?: any[]
14
23
  newViz: boolean
15
24
  openModal: boolean
16
25
  originalFormattedData: any
17
26
  orientation: 'vertical' | 'horizontal'
18
- table: {
19
- showDataTableLink: boolean
20
- }
27
+ series: Series
28
+ table: Table
21
29
  title: string
22
- type: 'dashboard' | 'chart' | 'map' | 'data-bite' | 'waffle-chart' | 'markup-include' | 'filtered-text' | 'filter-dropdowns'
23
- uid: string
30
+ type: BaseVisualizationType
31
+ uid: string // this is the actual key of the visualization object
24
32
  usesSharedFilter: any
25
33
  visualizationType: string
26
34
  visualizationSubType: string
35
+ xAxis: Axis
27
36
  }
@@ -1,7 +0,0 @@
1
- const SkipNav = skipId => (
2
- <a id='skip-nav' className='cdcdataviz-sr-only-focusable' href={`#${skipId}`}>
3
- Skip Navigation or Skip to Content
4
- </a>
5
- )
6
-
7
- export default SkipNav
@@ -1,9 +0,0 @@
1
- import { timeFormat, timeParse } from 'd3-time-format'
2
-
3
- export function formatDate(format = undefined, date) {
4
- return timeFormat(format)(date)
5
- }
6
-
7
- export function parseDate(format = undefined, dateString) {
8
- return timeParse(format)(dateString) || new Date()
9
- }
@@ -1,10 +0,0 @@
1
- const update_4_23 = async config => {
2
- const ver = 4.23
3
-
4
- let newConfig = { ...config }
5
-
6
- newConfig.validated = ver
7
- return newConfig
8
- }
9
-
10
- export default update_4_23