@cdc/chart 4.23.10 → 4.24.1
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 +34606 -32218
- package/examples/feature/bar/additional-column-tooltip.json +446 -0
- package/examples/feature/bar/example-bar-chart.json +1 -46
- package/examples/feature/bar/lollipop.json +156 -0
- package/examples/feature/bar/tall-data.json +98 -0
- package/examples/feature/combo/planet-combo-example-config.json +99 -9
- package/examples/feature/dev-4261.json +399 -0
- package/examples/feature/forest-plot/forest-plot.json +63 -19
- package/examples/feature/forest-plot/{broken.json → linear.json} +77 -23
- package/examples/feature/forest-plot/log.json +26 -0
- package/examples/feature/forest-plot/logarithmic.json +271 -0
- package/examples/feature/line/line-chart-preliminary.json +346 -0
- package/examples/feature/line/line-points.json +340 -0
- package/examples/feature/regions/index.json +462 -0
- package/examples/feature/scatterplot/scatterplot.json +272 -33
- package/examples/gallery/bar-chart-vertical/combo-line-chart.json +181 -48
- package/examples/private/chart-t.json +3740 -0
- package/examples/private/combo.json +369 -0
- package/examples/private/epi-data.csv +13 -0
- package/examples/private/epi-data.json +62 -0
- package/examples/private/epi.json +403 -0
- package/examples/private/occupancy.json +109283 -0
- package/examples/private/prod-line-config.json +401 -0
- package/examples/private/region-data.json +822 -0
- package/examples/private/region-testing.json +312 -0
- package/examples/private/scaling.json +45325 -0
- package/examples/private/testing-data.json +1739 -0
- package/examples/private/testing.json +816 -0
- package/examples/sparkline-multilple.json +846 -0
- package/index.html +12 -8
- package/package.json +3 -3
- package/src/CdcChart.tsx +42 -211
- package/src/ConfigContext.tsx +6 -0
- package/src/_stories/Chart.stories.tsx +188 -0
- package/src/_stories/Chart.tooltip.stories.tsx +305 -0
- package/src/_stories/ChartBrush.stories.tsx +19 -0
- package/src/_stories/ChartEditor.stories.tsx +22 -0
- package/src/_stories/ChartLine.preliminary.tsx +19 -0
- package/src/_stories/ChartSuppress.stories.tsx +19 -0
- package/src/_stories/_mock/brush_mock.json +393 -0
- package/src/_stories/_mock/pie_config.json +191 -0
- package/src/_stories/_mock/pie_data.json +218 -0
- package/src/_stories/_mock/preliminary_mock.json +346 -0
- package/src/_stories/_mock/suppress_mock.json +911 -0
- package/src/components/{AreaChart.Stacked.jsx → AreaChart/components/AreaChart.Stacked.jsx} +6 -7
- package/src/components/{AreaChart.jsx → AreaChart/components/AreaChart.jsx} +7 -36
- package/src/components/AreaChart/index.tsx +4 -0
- package/src/components/{BarChart.Horizontal.jsx → BarChart/components/BarChart.Horizontal.tsx} +111 -34
- package/src/components/{BarChart.StackedHorizontal.jsx → BarChart/components/BarChart.StackedHorizontal.tsx} +55 -20
- package/src/components/BarChart/components/BarChart.StackedVertical.tsx +106 -0
- package/src/components/{BarChart.Vertical.jsx → BarChart/components/BarChart.Vertical.tsx} +162 -34
- package/src/components/BarChart/components/BarChart.jsx +39 -0
- package/src/components/{BarChartType.jsx → BarChart/components/BarChartType.jsx} +0 -2
- package/src/components/BarChart/components/context.tsx +13 -0
- package/src/components/BarChart/index.tsx +3 -0
- package/src/components/{BoxPlot.jsx → BoxPlot/BoxPlot.jsx} +1 -1
- package/src/components/BoxPlot/index.tsx +3 -0
- package/src/components/DeviationBar.jsx +4 -3
- package/src/components/{EditorPanel.jsx → EditorPanel/EditorPanel.tsx} +807 -865
- package/src/components/EditorPanel/components/Panel.DateHighlighting.tsx +109 -0
- package/src/components/{ForestPlotSettings.jsx → EditorPanel/components/Panel.ForestPlotSettings.tsx} +190 -220
- package/src/components/EditorPanel/components/Panel.Regions.tsx +168 -0
- package/src/components/{Series.jsx → EditorPanel/components/Panel.Series.tsx} +23 -4
- package/src/components/EditorPanel/components/PanelProps.ts +3 -0
- package/src/components/EditorPanel/components/Panels.tsx +13 -0
- package/src/components/EditorPanel/components/panels.scss +72 -0
- package/src/components/EditorPanel/editor-panel.scss +751 -0
- package/src/components/EditorPanel/index.tsx +3 -0
- package/src/{hooks → components/EditorPanel}/useEditorPermissions.js +50 -5
- package/src/components/{Forecasting.jsx → Forecasting/Forecasting.jsx} +1 -1
- package/src/components/Forecasting/index.tsx +3 -0
- package/src/components/ForestPlot/ForestPlot.tsx +254 -0
- package/src/components/ForestPlot/ForestPlotProps.ts +18 -0
- package/src/components/ForestPlot/index.scss +1 -0
- package/src/components/ForestPlot/index.tsx +3 -0
- package/src/components/Legend/Legend.tsx +347 -0
- package/src/components/Legend/index.tsx +3 -0
- package/src/components/LineChart/LineChartProps.ts +46 -0
- package/src/components/{LineChart.Circle.tsx → LineChart/components/LineChart.Circle.tsx} +36 -30
- package/src/components/LineChart/helpers.ts +45 -0
- package/src/components/LineChart/index.scss +1 -0
- package/src/components/{LineChart.tsx → LineChart/index.tsx} +83 -42
- package/src/components/LinearChart.jsx +125 -82
- package/src/components/PairedBarChart.jsx +2 -2
- package/src/components/{PieChart.jsx → PieChart/PieChart.tsx} +16 -7
- package/src/components/PieChart/index.tsx +3 -0
- package/src/components/Regions/components/Regions.tsx +135 -0
- package/src/components/Regions/index.tsx +3 -0
- package/src/components/{ScatterPlot.jsx → ScatterPlot/ScatterPlot.jsx} +3 -3
- package/src/components/ScatterPlot/index.tsx +3 -0
- package/src/components/{SparkLine.jsx → Sparkline/SparkLine.jsx} +2 -2
- package/src/components/Sparkline/index.tsx +3 -0
- package/src/components/ZoomBrush.tsx +168 -0
- package/src/data/initial-state.js +30 -16
- package/src/helpers/abbreviateNumber.ts +17 -0
- package/src/helpers/computeMarginBottom.ts +55 -0
- package/src/helpers/filterData.ts +18 -0
- package/src/helpers/generateColorsArray.ts +8 -0
- package/src/helpers/getQuartiles.ts +30 -0
- package/src/helpers/handleChartAriaLabels.ts +19 -0
- package/src/helpers/handleLineType.ts +18 -0
- package/src/helpers/lineOptions.ts +18 -0
- package/src/helpers/sort.ts +7 -0
- package/src/helpers/tests/computeMarginBottom.test.ts +20 -0
- package/src/hooks/useBarChart.js +72 -7
- package/src/hooks/useColorScale.ts +50 -0
- package/src/hooks/{useMinMax.js → useMinMax.ts} +75 -23
- package/src/hooks/{useRightAxis.js → useRightAxis.ts} +10 -2
- package/src/hooks/{useScales.js → useScales.ts} +64 -17
- package/src/hooks/{useTooltip.jsx → useTooltip.tsx} +84 -55
- package/src/scss/main.scss +70 -38
- package/src/types/ChartConfig.ts +178 -0
- package/src/types/ChartContext.ts +54 -0
- package/src/types/ForestPlot.ts +53 -0
- package/examples/feature/scatterplot/scatterplot-continuous.csv +0 -17
- package/src/ConfigContext.jsx +0 -5
- package/src/components/BarChart.StackedVertical.jsx +0 -95
- package/src/components/BarChart.jsx +0 -30
- package/src/components/ForestPlot.jsx +0 -191
- package/src/components/Legend.jsx +0 -277
- package/src/scss/LinearChart.scss +0 -0
- package/src/scss/editor-panel.scss +0 -745
- package/src/scss/legend.scss +0 -206
- package/src/scss/mixins.scss +0 -0
- package/src/scss/variables.scss +0 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import Chart from '../CdcChart'
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Chart> = {
|
|
6
|
+
title: 'Components/Templates/Chart',
|
|
7
|
+
component: Chart
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof Chart>
|
|
11
|
+
|
|
12
|
+
export const Lollipop: Story = {
|
|
13
|
+
args: {
|
|
14
|
+
config: {
|
|
15
|
+
type: 'chart',
|
|
16
|
+
title: 'Lollipop Style Horizontal Bar Chart - Number of Spills Occurring in the Home',
|
|
17
|
+
showTitle: true,
|
|
18
|
+
showDownloadMediaButton: false,
|
|
19
|
+
theme: 'theme-blue',
|
|
20
|
+
animate: true,
|
|
21
|
+
fontSize: 'medium',
|
|
22
|
+
lineDatapointStyle: 'hover',
|
|
23
|
+
barHasBorder: 'false',
|
|
24
|
+
isLollipopChart: true,
|
|
25
|
+
lollipopShape: 'circle',
|
|
26
|
+
lollipopColorStyle: 'two-tone',
|
|
27
|
+
visualizationSubType: 'horizontal',
|
|
28
|
+
barStyle: '',
|
|
29
|
+
roundingStyle: 'standard',
|
|
30
|
+
tipRounding: 'top',
|
|
31
|
+
isResponsiveTicks: false,
|
|
32
|
+
general: { showDownloadButton: false },
|
|
33
|
+
padding: { left: 5, right: 5 },
|
|
34
|
+
yAxis: {
|
|
35
|
+
hideAxis: true,
|
|
36
|
+
displayNumbersOnBar: true,
|
|
37
|
+
hideLabel: false,
|
|
38
|
+
hideTicks: false,
|
|
39
|
+
size: '13',
|
|
40
|
+
gridLines: false,
|
|
41
|
+
enablePadding: false,
|
|
42
|
+
min: '',
|
|
43
|
+
max: '',
|
|
44
|
+
labelColor: '#333',
|
|
45
|
+
tickLabelColor: '#333',
|
|
46
|
+
tickColor: '#333',
|
|
47
|
+
rightHideAxis: true,
|
|
48
|
+
rightAxisSize: 50,
|
|
49
|
+
rightLabel: '',
|
|
50
|
+
rightLabelOffsetSize: 0,
|
|
51
|
+
rightAxisLabelColor: '#333',
|
|
52
|
+
rightAxisTickLabelColor: '#333',
|
|
53
|
+
rightAxisTickColor: '#333',
|
|
54
|
+
numTicks: '9',
|
|
55
|
+
axisPadding: 0,
|
|
56
|
+
tickRotation: 0,
|
|
57
|
+
anchors: [],
|
|
58
|
+
type: 'chart',
|
|
59
|
+
title: 'Lollipop Style Horizontal Bar Chart',
|
|
60
|
+
theme: 'theme-blue',
|
|
61
|
+
fontSize: 'medium',
|
|
62
|
+
lineDatapointStyle: 'hover',
|
|
63
|
+
barHasBorder: 'false',
|
|
64
|
+
isLollipopChart: false,
|
|
65
|
+
lollipopShape: 'circle',
|
|
66
|
+
lollipopColorStyle: 'two-tone',
|
|
67
|
+
visualizationSubType: 'horizontal',
|
|
68
|
+
padding: { left: 5, right: 5 },
|
|
69
|
+
yAxis: { size: 50, gridLines: false },
|
|
70
|
+
barThickness: 0.35,
|
|
71
|
+
height: 260,
|
|
72
|
+
xAxis: { type: 'categorical', size: 75, tickRotation: 0, dataKey: 'Vehicle' },
|
|
73
|
+
table: { label: 'Data Table', expanded: true, show: true },
|
|
74
|
+
legend: { behavior: 'isolate', position: 'right' },
|
|
75
|
+
exclusions: { active: false, keys: [] },
|
|
76
|
+
palette: 'qualitative-bold',
|
|
77
|
+
labels: false,
|
|
78
|
+
dataFormat: {},
|
|
79
|
+
confidenceKeys: {},
|
|
80
|
+
data: [
|
|
81
|
+
{ Group: 'Combined Total of Group A', Vehicle: '100', Home: '120', Work: '140', Office: '120' },
|
|
82
|
+
{ Group: 'Combined Total of Group B', Vehicle: '150', Home: '140', Work: '100', Office: '90' },
|
|
83
|
+
{ Group: 'Combined Total of Group C', Vehicle: '90', Home: '90', Work: '80', Office: '80' },
|
|
84
|
+
{ Group: 'Combined Total of Group D', Vehicle: '70', Home: '60', Work: '50', Office: '70' }
|
|
85
|
+
],
|
|
86
|
+
dataFileName: 'CSV_Source_Example_for_Horizontal_Bar_viz-cdcwp1619811744363.csv',
|
|
87
|
+
dataFileSourceType: 'file',
|
|
88
|
+
visualizationType: 'Bar',
|
|
89
|
+
runtime: {
|
|
90
|
+
seriesLabels: { Vehicle: 'Vehicle' },
|
|
91
|
+
seriesLabelsAll: ['Vehicle'],
|
|
92
|
+
originalXAxis: { type: 'categorical', size: 75, tickRotation: 0, dataKey: 'Vehicle' },
|
|
93
|
+
seriesKeys: ['Vehicle'],
|
|
94
|
+
xAxis: { size: 50, gridLines: false },
|
|
95
|
+
yAxis: { type: 'categorical', size: 75, tickRotation: 0, dataKey: 'Vehicle' },
|
|
96
|
+
horizontal: true,
|
|
97
|
+
uniqueId: 1651765968212,
|
|
98
|
+
editorErrorMessage: ''
|
|
99
|
+
},
|
|
100
|
+
description: 'Subtext can be added here for options like citing data sources or insight into reading the bar chart.',
|
|
101
|
+
series: [{ dataKey: 'Vehicle', type: 'Bar' }],
|
|
102
|
+
barHeight: 25,
|
|
103
|
+
barPadding: 40,
|
|
104
|
+
labelPlacement: 'Below Bar',
|
|
105
|
+
label: 'Number of Accidents'
|
|
106
|
+
},
|
|
107
|
+
boxplot: [],
|
|
108
|
+
topAxis: { hasLine: false },
|
|
109
|
+
isLegendValue: false,
|
|
110
|
+
barThickness: 0.35,
|
|
111
|
+
barHeight: 6,
|
|
112
|
+
barSpace: 15,
|
|
113
|
+
heights: { vertical: 300, horizontal: 170.39999999999998 },
|
|
114
|
+
xAxis: {
|
|
115
|
+
anchors: [],
|
|
116
|
+
type: 'categorical',
|
|
117
|
+
showTargetLabel: true,
|
|
118
|
+
targetLabel: 'Target',
|
|
119
|
+
hideAxis: true,
|
|
120
|
+
hideLabel: true,
|
|
121
|
+
hideTicks: true,
|
|
122
|
+
size: '16',
|
|
123
|
+
tickRotation: 0,
|
|
124
|
+
min: '',
|
|
125
|
+
max: '160',
|
|
126
|
+
labelColor: '#333',
|
|
127
|
+
tickLabelColor: '#333',
|
|
128
|
+
tickColor: '#333',
|
|
129
|
+
numTicks: '',
|
|
130
|
+
labelOffset: 65,
|
|
131
|
+
axisPadding: 0,
|
|
132
|
+
target: 0,
|
|
133
|
+
maxTickRotation: 0,
|
|
134
|
+
dataKey: 'Group'
|
|
135
|
+
},
|
|
136
|
+
table: { label: 'Data Table', expanded: false, limitHeight: false, height: '', caption: '', showDownloadUrl: false, showDataTableLink: true, indexLabel: 'Group', download: false, showVertical: true, show: true },
|
|
137
|
+
orientation: 'horizontal',
|
|
138
|
+
color: 'pinkpurple',
|
|
139
|
+
columns: {},
|
|
140
|
+
legend: {
|
|
141
|
+
behavior: 'isolate',
|
|
142
|
+
singleRow: false,
|
|
143
|
+
colorCode: '',
|
|
144
|
+
reverseLabelOrder: false,
|
|
145
|
+
description: '',
|
|
146
|
+
dynamicLegend: false,
|
|
147
|
+
dynamicLegendDefaultText: 'Show All',
|
|
148
|
+
dynamicLegendItemLimit: 5,
|
|
149
|
+
dynamicLegendItemLimitMessage: 'Dynamic Legend Item Limit Hit.',
|
|
150
|
+
dynamicLegendChartMessage: 'Select Options from the Legend',
|
|
151
|
+
position: 'right',
|
|
152
|
+
hide: true,
|
|
153
|
+
label: 'Accident Location'
|
|
154
|
+
},
|
|
155
|
+
exclusions: { active: false, keys: [] },
|
|
156
|
+
palette: 'qualitative-bold',
|
|
157
|
+
isPaletteReversed: false,
|
|
158
|
+
twoColor: { palette: 'monochrome-1', isPaletteReversed: false },
|
|
159
|
+
labels: false,
|
|
160
|
+
dataFormat: { commas: false, prefix: '', suffix: '', abbreviated: false, bottomSuffix: '', bottomPrefix: '', bottomAbbreviated: false },
|
|
161
|
+
confidenceKeys: {},
|
|
162
|
+
visual: { border: true, accent: true, background: true, verticalHoverLine: false, horizontalHoverLine: false },
|
|
163
|
+
useLogScale: false,
|
|
164
|
+
filterBehavior: 'Filter Change',
|
|
165
|
+
highlightedBarValues: [],
|
|
166
|
+
series: [{ dataKey: 'Home', type: 'Bar', tooltip: true }],
|
|
167
|
+
tooltips: { opacity: 90 },
|
|
168
|
+
height: 212,
|
|
169
|
+
data: [
|
|
170
|
+
{ Group: 'Combined Total of Group A', Vehicle: '100', Home: '120', Work: '140', Office: '120' },
|
|
171
|
+
{ Group: 'Combined Total of Group B', Vehicle: '150', Home: '140', Work: '100', Office: '90' },
|
|
172
|
+
{ Group: 'Combined Total of Group C', Vehicle: '90', Home: '90', Work: '80', Office: '80' },
|
|
173
|
+
{ Group: 'Combined Total of Group D', Vehicle: '70', Home: '60', Work: '50', Office: '70' }
|
|
174
|
+
],
|
|
175
|
+
dataFileName: 'CSV_Source_Example_for_Horizontal_Bar_viz-cdcwp1619811744363.csv',
|
|
176
|
+
dataFileSourceType: 'file',
|
|
177
|
+
visualizationType: 'Bar',
|
|
178
|
+
description: 'Subtext can be added here for options like citing data sources or insight into reading the bar chart.',
|
|
179
|
+
barPadding: 47,
|
|
180
|
+
filters: [],
|
|
181
|
+
lollipopSize: 'medium',
|
|
182
|
+
validated: 4.23,
|
|
183
|
+
dynamicMarginTop: 0
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export default meta
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import Chart from '../CdcChart'
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Chart> = {
|
|
6
|
+
title: 'Components/Templates/Chart/Tooltip',
|
|
7
|
+
component: Chart
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof Chart>
|
|
11
|
+
|
|
12
|
+
export const Additional_Tooltip: Story = {
|
|
13
|
+
args: {
|
|
14
|
+
config: {
|
|
15
|
+
type: 'chart',
|
|
16
|
+
debugSvg: false,
|
|
17
|
+
chartMessage: {
|
|
18
|
+
noData: 'No Data Available'
|
|
19
|
+
},
|
|
20
|
+
title: 'Example Stacked Bar Chart with Additional tolltip column',
|
|
21
|
+
showTitle: true,
|
|
22
|
+
showDownloadMediaButton: false,
|
|
23
|
+
theme: 'theme-orange',
|
|
24
|
+
animate: false,
|
|
25
|
+
fontSize: 'medium',
|
|
26
|
+
lineDatapointStyle: 'hover',
|
|
27
|
+
barHasBorder: 'false',
|
|
28
|
+
isLollipopChart: false,
|
|
29
|
+
lollipopShape: 'circle',
|
|
30
|
+
lollipopColorStyle: 'two-tone',
|
|
31
|
+
visualizationSubType: 'stacked',
|
|
32
|
+
barStyle: '',
|
|
33
|
+
roundingStyle: 'standard',
|
|
34
|
+
tipRounding: 'top',
|
|
35
|
+
isResponsiveTicks: false,
|
|
36
|
+
general: {
|
|
37
|
+
showDownloadButton: false
|
|
38
|
+
},
|
|
39
|
+
padding: {
|
|
40
|
+
left: 5,
|
|
41
|
+
right: 5
|
|
42
|
+
},
|
|
43
|
+
yAxis: {
|
|
44
|
+
hideAxis: false,
|
|
45
|
+
displayNumbersOnBar: false,
|
|
46
|
+
hideLabel: false,
|
|
47
|
+
hideTicks: false,
|
|
48
|
+
size: '64',
|
|
49
|
+
gridLines: false,
|
|
50
|
+
enablePadding: false,
|
|
51
|
+
min: '',
|
|
52
|
+
max: '',
|
|
53
|
+
labelColor: '#333',
|
|
54
|
+
tickLabelColor: '#333',
|
|
55
|
+
tickColor: '#333',
|
|
56
|
+
rightHideAxis: true,
|
|
57
|
+
rightAxisSize: 0,
|
|
58
|
+
rightLabel: '',
|
|
59
|
+
rightLabelOffsetSize: 0,
|
|
60
|
+
rightAxisLabelColor: '#333',
|
|
61
|
+
rightAxisTickLabelColor: '#333',
|
|
62
|
+
rightAxisTickColor: '#333',
|
|
63
|
+
numTicks: '',
|
|
64
|
+
axisPadding: 0,
|
|
65
|
+
tickRotation: 0,
|
|
66
|
+
anchors: [],
|
|
67
|
+
label: 'Y-Axis Label Example'
|
|
68
|
+
},
|
|
69
|
+
boxplot: {
|
|
70
|
+
plots: [],
|
|
71
|
+
borders: 'true',
|
|
72
|
+
firstQuartilePercentage: 25,
|
|
73
|
+
thirdQuartilePercentage: 75,
|
|
74
|
+
boxWidthPercentage: 40,
|
|
75
|
+
plotOutlierValues: false,
|
|
76
|
+
plotNonOutlierValues: true,
|
|
77
|
+
legend: {
|
|
78
|
+
showHowToReadText: false,
|
|
79
|
+
howToReadText: ''
|
|
80
|
+
},
|
|
81
|
+
labels: {
|
|
82
|
+
q1: 'Lower Quartile',
|
|
83
|
+
q2: 'q2',
|
|
84
|
+
q3: 'Upper Quartile',
|
|
85
|
+
q4: 'q4',
|
|
86
|
+
minimum: 'Minimum',
|
|
87
|
+
maximum: 'Maximum',
|
|
88
|
+
mean: 'Mean',
|
|
89
|
+
median: 'Median',
|
|
90
|
+
sd: 'Standard Deviation',
|
|
91
|
+
iqr: 'Interquartile Range',
|
|
92
|
+
total: 'Total',
|
|
93
|
+
outliers: 'Outliers',
|
|
94
|
+
values: 'Values',
|
|
95
|
+
lowerBounds: 'Lower Bounds',
|
|
96
|
+
upperBounds: 'Upper Bounds'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
topAxis: {
|
|
100
|
+
hasLine: false
|
|
101
|
+
},
|
|
102
|
+
isLegendValue: false,
|
|
103
|
+
barThickness: 0.35,
|
|
104
|
+
barHeight: 25,
|
|
105
|
+
barSpace: 15,
|
|
106
|
+
heights: {
|
|
107
|
+
vertical: 300,
|
|
108
|
+
horizontal: 750
|
|
109
|
+
},
|
|
110
|
+
xAxis: {
|
|
111
|
+
sortDates: false,
|
|
112
|
+
anchors: [],
|
|
113
|
+
type: 'categorical',
|
|
114
|
+
showTargetLabel: true,
|
|
115
|
+
targetLabel: 'Target',
|
|
116
|
+
hideAxis: false,
|
|
117
|
+
hideLabel: false,
|
|
118
|
+
hideTicks: false,
|
|
119
|
+
size: '67',
|
|
120
|
+
tickRotation: '25',
|
|
121
|
+
min: '',
|
|
122
|
+
max: '',
|
|
123
|
+
labelColor: '#333',
|
|
124
|
+
tickLabelColor: '#333',
|
|
125
|
+
tickColor: '#333',
|
|
126
|
+
numTicks: '',
|
|
127
|
+
labelOffset: 65,
|
|
128
|
+
axisPadding: 0,
|
|
129
|
+
target: 0,
|
|
130
|
+
maxTickRotation: 0,
|
|
131
|
+
dataKey: 'Year',
|
|
132
|
+
label: 'X-Axis Label Example',
|
|
133
|
+
tickWidthMax: 41
|
|
134
|
+
},
|
|
135
|
+
table: {
|
|
136
|
+
label: 'Data Table',
|
|
137
|
+
expanded: true,
|
|
138
|
+
limitHeight: false,
|
|
139
|
+
height: '',
|
|
140
|
+
caption: '',
|
|
141
|
+
showDownloadUrl: false,
|
|
142
|
+
showDataTableLink: true,
|
|
143
|
+
indexLabel: '',
|
|
144
|
+
download: true,
|
|
145
|
+
showVertical: false,
|
|
146
|
+
show: true
|
|
147
|
+
},
|
|
148
|
+
orientation: 'vertical',
|
|
149
|
+
color: 'pinkpurple',
|
|
150
|
+
columns: {
|
|
151
|
+
additionalColumn1: {
|
|
152
|
+
label: 'New Column',
|
|
153
|
+
dataTable: false,
|
|
154
|
+
tooltips: true,
|
|
155
|
+
prefix: '',
|
|
156
|
+
suffix: '',
|
|
157
|
+
forestPlot: false,
|
|
158
|
+
startingPoint: '0',
|
|
159
|
+
forestPlotAlignRight: false,
|
|
160
|
+
name: 'Data 1'
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
legend: {
|
|
164
|
+
hide: false,
|
|
165
|
+
behavior: 'isolate',
|
|
166
|
+
singleRow: false,
|
|
167
|
+
colorCode: '',
|
|
168
|
+
reverseLabelOrder: false,
|
|
169
|
+
description: '',
|
|
170
|
+
dynamicLegend: false,
|
|
171
|
+
dynamicLegendDefaultText: 'Show All',
|
|
172
|
+
dynamicLegendItemLimit: 5,
|
|
173
|
+
dynamicLegendItemLimitMessage: 'Dynamic Legend Item Limit Hit.',
|
|
174
|
+
dynamicLegendChartMessage: 'Select Options from the Legend',
|
|
175
|
+
lineMode: false,
|
|
176
|
+
verticalSorted: false,
|
|
177
|
+
position: 'right',
|
|
178
|
+
label: 'Data Type'
|
|
179
|
+
},
|
|
180
|
+
brush: {
|
|
181
|
+
height: 25,
|
|
182
|
+
data: [],
|
|
183
|
+
active: false
|
|
184
|
+
},
|
|
185
|
+
exclusions: {
|
|
186
|
+
active: false,
|
|
187
|
+
keys: []
|
|
188
|
+
},
|
|
189
|
+
palette: 'qualitative-bold',
|
|
190
|
+
isPaletteReversed: false,
|
|
191
|
+
twoColor: {
|
|
192
|
+
palette: 'monochrome-1',
|
|
193
|
+
isPaletteReversed: false
|
|
194
|
+
},
|
|
195
|
+
labels: false,
|
|
196
|
+
dataFormat: {
|
|
197
|
+
commas: false,
|
|
198
|
+
prefix: '',
|
|
199
|
+
suffix: '%',
|
|
200
|
+
abbreviated: false,
|
|
201
|
+
bottomSuffix: '',
|
|
202
|
+
bottomPrefix: '',
|
|
203
|
+
bottomAbbreviated: false
|
|
204
|
+
},
|
|
205
|
+
confidenceKeys: {},
|
|
206
|
+
visual: {
|
|
207
|
+
border: true,
|
|
208
|
+
accent: true,
|
|
209
|
+
background: true,
|
|
210
|
+
verticalHoverLine: false,
|
|
211
|
+
horizontalHoverLine: false
|
|
212
|
+
},
|
|
213
|
+
useLogScale: false,
|
|
214
|
+
filterBehavior: 'Filter Change',
|
|
215
|
+
highlightedBarValues: [],
|
|
216
|
+
series: [
|
|
217
|
+
{
|
|
218
|
+
dataKey: 'Data 2',
|
|
219
|
+
type: 'Bar',
|
|
220
|
+
tooltip: true
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
dataKey: 'Data 3',
|
|
224
|
+
type: 'Bar',
|
|
225
|
+
tooltip: true
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
tooltips: {
|
|
229
|
+
opacity: 90
|
|
230
|
+
},
|
|
231
|
+
forestPlot: {
|
|
232
|
+
startAt: 0,
|
|
233
|
+
width: 'auto',
|
|
234
|
+
colors: {
|
|
235
|
+
line: '',
|
|
236
|
+
shape: ''
|
|
237
|
+
},
|
|
238
|
+
estimateField: '',
|
|
239
|
+
estimateRadius: '',
|
|
240
|
+
lowerCiField: '',
|
|
241
|
+
upperCiField: '',
|
|
242
|
+
shape: '',
|
|
243
|
+
rowHeight: 20,
|
|
244
|
+
showZeroLine: false,
|
|
245
|
+
description: {
|
|
246
|
+
show: true,
|
|
247
|
+
text: 'description',
|
|
248
|
+
location: 0
|
|
249
|
+
},
|
|
250
|
+
result: {
|
|
251
|
+
show: true,
|
|
252
|
+
text: 'result',
|
|
253
|
+
location: 100
|
|
254
|
+
},
|
|
255
|
+
radius: {
|
|
256
|
+
min: 1,
|
|
257
|
+
max: 8,
|
|
258
|
+
scalingColumn: ''
|
|
259
|
+
},
|
|
260
|
+
regression: {
|
|
261
|
+
lower: 0,
|
|
262
|
+
upper: 0,
|
|
263
|
+
estimateField: 0
|
|
264
|
+
},
|
|
265
|
+
leftWidthOffset: 0,
|
|
266
|
+
rightWidthOffset: 0
|
|
267
|
+
},
|
|
268
|
+
area: {
|
|
269
|
+
isStacked: false
|
|
270
|
+
},
|
|
271
|
+
height: '375',
|
|
272
|
+
data: [
|
|
273
|
+
{
|
|
274
|
+
Year: '2015',
|
|
275
|
+
'Data 1': '25',
|
|
276
|
+
'Data 2': '20',
|
|
277
|
+
'Data 3': '55'
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
Year: '2016',
|
|
281
|
+
'Data 1': '35',
|
|
282
|
+
'Data 2': '30',
|
|
283
|
+
'Data 3': '35'
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
Year: '2017',
|
|
287
|
+
'Data 1': '22',
|
|
288
|
+
'Data 2': '38',
|
|
289
|
+
'Data 3': '40'
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
Year: '2018',
|
|
293
|
+
'Data 1': '40',
|
|
294
|
+
'Data 2': '40',
|
|
295
|
+
'Data 3': '20'
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
visualizationType: 'Bar',
|
|
299
|
+
validated: 4.23,
|
|
300
|
+
dynamicMarginTop: 0
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export default meta
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import chartBrushConfig from './_mock/brush_mock.json'
|
|
3
|
+
|
|
4
|
+
import Chart from '../CdcChart'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Chart> = {
|
|
7
|
+
title: 'Components/Templates/Chart/Brush',
|
|
8
|
+
component: Chart
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof Chart>
|
|
12
|
+
|
|
13
|
+
export const Area_Brush: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
config: chartBrushConfig
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import Chart from '../CdcChart'
|
|
4
|
+
|
|
5
|
+
import pieChartExample from './_mock/pie_config.json'
|
|
6
|
+
import pieData from './_mock/pie_data.json'
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof Chart> = {
|
|
9
|
+
title: 'Components/Templates/Editor/Chart',
|
|
10
|
+
component: Chart
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Chart>
|
|
14
|
+
|
|
15
|
+
export const Primary: Story = {
|
|
16
|
+
args: {
|
|
17
|
+
config: { ...pieChartExample, data: pieData },
|
|
18
|
+
isEditor: true
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default meta
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import chartLinepreliminary from './_mock/preliminary_mock.json'
|
|
3
|
+
|
|
4
|
+
import Chart from '../CdcChart'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Chart> = {
|
|
7
|
+
title: 'Components/Templates/Chart/Line/Preliminary',
|
|
8
|
+
component: Chart
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof Chart>
|
|
12
|
+
|
|
13
|
+
export const Line_Chart: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
config: chartLinepreliminary
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import suppressMock from './_mock/suppress_mock.json'
|
|
3
|
+
|
|
4
|
+
import Chart from '../CdcChart'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Chart> = {
|
|
7
|
+
title: 'Components/Templates/Chart/Suppress',
|
|
8
|
+
component: Chart
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof Chart>
|
|
12
|
+
|
|
13
|
+
export const Horizontal_Chart: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
config: suppressMock
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default meta
|