@cdc/core 4.25.7 → 4.25.10
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/components/AdvancedEditor/AdvancedEditor.tsx +29 -8
- package/components/DataTable/DataTable.tsx +63 -11
- package/components/DataTable/DataTableStandAlone.tsx +4 -1
- package/components/DataTable/components/ChartHeader.tsx +58 -9
- package/components/DataTable/components/ExpandCollapse.tsx +21 -1
- package/components/DataTable/components/MapHeader.tsx +35 -7
- package/components/DataTable/data-table.css +6 -0
- package/components/DataTable/helpers/chartCellMatrix.tsx +11 -8
- package/components/DataTable/helpers/mapCellMatrix.tsx +19 -1
- package/components/DownloadButton.tsx +42 -13
- package/components/EditorPanel/DataTableEditor.tsx +10 -1
- package/components/EditorPanel/components/MarkupHighlightedTextField.tsx +227 -0
- package/components/EditorPanel/components/MarkupVariablesEditor.tsx +411 -0
- package/components/EditorPanel/components/PanelMarkup.tsx +59 -0
- package/components/ErrorBoundary.jsx +3 -1
- package/components/Filters/Filters.tsx +35 -11
- package/components/Filters/components/Tabs.tsx +1 -0
- package/components/Footnotes/FootnotesStandAlone.tsx +2 -1
- package/components/Legend/Legend.Gradient.tsx +3 -6
- package/components/LegendShape.tsx +121 -3
- package/components/{MediaControls.jsx → MediaControls.tsx} +80 -16
- package/components/PaletteConversionModal.tsx +87 -0
- package/components/PaletteSelector/DeveloperPaletteRollback.tsx +114 -0
- package/components/PaletteSelector/PaletteSelector.css +51 -0
- package/components/PaletteSelector/PaletteSelector.tsx +112 -0
- package/components/PaletteSelector/index.ts +2 -0
- package/components/RichTooltip/RichTooltip.tsx +1 -0
- package/components/Table/Table.tsx +3 -1
- package/components/_stories/BlurStrokeTest.stories.tsx +1 -1
- package/components/_stories/DataTable.stories.tsx +1 -1
- package/components/_stories/Filters.stories.tsx +1 -1
- package/components/_stories/Footnotes.stories.tsx +1 -1
- package/components/_stories/Inputs.stories.tsx +1 -1
- package/components/_stories/MultiSelect.stories.tsx +3 -3
- package/components/_stories/NestedDropdown.stories.tsx +1 -1
- package/components/_stories/Table.stories.tsx +1 -1
- package/components/elements/_stories/Button.stories.tsx +1 -1
- package/components/elements/_stories/Card.stories.tsx +1 -1
- package/components/inputs/InputToggle.tsx +2 -0
- package/components/managers/DataDesigner.tsx +10 -9
- package/components/managers/_stories/DataDesigner.stories.tsx +1 -1
- package/components/ui/Tooltip.tsx +2 -1
- package/components/ui/_stories/Accordion.stories.tsx +1 -1
- package/components/ui/_stories/ColorPaletteMigration.stories.mdx +275 -0
- package/components/ui/_stories/Colors.stories.tsx +330 -0
- package/components/ui/_stories/IconGallery.stories.tsx +316 -0
- package/components/ui/_stories/Title.stories.tsx +1 -1
- package/contexts/EditorContext.ts +18 -0
- package/contexts/editor.actions.ts +28 -0
- package/contexts/editor.reducer.ts +94 -0
- package/data/chartColorPalettes.ts +118 -0
- package/data/colorPalettes.ts +9 -0
- package/data/mapColorPalettes.ts +45 -0
- package/data/sharedPalettes.ts +50 -0
- package/dist/cove-main.css +14 -13
- package/dist/cove-main.css.map +1 -1
- package/generateViteConfig.js +80 -0
- package/helpers/addValuesToFilters.ts +2 -3
- package/helpers/cloneConfig.ts +31 -0
- package/helpers/configDataHelpers.ts +128 -0
- package/helpers/configHelpers.ts +27 -0
- package/helpers/constants.ts +5 -2
- package/helpers/cove/number.ts +6 -2
- package/helpers/coveUpdateWorker.ts +15 -3
- package/helpers/events.ts +32 -0
- package/helpers/filterColorPalettes.ts +152 -0
- package/helpers/generateColorsArray.ts +13 -0
- package/helpers/getColorPaletteVersion.ts +33 -0
- package/helpers/getPaletteAccessor.ts +18 -0
- package/helpers/markupProcessor.ts +205 -0
- package/helpers/metrics/helpers.ts +75 -0
- package/helpers/metrics/types.ts +82 -0
- package/helpers/metrics/utils.ts +34 -0
- package/helpers/palettes/colorDistributions.ts +56 -0
- package/helpers/palettes/migratePaletteName.ts +150 -0
- package/helpers/palettes/standardizePaletteNames.ts +77 -0
- package/helpers/palettes/utils.ts +267 -0
- package/helpers/queryStringUtils.ts +13 -0
- package/helpers/testing.ts +345 -0
- package/helpers/tests/addValuesToFilters.test.ts +1 -2
- package/helpers/tests/generateColorsArray.test.ts +24 -0
- package/helpers/tests/markupProcessor.test.ts +538 -0
- package/helpers/tests/testStandaloneBuild.ts +44 -0
- package/helpers/useMarkupVariables.ts +31 -0
- package/helpers/vegaConfig.ts +0 -1
- package/helpers/ver/4.24.10.ts +2 -1
- package/helpers/ver/4.24.11.ts +2 -1
- package/helpers/ver/4.24.3.ts +2 -1
- package/helpers/ver/4.24.4.ts +2 -1
- package/helpers/ver/4.24.5.ts +2 -1
- package/helpers/ver/4.24.7.ts +2 -1
- package/helpers/ver/4.24.9.ts +2 -1
- package/helpers/ver/4.25.1.ts +2 -1
- package/helpers/ver/4.25.10.ts +36 -0
- package/helpers/ver/4.25.3.ts +2 -1
- package/helpers/ver/4.25.4.ts +2 -1
- package/helpers/ver/4.25.6.ts +2 -1
- package/helpers/ver/4.25.7.ts +2 -1
- package/helpers/ver/4.25.8.ts +62 -0
- package/helpers/ver/4.25.9.ts +293 -0
- package/helpers/ver/tests/4.25.10.test.ts +204 -0
- package/helpers/ver/tests/4.25.8.test.ts +86 -0
- package/helpers/ver/tests/4.25.9.test.ts +51 -0
- package/helpers/viewports.ts +2 -0
- package/hooks/useColorPalette.ts +79 -0
- package/package.json +12 -4
- package/styles/_button-section.scss +0 -2
- package/styles/_global.scss +7 -5
- package/styles/base.scss +8 -5
- package/styles/v2/components/button.scss +4 -3
- package/styles/v2/components/editor.scss +2 -1
- package/styles/v2/layout/_data-table.scss +3 -2
- package/styles/v2/themes/_color-definitions.scss +18 -17
- package/testBuild.js +0 -0
- package/testing-setup.js +32 -0
- package/types/ForecastingSeriesKey.ts +0 -1
- package/types/MarkupInclude.ts +6 -1
- package/types/MarkupVariable.ts +19 -0
- package/types/Series.ts +4 -0
- package/types/Table.ts +1 -0
- package/types/VizFilter.ts +1 -0
- package/vitest.config.ts +16 -0
- package/components/ui/_stories/Colors.stories.mdx +0 -220
- package/components/ui/_stories/IconGallery.stories.mdx +0 -14
- package/data/colorPalettes.js +0 -171
- package/helpers/events.js +0 -14
- package/helpers/formatConfigBeforeSave.ts +0 -135
- package/helpers/tests/formatConfigBeforeSave.test.ts +0 -68
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import _ from 'lodash'
|
|
3
|
+
import { isCoveDeveloperMode } from '../../helpers/queryStringUtils'
|
|
4
|
+
import {
|
|
5
|
+
hasPaletteBackup,
|
|
6
|
+
getOriginalPaletteName,
|
|
7
|
+
rollbackPaletteToOriginal,
|
|
8
|
+
hasTwoColorPaletteBackup,
|
|
9
|
+
getOriginalTwoColorPaletteName,
|
|
10
|
+
rollbackTwoColorPaletteToOriginal
|
|
11
|
+
} from '../../helpers/palettes/utils'
|
|
12
|
+
import './PaletteSelector.css'
|
|
13
|
+
|
|
14
|
+
interface DeveloperPaletteRollbackProps {
|
|
15
|
+
config: any
|
|
16
|
+
updateConfig: (newConfig: any) => void
|
|
17
|
+
className?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const DeveloperPaletteRollback: React.FC<DeveloperPaletteRollbackProps> = ({
|
|
21
|
+
config,
|
|
22
|
+
updateConfig,
|
|
23
|
+
className = ''
|
|
24
|
+
}) => {
|
|
25
|
+
// Only show if developer mode is enabled
|
|
26
|
+
if (!isCoveDeveloperMode()) {
|
|
27
|
+
return null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Check for both regular and two-color palette backups
|
|
31
|
+
const hasRegularBackup = hasPaletteBackup(config)
|
|
32
|
+
const hasTwoColorBackup = hasTwoColorPaletteBackup(config)
|
|
33
|
+
|
|
34
|
+
// Only show if there's backup data available
|
|
35
|
+
if (!hasRegularBackup && !hasTwoColorBackup) {
|
|
36
|
+
return null
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const originalPaletteName = getOriginalPaletteName(config)
|
|
40
|
+
const originalTwoColorPaletteName = getOriginalTwoColorPaletteName(config)
|
|
41
|
+
const currentPaletteName = config?.general?.palette?.name || config?.palette || config?.color
|
|
42
|
+
const currentTwoColorPaletteName = config?.twoColor?.palette
|
|
43
|
+
|
|
44
|
+
const handleRollback = () => {
|
|
45
|
+
// Determine which type of rollback to perform and show appropriate confirmation
|
|
46
|
+
let confirmMessage = ''
|
|
47
|
+
let fromName = ''
|
|
48
|
+
let toName = ''
|
|
49
|
+
|
|
50
|
+
if (hasTwoColorBackup) {
|
|
51
|
+
// Two-color palette rollback
|
|
52
|
+
fromName = currentTwoColorPaletteName
|
|
53
|
+
toName = originalTwoColorPaletteName
|
|
54
|
+
confirmMessage = `Are you sure you want to rollback the palette from "${fromName}" to "${toName}"?\n\nThis will restore the original v1 palette configuration.`
|
|
55
|
+
} else if (hasRegularBackup) {
|
|
56
|
+
// Regular palette rollback
|
|
57
|
+
fromName = currentPaletteName
|
|
58
|
+
toName = originalPaletteName
|
|
59
|
+
confirmMessage = `Are you sure you want to rollback the palette from "${fromName}" to "${toName}"?\n\nThis will restore the original palette configuration and remove the migrated structure.`
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const confirmRollback = window.confirm(confirmMessage)
|
|
63
|
+
|
|
64
|
+
if (confirmRollback) {
|
|
65
|
+
const configCopy = _.cloneDeep(config)
|
|
66
|
+
console.log('Config before rollback:', JSON.stringify(configCopy, null, 2))
|
|
67
|
+
|
|
68
|
+
let success = false
|
|
69
|
+
|
|
70
|
+
if (hasTwoColorBackup) {
|
|
71
|
+
success = rollbackTwoColorPaletteToOriginal(configCopy)
|
|
72
|
+
console.log('Two-color rollback success:', success)
|
|
73
|
+
} else if (hasRegularBackup) {
|
|
74
|
+
const rolledBackConfig = rollbackPaletteToOriginal(configCopy)
|
|
75
|
+
success = !!rolledBackConfig
|
|
76
|
+
console.log('Regular rollback success:', success)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
console.log('Config after rollback:', JSON.stringify(configCopy, null, 2))
|
|
80
|
+
|
|
81
|
+
if (success) {
|
|
82
|
+
updateConfig(configCopy)
|
|
83
|
+
} else {
|
|
84
|
+
alert('Rollback failed: No backup data available')
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Determine display text based on available backups
|
|
90
|
+
const displayPaletteName = hasTwoColorBackup ? originalTwoColorPaletteName : originalPaletteName
|
|
91
|
+
const infoText = hasTwoColorBackup
|
|
92
|
+
? `Developer Mode: Two-color palette migrated from "${originalTwoColorPaletteName}"`
|
|
93
|
+
: `Developer Mode: Migrated from "${originalPaletteName}"`
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<div className={`developer-palette-rollback ${className}`}>
|
|
97
|
+
<div className="rollback-info">
|
|
98
|
+
<small className="text-muted">
|
|
99
|
+
{infoText}
|
|
100
|
+
</small>
|
|
101
|
+
</div>
|
|
102
|
+
<button
|
|
103
|
+
type="button"
|
|
104
|
+
className="btn btn-sm btn-outline-warning"
|
|
105
|
+
onClick={handleRollback}
|
|
106
|
+
title={`Rollback to original palette: ${displayPaletteName}`}
|
|
107
|
+
>
|
|
108
|
+
Rollback Palette
|
|
109
|
+
</button>
|
|
110
|
+
</div>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default DeveloperPaletteRollback
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* PaletteSelector component styles */
|
|
2
|
+
/* Shared styles for palette color swatches across all visualization types */
|
|
3
|
+
|
|
4
|
+
.color-palette {
|
|
5
|
+
/* Button-based palette selector (used by charts) */
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.color-palette button:not(.selected) {
|
|
9
|
+
border: var(--cool-gray-30) 2px solid !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.color-palette button.selected {
|
|
13
|
+
border: black 2px solid !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* List item-based palette selector (used by maps) */
|
|
17
|
+
.color-palette li {
|
|
18
|
+
border: var(--cool-gray-30) 2px solid;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.color-palette li.selected {
|
|
22
|
+
border: black 2px solid;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Developer rollback component styles */
|
|
26
|
+
.developer-palette-rollback {
|
|
27
|
+
margin: 8px 0;
|
|
28
|
+
padding: 8px;
|
|
29
|
+
border: 1px dashed #ffc107;
|
|
30
|
+
border-radius: 4px;
|
|
31
|
+
background-color: #fffbf0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.developer-palette-rollback .rollback-info {
|
|
35
|
+
margin-bottom: 4px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.developer-palette-rollback .rollback-info small {
|
|
39
|
+
color: #856404;
|
|
40
|
+
font-size: 0.75rem;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.developer-palette-rollback button {
|
|
44
|
+
font-size: 0.75rem;
|
|
45
|
+
padding: 2px 8px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.developer-palette-rollback button:hover {
|
|
49
|
+
background-color: #ffc107;
|
|
50
|
+
color: #212529;
|
|
51
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { getPaletteAccessor } from '../../helpers/getPaletteAccessor'
|
|
3
|
+
import './PaletteSelector.css'
|
|
4
|
+
|
|
5
|
+
interface PaletteSelectorProps {
|
|
6
|
+
palettes: string[]
|
|
7
|
+
colorPalettes: any
|
|
8
|
+
config: any
|
|
9
|
+
onPaletteSelect: (palette: string) => void
|
|
10
|
+
selectedPalette?: string
|
|
11
|
+
colorIndices?: [number, number, number]
|
|
12
|
+
className?: string
|
|
13
|
+
element?: 'button' | 'li'
|
|
14
|
+
minColorsForFilter?: (palette: string, paletteAccessor: any, config: any) => boolean
|
|
15
|
+
getItemClassName?: (palette: string) => string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const PaletteSelector: React.FC<PaletteSelectorProps> = ({
|
|
19
|
+
palettes,
|
|
20
|
+
colorPalettes,
|
|
21
|
+
config,
|
|
22
|
+
onPaletteSelect,
|
|
23
|
+
selectedPalette,
|
|
24
|
+
colorIndices = [2, 3, 5],
|
|
25
|
+
className = 'color-palette',
|
|
26
|
+
element = 'button',
|
|
27
|
+
minColorsForFilter,
|
|
28
|
+
getItemClassName
|
|
29
|
+
}) => {
|
|
30
|
+
|
|
31
|
+
const handlePaletteSelection = (palette: string) => (e: React.MouseEvent) => {
|
|
32
|
+
if (element === 'button') {
|
|
33
|
+
e.preventDefault()
|
|
34
|
+
}
|
|
35
|
+
onPaletteSelect(palette)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const getSelectedClass = (palette: string) => {
|
|
39
|
+
if (getItemClassName) {
|
|
40
|
+
return getItemClassName(palette)
|
|
41
|
+
}
|
|
42
|
+
return selectedPalette === palette ? 'selected' : ''
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const renderPaletteColors = (palette: string) => {
|
|
46
|
+
const [colorOneIndex, colorTwoIndex, colorThreeIndex] = colorIndices
|
|
47
|
+
|
|
48
|
+
// Use the enhanced getPaletteAccessor to get the specific palette colors
|
|
49
|
+
const paletteColors = getPaletteAccessor(colorPalettes, config, palette)
|
|
50
|
+
|
|
51
|
+
if (!paletteColors || !Array.isArray(paletteColors)) {
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<span style={{ backgroundColor: '#ccc' }}></span>
|
|
55
|
+
<span style={{ backgroundColor: '#ccc' }}></span>
|
|
56
|
+
<span style={{ backgroundColor: '#ccc' }}></span>
|
|
57
|
+
</>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const colorOne = {
|
|
62
|
+
backgroundColor: paletteColors[colorOneIndex] || '#ccc'
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const colorTwo = {
|
|
66
|
+
backgroundColor: paletteColors[colorTwoIndex] || '#ccc'
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const colorThree = {
|
|
70
|
+
backgroundColor: paletteColors[colorThreeIndex] || '#ccc'
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<>
|
|
75
|
+
<span style={colorOne}></span>
|
|
76
|
+
<span style={colorTwo}></span>
|
|
77
|
+
<span style={colorThree}></span>
|
|
78
|
+
</>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const Container = element === 'li' ? 'ul' : 'div'
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<Container className={className}>
|
|
86
|
+
{palettes.map(palette => {
|
|
87
|
+
// Apply custom filter if provided
|
|
88
|
+
if (minColorsForFilter) {
|
|
89
|
+
const paletteColors = getPaletteAccessor(colorPalettes, config, palette)
|
|
90
|
+
if (!minColorsForFilter(palette, paletteColors, config)) {
|
|
91
|
+
return null
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const Element = element
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Element
|
|
99
|
+
key={palette}
|
|
100
|
+
title={palette}
|
|
101
|
+
onClick={handlePaletteSelection(palette)}
|
|
102
|
+
className={getSelectedClass(palette)}
|
|
103
|
+
>
|
|
104
|
+
{renderPaletteColors(palette)}
|
|
105
|
+
</Element>
|
|
106
|
+
)
|
|
107
|
+
})}
|
|
108
|
+
</Container>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default PaletteSelector
|
|
@@ -46,8 +46,10 @@ const Table = ({
|
|
|
46
46
|
const headStyle = stickyHeader ? { position: 'sticky' as Position, top: 0, zIndex: 2 } : {}
|
|
47
47
|
const isGroupedMatrix = !Array.isArray(childrenMatrix)
|
|
48
48
|
|
|
49
|
+
const { cellMinWidth, ...tableAttrs } = tableOptions
|
|
50
|
+
|
|
49
51
|
return (
|
|
50
|
-
<table {...
|
|
52
|
+
<table {...tableAttrs}>
|
|
51
53
|
<caption className='visually-hidden'>{caption}</caption>
|
|
52
54
|
{noData ? (
|
|
53
55
|
<tr>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a } from 'vitest/dist/suite-IbNSsUWN'
|
|
2
2
|
import { BlurStrokeText } from '../BlurStrokeText'
|
|
3
|
-
import { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { Meta, StoryObj } from '@storybook/react-vite'
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof BlurStrokeText> = {
|
|
6
6
|
title: 'Components/Atoms/BlurStrokeText',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react'
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
2
|
|
|
3
3
|
import MultiSelect from '../MultiSelect'
|
|
4
|
-
import { userEvent, within } from '
|
|
4
|
+
import { userEvent, within } from 'storybook/test'
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof MultiSelect> = {
|
|
7
7
|
title: 'Components/Molecules/MultiSelect',
|
|
@@ -10,7 +10,7 @@ const meta: Meta<typeof MultiSelect> = {
|
|
|
10
10
|
|
|
11
11
|
type Story = StoryObj<typeof MultiSelect>
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const PrimaryTests: Story = {
|
|
14
14
|
args: {
|
|
15
15
|
options: [
|
|
16
16
|
{ value: '1', label: 'One' },
|
|
@@ -19,6 +19,8 @@ type InputSliderProps = {
|
|
|
19
19
|
fieldName?: string
|
|
20
20
|
/** Prop drill down of the updateField function */
|
|
21
21
|
updateField?: Function
|
|
22
|
+
/** Click handler function */
|
|
23
|
+
onClick?: Function
|
|
22
24
|
/** Current value of the input, usually the current config option value */
|
|
23
25
|
value: boolean
|
|
24
26
|
}
|
|
@@ -22,6 +22,7 @@ type DataDesignerProps = {
|
|
|
22
22
|
|
|
23
23
|
const DataDesigner = (props: DataDesignerProps) => {
|
|
24
24
|
const { configureData, updateDescriptionProp, config, setConfig } = props
|
|
25
|
+
const firstDataRow = configureData?.data?.[0] || {}
|
|
25
26
|
const hasDataOrientation = config?.visualizationType !== 'Forest Plot'
|
|
26
27
|
const hasMultipleSeries = config?.visualizationType !== 'Forest Plot'
|
|
27
28
|
const hasRowSelection = config?.visualizationType !== 'Forest Plot'
|
|
@@ -134,7 +135,7 @@ const DataDesigner = (props: DataDesignerProps) => {
|
|
|
134
135
|
defaultValue={configureData.dataDescription.seriesKey}
|
|
135
136
|
>
|
|
136
137
|
<option value=''>Choose an option</option>
|
|
137
|
-
{Object.keys(
|
|
138
|
+
{Object.keys(firstDataRow).map((value, index) => (
|
|
138
139
|
<option value={value} key={index}>
|
|
139
140
|
{value}
|
|
140
141
|
</option>
|
|
@@ -200,7 +201,7 @@ const DataDesigner = (props: DataDesignerProps) => {
|
|
|
200
201
|
defaultValue={configureData.dataDescription.seriesKey}
|
|
201
202
|
>
|
|
202
203
|
<option value=''>Choose an option</option>
|
|
203
|
-
{Object.keys(
|
|
204
|
+
{Object.keys(firstDataRow).map((value, index) => (
|
|
204
205
|
<option value={value} key={index}>
|
|
205
206
|
{value}
|
|
206
207
|
</option>
|
|
@@ -218,7 +219,7 @@ const DataDesigner = (props: DataDesignerProps) => {
|
|
|
218
219
|
defaultValue={configureData.dataDescription.xKey}
|
|
219
220
|
>
|
|
220
221
|
<option value=''>Choose an option</option>
|
|
221
|
-
{Object.keys(
|
|
222
|
+
{Object.keys(firstDataRow).map((value, index) => (
|
|
222
223
|
<option value={value} key={index}>
|
|
223
224
|
{value}
|
|
224
225
|
</option>
|
|
@@ -264,7 +265,7 @@ const DataDesigner = (props: DataDesignerProps) => {
|
|
|
264
265
|
}}
|
|
265
266
|
>
|
|
266
267
|
<option value=''>Choose an option</option>
|
|
267
|
-
{Object.keys(
|
|
268
|
+
{Object.keys(firstDataRow)
|
|
268
269
|
.filter(
|
|
269
270
|
value =>
|
|
270
271
|
!configureData.dataDescription.valueKeysTallSupport ||
|
|
@@ -313,7 +314,7 @@ const DataDesigner = (props: DataDesignerProps) => {
|
|
|
313
314
|
}}
|
|
314
315
|
>
|
|
315
316
|
<option value=''>Choose an option</option>
|
|
316
|
-
{Object.keys(
|
|
317
|
+
{Object.keys(firstDataRow)
|
|
317
318
|
.filter(
|
|
318
319
|
value =>
|
|
319
320
|
!configureData.dataDescription.ignoredKeys ||
|
|
@@ -348,7 +349,7 @@ const DataDesigner = (props: DataDesignerProps) => {
|
|
|
348
349
|
defaultValue={'Select'}
|
|
349
350
|
>
|
|
350
351
|
<option value=''>Choose an option</option>
|
|
351
|
-
{Object.keys(
|
|
352
|
+
{Object.keys(firstDataRow).map((value, index) => (
|
|
352
353
|
<option value={value} key={index}>
|
|
353
354
|
{value}
|
|
354
355
|
</option>
|
|
@@ -371,7 +372,7 @@ const DataDesigner = (props: DataDesignerProps) => {
|
|
|
371
372
|
defaultValue={'Select'}
|
|
372
373
|
>
|
|
373
374
|
<option value=''>Choose an option</option>
|
|
374
|
-
{Object.keys(
|
|
375
|
+
{Object.keys(firstDataRow).map((value, index) => (
|
|
375
376
|
<option value={value} key={index}>
|
|
376
377
|
{value}
|
|
377
378
|
</option>
|
|
@@ -394,7 +395,7 @@ const DataDesigner = (props: DataDesignerProps) => {
|
|
|
394
395
|
defaultValue={'Select'}
|
|
395
396
|
>
|
|
396
397
|
<option value=''>Choose an option</option>
|
|
397
|
-
{Object.keys(
|
|
398
|
+
{Object.keys(firstDataRow).map((value, index) => (
|
|
398
399
|
<option value={value} key={index}>
|
|
399
400
|
{value}
|
|
400
401
|
</option>
|
|
@@ -417,7 +418,7 @@ const DataDesigner = (props: DataDesignerProps) => {
|
|
|
417
418
|
defaultValue={'Select'}
|
|
418
419
|
>
|
|
419
420
|
<option value=''>Choose an option</option>
|
|
420
|
-
{Object.keys(
|
|
421
|
+
{Object.keys(firstDataRow).map((value, index) => (
|
|
421
422
|
<option value={value} key={index}>
|
|
422
423
|
{value}
|
|
423
424
|
</option>
|
|
@@ -2,6 +2,7 @@ import { useId } from 'react'
|
|
|
2
2
|
|
|
3
3
|
// Third Party
|
|
4
4
|
import { Tooltip as ReactTooltip } from 'react-tooltip'
|
|
5
|
+
import 'react-tooltip/dist/react-tooltip.css'
|
|
5
6
|
import type { PlacesType } from 'react-tooltip'
|
|
6
7
|
|
|
7
8
|
// Styles
|
|
@@ -44,7 +45,7 @@ const Tooltip: React.FC<ToolTipProps> & { Target; Content } = ({
|
|
|
44
45
|
className='cove-tooltip--target'
|
|
45
46
|
data-tooltip-float={float}
|
|
46
47
|
data-tooltip-place={place}
|
|
47
|
-
data-tooltip-
|
|
48
|
+
data-tooltip-isopen={true}
|
|
48
49
|
>
|
|
49
50
|
{tooltipTargetChildren ? tooltipTargetChildren.props.children : null}
|
|
50
51
|
</a>
|