@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.
- package/dist/cdcchart.js +34377 -33726
- package/examples/feature/line/line-chart.json +361 -37
- package/examples/region-issue.json +2065 -0
- package/examples/test.json +5409 -0
- package/index.html +13 -11
- package/package.json +2 -2
- package/src/CdcChart.tsx +159 -89
- package/src/_stories/Chart.stories.tsx +8 -0
- package/src/_stories/_mock/bar-chart-suppressed.json +474 -0
- package/src/components/AreaChart/components/AreaChart.jsx +2 -2
- package/src/components/BarChart/components/BarChart.Horizontal.tsx +61 -63
- package/src/components/BarChart/components/BarChart.Vertical.tsx +79 -94
- package/src/components/DeviationBar.jsx +4 -2
- package/src/components/EditorPanel/EditorPanel.tsx +1580 -1924
- package/src/components/EditorPanel/components/Panels/Panel.General.tsx +19 -2
- package/src/components/EditorPanel/components/Panels/Panel.Sankey.tsx +0 -1
- package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +4 -5
- package/src/components/EditorPanel/editor-panel.scss +0 -724
- package/src/components/EditorPanel/useEditorPermissions.js +4 -1
- package/src/components/Legend/Legend.Component.tsx +82 -58
- package/src/components/Legend/Legend.tsx +5 -1
- package/src/components/LineChart/LineChartProps.ts +13 -6
- package/src/components/LineChart/components/LineChart.Circle.tsx +22 -11
- package/src/components/LineChart/helpers.ts +134 -10
- package/src/components/LineChart/index.tsx +69 -42
- package/src/components/LinearChart.jsx +156 -139
- package/src/components/ZoomBrush.tsx +40 -21
- package/src/data/initial-state.js +4 -4
- package/src/hooks/useBarChart.js +47 -22
- package/src/hooks/useMinMax.ts +21 -2
- package/src/hooks/useScales.ts +33 -1
- package/src/hooks/useTooltip.tsx +11 -11
- package/src/scss/main.scss +80 -5
- package/src/types/ChartConfig.ts +3 -13
- package/src/types/ChartContext.ts +4 -0
- package/src/_stories/ChartLine.preliminary.tsx +0 -19
- package/src/_stories/ChartSuppress.stories.tsx +0 -19
- package/src/_stories/_mock/suppress_mock.json +0 -911
- 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() &&
|
|
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>
|
|
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
|
}
|
|
@@ -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=
|
|
460
|
-
max=
|
|
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
|
}}
|