@cdc/dashboard 4.25.6-2 → 4.25.7-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/dist/cdcdashboard.js +65154 -42764
- package/package.json +9 -9
- package/src/CdcDashboardComponent.tsx +11 -8
- package/src/components/Header/Header.tsx +2 -2
- package/src/components/VisualizationRow.tsx +324 -324
- package/src/helpers/getVizConfig.ts +1 -0
- package/src/helpers/getVizRowColumnLocator.ts +10 -10
- package/src/helpers/reloadURLHelpers.ts +124 -124
- package/src/store/dashboard.reducer.ts +288 -288
- package/src/types/ConfigRow.ts +19 -19
- package/src/types/Dashboard.ts +11 -11
- package/examples/private/DEV-10120.json +0 -1294
- package/examples/private/DEV-10527.json +0 -845
- package/examples/private/DEV-10586.json +0 -54319
- package/examples/private/DEV-10856.json +0 -54319
- package/examples/private/DEV-9199.json +0 -606
- package/examples/private/DEV-9644.json +0 -20092
- package/examples/private/DEV-9684.json +0 -2135
- package/examples/private/DEV-9932.json +0 -95
- package/examples/private/DEV-9989.json +0 -229
- package/examples/private/art-dashboard.json +0 -18174
- package/examples/private/art-scratch.json +0 -2406
- package/examples/private/bird-flu-2.json +0 -440
- package/examples/private/bird-flu.json +0 -413
- package/examples/private/crashing-sidebar.json +0 -975
- package/examples/private/d.json +0 -1561
- package/examples/private/dashboard-config-ehdi.json +0 -29915
- package/examples/private/dashboard-map-filter.json +0 -815
- package/examples/private/dashboard-margins.js +0 -15
- package/examples/private/dataset.json +0 -1452
- package/examples/private/dev-10856-2.json +0 -1348
- package/examples/private/ehdi-data.json +0 -29502
- package/examples/private/exposure-source-h5-data.csv +0 -26
- package/examples/private/fatal-data.csv +0 -3159
- package/examples/private/feelings.json +0 -1
- package/examples/private/gaza-issue.json +0 -1214
- package/examples/private/josh.json +0 -6175
- package/examples/private/map-issue.json +0 -628
- package/examples/private/markup.json +0 -115
- package/examples/private/mpox.json +0 -429
- package/examples/private/nhis.json +0 -1792
- package/examples/private/testing-pie.json +0 -436
- package/examples/private/workforce.json +0 -2041
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/dashboard",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.7-2",
|
|
4
4
|
"description": "React component for combining multiple visualizations into a single dashboard",
|
|
5
5
|
"moduleName": "CdcDashboard",
|
|
6
6
|
"main": "dist/cdcdashboard",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@cdc/chart": "^4.25.
|
|
31
|
-
"@cdc/core": "^4.25.
|
|
32
|
-
"@cdc/data-bite": "^4.25.
|
|
33
|
-
"@cdc/filtered-text": "^4.25.
|
|
34
|
-
"@cdc/map": "^4.25.
|
|
35
|
-
"@cdc/markup-include": "^4.25.
|
|
36
|
-
"@cdc/waffle-chart": "^4.25.
|
|
30
|
+
"@cdc/chart": "^4.25.7",
|
|
31
|
+
"@cdc/core": "^4.25.7",
|
|
32
|
+
"@cdc/data-bite": "^4.25.7",
|
|
33
|
+
"@cdc/filtered-text": "^4.25.7",
|
|
34
|
+
"@cdc/map": "^4.25.7-2",
|
|
35
|
+
"@cdc/markup-include": "^4.25.7",
|
|
36
|
+
"@cdc/waffle-chart": "^4.25.7",
|
|
37
37
|
"js-base64": "^2.5.2",
|
|
38
38
|
"react-accessible-accordion": "^3.3.4",
|
|
39
39
|
"react-dnd": "^14.0.2",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"react": "^18.2.0",
|
|
45
45
|
"react-dom": "^18.2.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "432a2d1acab22915fafe793cb9da1f10318ff793"
|
|
48
48
|
}
|
|
@@ -267,29 +267,32 @@ export default function CdcDashboard({ initialState, isEditor = false, isDebug =
|
|
|
267
267
|
dispatch({ type: 'SET_SHARED_FILTERS', payload: newConfig.dashboard.sharedFilters })
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
const setEventData = ({ detail }) => {
|
|
270
|
+
const setEventData = ({ detail }, data, filteredData) => {
|
|
271
|
+
// eslint-disable-next-line no-console
|
|
272
|
+
console.log('Event: cove_set_data', detail)
|
|
271
273
|
try {
|
|
272
274
|
const newDatasets = Object.keys(detail).reduce((acc, key) => {
|
|
273
|
-
if (
|
|
275
|
+
if (data[key] !== undefined) {
|
|
274
276
|
acc[key] = detail[key]
|
|
275
277
|
}
|
|
276
278
|
return acc
|
|
277
279
|
}, {})
|
|
278
|
-
const newConfig = { ...state, data: { ...
|
|
279
|
-
const newFilteredData = getFilteredData(newConfig, _.cloneDeep(
|
|
280
|
+
const newConfig = { ...state, data: { ...data, ...newDatasets } }
|
|
281
|
+
const newFilteredData = getFilteredData(newConfig, _.cloneDeep(filteredData))
|
|
280
282
|
dispatch({ type: 'SET_FILTERED_DATA', payload: newFilteredData })
|
|
281
|
-
dispatch({ type: 'SET_DATA', payload: { ...
|
|
283
|
+
dispatch({ type: 'SET_DATA', payload: { ...data, ...newDatasets } })
|
|
282
284
|
} catch (e) {
|
|
283
285
|
console.error('Error setting event data: ', e)
|
|
284
286
|
}
|
|
285
287
|
}
|
|
286
288
|
|
|
287
289
|
useEffect(() => {
|
|
288
|
-
|
|
290
|
+
const eventCallback = e => setEventData(e, state.data, state.filteredData)
|
|
291
|
+
subscribe('cove_set_data', eventCallback)
|
|
289
292
|
return () => {
|
|
290
|
-
unsubscribe('cove_set_data',
|
|
293
|
+
unsubscribe('cove_set_data', eventCallback)
|
|
291
294
|
}
|
|
292
|
-
}, [])
|
|
295
|
+
}, [state.data, state.filteredData])
|
|
293
296
|
|
|
294
297
|
useEffect(() => {
|
|
295
298
|
const { config } = state
|
|
@@ -17,7 +17,6 @@ const Header = (props: HeaderProps) => {
|
|
|
17
17
|
const tabs: Tab[] = ['Dashboard Description', 'Data Table Settings', 'Dashboard Preview']
|
|
18
18
|
const { visualizationKey, subEditor } = props
|
|
19
19
|
const { config, setParentConfig, tabSelected, data } = useContext(DashboardContext)
|
|
20
|
-
if (!config) return null
|
|
21
20
|
const dispatch = useContext(DashboardDispatchContext)
|
|
22
21
|
const back = () => {
|
|
23
22
|
if (!visualizationKey) return
|
|
@@ -80,8 +79,9 @@ const Header = (props: HeaderProps) => {
|
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
if (!config) return null
|
|
84
83
|
|
|
84
|
+
const multiInitialized = !!config.multiDashboards
|
|
85
85
|
return (
|
|
86
86
|
<div aria-level={2} role='heading' className={`editor-heading${subEditor ? ' sub-dashboard-viz' : ''}`}>
|
|
87
87
|
{subEditor ? (
|