@cdc/chart 4.25.10 → 4.26.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-1a1724a1.es.js → cdcchart-dgT_1dIT.es.js} +136 -151
- package/dist/cdcchart.js +44003 -43518
- package/examples/feature/__data__/planet-example-data.json +1 -1
- package/examples/feature/boxplot/valid-boxplot.csv +38 -17
- package/examples/feature/pie/planet-pie-example-config.json +48 -2
- package/examples/private/DEV-11825.json +573 -0
- package/examples/private/DEV-12100.json +1303 -0
- package/examples/private/cat-y.json +1235 -0
- package/examples/private/data-points.json +228 -0
- package/examples/private/height.json +3915 -0
- package/examples/private/links.json +569 -0
- package/examples/private/na.json +913 -0
- package/examples/private/quadrant.txt +30 -0
- package/examples/private/test-data.csv +28 -0
- package/examples/private/test-forecast.json +5510 -0
- package/examples/private/warming-stripe-test.json +2578 -0
- package/examples/private/warming-stripes.json +4763 -0
- package/examples/tech-adoption-with-links.json +560 -0
- package/index.html +16 -140
- package/package.json +6 -5
- package/preview.html +1616 -0
- package/src/CdcChart.tsx +8 -11
- package/src/CdcChartComponent.tsx +329 -124
- package/src/_stories/Chart.Combo.stories.tsx +18 -0
- package/src/_stories/Chart.Forecast.stories.tsx +36 -0
- package/src/_stories/Chart.HTMLInDataTable.stories.tsx +520 -0
- package/src/_stories/Chart.Patterns.stories.tsx +2 -1
- package/src/_stories/Chart.PreserveDecimals.stories.tsx +220 -0
- package/src/_stories/Chart.Regions.Categorical.stories.tsx +148 -0
- package/src/_stories/Chart.Regions.DateScale.stories.tsx +197 -0
- package/src/_stories/Chart.Regions.DateTimeScale.stories.tsx +297 -0
- package/src/_stories/Chart.SmallMultiples.stories.tsx +47 -0
- package/src/_stories/Chart.stories.tsx +8 -0
- package/src/_stories/ChartAnnotation.stories.tsx +6 -3
- package/src/_stories/ChartBar.Editor.stories.tsx +3585 -0
- package/src/_stories/ChartBrush.Editor.stories.tsx +295 -0
- package/src/_stories/ChartBrush.stories.tsx +50 -0
- package/src/_stories/ChartEditor.Editor.stories.tsx +656 -0
- package/src/_stories/ChartEditor.stories.tsx +1 -2
- package/src/_stories/TechAdoptionWithLinks.stories.tsx +27 -0
- package/src/_stories/_mock/brush_enabled.json +326 -0
- package/src/_stories/_mock/brush_mock.json +2 -69
- package/src/_stories/_mock/combo.json +451 -0
- package/src/_stories/_mock/editor-test-configs.json +376 -0
- package/src/_stories/_mock/editor-test-datasets.json +477 -0
- package/src/_stories/_mock/editor-tests/bar-chart-editor-test.json +255 -0
- package/src/_stories/_mock/editor-tests/bar-chart-general-test.json +267 -0
- package/src/_stories/_mock/editor-tests/bar-chart-test.json +237 -0
- package/src/_stories/_mock/forecast_combo_with_gaps.json +913 -0
- package/src/_stories/_mock/horizontal-bars-dynamic-y-axis.json +413 -0
- package/src/_stories/_mock/pie_config.json +257 -62
- package/src/_stories/_mock/small_multiples/small_multiples_bars.json +1944 -0
- package/src/_stories/_mock/small_multiples/small_multiples_big_data_bars.json +1114 -0
- package/src/_stories/_mock/small_multiples/small_multiples_lines.json +2646 -0
- package/src/_stories/_mock/small_multiples/small_multiples_lines_colors.json +1305 -0
- package/src/_stories/_mock/small_multiples/small_multiples_stacked_bars.json +1936 -0
- package/src/components/Annotations/components/findNearestDatum.ts +6 -41
- package/src/components/AreaChart/components/AreaChart.Stacked.jsx +10 -7
- package/src/components/AreaChart/index.tsx +1 -2
- package/src/components/Axis/Categorical.Axis.tsx +6 -7
- package/src/components/BarChart/components/BarChart.Horizontal.tsx +181 -27
- package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +3 -1
- package/src/components/BarChart/components/BarChart.StackedVertical.tsx +1 -0
- package/src/components/BarChart/components/BarChart.Vertical.tsx +8 -9
- package/src/components/BarChart/components/context.tsx +1 -0
- package/src/components/BarChart/helpers/useBarChart.ts +14 -2
- package/src/components/BoxPlot/helpers/index.ts +3 -3
- package/src/components/Brush/BrushSelector.tsx +1258 -0
- package/src/components/Brush/MiniChartPreview.tsx +283 -0
- package/src/components/DeviationBar.jsx +9 -7
- package/src/components/EditorPanel/EditorPanel.tsx +2720 -2586
- package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +96 -111
- package/src/components/EditorPanel/components/Panels/Panel.ForestPlotSettings.tsx +56 -34
- package/src/components/EditorPanel/components/Panels/Panel.General.tsx +76 -31
- package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +104 -55
- package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +54 -49
- package/src/components/EditorPanel/components/Panels/Panel.SmallMultiples.tsx +427 -0
- package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +96 -48
- package/src/components/EditorPanel/components/Panels/index.tsx +3 -1
- package/src/components/EditorPanel/editor-panel.scss +0 -20
- package/src/components/EditorPanel/useEditorPermissions.ts +36 -31
- package/src/components/Forecasting/Forecasting.tsx +139 -21
- package/src/components/Legend/Legend.Component.tsx +16 -9
- package/src/components/Legend/Legend.tsx +3 -2
- package/src/components/Legend/helpers/createFormatLabels.tsx +325 -176
- package/src/components/Legend/helpers/getLegendClasses.ts +0 -1
- package/src/components/Legend/helpers/index.ts +10 -6
- package/src/components/LineChart/LineChartProps.ts +0 -3
- package/src/components/LineChart/helpers.ts +1 -1
- package/src/components/LineChart/index.tsx +36 -13
- package/src/components/LinearChart.tsx +559 -499
- package/src/components/PairedBarChart.jsx +20 -3
- package/src/components/Regions/components/Regions.tsx +366 -144
- package/src/components/Sankey/types/index.ts +1 -1
- package/src/components/ScatterPlot/ScatterPlot.jsx +2 -2
- package/src/components/SmallMultiples/SmallMultipleTile.tsx +202 -0
- package/src/components/SmallMultiples/SmallMultiples.css +32 -0
- package/src/components/SmallMultiples/SmallMultiples.tsx +271 -0
- package/src/components/SmallMultiples/index.ts +2 -0
- package/src/components/WarmingStripes/WarmingStripes.tsx +160 -0
- package/src/components/WarmingStripes/WarmingStripesGradientLegend.css +35 -0
- package/src/components/WarmingStripes/WarmingStripesGradientLegend.tsx +104 -0
- package/src/components/WarmingStripes/index.tsx +3 -0
- package/src/data/initial-state.js +16 -2
- package/src/helpers/buildForecastPaletteOptions.ts +0 -38
- package/src/helpers/calculateHorizontalBarCategoryLabelWidth.ts +57 -0
- package/src/helpers/getColorScale.ts +10 -0
- package/src/{hooks/useMinMax.ts → helpers/getMinMax.ts} +26 -14
- package/src/helpers/getYAxisAutoPadding.ts +53 -0
- package/src/helpers/sizeHelpers.ts +0 -20
- package/src/helpers/smallMultiplesHelpers.ts +529 -0
- package/src/hooks/useChartHoverAnalytics.tsx +10 -9
- package/src/hooks/useProgrammaticTooltip.ts +96 -0
- package/src/hooks/useScales.ts +98 -34
- package/src/hooks/useSmallMultipleSynchronization.ts +59 -0
- package/src/hooks/useTooltip.tsx +91 -25
- package/src/scss/DataTable.scss +0 -4
- package/src/scss/main.scss +18 -83
- package/src/store/chart.actions.ts +2 -0
- package/src/store/chart.reducer.ts +4 -0
- package/src/test/CdcChart.test.jsx +1 -1
- package/src/types/ChartConfig.ts +27 -6
- package/src/types/ChartContext.ts +3 -0
- package/src/types/Label.ts +1 -0
- package/src/utils/analyticsTracking.ts +19 -0
- package/LICENSE +0 -201
- package/src/_stories/_mock/pie_data.json +0 -218
- package/src/components/AreaChart/components/AreaChart.jsx +0 -109
- package/src/components/Brush/BrushChart.tsx +0 -128
- package/src/components/Brush/BrushController.tsx +0 -71
- package/src/components/Brush/types.tsx +0 -8
- package/src/components/BrushChart.tsx +0 -223
- package/src/helpers/sort.ts +0 -7
- package/src/hooks/useActiveElement.js +0 -19
- package/src/hooks/useChartClasses.js +0 -41
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// generate a combo chart story
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { Meta, Story } from '@storybook/react'
|
|
4
|
+
import CdcChart from '@cdc/chart/src/CdcChart'
|
|
5
|
+
import comboChartConfig from './_mock/combo.json'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/Templates/Chart/Combo Chart',
|
|
9
|
+
component: CdcChart
|
|
10
|
+
} as Meta
|
|
11
|
+
|
|
12
|
+
const Template: Story = args => <CdcChart {...args} />
|
|
13
|
+
|
|
14
|
+
export const ComboChart = Template.bind({})
|
|
15
|
+
ComboChart.args = {
|
|
16
|
+
config: comboChartConfig,
|
|
17
|
+
isEditor: true
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
|
|
3
|
+
import Chart from '../CdcChart'
|
|
4
|
+
import forecastComboWithGaps from './_mock/forecast_combo_with_gaps.json'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Chart> = {
|
|
7
|
+
title: 'Components/Templates/Chart/Forecast Chart',
|
|
8
|
+
component: Chart,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component:
|
|
13
|
+
'Forecast charts with gap handling. This story demonstrates how forecast charts properly handle gaps in data by filtering invalid values (NA) and splitting segments at gaps.'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof Chart>
|
|
20
|
+
|
|
21
|
+
export const Forecast_Combo_With_Gaps: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
config: forecastComboWithGaps,
|
|
24
|
+
isEditor: true
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
docs: {
|
|
28
|
+
description: {
|
|
29
|
+
story:
|
|
30
|
+
'A combo chart with forecast confidence intervals that demonstrates proper gap handling. The forecast areas and lines are split into separate segments when gaps are detected, preventing misleading connections across missing data periods. Invalid data points (NA values) are automatically filtered out.'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default meta
|
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
import CdcChart from '../CdcChartComponent'
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof CdcChart> = {
|
|
5
|
+
title: 'Components/Templates/Chart/HTML in Data Table',
|
|
6
|
+
component: CdcChart,
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component:
|
|
11
|
+
'Demonstrates charts with HTML content rendered in data table columns, including footnotes, links, and formatted text.'
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof CdcChart>
|
|
20
|
+
|
|
21
|
+
// Sample data with HTML footnotes as a column
|
|
22
|
+
const sampleDataWithHTMLFootnotes = [
|
|
23
|
+
{
|
|
24
|
+
State: 'California',
|
|
25
|
+
VaccinationRate: 82.4,
|
|
26
|
+
Year: 2023,
|
|
27
|
+
Category: 'High',
|
|
28
|
+
Footnote: 'Data from <strong>CDC National Immunization Survey</strong>'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
State: 'Connecticut',
|
|
32
|
+
VaccinationRate: 85.6,
|
|
33
|
+
Year: 2023,
|
|
34
|
+
Category: 'High',
|
|
35
|
+
Footnote: 'Coverage rate includes <em>all age groups</em>'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
State: 'Massachusetts',
|
|
39
|
+
VaccinationRate: 87.3,
|
|
40
|
+
Year: 2023,
|
|
41
|
+
Category: 'High',
|
|
42
|
+
Footnote: 'Highest rate in <strong>2023</strong> survey'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
State: 'New York',
|
|
46
|
+
VaccinationRate: 81.2,
|
|
47
|
+
Year: 2023,
|
|
48
|
+
Category: 'High',
|
|
49
|
+
Footnote: 'See <a href="https://www.cdc.gov" target="_blank">CDC.gov</a> for details'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
State: 'Washington',
|
|
53
|
+
VaccinationRate: 80.5,
|
|
54
|
+
Year: 2023,
|
|
55
|
+
Category: 'High',
|
|
56
|
+
Footnote: 'Rate increased <strong>5%</strong> from previous year'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
State: 'Alabama',
|
|
60
|
+
VaccinationRate: 72.5,
|
|
61
|
+
Year: 2023,
|
|
62
|
+
Category: 'Medium',
|
|
63
|
+
Footnote: 'Medium coverage: <em>60-79%</em> range'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
State: 'Arizona',
|
|
67
|
+
VaccinationRate: 75.8,
|
|
68
|
+
Year: 2023,
|
|
69
|
+
Category: 'Medium',
|
|
70
|
+
Footnote: 'Improving from <strong>previous surveys</strong>'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
State: 'Colorado',
|
|
74
|
+
VaccinationRate: 79.1,
|
|
75
|
+
Year: 2023,
|
|
76
|
+
Category: 'Medium',
|
|
77
|
+
Footnote: 'Near <em>high coverage</em> threshold'
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
// Base chart configuration
|
|
82
|
+
const baseChartConfig: any = {
|
|
83
|
+
type: 'chart',
|
|
84
|
+
visualizationType: 'Bar',
|
|
85
|
+
title: 'State Vaccination Coverage Rates',
|
|
86
|
+
showTitle: true,
|
|
87
|
+
theme: 'theme-blue',
|
|
88
|
+
fontSize: 'medium',
|
|
89
|
+
orientation: 'vertical',
|
|
90
|
+
filterBehavior: 'Filter Change',
|
|
91
|
+
filters: [],
|
|
92
|
+
xAxis: {
|
|
93
|
+
label: 'State',
|
|
94
|
+
dataKey: 'State',
|
|
95
|
+
type: 'categorical'
|
|
96
|
+
},
|
|
97
|
+
yAxis: {
|
|
98
|
+
label: 'Vaccination Rate (%)',
|
|
99
|
+
dataKey: 'VaccinationRate',
|
|
100
|
+
type: 'linear'
|
|
101
|
+
},
|
|
102
|
+
series: [
|
|
103
|
+
{
|
|
104
|
+
dataKey: 'VaccinationRate',
|
|
105
|
+
type: 'Bar',
|
|
106
|
+
name: 'Coverage Rate'
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
table: {
|
|
110
|
+
label: 'Data Table',
|
|
111
|
+
expanded: true,
|
|
112
|
+
show: true,
|
|
113
|
+
download: true
|
|
114
|
+
},
|
|
115
|
+
dataFormat: {
|
|
116
|
+
commas: false,
|
|
117
|
+
abbreviated: false,
|
|
118
|
+
roundTo: 1
|
|
119
|
+
},
|
|
120
|
+
data: sampleDataWithHTMLFootnotes
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Story 1: Basic HTML in footnote column
|
|
124
|
+
export const BasicHTMLInFootnoteColumn: Story = {
|
|
125
|
+
name: 'Basic HTML in Footnote Column',
|
|
126
|
+
args: {
|
|
127
|
+
config: {
|
|
128
|
+
...baseChartConfig,
|
|
129
|
+
columns: {
|
|
130
|
+
State: {
|
|
131
|
+
name: 'State',
|
|
132
|
+
label: 'State',
|
|
133
|
+
dataTable: true
|
|
134
|
+
},
|
|
135
|
+
VaccinationRate: {
|
|
136
|
+
name: 'VaccinationRate',
|
|
137
|
+
label: 'Vaccination Rate (%)',
|
|
138
|
+
dataTable: true,
|
|
139
|
+
suffix: '%',
|
|
140
|
+
roundToPlace: 1
|
|
141
|
+
},
|
|
142
|
+
Footnote: {
|
|
143
|
+
name: 'Footnote',
|
|
144
|
+
label: 'Notes',
|
|
145
|
+
dataTable: true,
|
|
146
|
+
tooltips: false
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
isEditor: true
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Story 2: HTML with links and formatting
|
|
155
|
+
export const HTMLWithLinksAndFormatting: Story = {
|
|
156
|
+
name: 'HTML with Links and Formatting',
|
|
157
|
+
args: {
|
|
158
|
+
config: {
|
|
159
|
+
...baseChartConfig,
|
|
160
|
+
data: [
|
|
161
|
+
{
|
|
162
|
+
State: 'California',
|
|
163
|
+
VaccinationRate: 82.4,
|
|
164
|
+
Footnote:
|
|
165
|
+
'Source: <strong>CDC</strong> - <a href="https://www.cdc.gov/vaccines" target="_blank">Vaccine Data</a>\nReporting Period: January - December 2023'
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
State: 'Connecticut',
|
|
169
|
+
VaccinationRate: 85.6,
|
|
170
|
+
Footnote: 'Includes <em>all demographics</em>\nContact: <a href="mailto:health@ct.gov">health@ct.gov</a>'
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
State: 'Massachusetts',
|
|
174
|
+
VaccinationRate: 87.3,
|
|
175
|
+
Footnote:
|
|
176
|
+
'<strong style="color: #005ea2;">Leading state</strong> in vaccination coverage\nHighest rate in region'
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
State: 'New York',
|
|
180
|
+
VaccinationRate: 81.2,
|
|
181
|
+
Footnote: 'Data validated by <em>NYS Department of Health</em>\nSee full report for methodology'
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
State: 'Texas',
|
|
185
|
+
VaccinationRate: 69.8,
|
|
186
|
+
Footnote:
|
|
187
|
+
'More info: <a href="https://dshs.texas.gov" target="_blank">TX DSHS</a>\nOutreach programs available'
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
columns: {
|
|
191
|
+
State: {
|
|
192
|
+
name: 'State',
|
|
193
|
+
label: 'State',
|
|
194
|
+
dataTable: true
|
|
195
|
+
},
|
|
196
|
+
VaccinationRate: {
|
|
197
|
+
name: 'VaccinationRate',
|
|
198
|
+
label: 'Coverage Rate (%)',
|
|
199
|
+
dataTable: true,
|
|
200
|
+
suffix: '%',
|
|
201
|
+
roundToPlace: 1
|
|
202
|
+
},
|
|
203
|
+
Footnote: {
|
|
204
|
+
name: 'Footnote',
|
|
205
|
+
label: 'Additional Information',
|
|
206
|
+
dataTable: true
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
isEditor: true
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Story 3: HTML with line breaks
|
|
215
|
+
export const HTMLWithLineBreaks: Story = {
|
|
216
|
+
name: 'HTML with Line Breaks',
|
|
217
|
+
args: {
|
|
218
|
+
config: {
|
|
219
|
+
...baseChartConfig,
|
|
220
|
+
data: [
|
|
221
|
+
{
|
|
222
|
+
State: 'California',
|
|
223
|
+
VaccinationRate: 82.4,
|
|
224
|
+
Footnote: '<strong>Data Source:</strong> CDC Survey<br><em>Collection Period:</em> Jan-Dec 2023'
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
State: 'Connecticut',
|
|
228
|
+
VaccinationRate: 85.6,
|
|
229
|
+
Footnote: 'Coverage includes:<br>• Ages 6 months+<br>• All vaccine types'
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
State: 'Massachusetts',
|
|
233
|
+
VaccinationRate: 87.3,
|
|
234
|
+
Footnote: 'Leading state for:<br>1. Overall coverage<br>2. Equity metrics'
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
State: 'New York',
|
|
238
|
+
VaccinationRate: 81.2,
|
|
239
|
+
Footnote: '<strong>Note:</strong> Excludes NYC<br>See separate report'
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
State: 'Washington',
|
|
243
|
+
VaccinationRate: 80.5,
|
|
244
|
+
Footnote: 'Trend: ↑ 5% YoY<br>Target: <strong>85%</strong> by 2024'
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
columns: {
|
|
248
|
+
State: {
|
|
249
|
+
name: 'State',
|
|
250
|
+
label: 'State',
|
|
251
|
+
dataTable: true
|
|
252
|
+
},
|
|
253
|
+
VaccinationRate: {
|
|
254
|
+
name: 'VaccinationRate',
|
|
255
|
+
label: 'Rate (%)',
|
|
256
|
+
dataTable: true,
|
|
257
|
+
suffix: '%',
|
|
258
|
+
roundToPlace: 1
|
|
259
|
+
},
|
|
260
|
+
Footnote: {
|
|
261
|
+
name: 'Footnote',
|
|
262
|
+
label: 'Detailed Notes',
|
|
263
|
+
dataTable: true
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
isEditor: true
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Story 4: Complex HTML with lists
|
|
272
|
+
export const ComplexHTMLWithLists: Story = {
|
|
273
|
+
name: 'Complex HTML with Lists',
|
|
274
|
+
args: {
|
|
275
|
+
config: {
|
|
276
|
+
...baseChartConfig,
|
|
277
|
+
data: [
|
|
278
|
+
{
|
|
279
|
+
State: 'California',
|
|
280
|
+
VaccinationRate: 82.4,
|
|
281
|
+
Footnote:
|
|
282
|
+
'<strong>Program Details:</strong><ul style="margin:0;padding-left:20px;"><li>State-funded clinics</li><li>Mobile vaccination units</li></ul>'
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
State: 'Connecticut',
|
|
286
|
+
VaccinationRate: 85.6,
|
|
287
|
+
Footnote:
|
|
288
|
+
'<em>Success Factors:</em><br><ol style="margin:0;padding-left:20px;"><li>Community outreach</li><li>School programs</li></ol>'
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
State: 'Massachusetts',
|
|
292
|
+
VaccinationRate: 87.3,
|
|
293
|
+
Footnote:
|
|
294
|
+
'Achievements:<ul style="margin:0;padding-left:20px;"><li><strong>Highest rate</strong> in region</li><li>Improved <em>accessibility</em></li></ul>'
|
|
295
|
+
}
|
|
296
|
+
],
|
|
297
|
+
columns: {
|
|
298
|
+
State: {
|
|
299
|
+
name: 'State',
|
|
300
|
+
label: 'State',
|
|
301
|
+
dataTable: true
|
|
302
|
+
},
|
|
303
|
+
VaccinationRate: {
|
|
304
|
+
name: 'VaccinationRate',
|
|
305
|
+
label: 'Coverage (%)',
|
|
306
|
+
dataTable: true,
|
|
307
|
+
suffix: '%',
|
|
308
|
+
roundToPlace: 1
|
|
309
|
+
},
|
|
310
|
+
Footnote: {
|
|
311
|
+
name: 'Footnote',
|
|
312
|
+
label: 'Program Information',
|
|
313
|
+
dataTable: true
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
isEditor: true
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Story 5: HTML with inline styles
|
|
322
|
+
export const HTMLWithInlineStyles: Story = {
|
|
323
|
+
name: 'HTML with Inline Styles',
|
|
324
|
+
args: {
|
|
325
|
+
config: {
|
|
326
|
+
...baseChartConfig,
|
|
327
|
+
data: [
|
|
328
|
+
{
|
|
329
|
+
State: 'California',
|
|
330
|
+
VaccinationRate: 82.4,
|
|
331
|
+
Footnote:
|
|
332
|
+
'<span style="color: #005ea2; font-weight: bold;">High Priority State</span> - Continued improvement needed'
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
State: 'Connecticut',
|
|
336
|
+
VaccinationRate: 85.6,
|
|
337
|
+
Footnote: '<span style="background-color: #f0f0f0; padding: 2px 5px;">Exemplary Performance</span>'
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
State: 'Massachusetts',
|
|
341
|
+
VaccinationRate: 87.3,
|
|
342
|
+
Footnote: '<strong style="color: #2e8540;">✓ Target Achieved</strong> - Maintaining high coverage'
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
State: 'Texas',
|
|
346
|
+
VaccinationRate: 69.8,
|
|
347
|
+
Footnote: '<span style="color: #d54309;">⚠ Below Target</span> - Outreach initiatives underway'
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
columns: {
|
|
351
|
+
State: {
|
|
352
|
+
name: 'State',
|
|
353
|
+
label: 'State',
|
|
354
|
+
dataTable: true
|
|
355
|
+
},
|
|
356
|
+
VaccinationRate: {
|
|
357
|
+
name: 'VaccinationRate',
|
|
358
|
+
label: 'Rate (%)',
|
|
359
|
+
dataTable: true,
|
|
360
|
+
suffix: '%',
|
|
361
|
+
roundToPlace: 1
|
|
362
|
+
},
|
|
363
|
+
Footnote: {
|
|
364
|
+
name: 'Footnote',
|
|
365
|
+
label: 'Status',
|
|
366
|
+
dataTable: true
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
isEditor: true
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// Story 6: Line chart with HTML footnotes
|
|
375
|
+
export const LineChartWithHTMLFootnotes: Story = {
|
|
376
|
+
name: 'Line Chart with HTML Footnotes',
|
|
377
|
+
args: {
|
|
378
|
+
config: {
|
|
379
|
+
...baseChartConfig,
|
|
380
|
+
visualizationType: 'Line',
|
|
381
|
+
title: 'Vaccination Rate Trends',
|
|
382
|
+
data: [
|
|
383
|
+
{
|
|
384
|
+
Year: '2019',
|
|
385
|
+
Rate: 72.5,
|
|
386
|
+
Footnote: 'Baseline year - <strong>Pre-pandemic</strong> data'
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
Year: '2020',
|
|
390
|
+
Rate: 68.3,
|
|
391
|
+
Footnote: '<em style="color: #d54309;">Pandemic impact</em> - Reduced access to healthcare'
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
Year: '2021',
|
|
395
|
+
Rate: 75.8,
|
|
396
|
+
Footnote: 'Recovery begins - <strong>Vaccination campaigns</strong> launched'
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
Year: '2022',
|
|
400
|
+
Rate: 80.1,
|
|
401
|
+
Footnote: 'Significant improvement - See <a href="https://www.cdc.gov" target="_blank">CDC report</a>'
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
Year: '2023',
|
|
405
|
+
Rate: 82.4,
|
|
406
|
+
Footnote: '<strong style="color: #2e8540;">Target exceeded</strong> - Continued success'
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
xAxis: {
|
|
410
|
+
label: 'Year',
|
|
411
|
+
dataKey: 'Year',
|
|
412
|
+
type: 'categorical'
|
|
413
|
+
},
|
|
414
|
+
yAxis: {
|
|
415
|
+
label: 'Vaccination Rate (%)',
|
|
416
|
+
dataKey: 'Rate',
|
|
417
|
+
type: 'linear'
|
|
418
|
+
},
|
|
419
|
+
series: [
|
|
420
|
+
{
|
|
421
|
+
dataKey: 'Rate',
|
|
422
|
+
type: 'Line',
|
|
423
|
+
name: 'Coverage Rate'
|
|
424
|
+
}
|
|
425
|
+
],
|
|
426
|
+
columns: {
|
|
427
|
+
Year: {
|
|
428
|
+
name: 'Year',
|
|
429
|
+
label: 'Year',
|
|
430
|
+
dataTable: true
|
|
431
|
+
},
|
|
432
|
+
Rate: {
|
|
433
|
+
name: 'Rate',
|
|
434
|
+
label: 'Rate (%)',
|
|
435
|
+
dataTable: true,
|
|
436
|
+
suffix: '%',
|
|
437
|
+
roundToPlace: 1
|
|
438
|
+
},
|
|
439
|
+
Footnote: {
|
|
440
|
+
name: 'Footnote',
|
|
441
|
+
label: 'Context & Notes',
|
|
442
|
+
dataTable: true
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
isEditor: true
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Story 7: Pie chart with HTML footnotes
|
|
451
|
+
export const PieChartWithHTMLFootnotes: Story = {
|
|
452
|
+
name: 'Pie Chart with HTML Footnotes',
|
|
453
|
+
args: {
|
|
454
|
+
config: {
|
|
455
|
+
type: 'chart',
|
|
456
|
+
visualizationType: 'Pie',
|
|
457
|
+
title: 'Coverage by Category',
|
|
458
|
+
showTitle: true,
|
|
459
|
+
theme: 'theme-blue',
|
|
460
|
+
fontSize: 'medium',
|
|
461
|
+
filterBehavior: 'Filter Change',
|
|
462
|
+
filters: [],
|
|
463
|
+
data: [
|
|
464
|
+
{
|
|
465
|
+
Category: 'High Coverage',
|
|
466
|
+
Count: 5,
|
|
467
|
+
Percentage: 42,
|
|
468
|
+
Footnote: '<strong>5 states</strong> with ≥80% coverage<br>Leading examples: <em>MA, CT, NY</em>'
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
Category: 'Medium Coverage',
|
|
472
|
+
Count: 7,
|
|
473
|
+
Percentage: 58,
|
|
474
|
+
Footnote: '<strong>7 states</strong> with 60-79% coverage<br>Target: Move to <em>high category</em>'
|
|
475
|
+
}
|
|
476
|
+
],
|
|
477
|
+
series: [
|
|
478
|
+
{
|
|
479
|
+
dataKey: 'Percentage',
|
|
480
|
+
type: 'Pie',
|
|
481
|
+
name: 'Coverage Distribution'
|
|
482
|
+
}
|
|
483
|
+
],
|
|
484
|
+
table: {
|
|
485
|
+
label: 'Coverage Distribution Data',
|
|
486
|
+
expanded: true,
|
|
487
|
+
show: true,
|
|
488
|
+
download: true
|
|
489
|
+
},
|
|
490
|
+
columns: {
|
|
491
|
+
Category: {
|
|
492
|
+
name: 'Category',
|
|
493
|
+
label: 'Coverage Category',
|
|
494
|
+
dataTable: true
|
|
495
|
+
},
|
|
496
|
+
Count: {
|
|
497
|
+
name: 'Count',
|
|
498
|
+
label: 'Number of States',
|
|
499
|
+
dataTable: true
|
|
500
|
+
},
|
|
501
|
+
Percentage: {
|
|
502
|
+
name: 'Percentage',
|
|
503
|
+
label: 'Percentage',
|
|
504
|
+
dataTable: true,
|
|
505
|
+
suffix: '%'
|
|
506
|
+
},
|
|
507
|
+
Footnote: {
|
|
508
|
+
name: 'Footnote',
|
|
509
|
+
label: 'Details',
|
|
510
|
+
dataTable: true
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
dataFormat: {
|
|
514
|
+
commas: false,
|
|
515
|
+
abbreviated: false
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
isEditor: true
|
|
519
|
+
}
|
|
520
|
+
}
|