@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.
- package/dist/cdcwafflechart.js +8693 -7876
- package/package.json +12 -4
- package/src/CdcWaffleChart.tsx +9 -25
- package/src/_stories/WaffleChart.Editor.stories.tsx +744 -0
- package/src/_stories/WaffleChart.stories.tsx +19 -2
- package/src/components/EditorPanel.jsx +93 -181
- package/src/index.jsx +0 -1
- package/src/scss/main.scss +2 -12
- package/src/scss/waffle-chart.scss +10 -24
- package/src/store/chart.reducer.ts +1 -1
- package/src/test/CdcWaffleChart.test.jsx +8 -3
- package/tests/fixtures/example-data.json +50 -0
- package/tests/fixtures/test-config.json +41 -0
- package/vite.config.js +1 -1
- package/src/coreStyles_wafflechart.scss +0 -3
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
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('
|
|
4
|
-
|
|
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