@cdc/editor 4.25.11 → 4.26.2
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-8NmHlKRI.es.js +15 -0
- package/dist/cdceditor-BPoPzKPz.es.js +6 -0
- package/dist/cdceditor-Cf9_fbQf.es.js +6 -0
- package/dist/{cdceditor-dgT_1dIT.es.js → cdceditor-DQ00cQCm.es.js} +1 -20
- package/dist/cdceditor-jiQQPkty.es.js +6 -0
- package/dist/cdceditor.js +121242 -122361
- package/index.html +1 -20
- package/package.json +35 -37
- package/src/CdcEditor.tsx +0 -3
- package/src/components/ChooseTab.tsx +196 -156
- package/src/components/ConfigureTab.tsx +6 -1
- package/src/components/DataImport/components/SampleData.tsx +34 -9
- package/src/components/DataImport/components/samples/valid-horizon-chart.json +373 -0
- package/src/components/DataImport/components/samples/valid-radar-chart.csv +3 -0
- package/src/components/PreviewDataTable.tsx +32 -25
- package/src/components/modal/Modal.jsx +0 -3
- package/src/scss/choose-vis-tab.scss +40 -19
- package/vite.config.js +2 -1
- package/LICENSE +0 -201
- package/dist/cdceditor-BnB1QM5d.es.js +0 -361528
- package/dist/cdceditor-Ct2SB0vL.es.js +0 -231049
- package/dist/cdceditor-D6CG2-Hb.es.js +0 -39377
- package/dist/cdceditor-MXgURbdZ.es.js +0 -39194
package/index.html
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
6
|
-
<style type="text/css">
|
|
7
|
-
body {
|
|
8
|
-
margin: 0;
|
|
9
|
-
}
|
|
10
|
-
.react-container {
|
|
11
|
-
min-height: 100vh;
|
|
12
|
-
}
|
|
13
|
-
</style>
|
|
14
|
-
<link rel="stylesheet prefetch" href="https://www.cdc.gov/TemplatePackage/5.0/css/app.min.css?_=71669" />
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
<div class="react-container react--editor"></div>
|
|
18
|
-
<script type="module" src="./src/index.jsx"></script>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
1
|
+
<!-- index.html is generated by @cdc/core/generateViteConfig.js using the files in @cdc/core/devTemplate/ -->
|
package/package.json
CHANGED
|
@@ -1,51 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/editor",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.26.2",
|
|
4
4
|
"description": "React component for generating a new component entry",
|
|
5
|
-
"moduleName": "CdcEditor",
|
|
6
|
-
"main": "dist/cdceditor",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"start": "vite --open",
|
|
10
|
-
"build": "vite build",
|
|
11
|
-
"preview": "vite preview",
|
|
12
|
-
"graph": "nx graph",
|
|
13
|
-
"prepublishOnly": "lerna run --scope @cdc/editor build",
|
|
14
|
-
"test": "vitest run --reporter verbose",
|
|
15
|
-
"test-watch": "vitest watch --reporter verbose",
|
|
16
|
-
"test-watch:ui": "vitest --ui"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/CDCgov/cdc-open-viz",
|
|
21
|
-
"directory": "packages/editor"
|
|
22
|
-
},
|
|
23
|
-
"bugs": {
|
|
24
|
-
"url": "https://github.com/CDCgov/cdc-open-viz/issues"
|
|
25
|
-
},
|
|
26
5
|
"license": "Apache-2.0",
|
|
6
|
+
"bugs": "https://github.com/CDCgov/cdc-open-viz/issues",
|
|
27
7
|
"dependencies": {
|
|
28
|
-
"@cdc/chart": "^4.
|
|
29
|
-
"@cdc/core": "^4.
|
|
30
|
-
"@cdc/dashboard": "^4.
|
|
31
|
-
"@cdc/data-bite": "^4.
|
|
32
|
-
"@cdc/map": "^4.
|
|
33
|
-
"@cdc/markup-include": "^4.
|
|
34
|
-
"@cdc/waffle-chart": "^4.
|
|
35
|
-
"axios": "^1.
|
|
8
|
+
"@cdc/chart": "^4.26.2",
|
|
9
|
+
"@cdc/core": "^4.26.2",
|
|
10
|
+
"@cdc/dashboard": "^4.26.2",
|
|
11
|
+
"@cdc/data-bite": "^4.26.2",
|
|
12
|
+
"@cdc/map": "^4.26.2",
|
|
13
|
+
"@cdc/markup-include": "^4.26.2",
|
|
14
|
+
"@cdc/waffle-chart": "^4.26.2",
|
|
15
|
+
"axios": "^1.13.2",
|
|
36
16
|
"d3": "^7.9.0",
|
|
37
17
|
"react-dropzone": "^14.3.8",
|
|
38
|
-
"use-debounce": "^10.0
|
|
18
|
+
"use-debounce": "^10.1.0"
|
|
39
19
|
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@rollup/plugin-dsv": "^3.0.2",
|
|
22
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
23
|
+
"vite-plugin-css-injected-by-js": "^2.4.0",
|
|
24
|
+
"vite-plugin-svgr": "^4.2.0"
|
|
25
|
+
},
|
|
26
|
+
"gitHead": "be3413e8e1149abf94225108f86a7910f56e0616",
|
|
27
|
+
"main": "dist/cdceditor",
|
|
28
|
+
"moduleName": "CdcEditor",
|
|
40
29
|
"peerDependencies": {
|
|
41
30
|
"react": "^18.2.0",
|
|
42
31
|
"react-dom": "^18.2.0"
|
|
43
32
|
},
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/CDCgov/cdc-open-viz",
|
|
36
|
+
"directory": "packages/editor"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "vite build",
|
|
40
|
+
"graph": "nx graph",
|
|
41
|
+
"prepublishOnly": "lerna run --scope @cdc/editor build",
|
|
42
|
+
"preview": "vite preview",
|
|
43
|
+
"start": "vite --open",
|
|
44
|
+
"test": "vitest run --reporter verbose",
|
|
45
|
+
"test-watch": "vitest watch --reporter verbose",
|
|
46
|
+
"test-watch:ui": "vitest --ui"
|
|
49
47
|
},
|
|
50
|
-
"
|
|
48
|
+
"type": "module"
|
|
51
49
|
}
|
package/src/CdcEditor.tsx
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import React, { useState, useEffect, useCallback, useReducer, useMemo } from 'react'
|
|
2
|
-
|
|
3
|
-
// IE11
|
|
4
|
-
// import 'core-js/stable' // temp remove, appears to be used with html2pdf.js which we're temp removing
|
|
5
2
|
import ResizeObserver from 'resize-observer-polyfill'
|
|
6
3
|
|
|
7
4
|
import getViewport from '@cdc/core/helpers/getViewport'
|
|
@@ -4,29 +4,33 @@ import '../scss/choose-vis-tab.scss'
|
|
|
4
4
|
import ConfigContext, { EditorDispatchContext } from '@cdc/core/contexts/EditorContext'
|
|
5
5
|
import Tooltip from '@cdc/core/components/ui/Tooltip'
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import AlabamaGraphic from '@cdc/core/assets/icon-map-alabama.svg'
|
|
8
|
+
import AreaChartIcon from '@cdc/core/assets/icon-area-chart.svg'
|
|
8
9
|
import BarIcon from '@cdc/core/assets/icon-chart-bar.svg'
|
|
10
|
+
import BoxPlotIcon from '@cdc/core/assets/icon-chart-box-whisker.svg'
|
|
11
|
+
import CodeIcon from '@cdc/core/assets/icon-code.svg'
|
|
12
|
+
import ComboChartIcon from '@cdc/core/assets/icon-combo-chart.svg'
|
|
13
|
+
import DashboardIcon from '@cdc/core/assets/icon-dashboard.svg'
|
|
14
|
+
import DataBiteIcon from '@cdc/core/assets/icon-databite.svg'
|
|
15
|
+
import DeviationIcon from '@cdc/core/assets/icon-deviation-bar.svg'
|
|
16
|
+
import EpiChartIcon from '@cdc/core/assets/icon-epi-chart.svg'
|
|
17
|
+
import ForecastIcon from '@cdc/core/assets/icon-chart-forecast.svg'
|
|
18
|
+
import GaugeChartIcon from '@cdc/core/assets/icon-linear-gauge.svg'
|
|
19
|
+
import GlobeIcon from '@cdc/core/assets/icon-map-world.svg'
|
|
20
|
+
import HorizonChartIcon from '@cdc/core/assets/icon-chart-area.svg'
|
|
21
|
+
import HorizontalStackIcon from '@cdc/core/assets/icon-chart-bar-stacked.svg'
|
|
22
|
+
import Icon from '@cdc/core/components/ui/Icon'
|
|
9
23
|
import LineIcon from '@cdc/core/assets/icon-chart-line.svg'
|
|
24
|
+
import PairedBarIcon from '@cdc/core/assets/icon-chart-bar-paired.svg'
|
|
10
25
|
import PieIcon from '@cdc/core/assets/icon-chart-pie.svg'
|
|
11
|
-
import
|
|
26
|
+
import RadarChartIcon from '@cdc/core/assets/icon-chart-radar.svg'
|
|
27
|
+
import SankeyIcon from '@cdc/core/assets/icon-sankey.svg'
|
|
28
|
+
import ScatterPlotIcon from '@cdc/core/assets/icon-chart-scatterplot.svg'
|
|
29
|
+
import TableIcon from '@cdc/core/assets/icon-table.svg'
|
|
12
30
|
import UsaIcon from '@cdc/core/assets/icon-map-usa.svg'
|
|
13
31
|
import UsaRegionIcon from '@cdc/core/assets/usa-region-graphic.svg'
|
|
14
|
-
import DataBiteIcon from '@cdc/core/assets/icon-databite.svg'
|
|
15
32
|
import WaffleChartIcon from '@cdc/core/assets/icon-grid.svg'
|
|
16
|
-
import
|
|
17
|
-
import PairedBarIcon from '@cdc/core/assets/icon-chart-bar-paired.svg'
|
|
18
|
-
import HorizontalStackIcon from '@cdc/core/assets/icon-chart-bar-stacked.svg'
|
|
19
|
-
import ScatterPlotIcon from '@cdc/core/assets/icon-chart-scatterplot.svg'
|
|
20
|
-
import BoxPlotIcon from '@cdc/core/assets/icon-chart-box-whisker.svg'
|
|
21
|
-
import AreaChartIcon from '@cdc/core/assets/icon-area-chart.svg'
|
|
22
|
-
import GaugeChartIcon from '@cdc/core/assets/icon-linear-gauge.svg'
|
|
23
|
-
import ForecastIcon from '@cdc/core/assets/icon-chart-forecast.svg'
|
|
24
|
-
import DeviationIcon from '@cdc/core/assets/icon-deviation-bar.svg'
|
|
25
|
-
import SankeyIcon from '@cdc/core/assets/icon-sankey.svg'
|
|
26
|
-
import ComboChartIcon from '@cdc/core/assets/icon-combo-chart.svg'
|
|
27
|
-
import EpiChartIcon from '@cdc/core/assets/icon-epi-chart.svg'
|
|
28
|
-
import TableIcon from '@cdc/core/assets/icon-table.svg'
|
|
29
|
-
import Icon from '@cdc/core/components/ui/Icon'
|
|
33
|
+
import WarmingStripesIcon from '@cdc/core/assets/icon-warming-stripes.svg'
|
|
30
34
|
|
|
31
35
|
import {
|
|
32
36
|
convertVegaConfig,
|
|
@@ -276,6 +280,77 @@ const ChooseTab: React.FC = (): JSX.Element => {
|
|
|
276
280
|
export default ChooseTab
|
|
277
281
|
|
|
278
282
|
const buttons = [
|
|
283
|
+
// General - sorted by label
|
|
284
|
+
{
|
|
285
|
+
id: 15,
|
|
286
|
+
category: 'General',
|
|
287
|
+
label: 'Dashboard',
|
|
288
|
+
type: 'dashboard',
|
|
289
|
+
subType: null,
|
|
290
|
+
orientation: null,
|
|
291
|
+
icon: <DashboardIcon />,
|
|
292
|
+
content: 'Present multiple data visualizations with shared filter controls.'
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
id: 16,
|
|
296
|
+
category: 'General',
|
|
297
|
+
label: 'Data Bite',
|
|
298
|
+
type: 'data-bite',
|
|
299
|
+
subType: null,
|
|
300
|
+
orientation: null,
|
|
301
|
+
icon: <DataBiteIcon />,
|
|
302
|
+
content: 'Highlight a single aggregated value (e.g., sum or median).'
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: 24,
|
|
306
|
+
category: 'General',
|
|
307
|
+
label: 'Data Table',
|
|
308
|
+
type: 'table',
|
|
309
|
+
subType: null,
|
|
310
|
+
icon: <TableIcon />
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
id: 18,
|
|
314
|
+
category: 'General',
|
|
315
|
+
label: 'Gauge Chart',
|
|
316
|
+
type: 'waffle-chart',
|
|
317
|
+
subType: 'Gauge',
|
|
318
|
+
orientation: null,
|
|
319
|
+
icon: <GaugeChartIcon />,
|
|
320
|
+
content: `Specify the calculation of a single data point (such as a percentage value) and present it on a horizontal
|
|
321
|
+
scale.`
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
id: 26,
|
|
325
|
+
category: 'General',
|
|
326
|
+
label: 'Markup Include',
|
|
327
|
+
type: 'markup-include',
|
|
328
|
+
subType: null,
|
|
329
|
+
orientation: null,
|
|
330
|
+
icon: <CodeIcon />,
|
|
331
|
+
content: 'Include custom HTML markup or embed content from external URLs.'
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
id: 17,
|
|
335
|
+
category: 'General',
|
|
336
|
+
label: 'Waffle Chart',
|
|
337
|
+
type: 'waffle-chart',
|
|
338
|
+
subType: 'Waffle',
|
|
339
|
+
orientation: null,
|
|
340
|
+
icon: <WaffleChartIcon />,
|
|
341
|
+
content: 'Highlight a piece of data in relationship to a data set.'
|
|
342
|
+
},
|
|
343
|
+
// Charts - sorted by label
|
|
344
|
+
{
|
|
345
|
+
id: 6,
|
|
346
|
+
category: 'Charts',
|
|
347
|
+
label: 'Area Chart',
|
|
348
|
+
type: 'chart',
|
|
349
|
+
subType: 'Area Chart',
|
|
350
|
+
orientation: 'vertical',
|
|
351
|
+
icon: <AreaChartIcon />,
|
|
352
|
+
content: 'Display an area chart to visualize quantities over time.'
|
|
353
|
+
},
|
|
279
354
|
{
|
|
280
355
|
id: 1,
|
|
281
356
|
category: 'Charts',
|
|
@@ -295,23 +370,14 @@ const buttons = [
|
|
|
295
370
|
content: 'Use bars to show comparisons between data categories.'
|
|
296
371
|
},
|
|
297
372
|
{
|
|
298
|
-
id:
|
|
373
|
+
id: 9,
|
|
299
374
|
category: 'Charts',
|
|
300
|
-
label: '
|
|
375
|
+
label: 'Box Plot',
|
|
301
376
|
type: 'chart',
|
|
302
|
-
subType: '
|
|
377
|
+
subType: 'Box Plot',
|
|
303
378
|
orientation: 'vertical',
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
visualizationSubType: 'regular',
|
|
307
|
-
xAxis: {
|
|
308
|
-
type: 'date-time',
|
|
309
|
-
size: 0,
|
|
310
|
-
labelOffset: 0,
|
|
311
|
-
maxTickRotation: 45
|
|
312
|
-
},
|
|
313
|
-
icon: <EpiChartIcon />,
|
|
314
|
-
content: 'Use bars to show comparisons between data categories.'
|
|
379
|
+
icon: <BoxPlotIcon />,
|
|
380
|
+
content: 'Display a box plot to visualize the distribution of numerical data through quartiles.'
|
|
315
381
|
},
|
|
316
382
|
{
|
|
317
383
|
id: 3,
|
|
@@ -324,34 +390,33 @@ const buttons = [
|
|
|
324
390
|
content: 'Use bars to show comparisons between data categories.'
|
|
325
391
|
},
|
|
326
392
|
{
|
|
327
|
-
id:
|
|
328
|
-
category: 'Charts',
|
|
329
|
-
label: 'Line',
|
|
330
|
-
type: 'chart',
|
|
331
|
-
subType: 'Line',
|
|
332
|
-
orientation: 'vertical',
|
|
333
|
-
icon: <LineIcon />,
|
|
334
|
-
content: 'Present one or more data trends over time.'
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
id: 5,
|
|
393
|
+
id: 14,
|
|
338
394
|
category: 'Charts',
|
|
339
|
-
label: '
|
|
395
|
+
label: 'Deviation Bar',
|
|
340
396
|
type: 'chart',
|
|
341
|
-
subType: '
|
|
342
|
-
orientation: '
|
|
343
|
-
icon: <
|
|
344
|
-
content: 'Use
|
|
397
|
+
subType: 'Deviation Bar',
|
|
398
|
+
orientation: 'Pie',
|
|
399
|
+
icon: <DeviationIcon />,
|
|
400
|
+
content: 'Use deviation bars to display how individual values differ from a target'
|
|
345
401
|
},
|
|
346
402
|
{
|
|
347
|
-
id:
|
|
403
|
+
id: 2,
|
|
348
404
|
category: 'Charts',
|
|
349
|
-
label: '
|
|
405
|
+
label: 'Epi Chart',
|
|
350
406
|
type: 'chart',
|
|
351
|
-
subType: '
|
|
407
|
+
subType: 'Bar',
|
|
352
408
|
orientation: 'vertical',
|
|
353
|
-
|
|
354
|
-
|
|
409
|
+
barThickness: '0.95',
|
|
410
|
+
isResponsiveTicks: true,
|
|
411
|
+
visualizationSubType: 'regular',
|
|
412
|
+
xAxis: {
|
|
413
|
+
type: 'date-time',
|
|
414
|
+
size: 0,
|
|
415
|
+
labelOffset: 0,
|
|
416
|
+
maxTickRotation: 45
|
|
417
|
+
},
|
|
418
|
+
icon: <EpiChartIcon />,
|
|
419
|
+
content: 'Use bars to show comparisons between data categories.'
|
|
355
420
|
},
|
|
356
421
|
{
|
|
357
422
|
id: 7,
|
|
@@ -364,55 +429,45 @@ const buttons = [
|
|
|
364
429
|
content: 'Display a forecasting chart to predict future data trends.'
|
|
365
430
|
},
|
|
366
431
|
{
|
|
367
|
-
id:
|
|
432
|
+
id: 27,
|
|
368
433
|
category: 'Charts',
|
|
369
|
-
label: '
|
|
434
|
+
label: 'Horizon Chart',
|
|
370
435
|
type: 'chart',
|
|
371
|
-
subType: '
|
|
436
|
+
subType: 'Horizon Chart',
|
|
372
437
|
orientation: 'vertical',
|
|
373
|
-
icon: <
|
|
374
|
-
content: 'Display a
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
id: 9,
|
|
378
|
-
category: 'Charts',
|
|
379
|
-
label: 'Box Plot',
|
|
380
|
-
type: 'chart',
|
|
381
|
-
subType: 'Box Plot',
|
|
382
|
-
orientation: 'vertical',
|
|
383
|
-
icon: <BoxPlotIcon />,
|
|
384
|
-
content: 'Display a box plot to visualize the distribution of numerical data through quartiles.'
|
|
438
|
+
icon: <HorizonChartIcon />,
|
|
439
|
+
content: 'Display a horizon chart to visualize quantities over time in a smaller space.'
|
|
385
440
|
},
|
|
386
441
|
{
|
|
387
|
-
id:
|
|
442
|
+
id: 12,
|
|
388
443
|
category: 'Charts',
|
|
389
|
-
label: '
|
|
444
|
+
label: 'Horizontal Bar (Stacked)',
|
|
390
445
|
type: 'chart',
|
|
391
|
-
subType: '
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
446
|
+
subType: 'Bar',
|
|
447
|
+
visualizationSubType: 'stacked',
|
|
448
|
+
orientation: 'horizontal',
|
|
449
|
+
icon: <HorizontalStackIcon />,
|
|
450
|
+
content: 'Use bars to show comparisons between data categories.'
|
|
395
451
|
},
|
|
396
452
|
{
|
|
397
|
-
id:
|
|
453
|
+
id: 4,
|
|
398
454
|
category: 'Charts',
|
|
399
|
-
label: '
|
|
455
|
+
label: 'Line',
|
|
400
456
|
type: 'chart',
|
|
401
|
-
subType: '
|
|
457
|
+
subType: 'Line',
|
|
402
458
|
orientation: 'vertical',
|
|
403
|
-
icon: <
|
|
404
|
-
content: '
|
|
459
|
+
icon: <LineIcon />,
|
|
460
|
+
content: 'Present one or more data trends over time.'
|
|
405
461
|
},
|
|
406
462
|
{
|
|
407
|
-
id:
|
|
463
|
+
id: 5,
|
|
408
464
|
category: 'Charts',
|
|
409
|
-
label: '
|
|
465
|
+
label: 'Paired Bar',
|
|
410
466
|
type: 'chart',
|
|
411
|
-
subType: 'Bar',
|
|
412
|
-
visualizationSubType: 'stacked',
|
|
467
|
+
subType: 'Paired Bar',
|
|
413
468
|
orientation: 'horizontal',
|
|
414
|
-
icon: <
|
|
415
|
-
content: 'Use bars to show comparisons between data categories.'
|
|
469
|
+
icon: <PairedBarIcon />,
|
|
470
|
+
content: 'Use paired bars to show comparisons between two different data categories.'
|
|
416
471
|
},
|
|
417
472
|
{
|
|
418
473
|
id: 13,
|
|
@@ -425,65 +480,67 @@ const buttons = [
|
|
|
425
480
|
content: 'Present the numerical proportions of a data series.'
|
|
426
481
|
},
|
|
427
482
|
{
|
|
428
|
-
id:
|
|
483
|
+
id: 27,
|
|
429
484
|
category: 'Charts',
|
|
430
|
-
label: '
|
|
485
|
+
label: 'Radar',
|
|
431
486
|
type: 'chart',
|
|
432
|
-
subType: '
|
|
433
|
-
orientation: '
|
|
434
|
-
icon: <
|
|
435
|
-
content: '
|
|
487
|
+
subType: 'Radar',
|
|
488
|
+
orientation: 'vertical',
|
|
489
|
+
icon: <RadarChartIcon />,
|
|
490
|
+
content: 'Compare multiple quantitative variables across categories using a radial layout.'
|
|
436
491
|
},
|
|
437
492
|
{
|
|
438
|
-
id:
|
|
439
|
-
category: '
|
|
440
|
-
label: '
|
|
441
|
-
type: '
|
|
442
|
-
subType:
|
|
443
|
-
orientation:
|
|
444
|
-
icon: <
|
|
445
|
-
content: '
|
|
493
|
+
id: 10,
|
|
494
|
+
category: 'Charts',
|
|
495
|
+
label: 'Sankey Diagram',
|
|
496
|
+
type: 'chart',
|
|
497
|
+
subType: 'Sankey',
|
|
498
|
+
orientation: 'vertical',
|
|
499
|
+
icon: <SankeyIcon />,
|
|
500
|
+
content: 'Display a sankey diagram'
|
|
446
501
|
},
|
|
447
502
|
{
|
|
448
|
-
id:
|
|
449
|
-
category: '
|
|
450
|
-
label: '
|
|
451
|
-
type: '
|
|
452
|
-
subType:
|
|
453
|
-
orientation:
|
|
454
|
-
icon: <
|
|
455
|
-
content: '
|
|
503
|
+
id: 8,
|
|
504
|
+
category: 'Charts',
|
|
505
|
+
label: 'Scatter Plot',
|
|
506
|
+
type: 'chart',
|
|
507
|
+
subType: 'Scatter Plot',
|
|
508
|
+
orientation: 'vertical',
|
|
509
|
+
icon: <ScatterPlotIcon />,
|
|
510
|
+
content: 'Display a scatter plot to explore relationships between numeric variables.'
|
|
456
511
|
},
|
|
457
512
|
{
|
|
458
|
-
id:
|
|
459
|
-
category: '
|
|
460
|
-
label: '
|
|
461
|
-
type: '
|
|
462
|
-
subType: '
|
|
463
|
-
orientation:
|
|
464
|
-
|
|
465
|
-
|
|
513
|
+
id: 25,
|
|
514
|
+
category: 'Charts',
|
|
515
|
+
label: 'Warming Stripes',
|
|
516
|
+
type: 'chart',
|
|
517
|
+
subType: 'Warming Stripes',
|
|
518
|
+
orientation: 'vertical',
|
|
519
|
+
legend: {
|
|
520
|
+
position: 'bottom'
|
|
521
|
+
},
|
|
522
|
+
icon: <WarmingStripesIcon />,
|
|
523
|
+
content: 'Display temperature anomalies over time using color-coded vertical stripes.'
|
|
466
524
|
},
|
|
525
|
+
// Maps - sorted by label
|
|
467
526
|
{
|
|
468
|
-
id:
|
|
469
|
-
category: '
|
|
470
|
-
label: '
|
|
471
|
-
type: '
|
|
472
|
-
subType: '
|
|
473
|
-
|
|
474
|
-
icon: <
|
|
475
|
-
content:
|
|
476
|
-
scale.`
|
|
527
|
+
id: 23,
|
|
528
|
+
category: 'Maps',
|
|
529
|
+
label: 'U.S. Geocode',
|
|
530
|
+
type: 'map',
|
|
531
|
+
subType: 'us-county',
|
|
532
|
+
generalType: 'us-geocode',
|
|
533
|
+
icon: <UsaIcon />,
|
|
534
|
+
content: 'United States GeoCode'
|
|
477
535
|
},
|
|
478
536
|
{
|
|
479
|
-
id:
|
|
537
|
+
id: 22,
|
|
480
538
|
category: 'Maps',
|
|
481
|
-
label: '
|
|
539
|
+
label: 'U.S. State',
|
|
482
540
|
type: 'map',
|
|
483
|
-
subType: '
|
|
484
|
-
icon: <
|
|
485
|
-
content: 'Present a
|
|
486
|
-
position: 'right'
|
|
541
|
+
subType: 'single-state',
|
|
542
|
+
icon: <AlabamaGraphic />,
|
|
543
|
+
content: 'Present a choropleth map of an individual U.S. state.'
|
|
487
544
|
},
|
|
488
545
|
{
|
|
489
546
|
id: 20,
|
|
@@ -495,6 +552,16 @@ const buttons = [
|
|
|
495
552
|
content: 'Present a U.S. choropleth map at state or county level.',
|
|
496
553
|
position: 'right'
|
|
497
554
|
},
|
|
555
|
+
{
|
|
556
|
+
id: 19,
|
|
557
|
+
category: 'Maps',
|
|
558
|
+
label: 'United States (State- or County-Level)',
|
|
559
|
+
type: 'map',
|
|
560
|
+
subType: 'us',
|
|
561
|
+
icon: <UsaIcon />,
|
|
562
|
+
content: 'Present a U.S. choropleth map at state or county level.',
|
|
563
|
+
position: 'right'
|
|
564
|
+
},
|
|
498
565
|
{
|
|
499
566
|
id: 21,
|
|
500
567
|
category: 'Maps',
|
|
@@ -503,32 +570,5 @@ const buttons = [
|
|
|
503
570
|
subType: 'world',
|
|
504
571
|
icon: <GlobeIcon />,
|
|
505
572
|
content: 'Present a choropleth map of the world.'
|
|
506
|
-
},
|
|
507
|
-
{
|
|
508
|
-
id: 22,
|
|
509
|
-
category: 'Maps',
|
|
510
|
-
label: 'U.S. State',
|
|
511
|
-
type: 'map',
|
|
512
|
-
subType: 'single-state',
|
|
513
|
-
icon: <AlabamaGraphic />,
|
|
514
|
-
content: 'Present a choropleth map of an individual U.S. state.'
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
id: 23,
|
|
518
|
-
category: 'Maps',
|
|
519
|
-
label: 'U.S. Geocode',
|
|
520
|
-
type: 'map',
|
|
521
|
-
subType: 'us-county',
|
|
522
|
-
generalType: 'us-geocode',
|
|
523
|
-
icon: <UsaIcon />,
|
|
524
|
-
content: 'United States GeoCode'
|
|
525
|
-
},
|
|
526
|
-
{
|
|
527
|
-
id: 24,
|
|
528
|
-
category: 'General',
|
|
529
|
-
label: 'Data Table',
|
|
530
|
-
type: 'table',
|
|
531
|
-
subType: null,
|
|
532
|
-
icon: <TableIcon />
|
|
533
573
|
}
|
|
534
574
|
]
|
|
@@ -30,7 +30,12 @@ export default function ConfigureTab({ containerEl }) {
|
|
|
30
30
|
</ErrorBoundary>
|
|
31
31
|
)
|
|
32
32
|
case 'waffle-chart':
|
|
33
|
-
if (
|
|
33
|
+
if (
|
|
34
|
+
config.visualizationType === 'Waffle' ||
|
|
35
|
+
config.visualizationType === 'TP5 Waffle' ||
|
|
36
|
+
config.visualizationType === 'Gauge' ||
|
|
37
|
+
config.visualizationType === 'TP5 Gauge'
|
|
38
|
+
) {
|
|
34
39
|
return (
|
|
35
40
|
<ErrorBoundary component='CdcWaffleChart'>
|
|
36
41
|
<CdcWaffleChart isEditor={true} isDebug={isDebug} config={config} setConfig={setTempConfig} />
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
import SampleDataContext from './samples/SampleDataContext'
|
|
3
|
+
import { cityTemperature } from '@visx/mock-data'
|
|
3
4
|
|
|
4
5
|
// Data Samples
|
|
5
|
-
import
|
|
6
|
-
import
|
|
6
|
+
import pivotData from './samples/pivotData.json?raw'
|
|
7
|
+
import vaidWorldData from './samples/valid-world-data.json?raw'
|
|
8
|
+
import validAreaChart from './samples/valid-area-chart.json?raw'
|
|
9
|
+
import validBoxPlotData from './samples/valid-boxplot.csv?raw'
|
|
7
10
|
import validChartData from './samples/valid-data-chart.csv?raw'
|
|
8
11
|
import validCountyMapData from './samples/valid-county-data.csv?raw'
|
|
9
|
-
import validGeoPoint from './samples/valid-geo-point.csv?raw'
|
|
10
|
-
import validScatterPlot from './samples/valid-scatterplot.csv?raw'
|
|
11
|
-
import validBoxPlotData from './samples/valid-boxplot.csv?raw'
|
|
12
|
-
import validAreaChart from './samples/valid-area-chart.json?raw'
|
|
13
|
-
import validWorldGeocodeData from './samples/valid-world-geocode.json?raw'
|
|
14
12
|
import validForecastData from './samples/valid-forecast-data.csv?raw'
|
|
15
|
-
import
|
|
13
|
+
import validGeoPoint from './samples/valid-geo-point.csv?raw'
|
|
14
|
+
import validHorizonData from './samples/valid-horizon-chart.json?raw'
|
|
15
|
+
import validMapData from './samples/valid-data-map.csv?raw'
|
|
16
|
+
import validMapDataFootnotes from './samples/valid-data-map-footnotes.csv?raw'
|
|
17
|
+
import validRadarData from './samples/valid-radar-chart.csv?raw'
|
|
16
18
|
import validRegionData from './samples/valid-region-data.json?raw'
|
|
17
19
|
import validSankeyData from './samples/valid-sankey-data.json?raw'
|
|
18
|
-
import
|
|
20
|
+
import validScatterPlot from './samples/valid-scatterplot.csv?raw'
|
|
21
|
+
import validWorldGeocodeData from './samples/valid-world-geocode.json?raw'
|
|
22
|
+
|
|
23
|
+
// Convert visx cityTemperature data to CSV format
|
|
24
|
+
const visxTemperatureData = (() => {
|
|
25
|
+
const headers = Object.keys(cityTemperature[0])
|
|
26
|
+
const rows = cityTemperature.map(row => Object.values(row).join(','))
|
|
27
|
+
return [headers.join(','), ...rows].join('\n')
|
|
28
|
+
})()
|
|
19
29
|
|
|
20
30
|
// Add additional data to samples
|
|
21
31
|
const sampleData = {
|
|
@@ -45,15 +55,30 @@ const sampleData = {
|
|
|
45
55
|
fileName: 'valid-forecast-data.csv',
|
|
46
56
|
data: validForecastData
|
|
47
57
|
},
|
|
58
|
+
{
|
|
59
|
+
text: 'Horizon Chart Data',
|
|
60
|
+
fileName: 'valid-horizon-data.json',
|
|
61
|
+
data: validHorizonData
|
|
62
|
+
},
|
|
48
63
|
{
|
|
49
64
|
text: 'Sankey Chart Data',
|
|
50
65
|
fileName: 'valid-sankey-data.json',
|
|
51
66
|
data: validSankeyData
|
|
52
67
|
},
|
|
68
|
+
{
|
|
69
|
+
text: 'Radar Chart Data (Program Comparison)',
|
|
70
|
+
fileName: 'valid-radar-chart.csv',
|
|
71
|
+
data: validRadarData
|
|
72
|
+
},
|
|
53
73
|
{
|
|
54
74
|
text: 'Pivot Table Data',
|
|
55
75
|
fileName: 'pivotData.json',
|
|
56
76
|
data: pivotData
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
text: 'Warming Stripes Temperature Data',
|
|
80
|
+
fileName: 'visx-temperature-data.csv',
|
|
81
|
+
data: visxTemperatureData
|
|
57
82
|
}
|
|
58
83
|
],
|
|
59
84
|
maps: [
|