@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.
Files changed (85) hide show
  1. package/dist/{cdcchart-1a1724a1.es.js → cdcchart-dgT_1dIT.es.js} +136 -151
  2. package/dist/cdcchart.js +36258 -34658
  3. package/examples/feature/__data__/planet-example-data.json +1 -1
  4. package/examples/feature/boxplot/valid-boxplot.csv +38 -17
  5. package/examples/private/DEV-11825.json +573 -0
  6. package/examples/private/na.json +913 -0
  7. package/examples/private/test-data.csv +28 -0
  8. package/index.html +2 -121
  9. package/package.json +4 -4
  10. package/src/CdcChart.tsx +8 -11
  11. package/src/CdcChartComponent.tsx +256 -87
  12. package/src/_stories/Chart.Combo.stories.tsx +18 -0
  13. package/src/_stories/Chart.Forecast.stories.tsx +36 -0
  14. package/src/_stories/Chart.HTMLInDataTable.stories.tsx +520 -0
  15. package/src/_stories/Chart.Patterns.stories.tsx +2 -1
  16. package/src/_stories/Chart.PreserveDecimals.stories.tsx +220 -0
  17. package/src/_stories/Chart.SmallMultiples.stories.tsx +47 -0
  18. package/src/_stories/ChartAnnotation.stories.tsx +6 -3
  19. package/src/_stories/ChartBar.Editor.stories.tsx +3580 -0
  20. package/src/_stories/ChartEditor.Editor.stories.tsx +658 -0
  21. package/src/_stories/ChartEditor.stories.tsx +1 -2
  22. package/src/_stories/_mock/combo.json +451 -0
  23. package/src/_stories/_mock/editor-test-configs.json +376 -0
  24. package/src/_stories/_mock/editor-test-datasets.json +477 -0
  25. package/src/_stories/_mock/editor-tests/bar-chart-editor-test.json +255 -0
  26. package/src/_stories/_mock/editor-tests/bar-chart-general-test.json +267 -0
  27. package/src/_stories/_mock/editor-tests/bar-chart-test.json +237 -0
  28. package/src/_stories/_mock/forecast_combo_with_gaps.json +913 -0
  29. package/src/_stories/_mock/pie_config.json +257 -62
  30. package/src/_stories/_mock/small_multiples/small_multiples_bars.json +1944 -0
  31. package/src/_stories/_mock/small_multiples/small_multiples_big_data_bars.json +1114 -0
  32. package/src/_stories/_mock/small_multiples/small_multiples_lines.json +2646 -0
  33. package/src/_stories/_mock/small_multiples/small_multiples_lines_colors.json +1305 -0
  34. package/src/_stories/_mock/small_multiples/small_multiples_stacked_bars.json +1936 -0
  35. package/src/components/Annotations/components/findNearestDatum.ts +6 -41
  36. package/src/components/AreaChart/components/AreaChart.Stacked.jsx +10 -6
  37. package/src/components/AreaChart/index.tsx +1 -2
  38. package/src/components/BarChart/components/BarChart.Horizontal.tsx +4 -4
  39. package/src/components/BarChart/components/BarChart.Vertical.tsx +3 -2
  40. package/src/components/BoxPlot/helpers/index.ts +3 -3
  41. package/src/components/Brush/BrushChart.tsx +1 -1
  42. package/src/components/EditorPanel/EditorPanel.tsx +199 -190
  43. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +96 -111
  44. package/src/components/EditorPanel/components/Panels/Panel.General.tsx +19 -1
  45. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +102 -55
  46. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +54 -49
  47. package/src/components/EditorPanel/components/Panels/Panel.SmallMultiples.tsx +422 -0
  48. package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +75 -21
  49. package/src/components/EditorPanel/components/Panels/index.tsx +3 -1
  50. package/src/components/EditorPanel/editor-panel.scss +0 -20
  51. package/src/components/EditorPanel/useEditorPermissions.ts +7 -15
  52. package/src/components/Forecasting/Forecasting.tsx +139 -21
  53. package/src/components/Legend/Legend.Component.tsx +16 -9
  54. package/src/components/Legend/helpers/createFormatLabels.tsx +181 -181
  55. package/src/components/Legend/helpers/getLegendClasses.ts +0 -1
  56. package/src/components/LineChart/LineChartProps.ts +0 -3
  57. package/src/components/LineChart/helpers.ts +1 -1
  58. package/src/components/LineChart/index.tsx +36 -13
  59. package/src/components/LinearChart.tsx +75 -80
  60. package/src/components/Regions/components/Regions.tsx +3 -24
  61. package/src/components/Sankey/types/index.ts +1 -1
  62. package/src/components/SmallMultiples/SmallMultipleTile.tsx +198 -0
  63. package/src/components/SmallMultiples/SmallMultiples.css +32 -0
  64. package/src/components/SmallMultiples/SmallMultiples.tsx +271 -0
  65. package/src/components/SmallMultiples/index.ts +2 -0
  66. package/src/data/initial-state.js +13 -1
  67. package/src/helpers/buildForecastPaletteOptions.ts +0 -38
  68. package/src/helpers/getColorScale.ts +10 -0
  69. package/src/{hooks/useMinMax.ts → helpers/getMinMax.ts} +14 -7
  70. package/src/helpers/getYAxisAutoPadding.ts +53 -0
  71. package/src/helpers/smallMultiplesHelpers.ts +529 -0
  72. package/src/hooks/useProgrammaticTooltip.ts +96 -0
  73. package/src/hooks/useScales.ts +88 -34
  74. package/src/hooks/useSmallMultipleSynchronization.ts +59 -0
  75. package/src/hooks/useTooltip.tsx +60 -15
  76. package/src/scss/main.scss +1 -80
  77. package/src/store/chart.actions.ts +2 -0
  78. package/src/store/chart.reducer.ts +4 -0
  79. package/src/types/ChartConfig.ts +24 -6
  80. package/src/types/ChartContext.ts +3 -0
  81. package/src/_stories/_mock/pie_data.json +0 -218
  82. package/src/components/AreaChart/components/AreaChart.jsx +0 -109
  83. package/src/helpers/sort.ts +0 -7
  84. package/src/hooks/useActiveElement.js +0 -19
  85. 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 useMinMax from '../../hooks/useMinMax'
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 = { data, config }
637
- const { leftMax, rightMax } = useMinMax(properties)
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 float-left'>Displaying</legend>
1791
- <Tooltip style={{ textTransform: 'none' }}>
1792
- <Tooltip.Target>
1793
- <Icon display='question' style={{ marginLeft: '0.5rem' }} />
1794
- </Tooltip.Target>
1795
- <Tooltip.Content>
1796
- <p>
1797
- A data series is a set of related data points plotted in a chart and typically
1798
- represented in the chart legend.
1799
- </p>
1800
- </Tooltip.Content>
1801
- </Tooltip>
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
- <label>
1917
- <span className='edit-label'>
1918
- Axis Type
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
- </span>
1929
- <select
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
- <label>
2514
- Anchor Line Style
2515
- <select
2516
- value={config.yAxis.anchors[index].lineStyle || ''}
2517
- onChange={e => {
2518
- const copiedAnchors = [...config.yAxis.anchors]
2519
- copiedAnchors[index].lineStyle = e.target.value
2520
- updateConfig({
2521
- ...config,
2522
- yAxis: {
2523
- ...config.yAxis,
2524
- anchors: copiedAnchors
2525
- }
2526
- })
2527
- }}
2528
- >
2529
- <option>Select</option>
2530
- {lineOptions.map(line => (
2531
- <option key={line.key}>{line.value}</option>
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
- <label>
2639
- Anchor Line Style
2640
- <select
2641
- value={config.xAxis.anchors[index].lineStyle || ''}
2642
- onChange={e => {
2643
- const copiedAnchors = [...config.xAxis.anchors]
2644
- copiedAnchors[index].lineStyle = e.target.value
2645
- updateConfig({
2646
- ...config,
2647
- xAxis: {
2648
- ...config.xAxis,
2649
- anchors: copiedAnchors
2650
- }
2651
- })
2652
- }}
2653
- >
2654
- <option>Select</option>
2655
- {lineOptions.map(line => (
2656
- <option key={line.key}>{line.value}</option>
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
- <label>
2866
- <span className='edit-label'>
2867
- Data Scaling Type
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
- </span>
2878
- <select
2879
- value={config.xAxis.type}
2880
- onChange={e =>
2881
- updateConfig({
2882
- ...config,
2883
- xAxis: {
2884
- ...config.xAxis,
2885
- type: e.target.value
2886
- }
2887
- })
2888
- }
2889
- >
2890
- {config.visualizationType !== 'Bump Chart' && (
2891
- <option value='categorical'>Categorical (Linear Scale)</option>
2892
- )}
2893
- {config.visualizationType !== 'Bump Chart' && (
2894
- <option value='date'>Date (Linear Scale)</option>
2895
- )}
2896
- <option value='date-time'>Date (Date Time Scale)</option>
2897
- {config.visualizationType === 'Scatter Plot' && (
2898
- <option value={'continuous'}>Continuous</option>
2899
- )}
2900
- </select>
2901
- </label>
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) || config?.visualizationType === 'Bump Chart') && (
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
- <label>
3617
- <span className='edit-label column-heading'>Value</span>
3618
- <select
3619
- value={config.highlightedBarValues[i].value}
3620
- onChange={e => handleUpdateHighlightedBar(e, i)}
3621
- >
3622
- <option value=''>- Select Value -</option>
3623
- {highlightedSeriesValues &&
3624
- [...new Set(highlightedSeriesValues)]
3625
- .sort()
3626
- .map(option => (
3627
- <option key={`special-class-value-option-${i}-${option}`}>{option}</option>
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
- <label>
3835
- Anchor Line Style
3836
- <select
3837
- value={config.xAxis.anchors[index].lineStyle || ''}
3838
- onChange={e => {
3839
- const copiedAnchors = [...config.xAxis.anchors]
3840
- copiedAnchors[index].lineStyle = e.target.value
3841
- updateConfig({
3842
- ...config,
3843
- xAxis: {
3844
- ...config.xAxis,
3845
- anchors: copiedAnchors
3846
- }
3847
- })
3848
- }}
3849
- >
3850
- <option>Select</option>
3851
- {lineOptions.map(line => (
3852
- <option key={line.key}>{line.value}</option>
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
- <label>
3964
- Anchor Line Style
3965
- <select
3966
- value={config.yAxis.anchors[index].lineStyle || ''}
3967
- onChange={e => {
3968
- const copiedAnchors = [...config.yAxis.anchors]
3969
- copiedAnchors[index].lineStyle = e.target.value
3970
- updateConfig({
3971
- ...config,
3972
- yAxis: {
3973
- ...config.yAxis,
3974
- anchors: copiedAnchors
3975
- }
3976
- })
3977
- }}
3978
- >
3979
- <option>Select</option>
3980
- {lineOptions.map(line => (
3981
- <option key={line.key}>{line.value}</option>
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} />