@cdc/editor 4.22.10 → 4.22.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/README.md +8 -7
- package/dist/cdceditor.js +42 -42
- package/example/data-horizontal-filters.json +5 -6
- package/example/data-horizontal-multiseries-filters.json +13 -15
- package/example/data-horizontal-multiseries.json +4 -5
- package/example/data-horizontal.json +2 -3
- package/example/data-vertical-filters.json +7 -8
- package/example/data-vertical-multiseries-filters.json +13 -15
- package/example/data-vertical-multiseries-multirow-filters.json +49 -52
- package/example/data-vertical-multiseries-multirow.json +11 -11
- package/example/data-vertical-multiseries.json +4 -5
- package/example/data-vertical.json +4 -5
- package/example/private/city-state.json +434 -0
- package/example/private/example-city-state.json +86 -0
- package/example/private/map-issue.csv +11 -0
- package/example/private/test.html +26 -1
- package/example/region-map.json +32 -32
- package/example/valid-county-data.json +3047 -3047
- package/package.json +8 -8
- package/src/CdcEditor.js +72 -72
- package/src/components/ChooseTab.js +67 -88
- package/src/components/ConfigureTab.js +51 -51
- package/src/components/DataImport.js +248 -246
- package/src/components/PreviewDataTable.js +130 -149
- package/src/components/TabPane.js +3 -3
- package/src/components/Tabs.js +20 -27
- package/src/components/modal/Confirmation.js +16 -13
- package/src/components/modal/Modal.js +23 -35
- package/src/components/modal/UseModal.js +8 -8
- package/src/context.js +4 -4
- package/src/index.html +1 -4
- package/src/index.js +6 -7
- package/src/scss/_data-table.scss +1 -1
- package/src/scss/_variables.scss +1 -1
- package/src/scss/choose-vis-tab.scss +63 -63
- package/src/scss/configure-tab.scss +17 -17
- package/src/scss/data-import.scss +177 -177
- package/src/scss/main.scss +31 -32
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import React, { useContext } from 'react'
|
|
1
|
+
import React, { useContext } from 'react'
|
|
2
2
|
|
|
3
|
-
import CdcDashboard from '@cdc/dashboard'
|
|
4
|
-
import CdcMap from '@cdc/map'
|
|
5
|
-
import CdcChart from '@cdc/chart'
|
|
6
|
-
import CdcDataBite from '@cdc/data-bite'
|
|
3
|
+
import CdcDashboard from '@cdc/dashboard' // TODO: Lazy load this
|
|
4
|
+
import CdcMap from '@cdc/map' // TODO: Lazy load this
|
|
5
|
+
import CdcChart from '@cdc/chart' // TODO: Lazy load this
|
|
6
|
+
import CdcDataBite from '@cdc/data-bite'
|
|
7
7
|
import CdcWaffleChart from '@cdc/waffle-chart'
|
|
8
8
|
import CdcMarkupInclude from '@cdc/markup-include'
|
|
9
9
|
|
|
10
|
-
import '../scss/configure-tab.scss'
|
|
10
|
+
import '../scss/configure-tab.scss'
|
|
11
11
|
|
|
12
|
-
import ErrorBoundary from '@cdc/core/components/ErrorBoundary'
|
|
13
|
-
import GlobalState from '../context'
|
|
12
|
+
import ErrorBoundary from '@cdc/core/components/ErrorBoundary'
|
|
13
|
+
import GlobalState from '../context'
|
|
14
14
|
|
|
15
|
-
export default function ConfigureTab({containerEl}) {
|
|
16
|
-
|
|
15
|
+
export default function ConfigureTab({ containerEl }) {
|
|
16
|
+
const { config, setTempConfig, hostname } = useContext(GlobalState)
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
let { type } = config
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
20
|
+
switch (type) {
|
|
21
|
+
case 'map':
|
|
22
|
+
return (
|
|
23
|
+
<ErrorBoundary component='CdcMap'>
|
|
24
|
+
<CdcMap isEditor={true} config={config} hostname={hostname} setConfig={setTempConfig} containerEl={containerEl} />
|
|
25
|
+
</ErrorBoundary>
|
|
26
|
+
)
|
|
27
|
+
case 'chart':
|
|
28
|
+
return (
|
|
29
|
+
<ErrorBoundary component='CdcChart'>
|
|
30
|
+
<CdcChart isEditor={true} config={config} setConfig={setTempConfig} />
|
|
31
|
+
</ErrorBoundary>
|
|
32
|
+
)
|
|
33
|
+
case 'dashboard':
|
|
34
|
+
return (
|
|
35
|
+
<ErrorBoundary component='CdcDashboard'>
|
|
36
|
+
<CdcDashboard isEditor={true} config={config} setConfig={setTempConfig} />
|
|
37
|
+
</ErrorBoundary>
|
|
38
|
+
)
|
|
39
|
+
case 'data-bite':
|
|
40
|
+
return (
|
|
41
|
+
<ErrorBoundary component='CdcDashboard'>
|
|
42
|
+
<CdcDataBite isEditor={true} config={config} setConfig={setTempConfig} />
|
|
43
|
+
</ErrorBoundary>
|
|
44
|
+
)
|
|
45
|
+
case 'waffle-chart':
|
|
46
|
+
return (
|
|
47
|
+
<ErrorBoundary component='CdcDashboard'>
|
|
48
|
+
<CdcWaffleChart isEditor={true} config={config} setConfig={setTempConfig} />
|
|
49
|
+
</ErrorBoundary>
|
|
50
|
+
)
|
|
51
|
+
case 'markup-include':
|
|
52
|
+
return (
|
|
53
|
+
<ErrorBoundary component='CdcDashboard'>
|
|
54
|
+
<CdcMarkupInclude isEditor={true} config={config} setConfig={setTempConfig} />
|
|
55
|
+
</ErrorBoundary>
|
|
56
|
+
)
|
|
57
|
+
default:
|
|
58
|
+
return <p>No visualization type selected.</p>
|
|
59
|
+
}
|
|
60
60
|
}
|