@cdc/editor 1.4.3 → 9.22.9
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/cdceditor.js +70 -52
- package/example/private/map.csv +60 -0
- package/example/private/test.html +1 -0
- package/example/valid-data-map.csv +4 -3
- package/package.json +9 -9
- package/src/CdcEditor.js +84 -16
- package/src/components/ChooseTab.js +225 -85
- package/src/components/DataImport.js +289 -297
- package/src/scss/configure-tab.scss +4 -1
- package/src/scss/data-import.scss +32 -55
- package/src/scss/main.scss +16 -1
- package/src/assets/icons/dashboard.svg +0 -8
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
State,Activity Level,Funding Status,URL,
|
|
2
|
+
AL,Very High,*,https://www.cdc.gov/flu/,
|
|
3
|
+
AK,High,Current,https://www.cdc.gov/mmwr/,
|
|
4
|
+
AS,Moderate,Current,https://www.cdc.gov/flu/,
|
|
5
|
+
AZ,Low,Current,https://www.cdc.gov/flu/,
|
|
6
|
+
AR,Minimal,Current,https://www.cdc.gov/mmwr/,
|
|
7
|
+
CA,Very High,NA,https://www.cdc.gov/flu/,
|
|
8
|
+
CO,High,Current,https://www.cdc.gov/flu/,
|
|
9
|
+
CT,Moderate,Current,https://www.cdc.gov/mmwr/,
|
|
10
|
+
DE,Low,Current,https://www.cdc.gov/flu/,
|
|
11
|
+
DC,Minimal,Current,https://www.cdc.gov/flu/,
|
|
12
|
+
FL,Very High,Current,https://www.cdc.gov/mmwr/,
|
|
13
|
+
GA,High,Current,https://www.cdc.gov/flu/,
|
|
14
|
+
GU,Moderate,*,https://www.cdc.gov/flu/,
|
|
15
|
+
HI,Low,Current,https://www.cdc.gov/mmwr/,
|
|
16
|
+
ID,Minimal,Current,https://www.cdc.gov/flu/,
|
|
17
|
+
IL,Very High,Current,https://www.cdc.gov/flu/,
|
|
18
|
+
IN,High,Current,https://www.cdc.gov/mmwr/,
|
|
19
|
+
IA,Moderate,Current,https://www.cdc.gov/flu/,
|
|
20
|
+
KS,Low,Current,https://www.cdc.gov/flu/,
|
|
21
|
+
KY,Minimal,Current,https://www.cdc.gov/mmwr/,
|
|
22
|
+
LA,Very High,*,https://www.cdc.gov/flu/,
|
|
23
|
+
ME,High,Current,https://www.cdc.gov/flu/,
|
|
24
|
+
MH,Moderate,Current,https://www.cdc.gov/mmwr/,
|
|
25
|
+
MD,Low,Current,https://www.cdc.gov/flu/,
|
|
26
|
+
MA,Minimal,Current,https://www.cdc.gov/flu/,
|
|
27
|
+
MI,Very High,Current,https://www.cdc.gov/mmwr/,
|
|
28
|
+
FM,High,Current,https://www.cdc.gov/flu/,
|
|
29
|
+
MN,Moderate,NA,https://www.cdc.gov/flu/,
|
|
30
|
+
MS,Low,Current,https://www.cdc.gov/mmwr/,
|
|
31
|
+
MO,Minimal,Current,https://www.cdc.gov/flu/,
|
|
32
|
+
MT,Very High,Current,https://www.cdc.gov/flu/,
|
|
33
|
+
NE,High,Current,https://www.cdc.gov/mmwr/,
|
|
34
|
+
NV,Moderate,Current,https://www.cdc.gov/flu/,
|
|
35
|
+
NH,Low,Current,https://www.cdc.gov/flu/,
|
|
36
|
+
NJ,Minimal,Current,https://www.cdc.gov/mmwr/,
|
|
37
|
+
NM,Very High,NA,https://www.cdc.gov/flu/,
|
|
38
|
+
NY,High,Current,https://www.cdc.gov/flu/,
|
|
39
|
+
NC,Moderate,Current,https://www.cdc.gov/mmwr/,
|
|
40
|
+
ND,Low,Current,https://www.cdc.gov/flu/,
|
|
41
|
+
MP,Minimal,Current,https://www.cdc.gov/flu/,
|
|
42
|
+
OH,Very High,Current,https://www.cdc.gov/mmwr/,
|
|
43
|
+
OK,High,Current,https://www.cdc.gov/flu/,
|
|
44
|
+
OR,Moderate,Current,https://www.cdc.gov/flu/,
|
|
45
|
+
PW,Low,Current,https://www.cdc.gov/mmwr/,
|
|
46
|
+
PA,Minimal,Current,https://www.cdc.gov/flu/,
|
|
47
|
+
PR,Very High,Current,https://www.cdc.gov/flu/,
|
|
48
|
+
RI,High,Current,https://www.cdc.gov/mmwr/,
|
|
49
|
+
SC,Moderate,Current,https://www.cdc.gov/flu/,
|
|
50
|
+
SD,Low,Current,https://www.cdc.gov/flu/,
|
|
51
|
+
TN,Minimal,Current,https://www.cdc.gov/mmwr/,
|
|
52
|
+
TX,Very High,Current,https://www.cdc.gov/flu/,
|
|
53
|
+
UT,High,Current,https://www.cdc.gov/flu/,
|
|
54
|
+
VT,Moderate,Current,https://www.cdc.gov/mmwr/,
|
|
55
|
+
VI,Low,Current,https://www.cdc.gov/flu/,
|
|
56
|
+
VA,Minimal,Current,https://www.cdc.gov/flu/,
|
|
57
|
+
WA,Very High,Current,https://www.cdc.gov/mmwr/,
|
|
58
|
+
WV,High,Current,https://www.cdc.gov/flu/,
|
|
59
|
+
WI,Moderate,Current,https://www.cdc.gov/flu/,
|
|
60
|
+
WY,Low,Current,https://www.cdc.gov/mmwr/,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <h1>Header</h1> <p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.</p> <br> <p>Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. </p><br><p>She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek.</p></body></html>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
STATE,Rate,Location,URL
|
|
2
|
-
|
|
1
|
+
STATE,Rate,Location,URL
|
|
2
|
+
Overall,55,Vehicle,https://www.cdc.gov
|
|
3
|
+
Alabama,130,Vehicle,https://www.cdc.gov/
|
|
3
4
|
Alaska,40,Work,https://www.cdc.gov/
|
|
4
5
|
American Samoa,55,Home,https://www.cdc.gov/
|
|
5
6
|
Arizona,57,School,https://www.cdc.gov/
|
|
@@ -56,4 +57,4 @@ Virgin Islands,55,School,https://www.cdc.gov/
|
|
|
56
57
|
Virginia,57,School,https://www.cdc.gov/
|
|
57
58
|
Washington,62,Work,https://www.cdc.gov/
|
|
58
59
|
West Virginia,25,Vehicle,https://www.cdc.gov/
|
|
59
|
-
Wyoming,43,Vehicle,https://www.cdc.gov/
|
|
60
|
+
Wyoming,43,Vehicle,https://www.cdc.gov/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.22.9",
|
|
4
4
|
"main": "dist/cdceditor",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/CDCgov/cdc-open-viz/issues"
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.12.5",
|
|
21
|
-
"@cdc/chart": "^
|
|
22
|
-
"@cdc/core": "^
|
|
23
|
-
"@cdc/dashboard": "^
|
|
24
|
-
"@cdc/data-bite": "^
|
|
25
|
-
"@cdc/
|
|
26
|
-
"@cdc/markup-include": "^
|
|
27
|
-
"@cdc/
|
|
21
|
+
"@cdc/chart": "^9.22.9",
|
|
22
|
+
"@cdc/core": "^9.22.9",
|
|
23
|
+
"@cdc/dashboard": "^9.22.9",
|
|
24
|
+
"@cdc/data-bite": "^9.22.9",
|
|
25
|
+
"@cdc/map": "^9.22.9",
|
|
26
|
+
"@cdc/markup-include": "^9.22.9",
|
|
27
|
+
"@cdc/waffle-chart": "^9.22.9",
|
|
28
28
|
"axios": "^0.21.1",
|
|
29
29
|
"d3": "^7.0.0",
|
|
30
30
|
"html-react-parser": "1.4.9",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"resolutions": {
|
|
41
41
|
"@types/react": "17.x"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "90faf22c91ca0062432607e4599598f9e67c848a"
|
|
44
44
|
}
|
package/src/CdcEditor.js
CHANGED
|
@@ -6,7 +6,11 @@ import ResizeObserver from 'resize-observer-polyfill'
|
|
|
6
6
|
|
|
7
7
|
import getViewport from '@cdc/core/helpers/getViewport';
|
|
8
8
|
|
|
9
|
+
import { GlobalContextProvider } from '@cdc/core/components/GlobalContext'
|
|
9
10
|
import GlobalState from './context';
|
|
11
|
+
|
|
12
|
+
import OverlayFrame from '@cdc/core/components/ui/OverlayFrame'
|
|
13
|
+
|
|
10
14
|
import DataImport from './components/DataImport';
|
|
11
15
|
import ChooseTab from './components/ChooseTab';
|
|
12
16
|
import ConfigureTab from './components/ConfigureTab';
|
|
@@ -29,6 +33,54 @@ export default function CdcEditor({ config: configObj = {newViz: true}, hostname
|
|
|
29
33
|
startingTab = 2
|
|
30
34
|
}
|
|
31
35
|
|
|
36
|
+
// Legacy support - dashboards using a single dataset
|
|
37
|
+
if(config.type === 'dashboard'){
|
|
38
|
+
let legacyUpdateNeeded = false;
|
|
39
|
+
let newConfig;
|
|
40
|
+
|
|
41
|
+
if(config.data || config.dataUrl){
|
|
42
|
+
legacyUpdateNeeded = true;
|
|
43
|
+
newConfig = {...config};
|
|
44
|
+
|
|
45
|
+
newConfig.datasets = {};
|
|
46
|
+
newConfig.datasets[config.dataFileName || 'dataset-1'] = {
|
|
47
|
+
data: config.data,
|
|
48
|
+
dataUrl: config.dataUrl,
|
|
49
|
+
dataFileName: config.dataFileName || 'dataset-1',
|
|
50
|
+
dataFileSourceType: config.dataFileSourceType
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
Object.keys(newConfig.visualizations).forEach(vizKey => {
|
|
54
|
+
newConfig.visualizations[vizKey].dataKey = config.dataFileName || 'dataset-1';
|
|
55
|
+
newConfig.visualizations[vizKey].dataDescription = newConfig.dataDescription;
|
|
56
|
+
newConfig.visualizations[vizKey].formattedData = newConfig.formattedData;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
delete newConfig.data;
|
|
60
|
+
delete newConfig.dataUrl,
|
|
61
|
+
delete newConfig.dataFileName;
|
|
62
|
+
delete newConfig.dataFileSourceType;
|
|
63
|
+
delete newConfig.dataDescription;
|
|
64
|
+
delete newConfig.formattedData;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if(config.dashboard && config.dashboard.filters){
|
|
68
|
+
legacyUpdateNeeded = true;
|
|
69
|
+
newConfig = {...config};
|
|
70
|
+
|
|
71
|
+
newConfig.dashboard.sharedFilters = newConfig.dashboard.sharedFilters || [];
|
|
72
|
+
newConfig.dashboard.filters.forEach(filter => {
|
|
73
|
+
newConfig.dashboard.sharedFilters.push({...filter, key: filter.label, showDropdown: true, usedBy: Object.keys(newConfig.visualizations)});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
delete newConfig.dashboard.filters;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if(legacyUpdateNeeded){
|
|
80
|
+
setConfig(newConfig);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
32
84
|
const [globalActive, setGlobalActive] = useState(startingTab);
|
|
33
85
|
|
|
34
86
|
const resizeObserver = new ResizeObserver(([ container ]) => {
|
|
@@ -50,7 +102,7 @@ export default function CdcEditor({ config: configObj = {newViz: true}, hostname
|
|
|
50
102
|
if(null !== tempConfig) {
|
|
51
103
|
const parsedData = JSON.stringify(tempConfig)
|
|
52
104
|
// Emit the data in a regular JS event so it can be consumed by anything.
|
|
53
|
-
const event = new CustomEvent('updateVizConfig', { detail: parsedData})
|
|
105
|
+
const event = new CustomEvent('updateVizConfig', { detail: parsedData, bubbles: true })
|
|
54
106
|
window.dispatchEvent(event)
|
|
55
107
|
}
|
|
56
108
|
}, [tempConfig])
|
|
@@ -97,21 +149,37 @@ export default function CdcEditor({ config: configObj = {newViz: true}, hostname
|
|
|
97
149
|
sharepath
|
|
98
150
|
}
|
|
99
151
|
|
|
152
|
+
let configureDisabled = true;
|
|
153
|
+
|
|
154
|
+
if(config.type !== 'dashboard'){
|
|
155
|
+
if(config.formattedData){
|
|
156
|
+
configureDisabled = false;
|
|
157
|
+
}
|
|
158
|
+
} else {
|
|
159
|
+
if(config.datasets && Object.keys(config.datasets).length > 0){
|
|
160
|
+
configureDisabled = false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
100
164
|
return (
|
|
101
|
-
<
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
165
|
+
<GlobalContextProvider>
|
|
166
|
+
<GlobalState.Provider value={state}>
|
|
167
|
+
<div className={`cdc-open-viz-module cdc-editor ${currentViewport}`} ref={outerContainerRef}>
|
|
168
|
+
<Tabs className="top-level" startingTab={globalActive}>
|
|
169
|
+
<TabPane title="1. Choose Visualization Type" className="choose-type">
|
|
170
|
+
<ChooseTab />
|
|
171
|
+
</TabPane>
|
|
172
|
+
<TabPane title="2. Import Data" className="data-designer" disableRule={!config.type}>
|
|
173
|
+
<DataImport />
|
|
174
|
+
</TabPane>
|
|
175
|
+
|
|
176
|
+
<TabPane title="3. Configure" className="configure" disableRule={configureDisabled}>
|
|
177
|
+
<ConfigureTab containerEl={containerEl }/>
|
|
178
|
+
</TabPane>
|
|
179
|
+
</Tabs>
|
|
180
|
+
</div>
|
|
181
|
+
</GlobalState.Provider>
|
|
182
|
+
<OverlayFrame/>
|
|
183
|
+
</GlobalContextProvider>
|
|
116
184
|
);
|
|
117
185
|
}
|
|
@@ -1,103 +1,243 @@
|
|
|
1
|
-
import React, { useContext, useEffect } from 'react'
|
|
2
|
-
import '../scss/choose-vis-tab.scss'
|
|
3
|
-
|
|
4
|
-
import GlobalState from '../context'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
1
|
+
import React, { useContext, useEffect } from 'react'
|
|
2
|
+
import '../scss/choose-vis-tab.scss'
|
|
3
|
+
|
|
4
|
+
import GlobalState from '../context'
|
|
5
|
+
import Tooltip from '@cdc/core/components/ui/Tooltip'
|
|
6
|
+
|
|
7
|
+
import DashboardIcon from '@cdc/core/assets/icon-dashboard.svg'
|
|
8
|
+
import BarIcon from '@cdc/core/assets/icon-chart-bar.svg'
|
|
9
|
+
import LineIcon from '@cdc/core/assets/icon-chart-line.svg'
|
|
10
|
+
import PieIcon from '@cdc/core/assets/icon-chart-pie.svg'
|
|
11
|
+
import GlobeIcon from '@cdc/core/assets/icon-map-world.svg'
|
|
12
|
+
import UsaIcon from '@cdc/core/assets/icon-map-usa.svg'
|
|
13
|
+
import UsaRegionIcon from '@cdc/core/assets/usa-region-graphic.svg'
|
|
14
|
+
import DataBiteIcon from '@cdc/core/assets/icon-databite.svg'
|
|
15
|
+
import WaffleChartIcon from '@cdc/core/assets/icon-grid.svg'
|
|
16
|
+
import AlabamaGraphic from '@cdc/core/assets/icon-map-alabama.svg'
|
|
17
|
+
import PairedBarIcon from '@cdc/core/assets/icon-chart-bar-paired.svg'
|
|
18
|
+
import HorizontalStackIcon from '@cdc/core/assets/icon-chart-bar-stacked.svg'
|
|
17
19
|
|
|
18
20
|
export default function ChooseTab() {
|
|
19
|
-
|
|
21
|
+
const { config, setConfig, setGlobalActive, tempConfig, setTempConfig } = useContext(GlobalState)
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (tempConfig !== null) {
|
|
25
|
+
setConfig(tempConfig)
|
|
26
|
+
setTempConfig(null)
|
|
27
|
+
}
|
|
28
|
+
})
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
/**
|
|
31
|
+
* IconButton component
|
|
32
|
+
*/
|
|
33
|
+
const IconButton = ({ icon, label, type, subType, barType, orientation, stacked = false }) => {
|
|
34
|
+
let isSubType = false
|
|
35
|
+
let isHorizontalStackedChart = false
|
|
36
|
+
let classNames;
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
if (type === 'map' && config.general) {
|
|
39
|
+
let geoType = config.general.geoType
|
|
40
|
+
isSubType = (subType === geoType)
|
|
41
|
+
}
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
if (type === 'chart') {
|
|
44
|
+
isSubType = (subType === config.visualizationType)
|
|
45
|
+
isHorizontalStackedChart = (orientation === config.orientation && stacked === true)
|
|
46
|
+
}
|
|
42
47
|
|
|
43
|
-
|
|
48
|
+
if(type === 'dashboard' || type === 'data-bite' || type === 'waffle-chart' || type === 'markup-include') isSubType = true;
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
// TODO: sorry, we should refactor this at some point.
|
|
51
|
+
// trying to get this out for 4.22.5 - this is so stacked horizontal and bar charts aren't highlighted at the same time.
|
|
52
|
+
// this functionality appears to be working but is admittedly confusing.
|
|
53
|
+
if(type === 'chart' && stacked) {
|
|
54
|
+
classNames = (config.type === type && isSubType && config.visualizationSubType === 'stacked') ? 'active' : ''
|
|
55
|
+
} else if (type === 'chart' && !stacked && config.visualizationSubType !== 'stacked') {
|
|
56
|
+
classNames = (config.type === type && isSubType ) ? 'active' : ''
|
|
57
|
+
}
|
|
46
58
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
data: [...config.data],
|
|
51
|
-
dataFileName: config.dataFileName,
|
|
52
|
-
dataFileSourceType: config.dataFileSourceType,
|
|
53
|
-
dataDescription: config.dataDescription,
|
|
54
|
-
dataUrl: config.dataUrl,
|
|
55
|
-
newViz: true,
|
|
56
|
-
type
|
|
57
|
-
}
|
|
59
|
+
if(type !== 'chart') {
|
|
60
|
+
classNames = (config.type === type && isSubType && !isHorizontalStackedChart) ? 'active' : ''
|
|
61
|
+
}
|
|
58
62
|
|
|
59
|
-
if(config.formattedData) {
|
|
60
|
-
newConfig.formattedData = config.formattedData
|
|
61
|
-
}
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
let setTypes = () => {
|
|
65
|
+
if(type === config.type){
|
|
66
|
+
if(subType !== config.visualizationType){
|
|
67
|
+
setConfig({...config, newViz: true, visualizationType: subType})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
setGlobalActive(1)
|
|
71
|
+
} else {
|
|
72
|
+
let confirmation = !config.type || window.confirm('Changing visualization type will clear configuration settings. Do you want to continue?');
|
|
73
|
+
|
|
74
|
+
if(confirmation){
|
|
75
|
+
let newConfig = {
|
|
76
|
+
newViz: true,
|
|
77
|
+
datasets: {},
|
|
78
|
+
type
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if(type === 'map') {
|
|
82
|
+
newConfig.general = {
|
|
83
|
+
...newConfig.general,
|
|
84
|
+
geoType: subType
|
|
70
85
|
}
|
|
86
|
+
} else {
|
|
87
|
+
newConfig.visualizationType = subType
|
|
88
|
+
}
|
|
71
89
|
|
|
72
|
-
|
|
73
|
-
|
|
90
|
+
setConfig(newConfig);
|
|
91
|
+
setGlobalActive(1)
|
|
74
92
|
}
|
|
75
|
-
|
|
76
|
-
return (<button className={classNames} onClick={() => setTypes()} aria-label={label}>{icon}<span className="mt-1">{label}</span></button>)
|
|
93
|
+
}
|
|
77
94
|
}
|
|
78
95
|
|
|
79
|
-
return (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<ul className="grid">
|
|
90
|
-
<li><IconButton label="Bar" type="chart" subType="Bar" icon={ <BarIcon /> } /></li>
|
|
91
|
-
<li><IconButton label="Line" type="chart" subType="Line" icon={ <LineIcon /> } /></li>
|
|
92
|
-
<li><IconButton label="Pie" type="chart" subType="Pie" icon={ <PieIcon /> } /></li>
|
|
93
|
-
<li><IconButton label="Paired Bar" type="chart" subType="Paired Bar" icon={ <PairedBarIcon /> } /></li>
|
|
94
|
-
</ul>
|
|
95
|
-
<div className="heading-2">Maps</div>
|
|
96
|
-
<ul className="grid">
|
|
97
|
-
<li><IconButton label="United States (State- or County-Level)" type="map" subType="us" icon={ <UsaIcon /> } /></li>
|
|
98
|
-
<li><IconButton label="World" type="map" subType="world" icon={ <GlobeIcon /> } /></li>
|
|
99
|
-
<li><IconButton label="U.S. State" type="map" subType="single-state" icon={ <AlabamaGraphic /> } /></li>
|
|
100
|
-
</ul>
|
|
96
|
+
return (<button className={classNames} onClick={() => setTypes()} aria-label={label}>{icon}<span
|
|
97
|
+
className="mt-1">{label}</span></button>)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div className="choose-vis">
|
|
102
|
+
<a href="https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/index.html" target="_blank"
|
|
103
|
+
rel="noopener noreferrer" className="guidance-link" style={{marginTop: 0, marginBottom: "2rem"}}>
|
|
104
|
+
<div>
|
|
105
|
+
<p>For more information on the types of data visualizations in the WCMS, including examples and best practices, <u>see the WCMS Features Gallery</u>.</p>
|
|
101
106
|
</div>
|
|
102
|
-
|
|
107
|
+
</a>
|
|
108
|
+
|
|
109
|
+
<div className="heading-2">General</div>
|
|
110
|
+
<ul className="grid cove-temp"> {/*TODO: Remove cove class during refactor to Wizard*/}
|
|
111
|
+
<li>
|
|
112
|
+
<Tooltip position="right">
|
|
113
|
+
<Tooltip.Target>
|
|
114
|
+
<IconButton label="Dashboard" type="dashboard" icon={<DashboardIcon/>}/>
|
|
115
|
+
</Tooltip.Target>
|
|
116
|
+
<Tooltip.Content>
|
|
117
|
+
Present multiple data visualizations with shared filter controls.
|
|
118
|
+
</Tooltip.Content>
|
|
119
|
+
</Tooltip>
|
|
120
|
+
</li>
|
|
121
|
+
<li>
|
|
122
|
+
<Tooltip>
|
|
123
|
+
<Tooltip.Target>
|
|
124
|
+
<IconButton label="Data Bite" type="data-bite" icon={<DataBiteIcon/>}/>
|
|
125
|
+
</Tooltip.Target>
|
|
126
|
+
<Tooltip.Content>
|
|
127
|
+
Highlight a single aggregated value (e.g., sum or median).
|
|
128
|
+
</Tooltip.Content>
|
|
129
|
+
</Tooltip>
|
|
130
|
+
</li>
|
|
131
|
+
<li>
|
|
132
|
+
<Tooltip>
|
|
133
|
+
<Tooltip.Target>
|
|
134
|
+
<IconButton label="Waffle Chart" type="waffle-chart" icon={<WaffleChartIcon/>}/>
|
|
135
|
+
</Tooltip.Target>
|
|
136
|
+
<Tooltip.Content>
|
|
137
|
+
Highlight a piece of data in relationship to a data set.
|
|
138
|
+
</Tooltip.Content>
|
|
139
|
+
</Tooltip>
|
|
140
|
+
</li>
|
|
141
|
+
</ul>
|
|
142
|
+
|
|
143
|
+
<div className="heading-2">Charts</div>
|
|
144
|
+
<ul className="grid cove-temp">
|
|
145
|
+
<li>
|
|
146
|
+
<Tooltip position="right">
|
|
147
|
+
<Tooltip.Target>
|
|
148
|
+
<IconButton label="Bar" type="chart" subType="Bar" orientation="vertical" icon={<BarIcon/>}/>
|
|
149
|
+
</Tooltip.Target>
|
|
150
|
+
<Tooltip.Content>
|
|
151
|
+
Use bars to show comparisons between data categories.
|
|
152
|
+
</Tooltip.Content>
|
|
153
|
+
</Tooltip>
|
|
154
|
+
</li>
|
|
155
|
+
<li>
|
|
156
|
+
<Tooltip>
|
|
157
|
+
<Tooltip.Target>
|
|
158
|
+
<IconButton label="Line" type="chart" subType="Line" orientation="vertical" icon={<LineIcon/>}/>
|
|
159
|
+
</Tooltip.Target>
|
|
160
|
+
<Tooltip.Content>
|
|
161
|
+
Present one or more data trends over time.
|
|
162
|
+
</Tooltip.Content>
|
|
163
|
+
</Tooltip>
|
|
164
|
+
</li>
|
|
165
|
+
<li>
|
|
166
|
+
<Tooltip>
|
|
167
|
+
<Tooltip.Target>
|
|
168
|
+
<IconButton label="Pie" type="chart" subType="Pie" orientation="vertical" icon={<PieIcon/>}/>
|
|
169
|
+
</Tooltip.Target>
|
|
170
|
+
<Tooltip.Content>
|
|
171
|
+
Present the numerical proportions of a data series.
|
|
172
|
+
</Tooltip.Content>
|
|
173
|
+
</Tooltip>
|
|
174
|
+
</li>
|
|
175
|
+
<li>
|
|
176
|
+
<Tooltip>
|
|
177
|
+
<Tooltip.Target>
|
|
178
|
+
<IconButton label="Paired Bar" type="chart" subType="Paired Bar" orientation="horizontal" icon={<PairedBarIcon/>}/>
|
|
179
|
+
</Tooltip.Target>
|
|
180
|
+
<Tooltip.Content>
|
|
181
|
+
Use paired bars to show comparisons between two different data categories.
|
|
182
|
+
</Tooltip.Content>
|
|
183
|
+
</Tooltip>
|
|
184
|
+
</li>
|
|
185
|
+
<li>
|
|
186
|
+
<Tooltip>
|
|
187
|
+
<Tooltip.Target>
|
|
188
|
+
<IconButton label="Horizontal Bar (Stacked)" type="chart" subType="Bar" orientation="horizontal" stacked={true}
|
|
189
|
+
icon={<HorizontalStackIcon/>}/>
|
|
190
|
+
</Tooltip.Target>
|
|
191
|
+
<Tooltip.Content>
|
|
192
|
+
Use bars to show comparisons between data categories.
|
|
193
|
+
</Tooltip.Content>
|
|
194
|
+
</Tooltip>
|
|
195
|
+
</li>
|
|
196
|
+
</ul>
|
|
197
|
+
|
|
198
|
+
<div className="heading-2">Maps</div>
|
|
199
|
+
<ul className="grid cove-temp">
|
|
200
|
+
<li>
|
|
201
|
+
<Tooltip position="right">
|
|
202
|
+
<Tooltip.Target>
|
|
203
|
+
<IconButton label="United States (State- or County-Level)" type="map" subType="us" icon={<UsaIcon/>}/>
|
|
204
|
+
</Tooltip.Target>
|
|
205
|
+
<Tooltip.Content>
|
|
206
|
+
Present a U.S. choropleth map at state or county level.
|
|
207
|
+
</Tooltip.Content>
|
|
208
|
+
</Tooltip>
|
|
209
|
+
</li>
|
|
210
|
+
<li>
|
|
211
|
+
<Tooltip position="right">
|
|
212
|
+
<Tooltip.Target>
|
|
213
|
+
<IconButton label="United States (HHS Regions)" type="map" subType="us-region" icon={<UsaRegionIcon/>}/>
|
|
214
|
+
</Tooltip.Target>
|
|
215
|
+
<Tooltip.Content>
|
|
216
|
+
Present a U.S. choropleth map at state or county level.
|
|
217
|
+
</Tooltip.Content>
|
|
218
|
+
</Tooltip>
|
|
219
|
+
</li>
|
|
220
|
+
<li>
|
|
221
|
+
<Tooltip>
|
|
222
|
+
<Tooltip.Target>
|
|
223
|
+
<IconButton label="World" type="map" subType="world" icon={<GlobeIcon/>}/>
|
|
224
|
+
</Tooltip.Target>
|
|
225
|
+
<Tooltip.Content>
|
|
226
|
+
Present a choropleth map of the world.
|
|
227
|
+
</Tooltip.Content>
|
|
228
|
+
</Tooltip>
|
|
229
|
+
</li>
|
|
230
|
+
<li>
|
|
231
|
+
<Tooltip>
|
|
232
|
+
<Tooltip.Target>
|
|
233
|
+
<IconButton label="U.S. State" type="map" subType="single-state" icon={<AlabamaGraphic/>}/>
|
|
234
|
+
</Tooltip.Target>
|
|
235
|
+
<Tooltip.Content>
|
|
236
|
+
Present a choropleth map of an individual U.S. state.
|
|
237
|
+
</Tooltip.Content>
|
|
238
|
+
</Tooltip>
|
|
239
|
+
</li>
|
|
240
|
+
</ul>
|
|
241
|
+
</div>
|
|
242
|
+
)
|
|
103
243
|
}
|