@cdc/chart 4.25.10 → 4.25.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/dist/{cdcchart-1a1724a1.es.js → cdcchart-dgT_1dIT.es.js} +136 -151
- package/dist/cdcchart.js +36258 -34658
- package/examples/feature/__data__/planet-example-data.json +1 -1
- package/examples/feature/boxplot/valid-boxplot.csv +38 -17
- package/examples/private/DEV-11825.json +573 -0
- package/examples/private/na.json +913 -0
- package/examples/private/test-data.csv +28 -0
- package/index.html +2 -121
- package/package.json +4 -4
- package/src/CdcChart.tsx +8 -11
- package/src/CdcChartComponent.tsx +256 -87
- package/src/_stories/Chart.Combo.stories.tsx +18 -0
- package/src/_stories/Chart.Forecast.stories.tsx +36 -0
- package/src/_stories/Chart.HTMLInDataTable.stories.tsx +520 -0
- package/src/_stories/Chart.Patterns.stories.tsx +2 -1
- package/src/_stories/Chart.PreserveDecimals.stories.tsx +220 -0
- package/src/_stories/Chart.SmallMultiples.stories.tsx +47 -0
- package/src/_stories/ChartAnnotation.stories.tsx +6 -3
- package/src/_stories/ChartBar.Editor.stories.tsx +3580 -0
- package/src/_stories/ChartEditor.Editor.stories.tsx +658 -0
- package/src/_stories/ChartEditor.stories.tsx +1 -2
- package/src/_stories/_mock/combo.json +451 -0
- package/src/_stories/_mock/editor-test-configs.json +376 -0
- package/src/_stories/_mock/editor-test-datasets.json +477 -0
- package/src/_stories/_mock/editor-tests/bar-chart-editor-test.json +255 -0
- package/src/_stories/_mock/editor-tests/bar-chart-general-test.json +267 -0
- package/src/_stories/_mock/editor-tests/bar-chart-test.json +237 -0
- package/src/_stories/_mock/forecast_combo_with_gaps.json +913 -0
- package/src/_stories/_mock/pie_config.json +257 -62
- package/src/_stories/_mock/small_multiples/small_multiples_bars.json +1944 -0
- package/src/_stories/_mock/small_multiples/small_multiples_big_data_bars.json +1114 -0
- package/src/_stories/_mock/small_multiples/small_multiples_lines.json +2646 -0
- package/src/_stories/_mock/small_multiples/small_multiples_lines_colors.json +1305 -0
- package/src/_stories/_mock/small_multiples/small_multiples_stacked_bars.json +1936 -0
- package/src/components/Annotations/components/findNearestDatum.ts +6 -41
- package/src/components/AreaChart/components/AreaChart.Stacked.jsx +10 -6
- package/src/components/AreaChart/index.tsx +1 -2
- package/src/components/BarChart/components/BarChart.Horizontal.tsx +4 -4
- package/src/components/BarChart/components/BarChart.Vertical.tsx +3 -2
- package/src/components/BoxPlot/helpers/index.ts +3 -3
- package/src/components/Brush/BrushChart.tsx +1 -1
- package/src/components/EditorPanel/EditorPanel.tsx +199 -190
- package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +96 -111
- package/src/components/EditorPanel/components/Panels/Panel.General.tsx +19 -1
- package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +102 -55
- package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +54 -49
- package/src/components/EditorPanel/components/Panels/Panel.SmallMultiples.tsx +422 -0
- package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +75 -21
- package/src/components/EditorPanel/components/Panels/index.tsx +3 -1
- package/src/components/EditorPanel/editor-panel.scss +0 -20
- package/src/components/EditorPanel/useEditorPermissions.ts +7 -15
- package/src/components/Forecasting/Forecasting.tsx +139 -21
- package/src/components/Legend/Legend.Component.tsx +16 -9
- package/src/components/Legend/helpers/createFormatLabels.tsx +181 -181
- package/src/components/Legend/helpers/getLegendClasses.ts +0 -1
- package/src/components/LineChart/LineChartProps.ts +0 -3
- package/src/components/LineChart/helpers.ts +1 -1
- package/src/components/LineChart/index.tsx +36 -13
- package/src/components/LinearChart.tsx +75 -80
- package/src/components/Regions/components/Regions.tsx +3 -24
- package/src/components/Sankey/types/index.ts +1 -1
- package/src/components/SmallMultiples/SmallMultipleTile.tsx +198 -0
- package/src/components/SmallMultiples/SmallMultiples.css +32 -0
- package/src/components/SmallMultiples/SmallMultiples.tsx +271 -0
- package/src/components/SmallMultiples/index.ts +2 -0
- package/src/data/initial-state.js +13 -1
- package/src/helpers/buildForecastPaletteOptions.ts +0 -38
- package/src/helpers/getColorScale.ts +10 -0
- package/src/{hooks/useMinMax.ts → helpers/getMinMax.ts} +14 -7
- package/src/helpers/getYAxisAutoPadding.ts +53 -0
- package/src/helpers/smallMultiplesHelpers.ts +529 -0
- package/src/hooks/useProgrammaticTooltip.ts +96 -0
- package/src/hooks/useScales.ts +88 -34
- package/src/hooks/useSmallMultipleSynchronization.ts +59 -0
- package/src/hooks/useTooltip.tsx +60 -15
- package/src/scss/main.scss +1 -80
- package/src/store/chart.actions.ts +2 -0
- package/src/store/chart.reducer.ts +4 -0
- package/src/types/ChartConfig.ts +24 -6
- package/src/types/ChartContext.ts +3 -0
- package/src/_stories/_mock/pie_data.json +0 -218
- package/src/components/AreaChart/components/AreaChart.jsx +0 -109
- package/src/helpers/sort.ts +0 -7
- package/src/hooks/useActiveElement.js +0 -19
- package/src/hooks/useChartClasses.js +0 -41
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect, useCallback, memo, useContext } from 'react'
|
|
2
|
-
import { DragDropContext, Droppable } from '@hello-pangea/dnd'
|
|
2
|
+
import { DragDropContext, Droppable, Draggable } from '@hello-pangea/dnd'
|
|
3
3
|
import chroma from 'chroma-js'
|
|
4
4
|
import { isDateScale } from '@cdc/core/helpers/cove/date'
|
|
5
5
|
import {
|
|
@@ -36,11 +36,12 @@ import ConfigContext from '../../ConfigContext'
|
|
|
36
36
|
import useReduceData from '../../hooks/useReduceData'
|
|
37
37
|
import useRightAxis from '../../hooks/useRightAxis'
|
|
38
38
|
import WarningImage from '../../images/warning.svg'
|
|
39
|
-
import
|
|
39
|
+
import getMinMax from '../../helpers/getMinMax'
|
|
40
40
|
|
|
41
41
|
import { type ChartContext } from '../../types/ChartContext'
|
|
42
42
|
import { type ChartConfig } from '../../types/ChartConfig'
|
|
43
43
|
|
|
44
|
+
import '@cdc/core/components/EditorPanel/EditorPanel.styles.css'
|
|
44
45
|
import './editor-panel.scss'
|
|
45
46
|
import { Anchor } from '@cdc/core/types/Axis'
|
|
46
47
|
import EditorPanelContext from './EditorPanelContext'
|
|
@@ -633,8 +634,16 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
633
634
|
} = useContext<ChartContext>(ConfigContext)
|
|
634
635
|
|
|
635
636
|
const { minValue, maxValue, existPositiveValue, isAllLine } = useReduceData(config, unfilteredData)
|
|
636
|
-
const properties = {
|
|
637
|
-
|
|
637
|
+
const properties = {
|
|
638
|
+
data,
|
|
639
|
+
tableData: data,
|
|
640
|
+
config,
|
|
641
|
+
minValue,
|
|
642
|
+
maxValue,
|
|
643
|
+
existPositiveValue,
|
|
644
|
+
isAllLine
|
|
645
|
+
}
|
|
646
|
+
const { leftMax, rightMax } = getMinMax(properties)
|
|
638
647
|
|
|
639
648
|
const {
|
|
640
649
|
visHasAnchors,
|
|
@@ -1787,18 +1796,20 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
1787
1796
|
handleForecastPaletteSelection={handleForecastPaletteSelection}
|
|
1788
1797
|
>
|
|
1789
1798
|
<fieldset>
|
|
1790
|
-
<legend className='edit-label
|
|
1791
|
-
|
|
1792
|
-
<Tooltip
|
|
1793
|
-
<
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
<
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1799
|
+
<legend className='edit-label d-flex align-items-center'>
|
|
1800
|
+
Displaying
|
|
1801
|
+
<Tooltip style={{ textTransform: 'none' }}>
|
|
1802
|
+
<Tooltip.Target>
|
|
1803
|
+
<Icon display='question' style={{ marginLeft: '0.5rem' }} />
|
|
1804
|
+
</Tooltip.Target>
|
|
1805
|
+
<Tooltip.Content>
|
|
1806
|
+
<p>
|
|
1807
|
+
A data series is a set of related data points plotted in a chart and typically
|
|
1808
|
+
represented in the chart legend.
|
|
1809
|
+
</p>
|
|
1810
|
+
</Tooltip.Content>
|
|
1811
|
+
</Tooltip>
|
|
1812
|
+
</legend>
|
|
1802
1813
|
</fieldset>
|
|
1803
1814
|
|
|
1804
1815
|
<DragDropContext
|
|
@@ -1913,9 +1924,30 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
1913
1924
|
)}
|
|
1914
1925
|
{config.visualizationType !== 'Pie' && (
|
|
1915
1926
|
<>
|
|
1916
|
-
<
|
|
1917
|
-
|
|
1918
|
-
|
|
1927
|
+
<Select
|
|
1928
|
+
label='Axis Type'
|
|
1929
|
+
value={config.yAxis.type}
|
|
1930
|
+
options={[
|
|
1931
|
+
{ value: 'linear', label: 'Numeric (Linear Scale)' },
|
|
1932
|
+
...(config.visualizationSubType !== 'stacked'
|
|
1933
|
+
? [{ value: 'logarithmic', label: 'Numeric (Logarithmic Scale)' }]
|
|
1934
|
+
: []),
|
|
1935
|
+
...(config.orientation !== 'horizontal'
|
|
1936
|
+
? [{ value: 'categorical', label: 'Categorical' }]
|
|
1937
|
+
: [])
|
|
1938
|
+
]}
|
|
1939
|
+
section='yAxis'
|
|
1940
|
+
fieldName='type'
|
|
1941
|
+
updateField={(_section, _subsection, _fieldName, value) => {
|
|
1942
|
+
updateConfig({
|
|
1943
|
+
...config,
|
|
1944
|
+
yAxis: {
|
|
1945
|
+
...config.yAxis,
|
|
1946
|
+
type: value
|
|
1947
|
+
}
|
|
1948
|
+
})
|
|
1949
|
+
}}
|
|
1950
|
+
tooltip={
|
|
1919
1951
|
<Tooltip style={{ textTransform: 'none', display: 'inline-block' }}>
|
|
1920
1952
|
<Tooltip.Target>
|
|
1921
1953
|
<Icon display='question' style={{ marginLeft: '0.5rem' }} />
|
|
@@ -1925,26 +1957,8 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
1925
1957
|
exponential data, or 'Categorical' for discrete categories.
|
|
1926
1958
|
</Tooltip.Content>
|
|
1927
1959
|
</Tooltip>
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
value={config.yAxis.type}
|
|
1931
|
-
onChange={e =>
|
|
1932
|
-
updateConfig({
|
|
1933
|
-
...config,
|
|
1934
|
-
yAxis: {
|
|
1935
|
-
...config.yAxis,
|
|
1936
|
-
type: e.target.value
|
|
1937
|
-
}
|
|
1938
|
-
})
|
|
1939
|
-
}
|
|
1940
|
-
>
|
|
1941
|
-
<option value='linear'>Numeric (Linear Scale)</option>
|
|
1942
|
-
{config.visualizationSubType !== 'stacked' && (
|
|
1943
|
-
<option value='logarithmic'>Numeric (Logarithmic Scale)</option>
|
|
1944
|
-
)}
|
|
1945
|
-
{config.orientation !== 'horizontal' && <option value='categorical'>Categorical</option>}
|
|
1946
|
-
</select>
|
|
1947
|
-
</label>
|
|
1960
|
+
}
|
|
1961
|
+
/>
|
|
1948
1962
|
<CategoricalAxis
|
|
1949
1963
|
config={config}
|
|
1950
1964
|
updateConfig={updateConfig}
|
|
@@ -1990,25 +2004,6 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
1990
2004
|
</Tooltip>
|
|
1991
2005
|
}
|
|
1992
2006
|
/>
|
|
1993
|
-
<TextField
|
|
1994
|
-
display={!visHasCategoricalAxis()}
|
|
1995
|
-
value={config.yAxis.inlineLabel}
|
|
1996
|
-
section='yAxis'
|
|
1997
|
-
fieldName='inlineLabel'
|
|
1998
|
-
label='Inline Label'
|
|
1999
|
-
updateField={updateFieldDeprecated}
|
|
2000
|
-
maxLength={35}
|
|
2001
|
-
tooltip={
|
|
2002
|
-
<Tooltip style={{ textTransform: 'none' }}>
|
|
2003
|
-
<Tooltip.Target>
|
|
2004
|
-
<Icon display='question' style={{ marginLeft: '0.5rem' }} />
|
|
2005
|
-
</Tooltip.Target>
|
|
2006
|
-
<Tooltip.Content>
|
|
2007
|
-
<p>35 character limit</p>
|
|
2008
|
-
</Tooltip.Content>
|
|
2009
|
-
</Tooltip>
|
|
2010
|
-
}
|
|
2011
|
-
/>
|
|
2012
2007
|
{config.runtime.seriesKeys &&
|
|
2013
2008
|
config.runtime.seriesKeys.length === 1 &&
|
|
2014
2009
|
!['Box Plot', 'Deviation Bar', 'Forest Plot'].includes(config.visualizationType) && (
|
|
@@ -2247,6 +2242,30 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
2247
2242
|
updateField={updateFieldDeprecated}
|
|
2248
2243
|
min={0}
|
|
2249
2244
|
/>{' '}
|
|
2245
|
+
<CheckBox
|
|
2246
|
+
value={config.dataFormat.preserveOriginalDecimals}
|
|
2247
|
+
section='dataFormat'
|
|
2248
|
+
fieldName='preserveOriginalDecimals'
|
|
2249
|
+
label='Preserve Original Decimal Places'
|
|
2250
|
+
updateField={updateFieldDeprecated}
|
|
2251
|
+
tooltip={
|
|
2252
|
+
<Tooltip style={{ textTransform: 'none' }}>
|
|
2253
|
+
<Tooltip.Target>
|
|
2254
|
+
<Icon
|
|
2255
|
+
display='question'
|
|
2256
|
+
style={{ marginLeft: '0.5rem', display: 'inline-block', whiteSpace: 'nowrap' }}
|
|
2257
|
+
/>
|
|
2258
|
+
</Tooltip.Target>
|
|
2259
|
+
<Tooltip.Content>
|
|
2260
|
+
<p>
|
|
2261
|
+
When enabled, numbers will display with their original decimal places from the data source,
|
|
2262
|
+
bypassing the "Round to decimal point" setting above. This is useful when you have mixed
|
|
2263
|
+
data (e.g., whole numbers in one column and percentages with decimals in another).
|
|
2264
|
+
</p>
|
|
2265
|
+
</Tooltip.Content>
|
|
2266
|
+
</Tooltip>
|
|
2267
|
+
}
|
|
2268
|
+
/>
|
|
2250
2269
|
<div className='two-col-inputs'>
|
|
2251
2270
|
<TextField
|
|
2252
2271
|
value={config.dataFormat.prefix}
|
|
@@ -2510,28 +2529,25 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
2510
2529
|
/>
|
|
2511
2530
|
</label>
|
|
2512
2531
|
|
|
2513
|
-
<
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
yAxis
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
))}
|
|
2533
|
-
</select>
|
|
2534
|
-
</label>
|
|
2532
|
+
<Select
|
|
2533
|
+
value={config.yAxis.anchors[index].lineStyle || ''}
|
|
2534
|
+
label='Anchor Line Style'
|
|
2535
|
+
onChange={e => {
|
|
2536
|
+
const copiedAnchors = [...config.yAxis.anchors]
|
|
2537
|
+
copiedAnchors[index].lineStyle = e.target.value
|
|
2538
|
+
updateConfig({
|
|
2539
|
+
...config,
|
|
2540
|
+
yAxis: {
|
|
2541
|
+
...config.yAxis,
|
|
2542
|
+
anchors: copiedAnchors
|
|
2543
|
+
}
|
|
2544
|
+
})
|
|
2545
|
+
}}
|
|
2546
|
+
options={[
|
|
2547
|
+
{ value: '', label: 'Select' },
|
|
2548
|
+
...lineOptions.map(line => ({ value: line.value, label: line.value }))
|
|
2549
|
+
]}
|
|
2550
|
+
/>
|
|
2535
2551
|
</AccordionItemPanel>
|
|
2536
2552
|
</AccordionItem>
|
|
2537
2553
|
))}
|
|
@@ -2635,28 +2651,25 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
2635
2651
|
/>
|
|
2636
2652
|
</label>
|
|
2637
2653
|
|
|
2638
|
-
<
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
xAxis
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
))}
|
|
2658
|
-
</select>
|
|
2659
|
-
</label>
|
|
2654
|
+
<Select
|
|
2655
|
+
value={config.xAxis.anchors[index].lineStyle || ''}
|
|
2656
|
+
label='Anchor Line Style'
|
|
2657
|
+
onChange={e => {
|
|
2658
|
+
const copiedAnchors = [...config.xAxis.anchors]
|
|
2659
|
+
copiedAnchors[index].lineStyle = e.target.value
|
|
2660
|
+
updateConfig({
|
|
2661
|
+
...config,
|
|
2662
|
+
xAxis: {
|
|
2663
|
+
...config.xAxis,
|
|
2664
|
+
anchors: copiedAnchors
|
|
2665
|
+
}
|
|
2666
|
+
})
|
|
2667
|
+
}}
|
|
2668
|
+
options={[
|
|
2669
|
+
{ value: '', label: 'Select' },
|
|
2670
|
+
...lineOptions.map(line => ({ value: line.value, label: line.value }))
|
|
2671
|
+
]}
|
|
2672
|
+
/>
|
|
2660
2673
|
</AccordionItemPanel>
|
|
2661
2674
|
</AccordionItem>
|
|
2662
2675
|
))}
|
|
@@ -2862,9 +2875,9 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
2862
2875
|
<>
|
|
2863
2876
|
{config.visualizationType !== 'Forest Plot' && (
|
|
2864
2877
|
<>
|
|
2865
|
-
<
|
|
2866
|
-
|
|
2867
|
-
|
|
2878
|
+
<Select
|
|
2879
|
+
label='Data Scaling Type'
|
|
2880
|
+
tooltip={
|
|
2868
2881
|
<Tooltip style={{ textTransform: 'none', display: 'inline-block' }}>
|
|
2869
2882
|
<Tooltip.Target>
|
|
2870
2883
|
<Icon display='question' style={{ marginLeft: '0.5rem' }} />
|
|
@@ -2874,31 +2887,32 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
2874
2887
|
time-series data.
|
|
2875
2888
|
</Tooltip.Content>
|
|
2876
2889
|
</Tooltip>
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2890
|
+
}
|
|
2891
|
+
value={config.xAxis.type}
|
|
2892
|
+
options={[
|
|
2893
|
+
...(!['Bump Chart', 'Forecasting'].includes(config.visualizationType)
|
|
2894
|
+
? [{ label: 'Categorical (Linear Scale)', value: 'categorical' }]
|
|
2895
|
+
: []),
|
|
2896
|
+
...(!['Bump Chart'].includes(config.visualizationType)
|
|
2897
|
+
? [{ label: 'Date (Linear Scale)', value: 'date' }]
|
|
2898
|
+
: []),
|
|
2899
|
+
{ label: 'Date (Date Time Scale)', value: 'date-time' },
|
|
2900
|
+
...(config.visualizationType === 'Scatter Plot'
|
|
2901
|
+
? [{ label: 'Continuous', value: 'continuous' }]
|
|
2902
|
+
: [])
|
|
2903
|
+
]}
|
|
2904
|
+
section='xAxis'
|
|
2905
|
+
fieldName='type'
|
|
2906
|
+
updateField={(_section, _subsection, _fieldName, value) => {
|
|
2907
|
+
updateConfig({
|
|
2908
|
+
...config,
|
|
2909
|
+
xAxis: {
|
|
2910
|
+
...config.xAxis,
|
|
2911
|
+
type: value
|
|
2912
|
+
}
|
|
2913
|
+
})
|
|
2914
|
+
}}
|
|
2915
|
+
/>
|
|
2902
2916
|
<CheckBox
|
|
2903
2917
|
value={config.xAxis.manual}
|
|
2904
2918
|
section='xAxis'
|
|
@@ -3079,7 +3093,9 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
3079
3093
|
</>
|
|
3080
3094
|
)}
|
|
3081
3095
|
|
|
3082
|
-
{(isDateScale(config.xAxis) ||
|
|
3096
|
+
{(isDateScale(config.xAxis) ||
|
|
3097
|
+
config?.visualizationType === 'Bump Chart' ||
|
|
3098
|
+
config?.visualizationType === 'Forecasting') && (
|
|
3083
3099
|
<>
|
|
3084
3100
|
<p style={{ padding: '1.5em 0 0.5em', fontSize: '.9rem', lineHeight: '1rem' }}>
|
|
3085
3101
|
Format how charts should parse and display your dates using{' '}
|
|
@@ -3613,21 +3629,19 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
3613
3629
|
Remove
|
|
3614
3630
|
</button>
|
|
3615
3631
|
<p>Highlighted Bar {i + 1}</p>
|
|
3616
|
-
<
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
</select>
|
|
3630
|
-
</label>
|
|
3632
|
+
<Select
|
|
3633
|
+
value={config.highlightedBarValues[i].value}
|
|
3634
|
+
label='Value'
|
|
3635
|
+
onChange={e => handleUpdateHighlightedBar(e, i)}
|
|
3636
|
+
options={[
|
|
3637
|
+
{ value: '', label: '- Select Value -' },
|
|
3638
|
+
...(highlightedSeriesValues
|
|
3639
|
+
? [...new Set(highlightedSeriesValues)]
|
|
3640
|
+
.sort()
|
|
3641
|
+
.map(option => ({ value: option, label: option }))
|
|
3642
|
+
: [])
|
|
3643
|
+
]}
|
|
3644
|
+
/>
|
|
3631
3645
|
<label>
|
|
3632
3646
|
<span className='edit-label column-heading'>Color</span>
|
|
3633
3647
|
<input
|
|
@@ -3831,28 +3845,25 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
3831
3845
|
/>
|
|
3832
3846
|
</label>
|
|
3833
3847
|
|
|
3834
|
-
<
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
xAxis
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
))}
|
|
3854
|
-
</select>
|
|
3855
|
-
</label>
|
|
3848
|
+
<Select
|
|
3849
|
+
value={config.xAxis.anchors[index].lineStyle || ''}
|
|
3850
|
+
label='Anchor Line Style'
|
|
3851
|
+
onChange={e => {
|
|
3852
|
+
const copiedAnchors = [...config.xAxis.anchors]
|
|
3853
|
+
copiedAnchors[index].lineStyle = e.target.value
|
|
3854
|
+
updateConfig({
|
|
3855
|
+
...config,
|
|
3856
|
+
xAxis: {
|
|
3857
|
+
...config.xAxis,
|
|
3858
|
+
anchors: copiedAnchors
|
|
3859
|
+
}
|
|
3860
|
+
})
|
|
3861
|
+
}}
|
|
3862
|
+
options={[
|
|
3863
|
+
{ value: '', label: 'Select' },
|
|
3864
|
+
...lineOptions.map(line => ({ value: line.value, label: line.value }))
|
|
3865
|
+
]}
|
|
3866
|
+
/>
|
|
3856
3867
|
</AccordionItemPanel>
|
|
3857
3868
|
</AccordionItem>
|
|
3858
3869
|
))}
|
|
@@ -3960,28 +3971,25 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
3960
3971
|
/>
|
|
3961
3972
|
</label>
|
|
3962
3973
|
|
|
3963
|
-
<
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
yAxis
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
))}
|
|
3983
|
-
</select>
|
|
3984
|
-
</label>
|
|
3974
|
+
<Select
|
|
3975
|
+
value={config.yAxis.anchors[index].lineStyle || ''}
|
|
3976
|
+
label='Anchor Line Style'
|
|
3977
|
+
onChange={e => {
|
|
3978
|
+
const copiedAnchors = [...config.yAxis.anchors]
|
|
3979
|
+
copiedAnchors[index].lineStyle = e.target.value
|
|
3980
|
+
updateConfig({
|
|
3981
|
+
...config,
|
|
3982
|
+
yAxis: {
|
|
3983
|
+
...config.yAxis,
|
|
3984
|
+
anchors: copiedAnchors
|
|
3985
|
+
}
|
|
3986
|
+
})
|
|
3987
|
+
}}
|
|
3988
|
+
options={[
|
|
3989
|
+
{ value: '', label: 'Select' },
|
|
3990
|
+
...lineOptions.map(line => ({ value: line.value, label: line.value }))
|
|
3991
|
+
]}
|
|
3992
|
+
/>
|
|
3985
3993
|
</AccordionItemPanel>
|
|
3986
3994
|
</AccordionItem>
|
|
3987
3995
|
))}
|
|
@@ -4461,6 +4469,7 @@ const EditorPanel: React.FC<ChartEditorPanelProps> = ({ datasets }) => {
|
|
|
4461
4469
|
onMarkupVariablesChange={variables => updateField(null, null, 'markupVariables', variables)}
|
|
4462
4470
|
onToggleEnable={enabled => updateField(null, null, 'enableMarkupVariables', enabled)}
|
|
4463
4471
|
/>
|
|
4472
|
+
<Panels.SmallMultiples name='Small Multiples' />
|
|
4464
4473
|
</Accordion>
|
|
4465
4474
|
{config.type !== 'Spark Line' && (
|
|
4466
4475
|
<AdvancedEditor loadConfig={updateConfig} config={config} convertStateToConfig={convertStateToConfig} />
|