@cdc/core 4.25.8 → 4.25.11

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 (163) hide show
  1. package/_stories/StoryRenderingTests.stories.tsx +164 -0
  2. package/components/AdvancedEditor/AdvancedEditor.tsx +32 -9
  3. package/components/CustomColorsEditor/CustomColorsEditor.css +299 -0
  4. package/components/CustomColorsEditor/CustomColorsEditor.tsx +209 -0
  5. package/components/CustomColorsEditor/index.ts +1 -0
  6. package/components/DataTable/DataTable.tsx +56 -38
  7. package/components/DataTable/DataTableStandAlone.tsx +8 -3
  8. package/components/DataTable/components/ChartHeader.tsx +44 -14
  9. package/components/DataTable/components/DataTableEditorPanel.tsx +12 -2
  10. package/components/DataTable/components/ExpandCollapse.tsx +10 -1
  11. package/components/DataTable/components/MapHeader.tsx +24 -13
  12. package/components/DataTable/data-table.css +12 -0
  13. package/components/DataTable/helpers/chartCellMatrix.tsx +11 -8
  14. package/components/DataTable/helpers/mapCellMatrix.tsx +33 -4
  15. package/components/DataTable/helpers/standardizeState.js +2 -2
  16. package/components/DataTable/helpers/tests/standardizeState.test.js +54 -0
  17. package/components/DownloadButton.tsx +40 -14
  18. package/components/EditorPanel/DataTableEditor.tsx +3 -3
  19. package/components/EditorPanel/EditorPanel.styles.css +423 -0
  20. package/components/EditorPanel/FootnotesEditor.tsx +44 -37
  21. package/components/EditorPanel/Inputs.tsx +12 -2
  22. package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +35 -62
  23. package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +12 -2
  24. package/components/EditorPanel/components/MarkupHighlightedTextField.tsx +227 -0
  25. package/components/EditorPanel/components/MarkupVariablesEditor.tsx +450 -0
  26. package/components/EditorPanel/components/PanelMarkup.tsx +59 -0
  27. package/components/ErrorBoundary.jsx +3 -1
  28. package/components/Filters/Filters.tsx +52 -24
  29. package/components/Filters/components/Dropdown.tsx +6 -1
  30. package/components/Filters/components/Tabs.tsx +1 -0
  31. package/components/Footnotes/Footnotes.tsx +35 -25
  32. package/components/Footnotes/FootnotesStandAlone.tsx +42 -6
  33. package/components/HeaderThemeSelector/HeaderThemeSelector.css +43 -0
  34. package/components/HeaderThemeSelector/HeaderThemeSelector.stories.tsx +74 -0
  35. package/components/HeaderThemeSelector/HeaderThemeSelector.tsx +61 -0
  36. package/components/HeaderThemeSelector/index.ts +2 -0
  37. package/components/Layout/styles/editor.scss +2 -1
  38. package/components/Legend/Legend.Gradient.tsx +3 -6
  39. package/components/LegendShape.tsx +121 -3
  40. package/components/Loader/Loader.tsx +1 -1
  41. package/components/MediaControls.tsx +72 -21
  42. package/components/PaletteConversionModal.tsx +90 -0
  43. package/components/PaletteSelector/DeveloperPaletteRollback.tsx +114 -0
  44. package/components/PaletteSelector/PaletteSelector.css +94 -0
  45. package/components/PaletteSelector/PaletteSelector.tsx +112 -0
  46. package/components/PaletteSelector/index.ts +2 -0
  47. package/components/RichTooltip/RichTooltip.tsx +1 -0
  48. package/components/Table/Table.tsx +3 -1
  49. package/components/Table/components/Cell.tsx +23 -2
  50. package/components/Table/components/Row.tsx +5 -3
  51. package/components/_stories/BlurStrokeTest.stories.tsx +1 -1
  52. package/components/_stories/DataTable.stories.tsx +1 -1
  53. package/components/_stories/Filters.stories.tsx +21 -2
  54. package/components/_stories/Footnotes.CSV.stories.tsx +247 -0
  55. package/components/_stories/Footnotes.stories.tsx +769 -4
  56. package/components/_stories/Inputs.stories.tsx +3 -3
  57. package/components/_stories/MultiSelect.stories.tsx +3 -3
  58. package/components/_stories/NestedDropdown.stories.tsx +1 -1
  59. package/components/_stories/Table.stories.tsx +1 -1
  60. package/components/_stories/styles.scss +0 -1
  61. package/components/elements/_stories/Button.stories.tsx +1 -1
  62. package/components/elements/_stories/Card.stories.tsx +1 -1
  63. package/components/inputs/InputToggle.tsx +2 -0
  64. package/components/managers/DataDesigner.tsx +10 -9
  65. package/components/managers/_stories/DataDesigner.stories.tsx +1 -1
  66. package/components/ui/Accordion.jsx +1 -1
  67. package/components/ui/Tooltip.tsx +2 -1
  68. package/components/ui/_stories/Accordion.stories.tsx +1 -1
  69. package/components/ui/_stories/ColorPaletteMigration.stories.mdx +275 -0
  70. package/components/ui/_stories/Colors.stories.tsx +330 -0
  71. package/components/ui/_stories/IconGallery.stories.tsx +316 -0
  72. package/components/ui/_stories/Title.stories.tsx +1 -1
  73. package/components/ui/accordion.styles.css +57 -0
  74. package/contexts/EditorContext.ts +18 -0
  75. package/contexts/editor.actions.ts +28 -0
  76. package/contexts/editor.reducer.ts +94 -0
  77. package/data/chartColorPalettes.ts +118 -0
  78. package/data/colorPalettes.ts +9 -0
  79. package/data/mapColorPalettes.ts +45 -0
  80. package/data/sharedPalettes.ts +50 -0
  81. package/dist/cove-main.css +63 -14
  82. package/dist/cove-main.css.map +1 -1
  83. package/generateViteConfig.js +80 -0
  84. package/helpers/addValuesToFilters.ts +7 -3
  85. package/helpers/cloneConfig.ts +31 -0
  86. package/helpers/configDataHelpers.ts +128 -0
  87. package/helpers/configHelpers.ts +27 -0
  88. package/helpers/constants.ts +42 -2
  89. package/helpers/cove/number.ts +33 -12
  90. package/helpers/coveUpdateWorker.ts +15 -3
  91. package/helpers/fetchRemoteData.ts +3 -15
  92. package/helpers/filterColorPalettes.ts +152 -0
  93. package/helpers/generateColorsArray.ts +13 -0
  94. package/helpers/getColorPaletteVersion.ts +33 -0
  95. package/helpers/getPaletteAccessor.ts +18 -0
  96. package/helpers/markupProcessor.ts +220 -0
  97. package/helpers/mergeCustomOrderValues.ts +37 -0
  98. package/helpers/metrics/helpers.ts +42 -19
  99. package/helpers/metrics/types.ts +48 -9
  100. package/helpers/metrics/utils.ts +34 -0
  101. package/helpers/palettes/colorDistributions.ts +56 -0
  102. package/helpers/palettes/migratePaletteName.ts +150 -0
  103. package/helpers/palettes/standardizePaletteNames.ts +77 -0
  104. package/helpers/palettes/utils.ts +267 -0
  105. package/helpers/parseCsvWithQuotes.ts +65 -0
  106. package/helpers/queryStringUtils.ts +13 -0
  107. package/helpers/testing.ts +358 -0
  108. package/helpers/tests/addValuesToFilters.test.ts +1 -2
  109. package/helpers/tests/generateColorsArray.test.ts +24 -0
  110. package/helpers/tests/markupProcessor.test.ts +538 -0
  111. package/helpers/tests/testStandaloneBuild.ts +44 -0
  112. package/helpers/useMarkupVariables.ts +31 -0
  113. package/helpers/vegaConfig.ts +0 -1
  114. package/helpers/ver/4.24.10.ts +2 -1
  115. package/helpers/ver/4.24.11.ts +2 -1
  116. package/helpers/ver/4.24.3.ts +2 -1
  117. package/helpers/ver/4.24.4.ts +2 -1
  118. package/helpers/ver/4.24.5.ts +2 -1
  119. package/helpers/ver/4.24.7.ts +2 -1
  120. package/helpers/ver/4.24.9.ts +2 -1
  121. package/helpers/ver/4.25.1.ts +2 -1
  122. package/helpers/ver/4.25.10.ts +36 -0
  123. package/helpers/ver/4.25.11.ts +13 -0
  124. package/helpers/ver/4.25.3.ts +2 -1
  125. package/helpers/ver/4.25.4.ts +2 -1
  126. package/helpers/ver/4.25.6.ts +2 -1
  127. package/helpers/ver/4.25.7.ts +2 -1
  128. package/helpers/ver/4.25.8.ts +2 -1
  129. package/helpers/ver/4.25.9.ts +293 -0
  130. package/helpers/ver/tests/4.25.10.test.ts +204 -0
  131. package/helpers/ver/tests/4.25.8.test.ts +1 -1
  132. package/helpers/ver/tests/4.25.9.test.ts +51 -0
  133. package/helpers/viewports.ts +2 -0
  134. package/hooks/useColorPalette.ts +79 -0
  135. package/package.json +13 -4
  136. package/styles/_common-components.css +73 -0
  137. package/styles/_global.scss +32 -10
  138. package/styles/base.scss +8 -55
  139. package/styles/cove-main.scss +3 -1
  140. package/styles/filters.scss +10 -3
  141. package/styles/v2/base/index.scss +0 -1
  142. package/styles/v2/components/button.scss +4 -3
  143. package/styles/v2/components/editor.scss +16 -7
  144. package/styles/v2/layout/_data-table.scss +3 -2
  145. package/styles/v2/themes/_color-definitions.scss +18 -17
  146. package/styles/v2/utils/_breakpoints.scss +1 -1
  147. package/styles/v2/utils/index.scss +0 -1
  148. package/styles/waiting.scss +1 -1
  149. package/testing-setup.js +32 -0
  150. package/types/MarkupInclude.ts +8 -2
  151. package/types/MarkupVariable.ts +19 -0
  152. package/types/VizFilter.ts +2 -0
  153. package/vitest.config.ts +16 -0
  154. package/components/ui/_stories/Colors.stories.mdx +0 -220
  155. package/components/ui/_stories/IconGallery.stories.mdx +0 -14
  156. package/data/colorPalettes.js +0 -171
  157. package/helpers/formatConfigBeforeSave.ts +0 -135
  158. package/helpers/tests/formatConfigBeforeSave.test.ts +0 -68
  159. package/styles/_mixins.scss +0 -13
  160. package/styles/v2/base/_typography.scss +0 -0
  161. package/styles/v2/components/guidance-block.scss +0 -74
  162. package/styles/v2/utils/_functions.scss +0 -0
  163. /package/{styles/_typography.scss → testBuild.js} +0 -0
@@ -1,17 +1,782 @@
1
- import { Meta, StoryObj } from '@storybook/react'
1
+ import { Meta, StoryObj } from '@storybook/react-vite'
2
2
  import Footnotes from '../Footnotes'
3
+ import FootnotesStandAlone from '../Footnotes/FootnotesStandAlone'
4
+ import Chart from '@cdc/chart'
5
+ import CdcMap from '@cdc/map'
3
6
 
4
7
  const meta: Meta<typeof Footnotes> = {
5
8
  title: 'Components/Organisms/Footnotes',
6
- component: Footnotes
9
+ component: Footnotes,
10
+ parameters: {
11
+ docs: {
12
+ description: {
13
+ component: 'Renders footnotes with support for symbols, HTML tags, and newlines. See "CSV Features" stories for dynamic footnotes from CSV data.'
14
+ }
15
+ }
16
+ }
7
17
  }
8
18
 
9
19
  export default meta
10
20
 
11
- type Story = StoryObj<typeof Footnotes>
21
+ type Story = StoryObj<typeof FootnotesStandAlone>
12
22
 
13
23
  export const Primary: Story = {
24
+ render: args => <FootnotesStandAlone {...args} />,
25
+ args: {
26
+ config: {
27
+ staticFootnotes: [
28
+ { symbol: '*', text: 'This is a footnote' },
29
+ { symbol: '†', text: 'This is another footnote' },
30
+ { text: 'This is a third footnote' }
31
+ ]
32
+ },
33
+ data: [],
34
+ markupVariables: [],
35
+ enableMarkupVariables: false,
36
+ filters: []
37
+ }
38
+ }
39
+
40
+ export const WithHTMLTags: Story = {
41
+ render: args => <FootnotesStandAlone {...args} />,
42
+ args: {
43
+ config: {
44
+ staticFootnotes: [
45
+ { symbol: '*', text: 'This footnote has a <br> tag for line break' },
46
+ { symbol: '†', text: 'This has <strong>bold text</strong> and <em>italic text</em>' },
47
+ { symbol: '**', text: 'Multiple tags: <strong>bold</strong>, <em>italic</em>, and <br>line break' }
48
+ ]
49
+ },
50
+ data: [],
51
+ markupVariables: [],
52
+ enableMarkupVariables: false,
53
+ filters: []
54
+ }
55
+ }
56
+
57
+ export const WithNewlines: Story = {
58
+ render: args => <FootnotesStandAlone {...args} />,
59
+ args: {
60
+ config: {
61
+ staticFootnotes: [
62
+ { symbol: '*', text: 'This footnote has a newline\nbetween these two lines' },
63
+ { symbol: '†', text: 'This footnote has multiple\nnewlines\ncreating three lines' },
64
+ { symbol: '**', text: 'This footnote has a newline\nand continues on the next line' }
65
+ ]
66
+ },
67
+ data: [],
68
+ markupVariables: [],
69
+ enableMarkupVariables: false,
70
+ filters: []
71
+ }
72
+ }
73
+
74
+ export const WithNewlinesAndHTML: Story = {
75
+ render: args => <FootnotesStandAlone {...args} />,
14
76
  args: {
15
- footnotes: [{ symbol: '*', text: 'This is a footnote' }, { symbol: '†', text: 'This is another footnote' }, { text: 'This is a third footnote' }]
77
+ config: {
78
+ staticFootnotes: [
79
+ { symbol: '*', text: 'Line 1\nLine 2 with <strong>bold</strong> text' },
80
+ { symbol: '†', text: 'First line\nSecond line with <em>italic</em>\nThird line with <br>HTML tag' },
81
+ { symbol: '**', text: 'Start\nMiddle with <strong>bold</strong>\nEnd' }
82
+ ]
83
+ },
84
+ data: [],
85
+ markupVariables: [],
86
+ enableMarkupVariables: false,
87
+ filters: []
16
88
  }
17
89
  }
90
+
91
+ // Chart example with footnotes editor
92
+ type ChartStory = StoryObj<typeof Chart>
93
+
94
+ export const ChartWithFootnotes: ChartStory = {
95
+ name: 'Chart with Footnotes Editor',
96
+ render: (args: any) => <Chart {...args} />,
97
+ args: {
98
+ config: {
99
+ type: 'chart',
100
+ visualizationType: 'Bar',
101
+ title: 'Planets in Our Solar System',
102
+ showTitle: true,
103
+ theme: 'theme-blue',
104
+ fontSize: 'medium',
105
+ orientation: 'vertical',
106
+ xAxis: {
107
+ dataKey: 'Planet',
108
+ label: 'Planet',
109
+ type: 'categorical'
110
+ },
111
+ yAxis: {
112
+ dataKey: 'Diameter',
113
+ label: 'Diameter (km)',
114
+ type: 'linear'
115
+ },
116
+ series: [
117
+ {
118
+ dataKey: 'Diameter',
119
+ type: 'Bar',
120
+ name: 'Diameter'
121
+ }
122
+ ],
123
+ data: [
124
+ { Planet: 'Mercury', Diameter: 4879, Type: 'Terrestrial', Year: 2023, HasRings: 'No' },
125
+ { Planet: 'Venus', Diameter: 12104, Type: 'Terrestrial', Year: 2023, HasRings: 'No' },
126
+ { Planet: 'Earth', Diameter: 12742, Type: 'Terrestrial', Year: 2023, HasRings: 'No' },
127
+ { Planet: 'Mars', Diameter: 6779, Type: 'Terrestrial', Year: 2023, HasRings: 'No' },
128
+ { Planet: 'Jupiter', Diameter: 139820, Type: 'Gas Giant', Year: 2024, HasRings: 'Yes' },
129
+ { Planet: 'Saturn', Diameter: 116460, Type: 'Gas Giant', Year: 2024, HasRings: 'Yes' },
130
+ { Planet: 'Uranus', Diameter: 50724, Type: 'Ice Giant', Year: 2024, HasRings: 'Yes' },
131
+ { Planet: 'Neptune', Diameter: 49244, Type: 'Ice Giant', Year: 2024, HasRings: 'Yes' }
132
+ ],
133
+ filters: [
134
+ {
135
+ columnName: 'Year',
136
+ label: 'Data Year',
137
+ active: true,
138
+ values: [2023, 2024],
139
+ setBy: 'url',
140
+ filterBy: [2023],
141
+ filterFootnotes: true
142
+ }
143
+ ],
144
+ enableMarkupVariables: true,
145
+ markupVariables: [
146
+ {
147
+ name: 'planet_types',
148
+ columnName: 'Type',
149
+ tag: '{{planet_types}}',
150
+ conditions: [],
151
+ addCommas: false
152
+ },
153
+ {
154
+ name: 'terrestrial_planets',
155
+ columnName: 'Planet',
156
+ tag: '{{terrestrial_planets}}',
157
+ conditions: [
158
+ {
159
+ columnName: 'Type',
160
+ isOrIsNotEqualTo: 'is',
161
+ value: 'Terrestrial'
162
+ }
163
+ ],
164
+ addCommas: false
165
+ },
166
+ {
167
+ name: 'planets_with_rings',
168
+ columnName: 'Planet',
169
+ tag: '{{planets_with_rings}}',
170
+ conditions: [
171
+ {
172
+ columnName: 'HasRings',
173
+ isOrIsNotEqualTo: 'is',
174
+ value: 'Yes'
175
+ }
176
+ ],
177
+ addCommas: false
178
+ },
179
+ {
180
+ name: 'data_year',
181
+ columnName: 'Year',
182
+ tag: '{{data_year}}',
183
+ conditions: [],
184
+ addCommas: false
185
+ }
186
+ ],
187
+ footnotes: {
188
+ staticFootnotes: [
189
+ { symbol: '*', text: 'Planet types shown: {{planet_types}}' },
190
+ { symbol: '†', text: 'Terrestrial planets: {{terrestrial_planets}}' },
191
+ { text: 'Planets with rings: {{planets_with_rings}}. Data year: {{data_year}}' }
192
+ ]
193
+ }
194
+ },
195
+ isEditor: true
196
+ }
197
+ }
198
+
199
+ // Map example with footnotes editor
200
+ type MapStory = StoryObj<typeof CdcMap>
201
+
202
+ export const MapWithFootnotes: MapStory = {
203
+ name: 'Map with Footnotes Editor',
204
+ render: (args: any) => <CdcMap {...args} />,
205
+ args: {
206
+ config: {
207
+ "annotations": [],
208
+ "general": {
209
+ "navigationTarget": "_self",
210
+ "noDataMessage": "No State Selected",
211
+ "annotationDropdownText": "Annotations",
212
+ "geoBorderColor": "darkGray",
213
+ "headerColor": "theme-blue",
214
+ "title": "",
215
+ "showTitle": true,
216
+ "showSidebar": true,
217
+ "showDownloadMediaButton": false,
218
+ "displayAsHex": false,
219
+ "displayStateLabels": false,
220
+ "territoriesAlwaysShow": false,
221
+ "language": "en",
222
+ "geoType": "us",
223
+ "geoLabelOverride": "",
224
+ "hasRegions": false,
225
+ "fullBorder": false,
226
+ "type": "data",
227
+ "convertFipsCodes": true,
228
+ "palette": {
229
+ "isReversed": true,
230
+ "name": "sequential_bluereverse",
231
+ "version": "2.0"
232
+ },
233
+ "allowMapZoom": true,
234
+ "hideGeoColumnInTooltip": false,
235
+ "hidePrimaryColumnInTooltip": false,
236
+ "statesPicked": [],
237
+ "expandDataTable": false
238
+ },
239
+ "type": "map",
240
+ "columns": {
241
+ "geo": {
242
+ "name": "State",
243
+ "label": "Location",
244
+ "tooltip": false,
245
+ "dataTable": true
246
+ },
247
+ "primary": {
248
+ "dataTable": true,
249
+ "tooltip": true,
250
+ "prefix": "",
251
+ "suffix": "%",
252
+ "name": "Coverage",
253
+ "label": "Coverage Rate (%)",
254
+ "roundToPlace": 0
255
+ },
256
+ "navigate": {
257
+ "name": "State",
258
+ "tooltip": false,
259
+ "dataTable": false
260
+ },
261
+ "latitude": {
262
+ "name": ""
263
+ },
264
+ "longitude": {
265
+ "name": ""
266
+ }
267
+ },
268
+ "legend": {
269
+ "descriptions": {
270
+ "High": "Coverage ≥ 80%",
271
+ "Medium": "Coverage 60-79%",
272
+ "Low": "Coverage < 60%"
273
+ },
274
+ "specialClasses": [],
275
+ "unified": false,
276
+ "singleColumn": false,
277
+ "singleRow": false,
278
+ "verticalSorted": false,
279
+ "showSpecialClassesLast": false,
280
+ "dynamicDescription": false,
281
+ "type": "equalnumber",
282
+ "numberOfItems": 3,
283
+ "position": "side",
284
+ "title": "",
285
+ "style": "circles",
286
+ "subStyle": "linear blocks",
287
+ "tickRotation": "",
288
+ "singleColumnLegend": false,
289
+ "hideBorder": false,
290
+ "groupBy": "",
291
+ "hide": false
292
+ },
293
+ "filters": [
294
+ {
295
+ "columnName": "Year",
296
+ "label": "Reporting Year",
297
+ "active": 2023,
298
+ "values": [
299
+ 2023,
300
+ 2024
301
+ ],
302
+ "setBy": "url",
303
+ "filterBy": [
304
+ 2023
305
+ ],
306
+ "filterFootnotes": true,
307
+ "id": 1762985265975,
308
+ "filterStyle": "dropdown"
309
+ }
310
+ ],
311
+ "table": {
312
+ "wrapColumns": false,
313
+ "label": "Data Table",
314
+ "expanded": false,
315
+ "limitHeight": false,
316
+ "height": "",
317
+ "caption": "",
318
+ "showDownloadUrl": false,
319
+ "showDataTableLink": true,
320
+ "showDownloadLinkBelow": true,
321
+ "showFullGeoNameInCSV": false,
322
+ "forceDisplay": true,
323
+ "download": true,
324
+ "indexLabel": "",
325
+ "cellMinWidth": "0",
326
+ "collapsible": true
327
+ },
328
+ "tooltips": {
329
+ "appearanceType": "hover",
330
+ "linkLabel": "Learn More",
331
+ "opacity": 90
332
+ },
333
+ "runtime": {
334
+ "editorErrorMessage": []
335
+ },
336
+ "visual": {
337
+ "minBubbleSize": 1,
338
+ "maxBubbleSize": 20,
339
+ "extraBubbleBorder": false,
340
+ "cityStyle": "circle",
341
+ "cityStyleLabel": "",
342
+ "showBubbleZeros": false,
343
+ "additionalCityStyles": [],
344
+ "geoCodeCircleSize": 8
345
+ },
346
+ "mapPosition": {
347
+ "coordinates": [
348
+ 0,
349
+ 30
350
+ ],
351
+ "zoom": 1
352
+ },
353
+ "map": {
354
+ "layers": [],
355
+ "patterns": []
356
+ },
357
+ "hexMap": {
358
+ "type": "",
359
+ "shapeGroups": [
360
+ {
361
+ "legendTitle": "",
362
+ "legendDescription": "",
363
+ "items": [
364
+ {
365
+ "key": "",
366
+ "shape": "Arrow Up",
367
+ "column": "",
368
+ "operator": "=",
369
+ "value": ""
370
+ }
371
+ ]
372
+ }
373
+ ]
374
+ },
375
+ "filterBehavior": "Filter Change",
376
+ "filterIntro": "",
377
+ "smallMultiples": {
378
+ "mode": "",
379
+ "tileColumn": "",
380
+ "tilesPerRowDesktop": 3,
381
+ "tilesPerRowMobile": 1,
382
+ "tileOrderType": "asc",
383
+ "tileOrder": [],
384
+ "tileTitles": {}
385
+ },
386
+ "markupVariables": [
387
+ {
388
+ "name": "all_categories",
389
+ "columnName": "Category",
390
+ "tag": "{{all_categories}}",
391
+ "conditions": [],
392
+ "addCommas": false
393
+ },
394
+ {
395
+ "name": "high_coverage_states",
396
+ "columnName": "State",
397
+ "tag": "{{high_coverage_states}}",
398
+ "conditions": [
399
+ {
400
+ "columnName": "Category",
401
+ "isOrIsNotEqualTo": "is",
402
+ "value": "High"
403
+ }
404
+ ],
405
+ "addCommas": false
406
+ },
407
+ {
408
+ "name": "medium_coverage_states",
409
+ "columnName": "State",
410
+ "tag": "{{medium_coverage_states}}",
411
+ "conditions": [
412
+ {
413
+ "columnName": "Category",
414
+ "isOrIsNotEqualTo": "is",
415
+ "value": "Medium"
416
+ }
417
+ ],
418
+ "addCommas": false
419
+ },
420
+ {
421
+ "name": "reporting_years",
422
+ "columnName": "Year",
423
+ "tag": "{{reporting_years}}",
424
+ "conditions": [],
425
+ "addCommas": false
426
+ },
427
+ {
428
+ "name": "vaccine_program",
429
+ "columnName": "Program",
430
+ "tag": "{{vaccine_program}}",
431
+ "conditions": [],
432
+ "addCommas": false
433
+ }
434
+ ],
435
+ "enableMarkupVariables": true,
436
+ "title": "Vaccination Coverage Rate by State",
437
+ "showTitle": true,
438
+ "theme": "theme-blue",
439
+ "fontSize": "medium",
440
+ "dataClassification": {
441
+ "numberOfItems": 3,
442
+ "method": "equalnumber"
443
+ },
444
+ "footnotes": {
445
+ "staticFootnotes": [
446
+ {
447
+ "symbol": "*",
448
+ "text": "Coverage categories shown: {{all_categories}}. High coverage states: {{high_coverage_states}}"
449
+ },
450
+ {
451
+ "symbol": "†",
452
+ "text": "Reporting year(s): {{reporting_years}}"
453
+ },
454
+ {
455
+ "text": "Program: {{vaccine_program}}. Medium coverage states: {{medium_coverage_states}}"
456
+ }
457
+ ]
458
+ },
459
+ "version": "4.25.10",
460
+ "migrations": {
461
+ "addColorMigration": true
462
+ },
463
+ "data": [
464
+ {
465
+ "geo": "AL",
466
+ "State": "Alabama",
467
+ "Coverage": 72.5,
468
+ "Year": 2023,
469
+ "Category": "Medium",
470
+ "Program": "Flu Vaccine"
471
+ },
472
+ {
473
+ "geo": "AK",
474
+ "State": "Alaska",
475
+ "Coverage": 68.3,
476
+ "Year": 2023,
477
+ "Category": "Medium",
478
+ "Program": "Flu Vaccine"
479
+ },
480
+ {
481
+ "geo": "AZ",
482
+ "State": "Arizona",
483
+ "Coverage": 75.8,
484
+ "Year": 2023,
485
+ "Category": "Medium",
486
+ "Program": "Flu Vaccine"
487
+ },
488
+ {
489
+ "geo": "CA",
490
+ "State": "California",
491
+ "Coverage": 82.4,
492
+ "Year": 2023,
493
+ "Category": "High",
494
+ "Program": "Flu Vaccine"
495
+ },
496
+ {
497
+ "geo": "CO",
498
+ "State": "Colorado",
499
+ "Coverage": 79.1,
500
+ "Year": 2023,
501
+ "Category": "Medium",
502
+ "Program": "Flu Vaccine"
503
+ },
504
+ {
505
+ "geo": "CT",
506
+ "State": "Connecticut",
507
+ "Coverage": 85.6,
508
+ "Year": 2023,
509
+ "Category": "High",
510
+ "Program": "Flu Vaccine"
511
+ },
512
+ {
513
+ "geo": "FL",
514
+ "State": "Florida",
515
+ "Coverage": 74.2,
516
+ "Year": 2023,
517
+ "Category": "Medium",
518
+ "Program": "Flu Vaccine"
519
+ },
520
+ {
521
+ "geo": "GA",
522
+ "State": "Georgia",
523
+ "Coverage": 70.9,
524
+ "Year": 2023,
525
+ "Category": "Medium",
526
+ "Program": "Flu Vaccine"
527
+ },
528
+ {
529
+ "geo": "IL",
530
+ "State": "Illinois",
531
+ "Coverage": 77.5,
532
+ "Year": 2023,
533
+ "Category": "Medium",
534
+ "Program": "Flu Vaccine"
535
+ },
536
+ {
537
+ "geo": "MA",
538
+ "State": "Massachusetts",
539
+ "Coverage": 87.3,
540
+ "Year": 2023,
541
+ "Category": "High",
542
+ "Program": "Flu Vaccine"
543
+ },
544
+ {
545
+ "geo": "NY",
546
+ "State": "New York",
547
+ "Coverage": 81.2,
548
+ "Year": 2023,
549
+ "Category": "High",
550
+ "Program": "Flu Vaccine"
551
+ },
552
+ {
553
+ "geo": "TX",
554
+ "State": "Texas",
555
+ "Coverage": 69.8,
556
+ "Year": 2023,
557
+ "Category": "Medium",
558
+ "Program": "Flu Vaccine"
559
+ },
560
+ {
561
+ "geo": "WA",
562
+ "State": "Washington",
563
+ "Coverage": 80.5,
564
+ "Year": 2023,
565
+ "Category": "High",
566
+ "Program": "Flu Vaccine"
567
+ },
568
+ {
569
+ "geo": "AL",
570
+ "State": "Alabama",
571
+ "Coverage": 74.8,
572
+ "Year": 2024,
573
+ "Category": "Medium",
574
+ "Program": "Flu Vaccine"
575
+ },
576
+ {
577
+ "geo": "AK",
578
+ "State": "Alaska",
579
+ "Coverage": 70.1,
580
+ "Year": 2024,
581
+ "Category": "Medium",
582
+ "Program": "Flu Vaccine"
583
+ },
584
+ {
585
+ "geo": "AZ",
586
+ "State": "Arizona",
587
+ "Coverage": 78.2,
588
+ "Year": 2024,
589
+ "Category": "Medium",
590
+ "Program": "Flu Vaccine"
591
+ },
592
+ {
593
+ "geo": "CA",
594
+ "State": "California",
595
+ "Coverage": 84.1,
596
+ "Year": 2024,
597
+ "Category": "High",
598
+ "Program": "Flu Vaccine"
599
+ },
600
+ {
601
+ "geo": "CO",
602
+ "State": "Colorado",
603
+ "Coverage": 81.3,
604
+ "Year": 2024,
605
+ "Category": "High",
606
+ "Program": "Flu Vaccine"
607
+ },
608
+ {
609
+ "geo": "CT",
610
+ "State": "Connecticut",
611
+ "Coverage": 87.9,
612
+ "Year": 2024,
613
+ "Category": "High",
614
+ "Program": "Flu Vaccine"
615
+ },
616
+ {
617
+ "geo": "FL",
618
+ "State": "Florida",
619
+ "Coverage": 76.5,
620
+ "Year": 2024,
621
+ "Category": "Medium",
622
+ "Program": "Flu Vaccine"
623
+ },
624
+ {
625
+ "geo": "GA",
626
+ "State": "Georgia",
627
+ "Coverage": 73.2,
628
+ "Year": 2024,
629
+ "Category": "Medium",
630
+ "Program": "Flu Vaccine"
631
+ },
632
+ {
633
+ "geo": "IL",
634
+ "State": "Illinois",
635
+ "Coverage": 79.8,
636
+ "Year": 2024,
637
+ "Category": "Medium",
638
+ "Program": "Flu Vaccine"
639
+ },
640
+ {
641
+ "geo": "MA",
642
+ "State": "Massachusetts",
643
+ "Coverage": 88.6,
644
+ "Year": 2024,
645
+ "Category": "High",
646
+ "Program": "Flu Vaccine"
647
+ },
648
+ {
649
+ "geo": "NY",
650
+ "State": "New York",
651
+ "Coverage": 83.4,
652
+ "Year": 2024,
653
+ "Category": "High",
654
+ "Program": "Flu Vaccine"
655
+ },
656
+ {
657
+ "geo": "TX",
658
+ "State": "Texas",
659
+ "Coverage": 72.1,
660
+ "Year": 2024,
661
+ "Category": "Medium",
662
+ "Program": "Flu Vaccine"
663
+ },
664
+ {
665
+ "geo": "WA",
666
+ "State": "Washington",
667
+ "Coverage": 82.7,
668
+ "Year": 2024,
669
+ "Category": "High",
670
+ "Program": "Flu Vaccine"
671
+ }
672
+ ]
673
+ },
674
+ isEditor: true
675
+ }
676
+ }
677
+
678
+ // Story demonstrating markup variables in footnotes
679
+ type StandAloneStory = StoryObj<typeof FootnotesStandAlone>
680
+
681
+ export const WithMarkupVariables: StandAloneStory = {
682
+ name: 'With Markup Variables',
683
+ render: args => <FootnotesStandAlone {...args} />,
684
+ args: {
685
+ config: {
686
+ staticFootnotes: [
687
+ {
688
+ symbol: '*',
689
+ text: 'Data shown for {{state_name}} with values from {{year}}'
690
+ },
691
+ {
692
+ symbol: '†',
693
+ text: 'The highest value recorded was {{max_value}}'
694
+ },
695
+ {
696
+ text: 'Category A states: {{category_a_states}}'
697
+ }
698
+ ]
699
+ },
700
+ data: [
701
+ { state: 'Alabama', value: 100, year: 2023, category: 'A' },
702
+ { state: 'Alaska', value: 200, year: 2023, category: 'B' },
703
+ { state: 'Arizona', value: 150, year: 2023, category: 'A' },
704
+ { state: 'Arkansas', value: 175, year: 2023, category: 'A' }
705
+ ],
706
+ markupVariables: [
707
+ {
708
+ name: 'state_name',
709
+ columnName: 'state',
710
+ tag: '{{state_name}}',
711
+ conditions: [],
712
+ addCommas: false
713
+ },
714
+ {
715
+ name: 'year',
716
+ columnName: 'year',
717
+ tag: '{{year}}',
718
+ conditions: [],
719
+ addCommas: false
720
+ },
721
+ {
722
+ name: 'max_value',
723
+ columnName: 'value',
724
+ tag: '{{max_value}}',
725
+ conditions: [],
726
+ addCommas: true
727
+ },
728
+ {
729
+ name: 'category_a_states',
730
+ columnName: 'state',
731
+ tag: '{{category_a_states}}',
732
+ conditions: [
733
+ {
734
+ columnName: 'category',
735
+ isOrIsNotEqualTo: 'is',
736
+ value: 'A'
737
+ }
738
+ ],
739
+ addCommas: false
740
+ }
741
+ ],
742
+ enableMarkupVariables: true,
743
+ filters: []
744
+ }
745
+ }
746
+
747
+ export const WithMarkupVariablesDisabled: StandAloneStory = {
748
+ name: 'With Markup Variables Disabled',
749
+ render: args => <FootnotesStandAlone {...args} />,
750
+ args: {
751
+ config: {
752
+ staticFootnotes: [
753
+ {
754
+ symbol: '*',
755
+ text: 'Data shown for {{state_name}} with values from {{year}}'
756
+ }
757
+ ]
758
+ },
759
+ data: [
760
+ { state: 'Alabama', value: 100, year: 2023 },
761
+ { state: 'Alaska', value: 200, year: 2023 }
762
+ ],
763
+ markupVariables: [
764
+ {
765
+ name: 'state_name',
766
+ columnName: 'state',
767
+ tag: '{{state_name}}',
768
+ conditions: [],
769
+ addCommas: false
770
+ },
771
+ {
772
+ name: 'year',
773
+ columnName: 'year',
774
+ tag: '{{year}}',
775
+ conditions: [],
776
+ addCommas: false
777
+ }
778
+ ],
779
+ enableMarkupVariables: false,
780
+ filters: []
781
+ },
782
+ }