@cdc/data-bite 4.23.2 → 4.23.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdc/data-bite",
3
- "version": "4.23.2",
3
+ "version": "4.23.4",
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",
@@ -10,7 +10,9 @@
10
10
  "build": "vite build",
11
11
  "preview": "vite preview",
12
12
  "graph": "nx graph",
13
- "prepublishOnly": "lerna run --scope @cdc/data-bite build"
13
+ "prepublishOnly": "lerna run --scope @cdc/data-bite build",
14
+ "test": "vitest watch --reporter verbose",
15
+ "test:ui": "vitest --ui"
14
16
  },
15
17
  "repository": {
16
18
  "type": "git",
@@ -24,7 +26,7 @@
24
26
  "license": "Apache-2.0",
25
27
  "homepage": "https://github.com/CDCgov/cdc-open-viz#readme",
26
28
  "dependencies": {
27
- "@cdc/core": "^4.23.2",
29
+ "@cdc/core": "^4.23.4",
28
30
  "chroma": "0.0.1",
29
31
  "chroma-js": "^2.1.0",
30
32
  "html-react-parser": "^3.0.8",
@@ -37,5 +39,5 @@
37
39
  "react": "^18.2.0",
38
40
  "react-dom": "^18.2.0"
39
41
  },
40
- "gitHead": "cd4216f47b1c41bfbc1de3b704f70c52cc7293c2"
42
+ "gitHead": "dcd395d76f70b2d113f2b4c6fe50a52522655cd1"
41
43
  }
@@ -101,13 +101,13 @@ const CdcDataBite = props => {
101
101
  setLoading(false)
102
102
  }
103
103
 
104
- const calculateDataBite = (includePrefixSuffix= true) => {
104
+ const calculateDataBite = (includePrefixSuffix = true) => {
105
105
  //If either the column or function aren't set, do not calculate
106
106
  if (!dataColumn || !dataFunction) {
107
107
  return ''
108
108
  }
109
109
 
110
- const applyPrecision = (value) => {
110
+ const applyPrecision = value => {
111
111
  // first validation
112
112
  if (value === undefined || value === null) {
113
113
  console.error('Enter correct value to "applyPrecision()" function ')
@@ -132,7 +132,7 @@ const CdcDataBite = props => {
132
132
  }
133
133
 
134
134
  // filter null and 0 out from count data
135
- const getColumnCount = (arr) => {
135
+ const getColumnCount = arr => {
136
136
  if (config.dataFormat.ignoreZeros) {
137
137
  numericalData = numericalData.filter(item => item && item)
138
138
  return numericalData.length
@@ -141,14 +141,13 @@ const CdcDataBite = props => {
141
141
  }
142
142
  }
143
143
 
144
- const getColumnSum = (arr) => {
144
+ const getColumnSum = arr => {
145
145
  // first validation
146
146
  if (arr === undefined || arr === null) {
147
147
  console.error('Enter valid value for getColumnSum function ')
148
148
  return
149
149
  }
150
150
  // second validation
151
- console.log('arr', arr)
152
151
  if (arr.length === 0 || !Array.isArray(arr)) {
153
152
  console.error('Arguments are not valid getColumnSum function ')
154
153
  return
@@ -163,7 +162,7 @@ const CdcDataBite = props => {
163
162
  return applyPrecision(sum)
164
163
  }
165
164
 
166
- const getColumnMean = (arr) => {
165
+ const getColumnMean = arr => {
167
166
  // add default params to escape errors on runtime
168
167
  // first validation
169
168
  if (arr === undefined || arr === null || !Array.isArray(arr)) {
@@ -220,7 +219,7 @@ const CdcDataBite = props => {
220
219
  return applyPrecision(value)
221
220
  }
222
221
 
223
- const applyLocaleString = (value) => {
222
+ const applyLocaleString = value => {
224
223
  if (value === undefined || value === null) return
225
224
  if (Number.isNaN(value) || typeof value === 'number') {
226
225
  value = String(value)
@@ -0,0 +1,6 @@
1
+ // Placeholder test until we add them in.
2
+ describe('Data Bite', () => {
3
+ it('has a test.', async () => {
4
+ return true
5
+ })
6
+ })