@cdc/editor 4.24.2 → 4.24.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/editor",
3
- "version": "4.24.2",
3
+ "version": "4.24.4",
4
4
  "description": "React component for generating a new component entry",
5
5
  "moduleName": "CdcEditor",
6
6
  "main": "dist/cdceditor",
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@cdc/chart": "^4.24.2",
28
- "@cdc/core": "^4.24.2",
29
- "@cdc/dashboard": "^4.24.2",
30
- "@cdc/data-bite": "^4.24.2",
31
- "@cdc/map": "^4.24.2",
32
- "@cdc/markup-include": "^4.24.2",
33
- "@cdc/waffle-chart": "^4.24.2",
27
+ "@cdc/chart": "^4.24.4",
28
+ "@cdc/core": "^4.24.4",
29
+ "@cdc/dashboard": "^4.24.4",
30
+ "@cdc/data-bite": "^4.24.4",
31
+ "@cdc/map": "^4.24.4",
32
+ "@cdc/markup-include": "^4.24.4",
33
+ "@cdc/waffle-chart": "^4.24.4",
34
34
  "axios": "^1.6.0",
35
35
  "d3": "^7.0.0",
36
36
  "html-react-parser": "^3.0.8",
@@ -43,5 +43,5 @@
43
43
  "react": "^18.2.0",
44
44
  "react-dom": "^18.2.0"
45
45
  },
46
- "gitHead": "edde49c96dee146de5e3a4537880b1bcf4dbee08"
46
+ "gitHead": "1843b4632140d582af6a87606374cbd4fe25ad5c"
47
47
  }
@@ -1,5 +1,8 @@
1
1
  import { Meta, StoryObj } from '@storybook/react'
2
2
  import CdcEditor from '../CdcEditor'
3
+ import StandAloneTableConfig from './_mock/standalone-table.json'
4
+ import BlankConfig from './_mock/blank-config.json'
5
+ import PivotFilterConfig from './_mock/pivot-filter.json'
3
6
 
4
7
  const meta: Meta<typeof CdcEditor> = {
5
8
  title: 'Components/Pages/CdcEditor',
@@ -9,88 +12,8 @@ export default meta
9
12
 
10
13
  type Story = StoryObj<typeof CdcEditor>
11
14
 
12
- const config = {
13
- dashboard: {
14
- theme: 'theme-blue'
15
- },
16
- rows: [
17
- [
18
- {
19
- width: 12
20
- },
21
- {},
22
- {}
23
- ]
24
- ],
25
- visualizations: {},
26
- table: {
27
- label: 'Data Table',
28
- show: true,
29
- showDownloadUrl: false,
30
- showVertical: true
31
- },
32
- newViz: true,
33
- datasets: {
34
- 'https://data.cdc.gov/resource/vdgb-f9s3.json': {
35
- data: [
36
- {
37
- surveyname: 'American Indian Adult Tobacco Survey',
38
- surveynameabbrev: 'AI ATS',
39
- year: '2007',
40
- e_cigarettes: 'No',
41
- question: 'During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?',
42
- responses: "Don't know/Not sure"
43
- },
44
- {
45
- surveyname: 'American Indian Adult Tobacco Survey',
46
- surveynameabbrev: 'AI ATS',
47
- year: '2007',
48
- e_cigarettes: 'No',
49
- question: 'During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?',
50
- responses: 'Refused'
51
- },
52
- {
53
- surveyname: 'American Indian Adult Tobacco Survey',
54
- surveynameabbrev: 'AI ATS',
55
- year: '2007',
56
- e_cigarettes: 'No',
57
- question: 'During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?',
58
- responses: 'No'
59
- }
60
- ]
61
- }
62
- },
63
- data: [
64
- {
65
- surveyname: 'American Indian Adult Tobacco Survey',
66
- surveynameabbrev: 'AI ATS',
67
- year: '2007',
68
- e_cigarettes: 'No',
69
- question: 'During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?',
70
- responses: "Don't know/Not sure"
71
- },
72
- {
73
- surveyname: 'American Indian Adult Tobacco Survey',
74
- surveynameabbrev: 'AI ATS',
75
- year: '2007',
76
- e_cigarettes: 'No',
77
- question: 'During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?',
78
- responses: 'Refused'
79
- },
80
- {
81
- surveyname: 'American Indian Adult Tobacco Survey',
82
- surveynameabbrev: 'AI ATS',
83
- year: '2007',
84
- e_cigarettes: 'No',
85
- question: 'During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?',
86
- responses: 'No'
87
- }
88
- ],
89
- type: 'dashboard'
90
- }
91
-
92
- export const DashboardEditor: Story = {
15
+ export const DefaultEditor: Story = {
93
16
  args: {
94
- config
17
+ config: BlankConfig
95
18
  }
96
19
  }
@@ -0,0 +1,79 @@
1
+ {
2
+ "dashboard": {
3
+ "theme": "theme-blue"
4
+ },
5
+ "rows": [
6
+ [
7
+ {
8
+ "width": 12
9
+ },
10
+ {},
11
+ {}
12
+ ]
13
+ ],
14
+ "visualizations": {},
15
+ "table": {
16
+ "label": "Data Table",
17
+ "show": true,
18
+ "showDownloadUrl": false,
19
+ "showVertical": true
20
+ },
21
+ "newViz": true,
22
+ "datasets": {
23
+ "https://data.cdc.gov/resource/vdgb-f9s3.json": {
24
+ "data": [
25
+ {
26
+ "surveyname": "American Indian Adult Tobacco Survey",
27
+ "surveynameabbrev": "AI ATS",
28
+ "year": "2007",
29
+ "e_cigarettes": "No",
30
+ "question": "During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?",
31
+ "responses": "Don't know/Not sure"
32
+ },
33
+ {
34
+ "surveyname": "American Indian Adult Tobacco Survey",
35
+ "surveynameabbrev": "AI ATS",
36
+ "year": "2007",
37
+ "e_cigarettes": "No",
38
+ "question": "During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?",
39
+ "responses": "Refused"
40
+ },
41
+ {
42
+ "surveyname": "American Indian Adult Tobacco Survey",
43
+ "surveynameabbrev": "AI ATS",
44
+ "year": "2007",
45
+ "e_cigarettes": "No",
46
+ "question": "During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?",
47
+ "responses": "No"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ "data": [
53
+ {
54
+ "surveyname": "American Indian Adult Tobacco Survey",
55
+ "surveynameabbrev": "AI ATS",
56
+ "year": "2007",
57
+ "e_cigarettes": "No",
58
+ "question": "During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?",
59
+ "responses": "Don't know/Not sure"
60
+ },
61
+ {
62
+ "surveyname": "American Indian Adult Tobacco Survey",
63
+ "surveynameabbrev": "AI ATS",
64
+ "year": "2007",
65
+ "e_cigarettes": "No",
66
+ "question": "During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?",
67
+ "responses": "Refused"
68
+ },
69
+ {
70
+ "surveyname": "American Indian Adult Tobacco Survey",
71
+ "surveynameabbrev": "AI ATS",
72
+ "year": "2007",
73
+ "e_cigarettes": "No",
74
+ "question": "During the past 12 months, have you stopped smoking for one day or longer because you were trying to quit smoking?",
75
+ "responses": "No"
76
+ }
77
+ ],
78
+ "type": "dashboard"
79
+ }
@@ -4,6 +4,7 @@ import '../scss/choose-vis-tab.scss'
4
4
  import ConfigContext, { EditorDispatchContext } from '../ConfigContext'
5
5
  import Tooltip from '@cdc/core/components/ui/Tooltip'
6
6
 
7
+ import InfoIcon from '@cdc/core/assets/icon-info.svg'
7
8
  import DashboardIcon from '@cdc/core/assets/icon-dashboard.svg'
8
9
  import BarIcon from '@cdc/core/assets/icon-chart-bar.svg'
9
10
  import LineIcon from '@cdc/core/assets/icon-chart-line.svg'
@@ -23,6 +24,7 @@ import GaugeChartIcon from '@cdc/core/assets/icon-linear-gauge.svg'
23
24
  import ForestPlotIcon from '@cdc/core/assets/icon-chart-forest-plot.svg'
24
25
  import ForecastIcon from '@cdc/core/assets/icon-chart-forecast.svg'
25
26
  import DeviationIcon from '@cdc/core/assets/icon-deviation-bar.svg'
27
+ import SankeyIcon from '@cdc/core/assets/icon-sankey.svg'
26
28
  import { Visualization } from '@cdc/core/types/Visualization'
27
29
 
28
30
  export default function ChooseTab() {
@@ -245,13 +247,22 @@ export default function ChooseTab() {
245
247
  </Tooltip>
246
248
  </li>
247
249
 
248
- <li>
250
+ {/* <li>
249
251
  <Tooltip>
250
252
  <Tooltip.Target>
251
253
  <IconButton label='Forest Plot' type='chart' subType='Forest Plot' orientation='vertical' icon={<ForestPlotIcon />} />
252
254
  </Tooltip.Target>
253
255
  <Tooltip.Content>Display a forest plot</Tooltip.Content>
254
256
  </Tooltip>
257
+ </li> */}
258
+
259
+ <li>
260
+ <Tooltip>
261
+ <Tooltip.Target>
262
+ <IconButton label='Sankey Diagram' type='chart' subType='Sankey' orientation='vertical' icon={<SankeyIcon />} />
263
+ </Tooltip.Target>
264
+ <Tooltip.Content>Display a sankey diagram</Tooltip.Content>
265
+ </Tooltip>
255
266
  </li>
256
267
  </ul>
257
268