@cdc/chart 4.24.3 → 4.24.5

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 (39) hide show
  1. package/dist/cdcchart.js +34377 -33726
  2. package/examples/feature/line/line-chart.json +361 -37
  3. package/examples/region-issue.json +2065 -0
  4. package/examples/test.json +5409 -0
  5. package/index.html +13 -11
  6. package/package.json +2 -2
  7. package/src/CdcChart.tsx +159 -89
  8. package/src/_stories/Chart.stories.tsx +8 -0
  9. package/src/_stories/_mock/bar-chart-suppressed.json +474 -0
  10. package/src/components/AreaChart/components/AreaChart.jsx +2 -2
  11. package/src/components/BarChart/components/BarChart.Horizontal.tsx +61 -63
  12. package/src/components/BarChart/components/BarChart.Vertical.tsx +79 -94
  13. package/src/components/DeviationBar.jsx +4 -2
  14. package/src/components/EditorPanel/EditorPanel.tsx +1580 -1924
  15. package/src/components/EditorPanel/components/Panels/Panel.General.tsx +19 -2
  16. package/src/components/EditorPanel/components/Panels/Panel.Sankey.tsx +0 -1
  17. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +4 -5
  18. package/src/components/EditorPanel/editor-panel.scss +0 -724
  19. package/src/components/EditorPanel/useEditorPermissions.js +4 -1
  20. package/src/components/Legend/Legend.Component.tsx +82 -58
  21. package/src/components/Legend/Legend.tsx +5 -1
  22. package/src/components/LineChart/LineChartProps.ts +13 -6
  23. package/src/components/LineChart/components/LineChart.Circle.tsx +22 -11
  24. package/src/components/LineChart/helpers.ts +134 -10
  25. package/src/components/LineChart/index.tsx +69 -42
  26. package/src/components/LinearChart.jsx +156 -139
  27. package/src/components/ZoomBrush.tsx +40 -21
  28. package/src/data/initial-state.js +4 -4
  29. package/src/hooks/useBarChart.js +47 -22
  30. package/src/hooks/useMinMax.ts +21 -2
  31. package/src/hooks/useScales.ts +33 -1
  32. package/src/hooks/useTooltip.tsx +11 -11
  33. package/src/scss/main.scss +80 -5
  34. package/src/types/ChartConfig.ts +3 -13
  35. package/src/types/ChartContext.ts +4 -0
  36. package/src/_stories/ChartLine.preliminary.tsx +0 -19
  37. package/src/_stories/ChartSuppress.stories.tsx +0 -19
  38. package/src/_stories/_mock/suppress_mock.json +0 -911
  39. package/src/helpers/computeMarginBottom.ts +0 -56
@@ -49,7 +49,24 @@ const PanelGeneral: FC<PanelProps> = props => {
49
49
  {visHasNumbersOnBars() ? (
50
50
  <CheckBox value={config.yAxis.displayNumbersOnBar} section='yAxis' fieldName='displayNumbersOnBar' label={config.isLollipopChart ? 'Display Numbers after Bar' : 'Display Numbers on Bar'} updateField={updateField} />
51
51
  ) : (
52
- visHasLabelOnData() && <CheckBox value={config.labels} fieldName='labels' label='Display label on data' updateField={updateField} />
52
+ visHasLabelOnData() && (
53
+ <CheckBox
54
+ value={config.labels}
55
+ fieldName='labels'
56
+ label='Display label on data'
57
+ updateField={updateField}
58
+ tooltip={
59
+ <Tooltip style={{ textTransform: 'none' }}>
60
+ <Tooltip.Target>
61
+ <Icon display='question' style={{ marginLeft: '0.5rem' }} />
62
+ </Tooltip.Target>
63
+ <Tooltip.Content>
64
+ <p>Selecting this option will not hide the display of "zero value", "suppressed data", or "no data" indicators on the chart (if applicable).</p>
65
+ </Tooltip.Content>
66
+ </Tooltip>
67
+ }
68
+ />
69
+ )
53
70
  )}
54
71
  {visualizationType === 'Pie' && <Select fieldName='pieType' label='Pie Chart Type' updateField={updateField} options={['Regular', 'Donut']} />}
55
72
 
@@ -144,7 +161,7 @@ const PanelGeneral: FC<PanelProps> = props => {
144
161
  <Icon display='question' style={{ marginLeft: '0.5rem' }} />
145
162
  </Tooltip.Target>
146
163
  <Tooltip.Content>
147
- <p>Footnotes</p>
164
+ <p>Consider adding footnotes when displaying 'suppressed,' 'no data,' and 'zero values' to ensure accurate interpretation of the data.</p>
148
165
  </Tooltip.Content>
149
166
  </Tooltip>
150
167
  }
@@ -21,7 +21,6 @@ const SankeySettings = () => {
21
21
  }
22
22
 
23
23
  storyNodes[i][fieldName] = value
24
- console.log('story nodes', storyNodes[i])
25
24
  updateConfig({
26
25
  ...config,
27
26
  sankey: {
@@ -5,15 +5,14 @@ import ConfigContext from '../../../../ConfigContext'
5
5
  import InputSelect from '@cdc/core/components/inputs/InputSelect'
6
6
  import Check from '@cdc/core/assets/icon-check.svg'
7
7
  import { approvedCurveTypes } from '@cdc/core/helpers/lineChartHelpers'
8
-
8
+ import { sequentialPalettes } from '@cdc/core/data/colorPalettes'
9
9
  import Icon from '@cdc/core/components/ui/Icon'
10
10
 
11
11
  // Third Party
12
12
  import { Accordion, AccordionItem, AccordionItemHeading, AccordionItemPanel, AccordionItemButton } from 'react-accessible-accordion'
13
13
  import { Draggable } from '@hello-pangea/dnd'
14
- import { colorPalettesChart, sequentialPalettes } from '@cdc/core/data/colorPalettes'
15
14
 
16
- const SeriesContext = React.createContext()
15
+ const SeriesContext = React.createContext({})
17
16
 
18
17
  const SeriesWrapper = props => {
19
18
  const { updateConfig, config, rawData } = useContext(ConfigContext)
@@ -456,8 +455,8 @@ const SeriesInputWeight = props => {
456
455
  type='number'
457
456
  key={`series-weight-${i}`}
458
457
  value={series.weight ? series.weight : ''}
459
- min="1"
460
- max="9"
458
+ min='1'
459
+ max='9'
461
460
  onChange={event => {
462
461
  changeSeriesWeight(i, event.target.value, event.target.min, event.target.max)
463
462
  }}