@cdc/waffle-chart 4.25.8 → 4.25.11

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.
@@ -1,7 +1,7 @@
1
1
  import { Config } from '../types/Config'
2
2
  import ChartActions from './chart.actions'
3
3
 
4
- export type ChartState = {
4
+ type ChartState = {
5
5
  config?: Config
6
6
  container: any
7
7
  coveLoadedHasRan: boolean
@@ -1,6 +1,11 @@
1
- // Placeholder test until we add them in.
1
+ import path from 'path'
2
+ import { testStandaloneBuild } from '@cdc/core/helpers/tests/testStandaloneBuild.ts'
3
+ import { describe, it, expect } from 'vitest'
4
+
2
5
  describe('Waffle Chart', () => {
3
- it('has a test.', async () => {
4
- return true
6
+ it('Can be built in isolation', async () => {
7
+ const pkgDir = path.join(__dirname, '..')
8
+ const result = testStandaloneBuild(pkgDir)
9
+ expect(result).toBe(true)
5
10
  })
6
11
  })
@@ -0,0 +1,50 @@
1
+ [
2
+ {
3
+ "Deaths": "250",
4
+ "Total Overdoses": "600",
5
+ "state": "Alabama",
6
+ "Year": "2010"
7
+ },
8
+ {
9
+ "Deaths": "16",
10
+ "Total Overdoses": "80",
11
+ "state": "Alaska",
12
+ "Year": "2008"
13
+ },
14
+ {
15
+ "Deaths": "19",
16
+ "Total Overdoses": "100",
17
+ "state": "Alaska",
18
+ "Year": "2010"
19
+ },
20
+ {
21
+ "Deaths": "93",
22
+ "Total Overdoses": "400",
23
+ "state": "Alaska",
24
+ "Year": "2012"
25
+ },
26
+ {
27
+ "Deaths": "82",
28
+ "Total Overdoses": "400",
29
+ "state": "Arizona",
30
+ "Year": "2010"
31
+ },
32
+ {
33
+ "Deaths": "150",
34
+ "Total Overdoses": "350",
35
+ "state": "California",
36
+ "Year": "2010"
37
+ },
38
+ {
39
+ "Deaths": "45",
40
+ "Total Overdoses": "120",
41
+ "state": "Colorado",
42
+ "Year": "2010"
43
+ },
44
+ {
45
+ "Deaths": "33",
46
+ "Total Overdoses": "85",
47
+ "state": "Connecticut",
48
+ "Year": "2010"
49
+ }
50
+ ]
@@ -0,0 +1,41 @@
1
+ {
2
+ "type": "waffle-chart",
3
+ "dataUrl": "/packages/waffle-chart/tests/fixtures/example-data.json",
4
+ "shape": "person",
5
+ "title": "Test Waffle Chart Title",
6
+ "showTitle": true,
7
+ "content": "of overdoses resulted in death.",
8
+ "subtext": "This test data is for E2E testing",
9
+ "orientation": "horizontal",
10
+ "filters": [],
11
+ "fontSize": null,
12
+ "overallFontSize": "medium",
13
+ "dataColumn": "Deaths",
14
+ "dataFunction": "Sum",
15
+ "dataConditionalColumn": "",
16
+ "dataConditionalOperator": null,
17
+ "dataConditionalComparate": "",
18
+ "customDenom": true,
19
+ "dataDenom": null,
20
+ "dataDenomColumn": "Total Overdoses",
21
+ "dataDenomFunction": "Sum",
22
+ "prefix": "",
23
+ "suffix": "%",
24
+ "roundToPlace": 0,
25
+ "nodeWidth": 10,
26
+ "nodeSpacer": 2,
27
+ "theme": "theme-blue",
28
+ "visualizationType": "Waffle",
29
+ "visualizationSubType": "",
30
+ "invalidComparate": false,
31
+ "showDenominator": false,
32
+ "showPercent": true,
33
+ "valueDescription": "testing",
34
+ "visual": {
35
+ "border": true,
36
+ "accent": true,
37
+ "background": true,
38
+ "hideBackgroundColor": false,
39
+ "borderColorTheme": true
40
+ }
41
+ }
package/vite.config.js CHANGED
@@ -1,4 +1,4 @@
1
- import GenerateViteConfig from '../../generateViteConfig.js'
1
+ import GenerateViteConfig from '@cdc/core/generateViteConfig.js'
2
2
  import { moduleName } from './package.json'
3
3
 
4
4
  export default GenerateViteConfig(moduleName)
@@ -1,3 +0,0 @@
1
- @import '@cdc/core/styles/base';
2
- @import '@cdc/core/styles/heading-colors';
3
- @import '@cdc/core/styles/v2/themes/color-definitions';