@cdc/chart 4.26.1 → 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.
Files changed (132) hide show
  1. package/CLAUDE.local.md +79 -0
  2. package/dist/{cdcchart-dgT_1dIT.es.js → cdcchart-DQ00cQCm.es.js} +1 -20
  3. package/dist/cdcchart.js +45357 -43655
  4. package/examples/default.json +378 -0
  5. package/examples/feature/__data__/horizon-chart-data.json +373 -0
  6. package/examples/feature/annotations/index.json +3 -6
  7. package/examples/feature/horizon/horizon-chart.json +395 -0
  8. package/examples/line-chart-states.json +1085 -0
  9. package/examples/private/123.json +694 -0
  10. package/examples/private/anchor-issue.json +4094 -0
  11. package/examples/private/backwards-slider.json +10430 -0
  12. package/examples/private/georgia.csv +160 -0
  13. package/examples/private/timeline-data.json +1 -0
  14. package/examples/private/timeline.json +389 -0
  15. package/examples/radar-chart-simple.json +133 -0
  16. package/examples/radar-chart.json +148 -0
  17. package/index.html +1 -31
  18. package/package.json +57 -59
  19. package/src/CdcChartComponent.tsx +99 -18
  20. package/src/_stories/Chart.Anchors.stories.tsx +10 -0
  21. package/src/_stories/Chart.BoxPlot.stories.tsx +7 -0
  22. package/src/_stories/Chart.CI.stories.tsx +13 -0
  23. package/src/_stories/Chart.Combo.stories.tsx +17 -0
  24. package/src/_stories/Chart.CustomColors.stories.tsx +4 -0
  25. package/src/_stories/Chart.DynamicSeries.stories.tsx +19 -0
  26. package/src/_stories/Chart.Filters.stories.tsx +4 -0
  27. package/src/_stories/Chart.Forecast.stories.tsx +4 -0
  28. package/src/_stories/Chart.HTMLInDataTable.stories.tsx +22 -0
  29. package/src/_stories/Chart.Legend.Gradient.stories.tsx +28 -0
  30. package/src/_stories/Chart.Patterns.stories.tsx +4 -0
  31. package/src/_stories/Chart.PreserveDecimals.stories.tsx +25 -0
  32. package/src/_stories/Chart.Regions.Categorical.stories.tsx +13 -0
  33. package/src/_stories/Chart.Regions.DateScale.stories.tsx +19 -0
  34. package/src/_stories/Chart.Regions.DateTimeScale.stories.tsx +25 -10
  35. package/src/_stories/Chart.ScatterPlot.stories.tsx +4 -0
  36. package/src/_stories/Chart.SmallMultiples.stories.tsx +16 -0
  37. package/src/_stories/Chart.stories.tsx +37 -0
  38. package/src/_stories/Chart.tooltip.stories.tsx +7 -0
  39. package/src/_stories/ChartAnnotation.stories.tsx +10 -0
  40. package/src/_stories/ChartAxisLabels.stories.tsx +4 -0
  41. package/src/_stories/ChartAxisTitles.stories.tsx +10 -0
  42. package/src/_stories/ChartBrush.Matrix.Continuous.stories.tsx +41 -0
  43. package/src/_stories/ChartBrush.Matrix.Date.stories.tsx +114 -0
  44. package/src/_stories/ChartBrush.Matrix.DateTime.stories.tsx +78 -0
  45. package/src/_stories/ChartBrush.stories.tsx +7 -0
  46. package/src/_stories/ChartEditor.stories.tsx +7 -0
  47. package/src/_stories/ChartLine.QuadrantAngles.stories.tsx +89 -0
  48. package/src/_stories/ChartLine.Suppression.stories.tsx +7 -0
  49. package/src/_stories/ChartLine.Symbols.stories.tsx +4 -0
  50. package/src/_stories/ChartPrefixSuffix.stories.tsx +46 -1
  51. package/src/_stories/TechAdoptionWithLinks.stories.tsx +7 -0
  52. package/src/_stories/_mock/brush_continuous.json +86 -0
  53. package/src/_stories/_mock/brush_date_large.json +176 -0
  54. package/src/_stories/_mock/line_chart_angle_near_zero_fall.json +195 -0
  55. package/src/_stories/_mock/line_chart_angle_near_zero_rise.json +195 -0
  56. package/src/_stories/_mock/line_chart_angle_q1_steep_upward.json +195 -0
  57. package/src/_stories/_mock/line_chart_angle_q2_gentle_downward.json +195 -0
  58. package/src/_stories/_mock/line_chart_angle_q3_steep_downward.json +195 -0
  59. package/src/_stories/_mock/line_chart_angle_q4_gentle_upward.json +195 -0
  60. package/src/_stories/_mock/line_chart_quadrant_angles.json +264 -0
  61. package/src/components/Annotations/components/AnnotationDraggable.styles.css +11 -17
  62. package/src/components/Annotations/components/AnnotationDraggable.tsx +240 -116
  63. package/src/components/Annotations/components/AnnotationDropdown.styles.css +1 -2
  64. package/src/components/Annotations/components/AnnotationDropdown.tsx +8 -12
  65. package/src/components/Annotations/components/AnnotationList.styles.css +4 -10
  66. package/src/components/Annotations/components/AnnotationList.tsx +5 -4
  67. package/src/components/Annotations/components/findNearestDatum.ts +75 -85
  68. package/src/components/Annotations/helpers/getVisibleAnnotations.ts +38 -0
  69. package/src/components/Axis/BottomAxis.tsx +270 -0
  70. package/src/components/Axis/LeftAxis.tsx +404 -0
  71. package/src/components/Axis/LeftAxisGridlines.tsx +77 -0
  72. package/src/components/Axis/PairedBarAxis.tsx +186 -0
  73. package/src/components/Axis/README.md +94 -0
  74. package/src/components/Axis/RightAxis.tsx +108 -0
  75. package/src/components/Axis/axis.constants.ts +21 -0
  76. package/src/components/Axis/index.ts +7 -0
  77. package/src/components/BarChart/components/BarChart.tsx +7 -1
  78. package/src/components/Brush/BrushSelector.tsx +154 -22
  79. package/src/components/Brush/MiniChartPreview.tsx +138 -21
  80. package/src/components/EditorPanel/EditorPanel.tsx +25 -11
  81. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +60 -22
  82. package/src/components/EditorPanel/components/Panels/Panel.General.tsx +81 -1
  83. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +1 -1
  84. package/src/components/EditorPanel/components/Panels/Panel.Radar.tsx +353 -0
  85. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +0 -1
  86. package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +21 -1
  87. package/src/components/EditorPanel/components/Panels/index.tsx +2 -0
  88. package/src/components/EditorPanel/useEditorPermissions.ts +55 -26
  89. package/src/components/HorizonChart/HorizonChart.tsx +131 -0
  90. package/src/components/HorizonChart/components/HorizonBand.tsx +160 -0
  91. package/src/components/HorizonChart/helpers/calculateHorizonBands.ts +27 -0
  92. package/src/components/HorizonChart/helpers/getHorizonLayerColors.ts +40 -0
  93. package/src/components/HorizonChart/index.tsx +3 -0
  94. package/src/components/Legend/Legend.Component.tsx +52 -4
  95. package/src/components/Legend/Legend.tsx +1 -1
  96. package/src/components/Legend/LegendValueRange.tsx +77 -0
  97. package/src/components/Legend/helpers/createFormatLabels.tsx +13 -0
  98. package/src/components/Legend/helpers/generateValueRanges.ts +92 -0
  99. package/src/components/LineChart/helpers/README.md +292 -0
  100. package/src/components/LineChart/helpers/labelPositioning.test.ts +245 -0
  101. package/src/components/LineChart/helpers/labelPositioning.ts +304 -0
  102. package/src/components/LineChart/index.tsx +44 -8
  103. package/src/components/LinearChart/README.md +109 -0
  104. package/src/components/LinearChart/VisualizationRenderer.tsx +267 -0
  105. package/src/components/LinearChart/linearChart.constants.ts +84 -0
  106. package/src/components/LinearChart/tests/LinearChart.test.tsx +201 -0
  107. package/src/components/LinearChart/tests/mockConfigContext.ts +129 -0
  108. package/src/components/LinearChart/utils/tickFormatting.ts +146 -0
  109. package/src/components/LinearChart.tsx +250 -1059
  110. package/src/components/PieChart/PieChart.tsx +1 -1
  111. package/src/components/RadarChart/RadarAxis.tsx +78 -0
  112. package/src/components/RadarChart/RadarChart.tsx +298 -0
  113. package/src/components/RadarChart/RadarGrid.tsx +64 -0
  114. package/src/components/RadarChart/RadarPolygon.tsx +91 -0
  115. package/src/components/RadarChart/helpers.ts +83 -0
  116. package/src/components/RadarChart/index.tsx +3 -0
  117. package/src/components/WarmingStripes/WarmingStripes.tsx +95 -25
  118. package/src/data/initial-state.js +14 -1
  119. package/src/helpers/getExcludedData.ts +4 -0
  120. package/src/helpers/handleChartAriaLabels.ts +19 -19
  121. package/src/helpers/handleLineType.ts +22 -18
  122. package/src/hooks/useProgrammaticTooltip.ts +23 -2
  123. package/src/hooks/useScales.ts +7 -0
  124. package/src/hooks/useTooltip.tsx +3 -0
  125. package/src/scss/main.scss +5 -0
  126. package/src/selectors/README.md +68 -0
  127. package/src/store/chart.reducer.ts +2 -0
  128. package/src/types/ChartConfig.ts +18 -0
  129. package/src/types/ChartContext.ts +1 -0
  130. package/src/types/Horizon.ts +64 -0
  131. package/preview.html +0 -1616
  132. package/src/components/Annotations/components/helpers/index.tsx +0 -46
@@ -0,0 +1,353 @@
1
+ import { useContext, FC } from 'react'
2
+ import {
3
+ AccordionItem,
4
+ AccordionItemHeading,
5
+ AccordionItemPanel,
6
+ AccordionItemButton
7
+ } from 'react-accessible-accordion'
8
+ import { TextField, Select, CheckBox } from '@cdc/core/components/EditorPanel/Inputs'
9
+ import Tooltip from '@cdc/core/components/ui/Tooltip'
10
+ import Icon from '@cdc/core/components/ui/Icon'
11
+ import ConfigContext from '../../../../ConfigContext'
12
+ import { useEditorPanelContext } from '../../EditorPanelContext'
13
+ import { type PanelProps } from './../PanelProps'
14
+ import { ChartContext } from '../../../../types/ChartContext'
15
+
16
+ const PanelRadar: FC<PanelProps> = props => {
17
+ const { config, rawData } = useContext<ChartContext>(ConfigContext)
18
+ const { updateField } = useEditorPanelContext()
19
+
20
+ if (config.visualizationType !== 'Radar') return null
21
+
22
+ const radar = config.radar || {}
23
+
24
+ // Get available columns from the data
25
+ const getColumns = () => {
26
+ if (!rawData || rawData.length === 0) return []
27
+ return Object.keys(rawData[0])
28
+ }
29
+
30
+ return (
31
+ <AccordionItem>
32
+ <AccordionItemHeading>
33
+ <AccordionItemButton>{props.name}</AccordionItemButton>
34
+ </AccordionItemHeading>
35
+ <AccordionItemPanel>
36
+ {/* Data Settings */}
37
+ <fieldset className='fieldset'>
38
+ <legend style={{ fontSize: '16px', fontWeight: 'bold', marginBottom: '10px' }}>Data Settings</legend>
39
+
40
+ <Select
41
+ value={config.xAxis?.dataKey || ''}
42
+ section='xAxis'
43
+ fieldName='dataKey'
44
+ label='Category Column'
45
+ initial='Select'
46
+ required={true}
47
+ updateField={updateField}
48
+ options={getColumns()}
49
+ tooltip={
50
+ <Tooltip style={{ textTransform: 'none' }}>
51
+ <Tooltip.Target>
52
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
53
+ </Tooltip.Target>
54
+ <Tooltip.Content>
55
+ <p>Select the column containing category labels for each axis of the radar chart.</p>
56
+ </Tooltip.Content>
57
+ </Tooltip>
58
+ }
59
+ />
60
+ </fieldset>
61
+
62
+ {/* Number Formatting */}
63
+ <fieldset className='fieldset' style={{ marginTop: '20px' }}>
64
+ <legend style={{ fontSize: '16px', fontWeight: 'bold', marginBottom: '10px' }}>Number Formatting</legend>
65
+
66
+ <CheckBox
67
+ value={config.dataFormat?.commas}
68
+ section='dataFormat'
69
+ fieldName='commas'
70
+ label='Add Commas'
71
+ updateField={updateField}
72
+ tooltip={
73
+ <Tooltip style={{ textTransform: 'none' }}>
74
+ <Tooltip.Target>
75
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
76
+ </Tooltip.Target>
77
+ <Tooltip.Content>
78
+ <p>Add commas to numeric values in tooltips and data table.</p>
79
+ </Tooltip.Content>
80
+ </Tooltip>
81
+ }
82
+ />
83
+
84
+ <TextField
85
+ value={config.dataFormat?.roundTo ?? 0}
86
+ type='number'
87
+ section='dataFormat'
88
+ fieldName='roundTo'
89
+ label='Round to Decimal Point'
90
+ updateField={updateField}
91
+ min={0}
92
+ />
93
+
94
+ <div className='two-col-inputs'>
95
+ <TextField
96
+ value={config.dataFormat?.prefix || ''}
97
+ section='dataFormat'
98
+ fieldName='prefix'
99
+ label='Prefix'
100
+ updateField={updateField}
101
+ tooltip={
102
+ <Tooltip style={{ textTransform: 'none' }}>
103
+ <Tooltip.Target>
104
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
105
+ </Tooltip.Target>
106
+ <Tooltip.Content>
107
+ <p>Enter a data prefix (such as "$"), if applicable.</p>
108
+ </Tooltip.Content>
109
+ </Tooltip>
110
+ }
111
+ />
112
+ <TextField
113
+ value={config.dataFormat?.suffix || ''}
114
+ section='dataFormat'
115
+ fieldName='suffix'
116
+ label='Suffix'
117
+ updateField={updateField}
118
+ tooltip={
119
+ <Tooltip style={{ textTransform: 'none' }}>
120
+ <Tooltip.Target>
121
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
122
+ </Tooltip.Target>
123
+ <Tooltip.Content>
124
+ <p>Enter a data suffix (such as "%"), if applicable.</p>
125
+ </Tooltip.Content>
126
+ </Tooltip>
127
+ }
128
+ />
129
+ </div>
130
+ </fieldset>
131
+
132
+ {/* Grid Settings */}
133
+ <fieldset className='fieldset' style={{ marginTop: '20px' }}>
134
+ <legend style={{ fontSize: '16px', fontWeight: 'bold', marginBottom: '10px' }}>Grid Settings</legend>
135
+
136
+ <TextField
137
+ type='number'
138
+ value={radar.gridRings ?? 5}
139
+ fieldName='gridRings'
140
+ section='radar'
141
+ label='Number of Grid Rings'
142
+ updateField={updateField}
143
+ min={3}
144
+ max={10}
145
+ tooltip={
146
+ <Tooltip style={{ textTransform: 'none' }}>
147
+ <Tooltip.Target>
148
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
149
+ </Tooltip.Target>
150
+ <Tooltip.Content>
151
+ <p>Number of concentric rings in the grid (3-10)</p>
152
+ </Tooltip.Content>
153
+ </Tooltip>
154
+ }
155
+ />
156
+
157
+ <CheckBox
158
+ value={radar.showGridRings ?? true}
159
+ fieldName='showGridRings'
160
+ section='radar'
161
+ label='Show Grid Rings'
162
+ updateField={updateField}
163
+ />
164
+
165
+ <Select
166
+ value={radar.gridRingStyle ?? 'polygons'}
167
+ fieldName='gridRingStyle'
168
+ section='radar'
169
+ label='Grid Style'
170
+ updateField={updateField}
171
+ options={['polygons', 'circles']}
172
+ tooltip={
173
+ <Tooltip style={{ textTransform: 'none' }}>
174
+ <Tooltip.Target>
175
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
176
+ </Tooltip.Target>
177
+ <Tooltip.Content>
178
+ <p>Shape of the grid rings - polygons match the data shape, circles are rounded</p>
179
+ </Tooltip.Content>
180
+ </Tooltip>
181
+ }
182
+ />
183
+ </fieldset>
184
+
185
+ {/* Scale Settings */}
186
+ <fieldset className='fieldset' style={{ marginTop: '20px' }}>
187
+ <legend style={{ fontSize: '16px', fontWeight: 'bold', marginBottom: '10px' }}>Scale Settings</legend>
188
+
189
+ <TextField
190
+ type='number'
191
+ value={radar.scaleMin ?? 0}
192
+ fieldName='scaleMin'
193
+ section='radar'
194
+ label='Minimum Value'
195
+ updateField={updateField}
196
+ tooltip={
197
+ <Tooltip style={{ textTransform: 'none' }}>
198
+ <Tooltip.Target>
199
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
200
+ </Tooltip.Target>
201
+ <Tooltip.Content>
202
+ <p>Minimum value for the radar scale (center point)</p>
203
+ </Tooltip.Content>
204
+ </Tooltip>
205
+ }
206
+ />
207
+
208
+ <TextField
209
+ type='number'
210
+ value={radar.scaleMax ?? ''}
211
+ fieldName='scaleMax'
212
+ section='radar'
213
+ label='Maximum Value'
214
+ updateField={updateField}
215
+ placeholder='Auto-calculated'
216
+ tooltip={
217
+ <Tooltip style={{ textTransform: 'none' }}>
218
+ <Tooltip.Target>
219
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
220
+ </Tooltip.Target>
221
+ <Tooltip.Content>
222
+ <p>Maximum value for the radar scale. Leave empty to auto-calculate from data.</p>
223
+ </Tooltip.Content>
224
+ </Tooltip>
225
+ }
226
+ />
227
+ </fieldset>
228
+
229
+ {/* Visual Settings */}
230
+ <fieldset className='fieldset' style={{ marginTop: '20px' }}>
231
+ <legend style={{ fontSize: '16px', fontWeight: 'bold', marginBottom: '10px' }}>Visual Settings</legend>
232
+
233
+ <CheckBox
234
+ value={radar.showFill ?? false}
235
+ fieldName='showFill'
236
+ section='radar'
237
+ label='Show Fill'
238
+ updateField={updateField}
239
+ tooltip={
240
+ <Tooltip style={{ textTransform: 'none' }}>
241
+ <Tooltip.Target>
242
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
243
+ </Tooltip.Target>
244
+ <Tooltip.Content>
245
+ <p>Fill the polygon area with color. When off, only the outline is shown.</p>
246
+ </Tooltip.Content>
247
+ </Tooltip>
248
+ }
249
+ />
250
+
251
+ {(radar.showFill ?? false) && (
252
+ <TextField
253
+ type='number'
254
+ value={radar.fillOpacity ?? 0.3}
255
+ fieldName='fillOpacity'
256
+ section='radar'
257
+ label='Fill Opacity'
258
+ updateField={updateField}
259
+ min={0}
260
+ max={1}
261
+ step={0.1}
262
+ tooltip={
263
+ <Tooltip style={{ textTransform: 'none' }}>
264
+ <Tooltip.Target>
265
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
266
+ </Tooltip.Target>
267
+ <Tooltip.Content>
268
+ <p>Opacity of the polygon fill (0 = transparent, 1 = solid)</p>
269
+ </Tooltip.Content>
270
+ </Tooltip>
271
+ }
272
+ />
273
+ )}
274
+
275
+ <TextField
276
+ type='number'
277
+ value={radar.strokeWidth ?? 2}
278
+ fieldName='strokeWidth'
279
+ section='radar'
280
+ label='Stroke Width'
281
+ updateField={updateField}
282
+ min={1}
283
+ max={5}
284
+ tooltip={
285
+ <Tooltip style={{ textTransform: 'none' }}>
286
+ <Tooltip.Target>
287
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
288
+ </Tooltip.Target>
289
+ <Tooltip.Content>
290
+ <p>Width of the polygon outline</p>
291
+ </Tooltip.Content>
292
+ </Tooltip>
293
+ }
294
+ />
295
+
296
+ <CheckBox
297
+ value={radar.showPoints ?? true}
298
+ fieldName='showPoints'
299
+ section='radar'
300
+ label='Show Data Points'
301
+ updateField={updateField}
302
+ tooltip={
303
+ <Tooltip style={{ textTransform: 'none' }}>
304
+ <Tooltip.Target>
305
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
306
+ </Tooltip.Target>
307
+ <Tooltip.Content>
308
+ <p>Display circular markers at each data point vertex</p>
309
+ </Tooltip.Content>
310
+ </Tooltip>
311
+ }
312
+ />
313
+
314
+ {(radar.showPoints ?? true) && (
315
+ <TextField
316
+ type='number'
317
+ value={radar.pointRadius ?? 4}
318
+ fieldName='pointRadius'
319
+ section='radar'
320
+ label='Point Size'
321
+ updateField={updateField}
322
+ min={2}
323
+ max={10}
324
+ />
325
+ )}
326
+
327
+ <TextField
328
+ type='number'
329
+ value={radar.axisLabelOffset ?? 15}
330
+ fieldName='axisLabelOffset'
331
+ section='radar'
332
+ label='Axis Label Offset'
333
+ updateField={updateField}
334
+ min={5}
335
+ max={50}
336
+ tooltip={
337
+ <Tooltip style={{ textTransform: 'none' }}>
338
+ <Tooltip.Target>
339
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
340
+ </Tooltip.Target>
341
+ <Tooltip.Content>
342
+ <p>Distance between axis endpoint and label</p>
343
+ </Tooltip.Content>
344
+ </Tooltip>
345
+ }
346
+ />
347
+ </fieldset>
348
+ </AccordionItemPanel>
349
+ </AccordionItem>
350
+ )
351
+ }
352
+
353
+ export default PanelRadar
@@ -50,7 +50,6 @@ const SeriesWrapper = props => {
50
50
  forecastingStages.forEach(stage => {
51
51
  forecastingStageArr.push({ key: stage })
52
52
  })
53
- // debugger
54
53
  series[index].stages = forecastingStageArr
55
54
  series[index].stageColumn = series[index].dataKey
56
55
  }
@@ -241,6 +241,27 @@ const PanelVisual: FC<PanelProps> = props => {
241
241
  updateField={updateField}
242
242
  options={['Same as Line', 'Lighter than Line']}
243
243
  />
244
+ <CheckBox
245
+ value={config.general?.useIntelligentLineChartLabels ?? false}
246
+ section='general'
247
+ fieldName='useIntelligentLineChartLabels'
248
+ label='Use Intelligent Label Positioning'
249
+ updateField={updateField}
250
+ tooltip={
251
+ <Tooltip style={{ textTransform: 'none' }}>
252
+ <Tooltip.Target>
253
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
254
+ </Tooltip.Target>
255
+ <Tooltip.Content>
256
+ <p>
257
+ Automatically positions data labels to avoid overlapping with line segments based on the direction
258
+ and location of data points. When disabled, all labels are positioned above and centered on their
259
+ data points.
260
+ </p>
261
+ </Tooltip.Content>
262
+ </Tooltip>
263
+ }
264
+ />
244
265
  <CheckBox
245
266
  value={!(config as LineChartConfig).isolatedDotsSameSize}
246
267
  fieldName='isolatedDotsSameSize'
@@ -398,7 +419,6 @@ const PanelVisual: FC<PanelProps> = props => {
398
419
  }}
399
420
  label='Custom Color Order'
400
421
  minColors={1}
401
- maxColors={20}
402
422
  />
403
423
  </div>
404
424
  )}
@@ -5,6 +5,7 @@ import General from './Panel.General'
5
5
  import BoxPlot from './Panel.BoxPlot'
6
6
  import Visual from './Panel.Visual'
7
7
  import Sankey from './Panel.Sankey'
8
+ import Radar from './Panel.Radar'
8
9
  import Annotate from './Panel.Annotate'
9
10
  import PatternSettings from './Panel.PatternSettings'
10
11
  import SmallMultiples from './Panel.SmallMultiples'
@@ -17,6 +18,7 @@ const Panels = {
17
18
  BoxPlot,
18
19
  Visual,
19
20
  Sankey,
21
+ Radar,
20
22
  Annotate,
21
23
  PatternSettings,
22
24
  SmallMultiples
@@ -16,9 +16,11 @@ export const useEditorPermissions = () => {
16
16
  'Deviation Bar',
17
17
  'Forecasting',
18
18
  // 'Forest Plot',
19
+ 'Horizon Chart',
19
20
  'Line',
20
21
  'Paired Bar',
21
22
  'Pie',
23
+ 'Radar',
22
24
  'Scatter Plot',
23
25
  'Spark Line',
24
26
  'Sankey',
@@ -26,7 +28,7 @@ export const useEditorPermissions = () => {
26
28
  ]
27
29
 
28
30
  const visSupportsDateCategoryAxis = () => {
29
- const disabledCharts = ['Forest Plot', 'Sankey']
31
+ const disabledCharts = ['Forest Plot', 'Radar', 'Sankey']
30
32
  if (disabledCharts.includes(visualizationType)) return false
31
33
  return true
32
34
  }
@@ -55,16 +57,30 @@ export const useEditorPermissions = () => {
55
57
  return true
56
58
  }
57
59
 
60
+ const visSupportsClickingLegend = () => {
61
+ const disabledCharts = ['Horizon Chart']
62
+ if (disabledCharts.includes(visualizationType)) return false
63
+ return true
64
+ }
65
+
66
+ const visSupportsDataAnnotations = () => {
67
+ const enabledCharts = ['Line', 'Bar', 'Combo', 'Area Chart', 'Forecasting']
68
+ if (enabledCharts.includes(visualizationType) && config.orientation !== 'horizontal') return true
69
+ return false
70
+ }
71
+
58
72
  const visHasLabelOnData = () => {
59
73
  const disabledCharts = [
60
74
  'Area Chart',
61
75
  'Box Plot',
76
+ 'Bump Chart',
77
+ 'Forest Plot',
78
+ 'Horizon Chart',
62
79
  'Pie',
80
+ 'Radar',
81
+ 'Sankey',
63
82
  'Scatter Plot',
64
- 'Forest Plot',
65
83
  'Spark Line',
66
- 'Sankey',
67
- 'Bump Chart',
68
84
  'Warming Stripes'
69
85
  ]
70
86
  if (disabledCharts.includes(visualizationType)) return false
@@ -74,12 +90,13 @@ export const useEditorPermissions = () => {
74
90
  const visCanAnimate = () => {
75
91
  const disabledCharts = [
76
92
  'Area Chart',
77
- 'Scatter Plot',
78
93
  'Box Plot',
94
+ 'Bump Chart',
79
95
  'Forest Plot',
80
- 'Spark Line',
96
+ 'Radar',
81
97
  'Sankey',
82
- 'Bump Chart',
98
+ 'Scatter Plot',
99
+ 'Spark Line',
83
100
  'Warming Stripes'
84
101
  ]
85
102
  if (disabledCharts.includes(visualizationType)) return false
@@ -145,10 +162,11 @@ export const useEditorPermissions = () => {
145
162
  }
146
163
  const visHasBrushChart = () => {
147
164
  if (config.xAxis.type === 'categorical') return false
148
- // Allow Line charts, vertical Bar charts (both stacked and grouped), and vertical Area charts
165
+ // Allow Line charts, vertical Bar charts (both stacked and grouped), vertical Area charts, and Combo charts
149
166
  if (visualizationType === 'Line' && orientation === 'vertical') return true
150
167
  if (visualizationType === 'Bar' && orientation === 'vertical') return true
151
168
  if (visualizationType === 'Area Chart' && orientation === 'vertical') return true
169
+ if (visualizationType === 'Combo' && orientation === 'vertical') return true
152
170
  return false
153
171
  }
154
172
 
@@ -256,7 +274,16 @@ export const useEditorPermissions = () => {
256
274
  }
257
275
 
258
276
  const visSupportsRegions = () => {
259
- const disabledCharts = ['Forest Plot', 'Pie', 'Paired Bar', 'Spark Line', 'Sankey', 'Warming Stripes']
277
+ const disabledCharts = [
278
+ 'Forest Plot',
279
+ 'Horizon Chart',
280
+ 'Pie',
281
+ 'Paired Bar',
282
+ 'Radar',
283
+ 'Spark Line',
284
+ 'Sankey',
285
+ 'Warming Stripes'
286
+ ]
260
287
  if (disabledCharts.includes(visualizationType)) return false
261
288
  return true
262
289
  }
@@ -326,13 +353,13 @@ export const useEditorPermissions = () => {
326
353
  }
327
354
  const visSupportsMobileChartHeight = () => {
328
355
  // TODO: this is a soft release. Support should eventually match visSupportsChartHeight
329
- const enabledCharts = ['Bar', 'Line', 'Combo', 'Area Chart']
356
+ const enabledCharts = ['Bar', 'Line', 'Combo', 'Area Chart', 'Radar']
330
357
  if (enabledCharts.includes(visualizationType)) return true
331
358
  return false
332
359
  }
333
360
 
334
361
  const visSupportsLeftValueAxis = () => {
335
- const disabledCharts = ['Spark Line', 'Sankey', 'Warming Stripes']
362
+ const disabledCharts = ['Radar', 'Spark Line', 'Sankey', 'Warming Stripes']
336
363
  if (disabledCharts.includes(visualizationType)) return false
337
364
  return true
338
365
  }
@@ -417,56 +444,58 @@ export const useEditorPermissions = () => {
417
444
  return {
418
445
  enabledChartTypes,
419
446
  visCanAnimate,
447
+ visHasaAdditionalLabelsOnBars,
420
448
  visHasAnchors,
421
449
  visHasBarBorders,
450
+ visHasBrushChart,
451
+ visHasCategoricalAxis,
422
452
  visHasDataCutoff,
423
- visHasLabelOnData,
424
453
  visHasDataSuppression,
454
+ visHasLabelOnData,
425
455
  visHasLegend,
426
456
  visHasLegendAxisAlign,
427
457
  visHasLegendColorCategory,
428
- visHasBrushChart,
429
458
  visHasNumbersOnBars,
430
- visHasaAdditionalLabelsOnBars,
459
+ visHasSelectableLegendValues,
460
+ visHasSingleSeriesTooltip,
431
461
  visSupportsBarSpace,
432
462
  visSupportsBarThickness,
433
463
  visSupportsChartHeight,
434
- visSupportsMobileChartHeight,
464
+ visSupportsClickingLegend,
465
+ visSupportsDataAnnotations,
435
466
  visSupportsDateCategoryAxis,
436
- visSupportsDateCategoryAxisMin,
437
- visSupportsDateCategoryAxisMax,
438
467
  visSupportsDateCategoryAxisLabel,
439
468
  visSupportsDateCategoryAxisLine,
469
+ visSupportsDateCategoryAxisMax,
470
+ visSupportsDateCategoryAxisMin,
471
+ visSupportsDateCategoryAxisPadding,
440
472
  visSupportsDateCategoryAxisTicks,
441
473
  visSupportsDateCategoryHeight,
442
474
  visSupportsDateCategoryNumTicks,
443
475
  visSupportsDateCategoryTickRotation,
444
- visSupportsDateCategoryAxisPadding,
476
+ visSupportsDynamicSeries,
445
477
  visSupportsFilters,
446
478
  visSupportsFootnotes,
447
479
  visSupportsLeftValueAxis,
480
+ visSupportsMobileChartHeight,
448
481
  visSupportsNonSequentialPallete,
449
482
  visSupportsPreliminaryData,
450
483
  visSupportsRankByValue,
484
+ visSupportsReactTooltip,
451
485
  visSupportsRegions,
452
486
  visSupportsResponsiveTicks,
453
487
  visSupportsReverseColorPalette,
454
488
  visSupportsSequentialPallete,
489
+ visSupportsSmallMultiples,
455
490
  visSupportsSuperTitle,
456
491
  visSupportsTooltipLines,
457
- visHasSelectableLegendValues,
458
492
  visSupportsTooltipOpacity,
459
493
  visSupportsValueAxisGridLines,
460
494
  visSupportsValueAxisLabels,
461
495
  visSupportsValueAxisLine,
462
- visSupportsValueAxisTicks,
463
- visSupportsReactTooltip,
464
496
  visSupportsValueAxisMax,
465
497
  visSupportsValueAxisMin,
466
- visSupportsDynamicSeries,
467
- visSupportsSmallMultiples,
468
- visSupportsYPadding,
469
- visHasSingleSeriesTooltip,
470
- visHasCategoricalAxis
498
+ visSupportsValueAxisTicks,
499
+ visSupportsYPadding
471
500
  }
472
501
  }