@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.
Files changed (147) hide show
  1. package/.claude/agents/qa-test-developer.md +126 -0
  2. package/CLAUDE.local.md +67 -0
  3. package/_stories/Gallery.Charts.stories.tsx +300 -0
  4. package/_stories/Gallery.DataBite.stories.tsx +79 -0
  5. package/_stories/Gallery.Maps.stories.tsx +239 -0
  6. package/_stories/Gallery.WaffleChart.stories.tsx +187 -0
  7. package/_stories/PageART.stories.tsx +193 -0
  8. package/_stories/PageBRFSS.stories.tsx +294 -0
  9. package/_stories/PageCancerRegistries.stories.tsx +199 -0
  10. package/_stories/PageEasternEquineEncephalitis.stories.tsx +216 -0
  11. package/_stories/PageExcessiveAlcoholUse.stories.tsx +201 -0
  12. package/_stories/PageMaternalMortality.stories.tsx +193 -0
  13. package/_stories/PageOralHealth.stories.tsx +201 -0
  14. package/_stories/PageRespiratory.stories.tsx +332 -0
  15. package/_stories/PageSmokingTobacco.stories.tsx +200 -0
  16. package/_stories/PageStateDiabetesProfiles.stories.tsx +201 -0
  17. package/_stories/PageWastewater.stories.tsx +477 -0
  18. package/_stories/VegaImport.stories.tsx +401 -0
  19. package/_stories/vega-fixtures/bars-with-line.json +444 -0
  20. package/_stories/vega-fixtures/bars.json +58 -0
  21. package/_stories/vega-fixtures/combo-bar-rolling-mean.json +88 -0
  22. package/_stories/vega-fixtures/combo.json +68 -0
  23. package/_stories/vega-fixtures/grouped-horizontal-bars.json +83 -0
  24. package/_stories/vega-fixtures/grouped-horizontal-bars2.json +231 -0
  25. package/_stories/vega-fixtures/horizontal-bar.json +427 -0
  26. package/_stories/vega-fixtures/horizontal-bars-with-bad-colors.json +197 -0
  27. package/_stories/vega-fixtures/horizontal-bars2.json +58 -0
  28. package/_stories/vega-fixtures/lines.json +227 -0
  29. package/_stories/vega-fixtures/measles-bars.json +348 -0
  30. package/_stories/vega-fixtures/measles-map.json +11101 -0
  31. package/_stories/vega-fixtures/measles-stacked-bars.json +2147 -0
  32. package/_stories/vega-fixtures/multi-dataset.json +255 -0
  33. package/_stories/vega-fixtures/no-data.json +14 -0
  34. package/_stories/vega-fixtures/pie-chart.json +94 -0
  35. package/_stories/vega-fixtures/repeat-spec.json +47 -0
  36. package/_stories/vega-fixtures/stacked-area.json +222 -0
  37. package/_stories/vega-fixtures/stacked-bar-with-rect.json +3412 -0
  38. package/_stories/vega-fixtures/stacked-bars-with-line.json +364 -0
  39. package/_stories/vega-fixtures/stacked-bars.json +212 -0
  40. package/_stories/vega-fixtures/stacked-horizontal-bars.json +140 -0
  41. package/_stories/vega-fixtures/warning-combo.json +59 -0
  42. package/_stories/vega-fixtures/warning-scatter-and-line.json +1182 -0
  43. package/assets/icon-chart-area.svg +1 -0
  44. package/assets/icon-chart-radar.svg +23 -0
  45. package/assets/icon-magnifying-glass.svg +5 -0
  46. package/assets/icon-warming-stripes.svg +13 -0
  47. package/assets/logo2.svg +31 -0
  48. package/components/AdvancedEditor/AdvancedEditor.tsx +4 -0
  49. package/components/AdvancedEditor/EmbedEditor.tsx +513 -0
  50. package/components/ComboBox/ComboBox.tsx +345 -0
  51. package/components/ComboBox/combobox.styles.css +185 -0
  52. package/components/ComboBox/index.ts +1 -0
  53. package/components/CustomColorsEditor/CustomColorsEditor.tsx +3 -10
  54. package/components/DataTable/DataTable.tsx +132 -58
  55. package/components/DataTable/data-table.css +216 -215
  56. package/components/DataTable/helpers/getSeriesName.ts +6 -0
  57. package/components/DataTable/helpers/mapCellMatrix.tsx +14 -6
  58. package/components/EditorPanel/ColumnsEditor.tsx +37 -19
  59. package/components/EditorPanel/DataTableEditor.tsx +51 -25
  60. package/components/EditorPanel/EditorPanel.styles.css +16 -0
  61. package/components/EditorPanel/EditorPanel.tsx +144 -0
  62. package/components/EditorPanel/EditorPanelDispatch.tsx +75 -0
  63. package/components/EditorPanel/FieldSetWrapper.tsx +66 -23
  64. package/components/EditorPanel/Inputs.tsx +33 -7
  65. package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +14 -6
  66. package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +240 -175
  67. package/components/EditorPanel/VizFilterEditor/components/FilterOrder.tsx +33 -29
  68. package/components/EditorPanel/sections/VisualSection.tsx +169 -0
  69. package/components/Filters/Filters.tsx +31 -5
  70. package/components/Filters/helpers/getNestedOptions.ts +2 -1
  71. package/components/Filters/helpers/handleSorting.ts +1 -1
  72. package/components/Layout/components/Sidebar/components/sidebar.styles.scss +84 -2
  73. package/components/Layout/components/Visualization/index.tsx +27 -1
  74. package/components/Layout/components/Visualization/visualizations.scss +7 -0
  75. package/components/Legend/Legend.Gradient.tsx +1 -1
  76. package/components/MediaControls.tsx +53 -28
  77. package/components/_stories/CustomColorsEditor.stories.tsx +37 -0
  78. package/components/_stories/DataTable.stories.tsx +1 -0
  79. package/components/ui/Icon.tsx +3 -1
  80. package/components/ui/Title/index.tsx +30 -2
  81. package/components/ui/Title/title.styles.css +42 -0
  82. package/data/colorPalettes.ts +18 -5
  83. package/data/mapColorPalettes.ts +10 -0
  84. package/devTemplate/dev.js +235 -0
  85. package/devTemplate/index.html +30 -0
  86. package/devTemplate/preview.html +1503 -0
  87. package/devTemplate/sidebar.css +151 -0
  88. package/dist/cove-main.css +2803 -4448
  89. package/dist/cove-main.css.map +1 -1
  90. package/generateViteConfig.js +118 -2
  91. package/helpers/DataTransform.ts +1 -5
  92. package/helpers/addValuesToFilters.ts +6 -1
  93. package/helpers/cove/date.ts +33 -1
  94. package/helpers/cove/string.ts +29 -0
  95. package/helpers/coveUpdateWorker.ts +21 -12
  96. package/helpers/embed/embedCodeGenerator.ts +80 -0
  97. package/helpers/embed/embedHelper.js +158 -0
  98. package/helpers/embed/filterUtils.ts +121 -0
  99. package/helpers/embed/index.ts +21 -0
  100. package/helpers/embed/urlValidation.ts +119 -0
  101. package/helpers/filterVizData.ts +6 -1
  102. package/helpers/getFileExtension.ts +0 -6
  103. package/helpers/getUniqueValues.ts +19 -0
  104. package/helpers/hashObj.ts +25 -0
  105. package/helpers/isRightAlignedTableValue.js +5 -0
  106. package/helpers/metrics/helpers.ts +1 -0
  107. package/helpers/metrics/types.ts +3 -0
  108. package/helpers/palettes/colorDistributions.ts +1 -1
  109. package/helpers/palettes/utils.ts +12 -12
  110. package/helpers/parseCsvWithQuotes.ts +15 -14
  111. package/helpers/pivotData.ts +2 -2
  112. package/helpers/prepareScreenshot.ts +288 -0
  113. package/helpers/queryStringUtils.ts +29 -0
  114. package/helpers/testing.ts +44 -0
  115. package/helpers/tests/DataTransform.test.ts +125 -0
  116. package/helpers/tests/date.test.ts +64 -0
  117. package/helpers/tests/prepareScreenshot.test.ts +414 -0
  118. package/helpers/tests/queryStringUtils.test.ts +381 -0
  119. package/helpers/tests/testStandaloneBuild.ts +23 -5
  120. package/helpers/useDataVizClasses.ts +0 -1
  121. package/helpers/vegaConfig.ts +1 -1
  122. package/helpers/vegaConfigImport.ts +160 -0
  123. package/helpers/ver/4.26.1.ts +80 -0
  124. package/helpers/ver/4.26.2.ts +84 -0
  125. package/helpers/ver/tests/4.26.1.test.ts +105 -0
  126. package/helpers/ver/tests/4.26.2.test.ts +298 -0
  127. package/helpers/viewports.ts +2 -0
  128. package/hooks/useDataColumns.ts +63 -0
  129. package/hooks/useFilterManagement.ts +94 -0
  130. package/hooks/useLegendSeparators.ts +26 -0
  131. package/hooks/useListManagement.ts +192 -0
  132. package/package.json +29 -33
  133. package/styles/_button-section.scss +0 -3
  134. package/styles/v2/components/editor.scss +9 -9
  135. package/styles/v2/utils/_grid.scss +8 -3
  136. package/types/Annotation.ts +10 -11
  137. package/types/Axis.ts +1 -0
  138. package/types/ForecastingSeriesKey.ts +1 -0
  139. package/types/General.ts +2 -0
  140. package/types/MarkupInclude.ts +1 -0
  141. package/types/Palette.ts +21 -0
  142. package/types/Series.ts +3 -0
  143. package/types/Table.ts +1 -0
  144. package/types/Visualization.ts +7 -0
  145. package/types/VizFilter.ts +1 -0
  146. package/LICENSE +0 -201
  147. package/_stories/StoryRenderingTests.stories.tsx +0 -164
@@ -0,0 +1,192 @@
1
+ import { useCallback } from 'react'
2
+
3
+ export interface UseListManagementOptions<TItem> {
4
+ /** Config object containing the list */
5
+ config: any
6
+ /** Function to update entire config */
7
+ updateConfig: (config: any) => void
8
+ /** Path to the list in config (e.g., 'items' or 'imageData.options') */
9
+ listPath: string
10
+ /** Factory function to create new items */
11
+ createItem: () => TItem
12
+ }
13
+
14
+ /**
15
+ * Hook for managing dynamic lists in EditorPanel configs
16
+ *
17
+ * Standardizes add/remove/update operations for dynamic arrays,
18
+ * eliminating the need for repetitive boilerplate code.
19
+ *
20
+ * @example
21
+ * // Basic usage
22
+ * const { items, add, remove, update } = useListManagement({
23
+ * config,
24
+ * updateConfig,
25
+ * listPath: 'imageData.options',
26
+ * createItem: () => ({ source: '', alt: '' })
27
+ * })
28
+ *
29
+ * @example
30
+ * // Usage in render
31
+ * {items.map((image, index) => (
32
+ * <div key={index}>
33
+ * <button onClick={() => remove(index)}>Remove</button>
34
+ * <input
35
+ * value={image.source}
36
+ * onChange={e => updateField(index, 'source', e.target.value)}
37
+ * />
38
+ * </div>
39
+ * ))}
40
+ * <button onClick={add}>Add Image</button>
41
+ */
42
+ export const useListManagement = <TItem = any>({
43
+ config,
44
+ updateConfig,
45
+ listPath,
46
+ createItem
47
+ }: UseListManagementOptions<TItem>) => {
48
+ /**
49
+ * Parse nested path (e.g., 'imageData.options' → config.imageData.options)
50
+ */
51
+ const getList = useCallback((): TItem[] => {
52
+ const parts = listPath.split('.')
53
+ let current = config
54
+ for (const part of parts) {
55
+ current = current?.[part]
56
+ }
57
+ return current || []
58
+ }, [config, listPath])
59
+
60
+ /**
61
+ * Update list at nested path
62
+ */
63
+ const setList = useCallback(
64
+ (newList: TItem[]) => {
65
+ const parts = listPath.split('.')
66
+ if (parts.length === 1) {
67
+ // Simple top-level path
68
+ updateConfig({ ...config, [parts[0]]: newList })
69
+ } else {
70
+ // Nested path - need to reconstruct nested structure
71
+ const updated = { ...config }
72
+ let current = updated
73
+ for (let i = 0; i < parts.length - 1; i++) {
74
+ current[parts[i]] = { ...current[parts[i]] }
75
+ current = current[parts[i]]
76
+ }
77
+ current[parts[parts.length - 1]] = newList
78
+ updateConfig(updated)
79
+ }
80
+ },
81
+ [config, updateConfig, listPath]
82
+ )
83
+
84
+ /**
85
+ * Add a new item to the list
86
+ */
87
+ const add = useCallback(() => {
88
+ const list = getList()
89
+ setList([...list, createItem()])
90
+ }, [getList, setList, createItem])
91
+
92
+ /**
93
+ * Remove an item at the specified index
94
+ */
95
+ const remove = useCallback(
96
+ (index: number) => {
97
+ const list = getList()
98
+ setList(list.filter((_, i) => i !== index))
99
+ },
100
+ [getList, setList]
101
+ )
102
+
103
+ /**
104
+ * Update an item with partial changes
105
+ */
106
+ const update = useCallback(
107
+ (index: number, partial: Partial<TItem>) => {
108
+ const list = getList()
109
+ const updated = [...list]
110
+ updated[index] = { ...updated[index], ...partial }
111
+ setList(updated)
112
+ },
113
+ [getList, setList]
114
+ )
115
+
116
+ /**
117
+ * Update a specific field of an item
118
+ */
119
+ const updateField = useCallback(
120
+ (index: number, field: keyof TItem, value: any) => {
121
+ const list = getList()
122
+ const updated = [...list]
123
+ updated[index] = { ...updated[index], [field]: value }
124
+ setList(updated)
125
+ },
126
+ [getList, setList]
127
+ )
128
+
129
+ /**
130
+ * Update a nested field within an array field
131
+ * Useful for imageData.options[i].arguments[j].threshold patterns
132
+ */
133
+ const updateNested = useCallback(
134
+ (index: number, field: keyof TItem, nestedIndex: number, nestedField: string, value: any) => {
135
+ const list = getList()
136
+ const updated = [...list]
137
+ const item = { ...updated[index] }
138
+ const nestedArray = [...(item[field] as any)]
139
+ nestedArray[nestedIndex] = { ...nestedArray[nestedIndex], [nestedField]: value }
140
+ item[field] = nestedArray as any
141
+ updated[index] = item
142
+ setList(updated)
143
+ },
144
+ [getList, setList]
145
+ )
146
+
147
+ /**
148
+ * Replace entire item at index
149
+ */
150
+ const replace = useCallback(
151
+ (index: number, item: TItem) => {
152
+ const list = getList()
153
+ const updated = [...list]
154
+ updated[index] = item
155
+ setList(updated)
156
+ },
157
+ [getList, setList]
158
+ )
159
+
160
+ /**
161
+ * Move an item from one index to another (for drag-and-drop)
162
+ */
163
+ const move = useCallback(
164
+ (fromIndex: number, toIndex: number) => {
165
+ const list = getList()
166
+ const updated = [...list]
167
+ const [removed] = updated.splice(fromIndex, 1)
168
+ updated.splice(toIndex, 0, removed)
169
+ setList(updated)
170
+ },
171
+ [getList, setList]
172
+ )
173
+
174
+ return {
175
+ /** Current list items */
176
+ items: getList(),
177
+ /** Add a new item to the end of the list */
178
+ add,
179
+ /** Remove an item at index */
180
+ remove,
181
+ /** Update item with partial changes */
182
+ update,
183
+ /** Update a specific field of an item */
184
+ updateField,
185
+ /** Update nested array field (e.g., item.arguments[i].threshold) */
186
+ updateNested,
187
+ /** Replace entire item at index */
188
+ replace,
189
+ /** Move item from one index to another */
190
+ move
191
+ }
192
+ }
package/package.json CHANGED
@@ -1,53 +1,49 @@
1
1
  {
2
2
  "name": "@cdc/core",
3
- "version": "4.25.11",
3
+ "version": "4.26.2",
4
4
  "description": "Core components, styles, hooks, and helpers, for the CDC Open Visualization project",
5
- "moduleName": "CdcCore",
6
- "main": "dist/cdccore",
7
- "type": "module",
8
- "scripts": {
9
- "test": "vitest run --environment jsdom --reporter verbose",
10
- "test-watch": "vitest watch --reporter verbose",
11
- "test-watch:ui": "vitest --ui",
12
- "build": "sass styles/cove-main.scss dist/cove-main.css"
13
- },
14
- "repository": {
15
- "type": "git",
16
- "url": "git+https://github.com/CDCgov/cdc-open-viz.git"
17
- },
18
- "author": "Rob Shelnutt <rob@blackairplane.com>",
19
- "homepage": "https://github.com/CDCgov/cdc-open-viz#readme",
20
- "bugs": {
21
- "url": "https://github.com/CDCgov/cdc-open-viz/issues"
22
- },
23
5
  "license": "Apache-2.0",
6
+ "author": "Rob Shelnutt <rob@blackairplane.com>",
7
+ "bugs": "https://github.com/CDCgov/cdc-open-viz/issues",
24
8
  "dependencies": {
25
- "chroma-js": "3.1.2",
26
- "dompurify": "^3.2.4",
27
- "html-react-parser": "5.2.3",
9
+ "@hello-pangea/dnd": "^16.2.0",
10
+ "chroma-js": "^3.1.2",
11
+ "dompurify": "^3.3.1",
12
+ "html-react-parser": "^5.2.3",
28
13
  "html2canvas": "^1.4.1",
29
14
  "json-edit-react": "^1.27.0",
30
- "papaparse": "5.5.2",
15
+ "papaparse": "^5.5.2",
31
16
  "prop-types": "^15.8.1",
32
17
  "react-accessible-accordion": "^5.0.1",
33
18
  "react-select": "^5.3.1",
34
19
  "react-tooltip": "5.8.2-beta.3",
35
20
  "resize-observer-polyfill": "^1.5.1",
36
- "use-debounce": "^10.0.5",
21
+ "use-debounce": "^10.1.0",
37
22
  "vega": "^6.1.0",
38
23
  "vega-lite": "^6.1.0"
39
24
  },
40
- "peerDependencies": {
41
- "react": "^18.2.0",
42
- "react-dom": "^18.2.0"
43
- },
44
- "gitHead": "5f09a137c22f454111ab5f4cd7fdf1d2d58e31bd",
45
25
  "devDependencies": {
46
26
  "@rollup/plugin-dsv": "^3.0.2",
47
- "@vitejs/plugin-react": "^4.3.4",
27
+ "@vitejs/plugin-react": "^5.1.2",
48
28
  "sass": "^1.89.2",
49
- "vite": "^5.4.21",
29
+ "vite": "^7.3.1",
50
30
  "vite-plugin-css-injected-by-js": "^2.4.0",
51
- "vite-plugin-svgr": "^2.4.0"
52
- }
31
+ "vite-plugin-svgr": "^4.2.0"
32
+ },
33
+ "gitHead": "be3413e8e1149abf94225108f86a7910f56e0616",
34
+ "homepage": "https://github.com/CDCgov/cdc-open-viz#readme",
35
+ "main": "dist/cdccore",
36
+ "moduleName": "CdcCore",
37
+ "peerDependencies": {
38
+ "react": "^18.2.0",
39
+ "react-dom": "^18.2.0"
40
+ },
41
+ "repository": "CDCgov/cdc-open-viz.git",
42
+ "scripts": {
43
+ "build": "sass styles/cove-main.scss dist/cove-main.css",
44
+ "test": "vitest run --environment jsdom --reporter verbose",
45
+ "test-watch": "vitest watch --reporter verbose",
46
+ "test-watch:ui": "vitest --ui"
47
+ },
48
+ "type": "module"
53
49
  }
@@ -16,9 +16,6 @@
16
16
  .download-links {
17
17
  justify-content: flex-end;
18
18
  line-height: 1;
19
- &.brush-active {
20
- margin-top: 2em;
21
- }
22
19
  a:not(:last-child) {
23
20
  margin-right: 10px;
24
21
  }
@@ -93,7 +93,7 @@
93
93
  margin-top: 1em;
94
94
  justify-content: space-between;
95
95
 
96
- >label {
96
+ > label {
97
97
  width: 48%;
98
98
  margin-top: 0 !important;
99
99
  }
@@ -130,7 +130,7 @@
130
130
  cursor: pointer;
131
131
  }
132
132
 
133
- +li {
133
+ + li {
134
134
  border-top: $lightGray 1px solid;
135
135
  }
136
136
  }
@@ -189,7 +189,7 @@
189
189
  display: flex;
190
190
  justify-content: space-between;
191
191
 
192
- >label {
192
+ > label {
193
193
  margin-top: 0;
194
194
  width: 30%;
195
195
  display: inline-block;
@@ -237,7 +237,7 @@
237
237
  margin-top: 0;
238
238
  }
239
239
 
240
- label+label {
240
+ label + label {
241
241
  margin-top: 1em;
242
242
  }
243
243
 
@@ -256,13 +256,13 @@
256
256
 
257
257
  .sort-list {
258
258
  list-style: none;
259
+ padding: 0;
259
260
 
260
- >li {
261
- margin-right: 0.3em;
261
+ > li {
262
262
  margin-bottom: 0.3em;
263
263
  }
264
264
 
265
- li>div {
265
+ li > div {
266
266
  display: block;
267
267
  box-sizing: border-box;
268
268
  border: 1px solid #d1d1d1;
@@ -270,8 +270,8 @@
270
270
  background: #f1f1f1;
271
271
  padding: 0.4em 0.6em;
272
272
  font-size: 0.8em;
273
- margin-bottom: 0.3em;
274
273
  cursor: move;
274
+ width: 100%;
275
275
  }
276
276
  }
277
277
 
@@ -491,4 +491,4 @@ ul.color-palette {
491
491
  // CheckBox component styling for EditorPanel/Inputs
492
492
  .edit-checkbox {
493
493
  margin-right: 8px;
494
- }
494
+ }
@@ -3,18 +3,21 @@ $grid-gap-max: 64;
3
3
  $grid-columns: 12;
4
4
 
5
5
  @mixin create-grid-selectors($breakpoint: null) {
6
- $infix: if($breakpoint == null, '', '-#{$breakpoint}');
6
+ $infix: if(sass($breakpoint ==null): ""; else: "-#{$breakpoint}");
7
7
 
8
8
  @for $i from 1 through $grid-columns {
9
9
  .col#{$infix}-#{$i} {
10
10
  grid-column-end: span $i;
11
11
  }
12
+
12
13
  .col-offset#{$infix}-#{$i} {
13
14
  grid-column-start: $i + 1;
14
15
  }
16
+
15
17
  .row#{$infix}-#{$i} {
16
18
  grid-row-end: span $i;
17
19
  }
20
+
18
21
  .row-offset#{$infix}-#{$i} {
19
22
  grid-row-start: $i + 1;
20
23
  }
@@ -23,11 +26,13 @@ $grid-columns: 12;
23
26
 
24
27
  @mixin grid-gaps() {
25
28
  $i: 0;
26
- @while ($i * $grid-gap-offset) <= $grid-gap-max {
29
+
30
+ @while ($i * $grid-gap-offset) <=$grid-gap-max {
27
31
  .grid-gap-#{$i} {
28
32
  grid-gap: #{($i * $grid-gap-offset) + 'px'};
29
33
  gap: #{($i * $grid-gap-offset) + 'px'};
30
34
  }
35
+
31
36
  $i: $i + 1;
32
37
  }
33
38
  }
@@ -44,4 +49,4 @@ $grid-columns: 12;
44
49
  @media (min-width: $width) {
45
50
  @include create-grid-selectors($breakpoint);
46
51
  }
47
- }
52
+ }
@@ -1,4 +1,7 @@
1
1
  export type Annotation = {
2
+ // Positioning mode: fixed uses x/y percentages, data anchors to data point
3
+ anchorMode?: 'fixed' | 'data'
4
+
2
5
  // background opacity of annotation
3
6
  opacity: number
4
7
  // HTML text string to display in annotation
@@ -15,26 +18,22 @@ export type Annotation = {
15
18
  horizontal: boolean
16
19
  vertical: boolean
17
20
  }
18
- // x value for scaling
19
- xKey: string
20
- // y value for scaling
21
- yKey: string
22
- // orignal x value of subject
23
- originalX: number
24
- // x of subject
21
+ // Data X value for data-anchored mode (timestamp, category, etc.)
22
+ dataX?: any
23
+ // x of subject (percentage 0-100)
25
24
  x: number
26
- // y of object
25
+ // y of object (percentage 0-100)
27
26
  y: number
28
27
  // x offset of label from subject
29
28
  dx: number
30
29
  // y offset of label from subject
31
30
  dy: number
32
31
  // assigned series that the annotation should snap to
33
- seriesKey: string
34
- // if the dragged item should be snapped to the nearest point
35
- snapToNearestPoint: boolean
32
+ seriesKey?: string
36
33
  // type of connecting line from label to subject
37
34
  connectionType: 'line' | 'curve' | 'elbow' | 'none'
35
+ // curve control point offset for curve connection type
36
+ bezier?: number
38
37
  // marker type highlighting the subject
39
38
  marker: 'arrow' | 'circle'
40
39
  // should the item be snapped to the subject?
package/types/Axis.ts CHANGED
@@ -52,4 +52,5 @@ export type Axis = {
52
52
  maxValue: string
53
53
  sortByRecentDate: boolean
54
54
  brushActive: boolean
55
+ brushDefaultRecentDateCount?: number
55
56
  }
@@ -6,6 +6,7 @@ export type ForecastingSeriesKey = {
6
6
  confidenceIntervals: {
7
7
  high: string
8
8
  low: string
9
+ showInTooltip?: boolean
9
10
  }[]
10
11
  stageColumn: string
11
12
  stages: {
package/types/General.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BoxPlot } from './BoxPlot'
2
+ import { Palette } from './Palette'
2
3
 
3
4
  export type General = {
4
5
  boxplot: BoxPlot
@@ -12,4 +13,5 @@ export type General = {
12
13
  hideNullValue: boolean
13
14
  title: string
14
15
  annotationDropdownText?: string
16
+ palette?: Palette
15
17
  }
@@ -14,6 +14,7 @@ export type MarkupIncludeConfig = Visualization & {
14
14
  noDataMessageText?: string
15
15
  srcUrl: string
16
16
  title: string
17
+ titleStyle?: 'legacy' | 'large' | 'small'
17
18
  useInlineHTML: boolean
18
19
  }
19
20
  data?: Object[]
@@ -0,0 +1,21 @@
1
+ export type PaletteVersion = '1.0' | '2.0'
2
+
3
+ export type PaletteBackup = {
4
+ name: string
5
+ type?: 'twoColor' | 'primary'
6
+ version?: PaletteVersion
7
+ isReversed?: boolean
8
+ }
9
+
10
+ export type Palette = {
11
+ name?: string
12
+ customColors?: string[]
13
+ version?: PaletteVersion
14
+ isReversed?: boolean
15
+ backups?: PaletteBackup[]
16
+ }
17
+
18
+ export type TwoColorConfig = {
19
+ palette?: string
20
+ isPaletteReversed?: boolean
21
+ }
package/types/Series.ts CHANGED
@@ -8,5 +8,8 @@ export type Series = {
8
8
  confidenceIntervals?: {
9
9
  high: string
10
10
  low: string
11
+ showInTooltip?: boolean
11
12
  }[]
13
+ stageColumn?: string
14
+ originalDataKey?: string
12
15
  }[]
package/types/Table.ts CHANGED
@@ -17,6 +17,7 @@ export type Table = {
17
17
  expanded?: boolean
18
18
  groupBy?: string
19
19
  height?: number
20
+ includeContextInDownload?: boolean
20
21
  indexLabel?: string
21
22
  label?: string
22
23
  limitHeight?: boolean
@@ -11,6 +11,7 @@ import { General } from './General'
11
11
  import { Runtime } from './Runtime'
12
12
  import { DashboardFilters } from '@cdc/dashboard/src/types/DashboardFilters'
13
13
  import Footnotes from './Footnotes'
14
+ import { TwoColorConfig } from './Palette'
14
15
 
15
16
  // This was originally created as a catchall for the different types of visualizations.
16
17
  // Currently it includes properties that ares specific to one Visualization type.
@@ -37,12 +38,18 @@ type DeprecatedVisualizationType = {
37
38
  table: Table
38
39
  theme: string
39
40
  title: string
41
+ titleStyle: 'legacy' | 'large' | 'small'
40
42
  type: 'chart' | 'map' | 'data-bite' | 'waffle-chart' | 'markup-include' | 'filtered-text' | 'table' | 'navigation'
41
43
  usesSharedFilter?: any
42
44
  visualizationSubType: string
43
45
  visualizationType: string
44
46
  xAxis: Axis
45
47
  preliminaryData: { type: 'effect' | 'suppression'; value: string }[]
48
+ twoColor?: TwoColorConfig
49
+ /** @deprecated Legacy v1 palette name - use general.palette.name instead */
50
+ palette?: string
51
+ /** @deprecated Legacy v1 color name - use general.palette.name instead */
52
+ color?: string
46
53
  }
47
54
 
48
55
  type StatefulProperties = {
@@ -18,6 +18,7 @@ export type VizFilterStyle =
18
18
  | 'dropdown bar'
19
19
  | 'multi-select'
20
20
  | 'nested-dropdown'
21
+ | 'combobox'
21
22
  export type GeneralFilter = FilterBase & {
22
23
  active: string
23
24
  queuedActive: string | string[]