@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
|
@@ -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.
|
|
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
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
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
|
|
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": "^
|
|
27
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
48
28
|
"sass": "^1.89.2",
|
|
49
|
-
"vite": "^
|
|
29
|
+
"vite": "^7.3.1",
|
|
50
30
|
"vite-plugin-css-injected-by-js": "^2.4.0",
|
|
51
|
-
"vite-plugin-svgr": "^2.
|
|
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
|
}
|
|
@@ -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 ==
|
|
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
|
-
|
|
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
|
+
}
|
package/types/Annotation.ts
CHANGED
|
@@ -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
|
-
//
|
|
19
|
-
|
|
20
|
-
//
|
|
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
|
|
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
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
|
}
|
package/types/MarkupInclude.ts
CHANGED
package/types/Palette.ts
ADDED
|
@@ -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
package/types/Table.ts
CHANGED
package/types/Visualization.ts
CHANGED
|
@@ -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 = {
|