@cdc/data-bite 4.23.5 → 4.23.6
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/cdcdatabite.js +4488 -4512
- package/package.json +3 -3
- package/src/CdcDataBite.jsx +19 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/data-bite",
|
|
3
|
-
"version": "4.23.
|
|
3
|
+
"version": "4.23.6",
|
|
4
4
|
"description": "React component for displaying a single piece of data in a card module",
|
|
5
5
|
"moduleName": "CdcDataBite",
|
|
6
6
|
"main": "dist/cdcdatabite",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"homepage": "https://github.com/CDCgov/cdc-open-viz#readme",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@cdc/core": "^4.23.
|
|
29
|
+
"@cdc/core": "^4.23.6",
|
|
30
30
|
"chroma": "0.0.1",
|
|
31
31
|
"chroma-js": "^2.1.0",
|
|
32
32
|
"html-react-parser": "^3.0.8",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"react": "^18.2.0",
|
|
40
40
|
"react-dom": "^18.2.0"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "aaed0388b487adfeb3e7e278b4ce74df09cbaade"
|
|
43
43
|
}
|
package/src/CdcDataBite.jsx
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
import React, { useEffect, useState, useCallback } from 'react'
|
|
2
|
-
import
|
|
2
|
+
import { Fragment } from 'react'
|
|
3
|
+
|
|
4
|
+
// contexts & initial state
|
|
3
5
|
import defaults from './data/initial-state'
|
|
6
|
+
import Context from './context'
|
|
7
|
+
|
|
8
|
+
// internal components
|
|
9
|
+
import EditorPanel from './components/EditorPanel'
|
|
4
10
|
import Loading from '@cdc/core/components/Loading'
|
|
5
|
-
import
|
|
11
|
+
import CircleCallout from './components/CircleCallout'
|
|
12
|
+
|
|
13
|
+
// external
|
|
6
14
|
import ResizeObserver from 'resize-observer-polyfill'
|
|
7
15
|
import parse from 'html-react-parser'
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
// helpers
|
|
18
|
+
import getViewport from '@cdc/core/helpers/getViewport'
|
|
10
19
|
import { DataTransform } from '@cdc/core/helpers/DataTransform'
|
|
11
|
-
import CircleCallout from './components/CircleCallout'
|
|
12
|
-
import './scss/main.scss'
|
|
13
20
|
import numberFromString from '@cdc/core/helpers/numberFromString'
|
|
14
21
|
import fetchRemoteData from '@cdc/core/helpers/fetchRemoteData'
|
|
15
|
-
import { Fragment } from 'react'
|
|
16
|
-
|
|
17
22
|
import { publish } from '@cdc/core/helpers/events'
|
|
18
23
|
import useDataVizClasses from '@cdc/core/helpers/useDataVizClasses'
|
|
19
24
|
import cacheBustingString from '@cdc/core/helpers/cacheBustingString'
|
|
25
|
+
import coveUpdateWorker from '@cdc/core/helpers/coveUpdateWorker'
|
|
26
|
+
|
|
27
|
+
// styles
|
|
28
|
+
import './scss/main.scss'
|
|
20
29
|
|
|
21
30
|
const CdcDataBite = props => {
|
|
22
31
|
const { configUrl, config: configObj, isDashboard = false, isEditor = false, setConfig: setParentConfig, link } = props
|
|
@@ -96,7 +105,9 @@ const CdcDataBite = props => {
|
|
|
96
105
|
|
|
97
106
|
response.data = responseData
|
|
98
107
|
|
|
99
|
-
|
|
108
|
+
const processedConfig = { ...(await coveUpdateWorker(response)) }
|
|
109
|
+
|
|
110
|
+
updateConfig({ ...defaults, ...processedConfig })
|
|
100
111
|
|
|
101
112
|
setLoading(false)
|
|
102
113
|
}
|