@cdc/chart 4.24.10 → 4.24.12

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 (93) hide show
  1. package/dist/cdcchart.js +34651 -33978
  2. package/examples/feature/boxplot/boxplot-data.json +88 -22
  3. package/examples/feature/boxplot/boxplot.json +540 -16
  4. package/examples/feature/boxplot/testing.csv +7 -7
  5. package/examples/feature/sankey/sankey-example-data.json +126 -14
  6. package/examples/feature/tests-date-exclusions/date-exclusions-config.json +372 -12
  7. package/examples/private/DEV-8850-2.json +493 -0
  8. package/examples/private/DEV-9822.json +574 -0
  9. package/examples/private/DEV-9840.json +553 -0
  10. package/examples/private/DEV-9850-3.json +461 -0
  11. package/examples/private/chart.json +1084 -0
  12. package/examples/private/ci_formatted.json +202 -0
  13. package/examples/private/ci_issue.json +3016 -0
  14. package/examples/private/completed.json +634 -0
  15. package/examples/private/dem-data-long.csv +20 -0
  16. package/examples/private/dem-data-long.json +36 -0
  17. package/examples/private/demographic_data.csv +157 -0
  18. package/examples/private/demographic_data.json +2654 -0
  19. package/examples/private/demographic_dynamic.json +443 -0
  20. package/examples/private/demographic_standard.json +560 -0
  21. package/examples/private/test.json +493 -0
  22. package/index.html +10 -7
  23. package/package.json +2 -2
  24. package/src/CdcChart.tsx +132 -152
  25. package/src/_stories/Chart.Anchors.stories.tsx +31 -0
  26. package/src/_stories/Chart.CustomColors.stories.tsx +19 -0
  27. package/src/_stories/Chart.DynamicSeries.stories.tsx +34 -0
  28. package/src/_stories/Chart.Legend.Gradient.stories.tsx +42 -1
  29. package/src/_stories/Chart.stories.tsx +37 -6
  30. package/src/_stories/ChartAxisLabels.stories.tsx +4 -1
  31. package/src/_stories/ChartEditor.stories.tsx +27 -0
  32. package/src/_stories/ChartLine.Suppression.stories.tsx +25 -0
  33. package/src/_stories/ChartPrefixSuffix.stories.tsx +8 -0
  34. package/{examples/feature/area/area-chart-date-city-temperature.json → src/_stories/_mock/area_chart_stacked.json} +125 -27
  35. package/src/_stories/_mock/boxplot_multiseries.json +647 -0
  36. package/src/_stories/_mock/dynamic_series_bar_config.json +723 -0
  37. package/src/_stories/_mock/dynamic_series_config.json +979 -0
  38. package/src/_stories/_mock/line_chart_dynamic_ci.json +493 -0
  39. package/src/_stories/_mock/line_chart_non_dynamic_ci.json +522 -0
  40. package/{examples/feature/scatterplot/scatterplot.json → src/_stories/_mock/scatterplot_mock.json} +62 -92
  41. package/src/_stories/_mock/short_dates.json +288 -0
  42. package/src/_stories/_mock/suppression_mock.json +1549 -0
  43. package/src/components/AreaChart/components/AreaChart.Stacked.jsx +15 -3
  44. package/src/components/Axis/Categorical.Axis.tsx +2 -2
  45. package/src/components/BarChart/components/BarChart.Horizontal.tsx +46 -37
  46. package/src/components/BarChart/components/BarChart.StackedVertical.tsx +43 -9
  47. package/src/components/BarChart/components/BarChart.Vertical.tsx +53 -47
  48. package/src/components/BarChart/helpers/getBarData.ts +28 -0
  49. package/src/components/BarChart/helpers/index.ts +1 -2
  50. package/src/components/BarChart/helpers/tests/getBarData.test.ts +74 -0
  51. package/src/components/BoxPlot/BoxPlot.tsx +131 -0
  52. package/src/components/BoxPlot/helpers/index.ts +54 -0
  53. package/src/components/BrushChart.tsx +23 -26
  54. package/src/components/EditorPanel/EditorPanel.tsx +117 -139
  55. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +3 -3
  56. package/src/components/EditorPanel/components/Panels/Panel.BoxPlot.tsx +51 -6
  57. package/src/components/EditorPanel/components/Panels/Panel.Regions.tsx +40 -9
  58. package/src/components/EditorPanel/components/Panels/Panel.Sankey.tsx +3 -3
  59. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +122 -56
  60. package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +1 -2
  61. package/src/components/EditorPanel/useEditorPermissions.ts +20 -2
  62. package/src/components/Legend/Legend.Component.tsx +11 -12
  63. package/src/components/Legend/Legend.tsx +16 -16
  64. package/src/components/Legend/helpers/getLegendClasses.ts +59 -0
  65. package/src/components/Legend/helpers/index.ts +2 -1
  66. package/src/components/Legend/tests/getLegendClasses.test.ts +115 -0
  67. package/src/components/LineChart/components/LineChart.Circle.tsx +1 -1
  68. package/src/components/LineChart/helpers.ts +49 -43
  69. package/src/components/LineChart/index.tsx +135 -83
  70. package/src/components/LinearChart.tsx +187 -181
  71. package/src/components/PieChart/PieChart.tsx +7 -1
  72. package/src/components/Sankey/components/ColumnList.tsx +19 -0
  73. package/src/components/Sankey/components/Sankey.tsx +479 -0
  74. package/src/components/Sankey/helpers/getSankeyTooltip.tsx +33 -0
  75. package/src/components/Sankey/index.tsx +1 -492
  76. package/src/components/Sankey/sankey.scss +22 -21
  77. package/src/components/Sankey/types/index.ts +1 -1
  78. package/src/components/Sankey/useSankeyAlert.tsx +60 -0
  79. package/src/components/ScatterPlot/ScatterPlot.jsx +20 -4
  80. package/src/data/initial-state.js +7 -12
  81. package/src/helpers/countNumOfTicks.ts +57 -0
  82. package/src/helpers/getQuartiles.ts +15 -18
  83. package/src/hooks/useMinMax.ts +44 -16
  84. package/src/hooks/useReduceData.ts +43 -10
  85. package/src/hooks/useScales.ts +90 -35
  86. package/src/hooks/useTooltip.tsx +59 -50
  87. package/src/scss/DataTable.scss +5 -0
  88. package/src/scss/main.scss +6 -20
  89. package/src/types/ChartConfig.ts +6 -19
  90. package/src/types/ChartContext.ts +4 -1
  91. package/src/types/ForestPlot.ts +8 -0
  92. package/src/components/BoxPlot/BoxPlot.jsx +0 -111
  93. package/src/hooks/useLegendClasses.ts +0 -72
@@ -171,7 +171,7 @@ const PreliminaryData: React.FC<PreliminaryProps> = ({ config, updateConfig, dat
171
171
  <p> {type === 'suppression' ? 'Suppressed' : 'Effect'} Data</p>
172
172
  <button
173
173
  type='button'
174
- className='remove-column'
174
+ className='btn btn-danger'
175
175
  onClick={event => {
176
176
  event.preventDefault()
177
177
  removeColumn(i)
@@ -450,7 +450,7 @@ const PreliminaryData: React.FC<PreliminaryProps> = ({ config, updateConfig, dat
450
450
  }
451
451
  )}
452
452
 
453
- <button type='button' onClick={addColumn} className='btn full-width'>
453
+ <button type='button' onClick={addColumn} className='btn btn-primary full-width'>
454
454
  {config.visualizationType === 'Line'
455
455
  ? 'Add Special Line'
456
456
  : config.visualizationType === 'Bar'
@@ -530,7 +530,7 @@ const CategoricalAxis: React.FC<CategoricalAxisProps> = ({ config, updateConfig,
530
530
  <p>Axis Category {i + 1}</p>
531
531
  <button
532
532
  type='button'
533
- className='remove-column'
533
+ className='btn btn-danger'
534
534
  onClick={event => {
535
535
  event.preventDefault()
536
536
  removeColumn(i)
@@ -583,7 +583,7 @@ const CategoricalAxis: React.FC<CategoricalAxisProps> = ({ config, updateConfig,
583
583
  )
584
584
  })}
585
585
 
586
- <button type='button' onClick={addColumn} className='btn full-width'>
586
+ <button type='button' onClick={addColumn} className='btn btn-primary full-width'>
587
587
  Add Axis Category
588
588
  </button>
589
589
  </>
@@ -619,52 +619,36 @@ const EditorPanel = () => {
619
619
  const { leftMax, rightMax } = useMinMax(properties)
620
620
 
621
621
  const {
622
- headerColors,
623
- visSupportsTooltipLines,
624
- visSupportsNonSequentialPallete,
625
- visSupportsSequentialPallete,
626
- visSupportsReverseColorPalette,
627
- visHasLabelOnData,
628
- visHasNumbersOnBars,
629
622
  visHasAnchors,
630
- visHasBarBorders,
631
- visHasDataCutoff,
632
- visHasSelectableLegendValues,
633
- visCanAnimate,
623
+ visHasBrushChart,
624
+ visHasCategoricalAxis,
634
625
  visHasLegend,
635
626
  visHasLegendAxisAlign,
636
627
  visHasLegendColorCategory,
637
- visHasBrushChart,
628
+ visHasSelectableLegendValues,
638
629
  visSupportsDateCategoryAxis,
639
- visSupportsValueAxisMin,
640
- visSupportsValueAxisMax,
641
630
  visSupportsDateCategoryAxisLabel,
642
631
  visSupportsDateCategoryAxisLine,
632
+ visSupportsDateCategoryAxisMax,
633
+ visSupportsDateCategoryAxisMin,
634
+ visSupportsDateCategoryAxisPadding,
643
635
  visSupportsDateCategoryAxisTicks,
644
- visSupportsDateCategoryTickRotation,
636
+ visSupportsDateCategoryHeight,
645
637
  visSupportsDateCategoryNumTicks,
646
- visSupportsDateCategoryAxisPadding,
647
- visSupportsRegions,
638
+ visSupportsDateCategoryTickRotation,
639
+ visSupportsDynamicSeries,
648
640
  visSupportsFilters,
641
+ visSupportsLeftValueAxis,
649
642
  visSupportsPreliminaryData,
643
+ visSupportsRankByValue,
644
+ visSupportsResponsiveTicks,
650
645
  visSupportsValueAxisGridLines,
646
+ visSupportsValueAxisLabels,
651
647
  visSupportsValueAxisLine,
648
+ visSupportsValueAxisMax,
649
+ visSupportsValueAxisMin,
652
650
  visSupportsValueAxisTicks,
653
- visSupportsValueAxisLabels,
654
- visSupportsBarSpace,
655
- visSupportsBarThickness,
656
- visSupportsFootnotes,
657
- visSupportsSuperTitle,
658
- visSupportsDataCutoff,
659
- visSupportsChartHeight,
660
- visSupportsLeftValueAxis,
661
- visSupportsTooltipOpacity,
662
- visSupportsRankByValue,
663
- visSupportsResponsiveTicks,
664
- visSupportsDateCategoryHeight,
665
- visHasDataSuppression,
666
- visHasCategoricalAxis,
667
- visSupportsDynamicSeries
651
+ visSupportsYPadding
668
652
  } = useEditorPermissions()
669
653
 
670
654
  // when the visualization type changes we
@@ -763,7 +747,7 @@ const EditorPanel = () => {
763
747
  newValue
764
748
  ) // eslint-disable-line
765
749
 
766
- if (section === 'boxplot' && subsection === 'legend') {
750
+ if (section === 'boxplot' && (subsection === 'legend' || subsection === 'labels')) {
767
751
  updateConfig({
768
752
  ...config,
769
753
  [section]: {
@@ -833,19 +817,6 @@ const EditorPanel = () => {
833
817
  return null
834
818
  }
835
819
 
836
- useEffect(() => {
837
- if (!config.general?.boxplot) return
838
- if (!config.general.boxplot.firstQuartilePercentage) {
839
- updateConfig({
840
- ...config,
841
- boxplot: {
842
- ...config.boxplot,
843
- firstQuartilePercentage: 25
844
- }
845
- })
846
- }
847
- }, [config])
848
-
849
820
  const setLollipopShape = shape => {
850
821
  updateConfig({
851
822
  ...config,
@@ -1376,6 +1347,9 @@ const EditorPanel = () => {
1376
1347
  updateConfig(updatedConfig)
1377
1348
  }
1378
1349
 
1350
+ const hasDynamicCategory = ![undefined, '- Select - '].includes(config.series?.[0]?.dynamicCategory)
1351
+ const hasMultipleSeries = config.series?.length > 1
1352
+
1379
1353
  const editorContextValues = {
1380
1354
  addNewExclusion,
1381
1355
  data,
@@ -1427,14 +1401,15 @@ const EditorPanel = () => {
1427
1401
  </AccordionItemButton>
1428
1402
  </AccordionItemHeading>
1429
1403
  <AccordionItemPanel>
1430
- {visSupportsDynamicSeries() && (
1404
+ {/* FEATURE to be reintroduced by DEV-9747 */}
1405
+ {/* {visSupportsDynamicSeries() && (
1431
1406
  <CheckBox
1432
1407
  value={config.dynamicSeries}
1433
1408
  fieldName='dynamicSeries'
1434
1409
  label='Dynamically generate series'
1435
1410
  updateField={updateField}
1436
1411
  />
1437
- )}
1412
+ )} */}
1438
1413
  {config.dynamicSeries && config.visualizationType === 'Line' && (
1439
1414
  <Select
1440
1415
  fieldName='dynamicSeriesType'
@@ -1525,7 +1500,8 @@ const EditorPanel = () => {
1525
1500
  </Panels.Series.Wrapper>
1526
1501
  )}
1527
1502
  </>
1528
- {config.series && config.series.length <= 1 && config.visualizationType === 'Bar' && (
1503
+ {((config.series && config.series.length && config.visualizationType === 'Bar') ||
1504
+ (config.series && config.series.length <= 1 && config.visualizationType === 'Line')) && (
1529
1505
  <>
1530
1506
  <span className='divider-heading'>Confidence Keys</span>
1531
1507
  <Select
@@ -1797,14 +1773,16 @@ const EditorPanel = () => {
1797
1773
  title={!config.yAxis.gridLines ? 'Show gridlines to enable' : ''}
1798
1774
  />
1799
1775
  )}
1800
- <CheckBox
1801
- value={config.yAxis.enablePadding}
1802
- section='yAxis'
1803
- fieldName='enablePadding'
1804
- label='Add Padding to Value Axis Scale'
1805
- updateField={updateField}
1806
- />
1807
- {config.yAxis.enablePadding && (
1776
+ {visSupportsYPadding() && (
1777
+ <CheckBox
1778
+ value={config.yAxis.enablePadding}
1779
+ section='yAxis'
1780
+ fieldName='enablePadding'
1781
+ label='Add Padding to Value Axis Scale'
1782
+ updateField={updateField}
1783
+ />
1784
+ )}
1785
+ {config.yAxis.enablePadding && visSupportsYPadding() && (
1808
1786
  <TextField
1809
1787
  type='number'
1810
1788
  section='yAxis'
@@ -1868,7 +1846,7 @@ const EditorPanel = () => {
1868
1846
  className='number-narrow'
1869
1847
  updateField={updateField}
1870
1848
  min={0}
1871
- />
1849
+ />{' '}
1872
1850
  <div className='two-col-inputs'>
1873
1851
  <TextField
1874
1852
  value={config.dataFormat.prefix}
@@ -1915,7 +1893,6 @@ const EditorPanel = () => {
1915
1893
  }
1916
1894
  />
1917
1895
  </div>
1918
-
1919
1896
  {config.orientation === 'horizontal' ? ( // horizontal - x is vertical y is horizontal
1920
1897
  <>
1921
1898
  {visSupportsValueAxisLine() && (
@@ -2044,20 +2021,23 @@ const EditorPanel = () => {
2044
2021
  updateField={updateField}
2045
2022
  />
2046
2023
  <span style={{ color: 'red', display: 'block' }}>{warningMsg.maxMsg}</span>
2047
- <TextField
2048
- value={config.yAxis.min}
2049
- section='yAxis'
2050
- fieldName='min'
2051
- type='number'
2052
- label='left axis min value'
2053
- placeholder='Auto'
2054
- updateField={updateField}
2055
- />
2056
- <span style={{ color: 'red', display: 'block' }}>{warningMsg.minMsg}</span>
2024
+ {config.visualizationType !== 'Area Chart' && config.visualizationSubType !== 'stacked' && (
2025
+ <>
2026
+ <TextField
2027
+ value={config.yAxis.min}
2028
+ section='yAxis'
2029
+ fieldName='min'
2030
+ type='number'
2031
+ label='left axis min value'
2032
+ placeholder='Auto'
2033
+ updateField={updateField}
2034
+ />
2035
+ <span style={{ color: 'red', display: 'block' }}>{warningMsg.minMsg}</span>
2036
+ </>
2037
+ )}
2057
2038
  </>
2058
2039
  )
2059
2040
  )}
2060
-
2061
2041
  {/* start: anchors */}
2062
2042
  {visHasAnchors() && config.orientation !== 'horizontal' && (
2063
2043
  <div className='edit-block'>
@@ -2166,7 +2146,7 @@ const EditorPanel = () => {
2166
2146
  </Accordion>
2167
2147
 
2168
2148
  <button
2169
- className='btn full-width'
2149
+ className='btn btn-primary full-width'
2170
2150
  onClick={e => {
2171
2151
  e.preventDefault()
2172
2152
  const anchors = [...config.yAxis.anchors]
@@ -2184,7 +2164,6 @@ const EditorPanel = () => {
2184
2164
  </button>
2185
2165
  </div>
2186
2166
  )}
2187
-
2188
2167
  {visHasAnchors() && config.orientation === 'horizontal' && (
2189
2168
  <div className='edit-block'>
2190
2169
  <span className='edit-label column-heading'>Anchors</span>
@@ -2292,7 +2271,7 @@ const EditorPanel = () => {
2292
2271
  </Accordion>
2293
2272
 
2294
2273
  <button
2295
- className='btn full-width'
2274
+ className='btn btn-primary full-width'
2296
2275
  onClick={e => {
2297
2276
  e.preventDefault()
2298
2277
  const anchors = [...config.xAxis.anchors]
@@ -2517,7 +2496,6 @@ const EditorPanel = () => {
2517
2496
  )}
2518
2497
  </select>
2519
2498
  </label>
2520
-
2521
2499
  <CheckBox
2522
2500
  value={config.xAxis.manual}
2523
2501
  section='xAxis'
@@ -2525,6 +2503,14 @@ const EditorPanel = () => {
2525
2503
  label='Manual Ticks'
2526
2504
  updateField={updateField}
2527
2505
  />
2506
+ <CheckBox
2507
+ display={config.xAxis.type !== 'categorical'}
2508
+ value={config.xAxis.sortByRecentDate}
2509
+ section='xAxis'
2510
+ fieldName='sortByRecentDate'
2511
+ label='Show dates newest to oldest'
2512
+ updateField={updateField}
2513
+ />
2528
2514
 
2529
2515
  {visSupportsDateCategoryAxisPadding() && (
2530
2516
  <TextField
@@ -2786,13 +2772,12 @@ const EditorPanel = () => {
2786
2772
  />
2787
2773
  </>
2788
2774
  )}
2789
-
2790
2775
  <CheckBox
2791
2776
  value={config.exclusions.active}
2792
2777
  section='exclusions'
2793
2778
  fieldName='active'
2794
2779
  label={
2795
- config.xAxis.type === 'date'
2780
+ config.xAxis.type === 'date' || config.xAxis.type === 'date-time'
2796
2781
  ? 'Limit by start and/or end dates'
2797
2782
  : 'Exclude one or more values'
2798
2783
  }
@@ -2891,26 +2876,27 @@ const EditorPanel = () => {
2891
2876
  </>
2892
2877
  )}
2893
2878
 
2894
- {config.xAxis.type === 'date' && (
2895
- <>
2896
- <TextField
2897
- type='date'
2898
- section='exclusions'
2899
- fieldName='dateStart'
2900
- label='Start Date'
2901
- updateField={updateField}
2902
- value={config.exclusions.dateStart || ''}
2903
- />
2904
- <TextField
2905
- type='date'
2906
- section='exclusions'
2907
- fieldName='dateEnd'
2908
- label='End Date'
2909
- updateField={updateField}
2910
- value={config.exclusions.dateEnd || ''}
2911
- />
2912
- </>
2913
- )}
2879
+ {config.xAxis.type === 'date' ||
2880
+ (config.xAxis.type === 'date-time' && (
2881
+ <>
2882
+ <TextField
2883
+ type='date'
2884
+ section='exclusions'
2885
+ fieldName='dateStart'
2886
+ label='Start Date'
2887
+ updateField={updateField}
2888
+ value={config.exclusions.dateStart || ''}
2889
+ />
2890
+ <TextField
2891
+ type='date'
2892
+ section='exclusions'
2893
+ fieldName='dateEnd'
2894
+ label='End Date'
2895
+ updateField={updateField}
2896
+ value={config.exclusions.dateEnd || ''}
2897
+ />
2898
+ </>
2899
+ ))}
2914
2900
  </>
2915
2901
  )}
2916
2902
 
@@ -3210,7 +3196,7 @@ const EditorPanel = () => {
3210
3196
  highlightedBarValues.map((highlightedBarValue, i) => (
3211
3197
  <fieldset>
3212
3198
  <div className='edit-block' key={`highlighted-bar-${i}`}>
3213
- <button className='remove-column' onClick={e => handleRemoveHighlightedBar(e, i)}>
3199
+ <button className='btn btn-danger' onClick={e => handleRemoveHighlightedBar(e, i)}>
3214
3200
  Remove
3215
3201
  </button>
3216
3202
  <p>Highlighted Bar {i + 1}</p>
@@ -3268,7 +3254,7 @@ const EditorPanel = () => {
3268
3254
  </div>
3269
3255
  </fieldset>
3270
3256
  ))}
3271
- <button className='btn full-width' onClick={e => handleAddNewHighlightedBar(e)}>
3257
+ <button className='btn btn-primary full-width' onClick={e => handleAddNewHighlightedBar(e)}>
3272
3258
  Add Highlighted Bar
3273
3259
  </button>
3274
3260
  </>
@@ -3328,6 +3314,30 @@ const EditorPanel = () => {
3328
3314
  </>
3329
3315
  )}
3330
3316
 
3317
+ {visSupportsDateCategoryAxisMin() && (
3318
+ <TextField
3319
+ value={config.xAxis.min}
3320
+ section='xAxis'
3321
+ fieldName='min'
3322
+ type='number'
3323
+ label='min value'
3324
+ placeholder='Auto'
3325
+ updateField={updateField}
3326
+ />
3327
+ )}
3328
+
3329
+ {visSupportsDateCategoryAxisMax() && (
3330
+ <TextField
3331
+ value={config.xAxis.max}
3332
+ section='xAxis'
3333
+ fieldName='max'
3334
+ type='number'
3335
+ label='max value'
3336
+ placeholder='Auto'
3337
+ updateField={updateField}
3338
+ />
3339
+ )}
3340
+
3331
3341
  {/* anchors */}
3332
3342
  {visHasAnchors() && config.orientation !== 'horizontal' && (
3333
3343
  <div className='edit-block'>
@@ -3436,7 +3446,7 @@ const EditorPanel = () => {
3436
3446
  </Accordion>
3437
3447
 
3438
3448
  <button
3439
- className='btn full-width'
3449
+ className='btn btn-primary full-width'
3440
3450
  onClick={e => {
3441
3451
  e.preventDefault()
3442
3452
  const anchors = [...config.xAxis.anchors]
@@ -3565,7 +3575,7 @@ const EditorPanel = () => {
3565
3575
  </Accordion>
3566
3576
 
3567
3577
  <button
3568
- className='btn full-width'
3578
+ className='btn btn-primary full-width'
3569
3579
  onClick={e => {
3570
3580
  e.preventDefault()
3571
3581
  const anchors = [...config.yAxis.anchors]
@@ -3669,38 +3679,6 @@ const EditorPanel = () => {
3669
3679
  updateField={updateField}
3670
3680
  />
3671
3681
 
3672
- {/* <fieldset className="checkbox-group">
3673
- <CheckBox value={config.legend.dynamicLegend} section="legend" fieldName="dynamicLegend" label="Dynamic Legend" updateField={updateField}/>
3674
- {config.legend.dynamicLegend && (
3675
- <>
3676
- <TextField value={config.legend.dynamicLegendDefaultText} section="legend" fieldName="dynamicLegendDefaultText" label="Dynamic Legend Default Text" updateField={updateField} />
3677
- <TextField value={config.legend.dynamicLegendItemLimit} type="number" min="0" section="legend" fieldName="dynamicLegendItemLimit" label={'Dynamic Legend Limit'} className="number-narrow" updateField={updateField}/>
3678
- <TextField value={config.legend.dynamicLegendItemLimitMessage} section="legend" fieldName="dynamicLegendItemLimitMessage" label="Dynamic Legend Item Limit Message" updateField={updateField} />
3679
- <TextField value={config.legend.dynamicLegendChartMessage} section="legend" fieldName="dynamicLegendChartMessage" label="Dynamic Legend Chart Message" updateField={updateField} />
3680
- </>
3681
- )}
3682
- </fieldset> */}
3683
-
3684
- <CheckBox
3685
- value={config.legend.hide ? true : false}
3686
- section='legend'
3687
- fieldName='hide'
3688
- label='Hide Legend'
3689
- updateField={updateField}
3690
- tooltip={
3691
- <Tooltip style={{ textTransform: 'none' }}>
3692
- <Tooltip.Target>
3693
- <Icon
3694
- display='question'
3695
- style={{ marginLeft: '0.5rem', display: 'inline-block', whiteSpace: 'nowrap' }}
3696
- />
3697
- </Tooltip.Target>
3698
- <Tooltip.Content>
3699
- <p>With a single-series chart, consider hiding the legend to reduce visual clutter.</p>
3700
- </Tooltip.Content>
3701
- </Tooltip>
3702
- }
3703
- />
3704
3682
  <CheckBox
3705
3683
  display={config.preliminaryData?.some(pd => pd.label && pd.type === 'suppression' && pd.value)}
3706
3684
  value={config.legend.hideSuppressedLabels}
@@ -3753,7 +3731,7 @@ const EditorPanel = () => {
3753
3731
  </>
3754
3732
  } */}
3755
3733
  <Select
3756
- display={config.series?.length > 1}
3734
+ display={hasDynamicCategory || hasMultipleSeries}
3757
3735
  value={config.legend.behavior}
3758
3736
  section='legend'
3759
3737
  fieldName='behavior'
@@ -3812,7 +3790,7 @@ const EditorPanel = () => {
3812
3790
  config.legend.seriesHighlight.map((val, i) => (
3813
3791
  <fieldset className='edit-block' key={`${val}-${i}`}>
3814
3792
  <button
3815
- className='remove-column'
3793
+ className='btn btn-danger'
3816
3794
  onClick={event => {
3817
3795
  event.preventDefault()
3818
3796
  const updatedSeriesHighlight = [...config.legend.seriesHighlight]
@@ -3841,7 +3819,7 @@ const EditorPanel = () => {
3841
3819
  </fieldset>
3842
3820
  ))}
3843
3821
  <button
3844
- className={'btn full-width'}
3822
+ className={'btn btn-primary full-width'}
3845
3823
  onClick={event => {
3846
3824
  event.preventDefault()
3847
3825
  const legendColumns = getLegendColumns()
@@ -283,7 +283,7 @@ const PanelAnnotate: React.FC<PanelProps> = props => {
283
283
  </select>
284
284
  </label>
285
285
 
286
- <Button className='warn btn-warn btn btn-remove delete' onClick={() => handleRemoveAnnotation(index)}>
286
+ <Button className='btn btn-danger full-width' onClick={() => handleRemoveAnnotation(index)}>
287
287
  Delete Annotation
288
288
  </Button>
289
289
  </div>
@@ -291,9 +291,9 @@ const PanelAnnotate: React.FC<PanelProps> = props => {
291
291
  </Accordion>
292
292
  ))}
293
293
  {config?.annotations?.length < 3 && (
294
- <Button onClick={handleAddAnnotation} className='mt-2'>
294
+ <button onClick={handleAddAnnotation} className='btn btn-primary mt-2 full-width'>
295
295
  Add Annotation
296
- </Button>
296
+ </button>
297
297
  )}
298
298
  </Accordion.Section>
299
299
  </Accordion>
@@ -1,5 +1,10 @@
1
1
  import { useContext, FC } from 'react'
2
- import { AccordionItem, AccordionItemHeading, AccordionItemPanel, AccordionItemButton } from 'react-accessible-accordion'
2
+ import {
3
+ AccordionItem,
4
+ AccordionItemHeading,
5
+ AccordionItemPanel,
6
+ AccordionItemButton
7
+ } from 'react-accessible-accordion'
3
8
  import { TextField } from '@cdc/core/components/EditorPanel/Inputs'
4
9
  import Tooltip from '@cdc/core/components/ui/Tooltip'
5
10
  import Icon from '@cdc/core/components/ui/Icon'
@@ -131,15 +136,55 @@ const PanelBoxPlot: FC<PanelProps> = props => {
131
136
  <h4 style={{ fontSize: '18px' }}>Labels for Additional Measures</h4>
132
137
 
133
138
  {/* iqr */}
134
- <TextField type='text' value={boxplot.labels.iqr} fieldName='iqr' section='boxplot' subsection='labels' label='Interquartile Range' updateField={updateField} />
139
+ <TextField
140
+ type='text'
141
+ value={boxplot.labels.iqr}
142
+ fieldName='iqr'
143
+ section='boxplot'
144
+ subsection='labels'
145
+ label='Interquartile Range'
146
+ updateField={updateField}
147
+ />
135
148
  {/* count */}
136
- <TextField type='text' value={boxplot.labels.total} fieldName='total' section='boxplot' subsection='labels' label='Total' updateField={updateField} />
149
+ <TextField
150
+ type='text'
151
+ value={boxplot.labels.count}
152
+ fieldName='count'
153
+ section='boxplot'
154
+ subsection='labels'
155
+ label='Count'
156
+ updateField={updateField}
157
+ />
137
158
  {/* mean */}
138
- <TextField type='text' value={boxplot.labels.mean} fieldName='mean' section='boxplot' subsection='labels' label='Mean' updateField={updateField} />
159
+ <TextField
160
+ type='text'
161
+ value={boxplot.labels.mean}
162
+ fieldName='mean'
163
+ section='boxplot'
164
+ subsection='labels'
165
+ label='Mean'
166
+ updateField={updateField}
167
+ />
139
168
  {/* outliers */}
140
- <TextField type='text' value={boxplot.labels.outliers} fieldName='outliers' section='boxplot' subsection='labels' label='Outliers' updateField={updateField} />
169
+ <TextField
170
+ type='text'
171
+ value={boxplot.labels.outliers}
172
+ fieldName='outliers'
173
+ section='boxplot'
174
+ subsection='labels'
175
+ label='Outliers'
176
+ updateField={updateField}
177
+ />
141
178
  {/* values */}
142
- <TextField type='text' value={boxplot.labels.values} fieldName='values' section='boxplot' subsection='labels' label='Values' updateField={updateField} />
179
+ <TextField
180
+ type='text'
181
+ value={boxplot.labels.values}
182
+ fieldName='values'
183
+ section='boxplot'
184
+ subsection='labels'
185
+ label='Values'
186
+ updateField={updateField}
187
+ />
143
188
  </AccordionItemPanel>
144
189
  </AccordionItem>
145
190
  )