@cdc/dashboard 4.26.3 → 4.26.4

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 (85) hide show
  1. package/CONFIG.md +172 -0
  2. package/README.md +60 -20
  3. package/dist/cdcdashboard-CY9IcPSi.es.js +6 -0
  4. package/dist/cdcdashboard-DlpiY3fQ.es.js +4 -0
  5. package/dist/cdcdashboard.js +51744 -49003
  6. package/examples/__data__/data-2.json +6 -0
  7. package/examples/__data__/data.json +6 -0
  8. package/examples/legend-issue.json +1 -1
  9. package/examples/minimal-example.json +34 -0
  10. package/examples/private/dengue.json +4640 -0
  11. package/examples/private/link_to_file.json +16662 -0
  12. package/examples/sankey.json +3 -3
  13. package/examples/test-api-filter-reset.json +4 -4
  14. package/examples/tp5-test.json +86 -4
  15. package/package.json +9 -9
  16. package/src/CdcDashboardComponent.tsx +1 -1
  17. package/src/_stories/Dashboard.smoke.stories.tsx +33 -0
  18. package/src/_stories/Dashboard.stories.tsx +43 -2
  19. package/src/_stories/_mock/dashboard-data-driven-colors.json +171 -0
  20. package/src/_stories/_mock/tp5-test.json +86 -5
  21. package/src/components/DashboardEditors.tsx +15 -0
  22. package/src/components/DashboardFilters/DashboardFilters.test.tsx +129 -0
  23. package/src/components/DashboardFilters/DashboardFilters.tsx +10 -7
  24. package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +5 -4
  25. package/src/components/DashboardFilters/DashboardFiltersEditor/components/APIModal.tsx +5 -3
  26. package/src/components/DashboardFilters/DashboardFiltersEditor/components/DeleteFilterModal.tsx +59 -58
  27. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.test.tsx +127 -0
  28. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +28 -4
  29. package/src/components/DashboardFilters/DashboardFiltersEditor/components/NestedDropDownDashboard.tsx +2 -2
  30. package/src/components/ExpandCollapseButtons.tsx +6 -4
  31. package/src/components/Grid.tsx +4 -3
  32. package/src/components/MultiConfigTabs/MultiConfigTabs.tsx +141 -140
  33. package/src/components/Row.tsx +11 -10
  34. package/src/components/VisualizationRow.tsx +71 -20
  35. package/src/components/VisualizationsPanel/VisualizationsPanel.tsx +1 -1
  36. package/src/components/Widget/Widget.tsx +5 -4
  37. package/src/components/Widget/widget.styles.css +41 -10
  38. package/src/data/initial-state.js +1 -0
  39. package/src/helpers/addVisualization.ts +3 -1
  40. package/src/helpers/tests/addVisualization.test.ts +1 -1
  41. package/src/scss/grid.scss +38 -8
  42. package/src/scss/main.scss +110 -38
  43. package/src/store/dashboard.reducer.ts +1 -0
  44. package/src/test/CdcDashboard.test.jsx +24 -0
  45. package/src/types/SharedFilter.ts +1 -0
  46. package/tests/fixtures/dashboard-config-with-metadata.json +1 -1
  47. package/LICENSE +0 -201
  48. package/dist/cdcdashboard-vr9HZwRt.es.js +0 -6
  49. package/examples/DEV-6574.json +0 -2224
  50. package/examples/api-dashboard-data.json +0 -272
  51. package/examples/api-dashboard-years.json +0 -11
  52. package/examples/api-geographies-data.json +0 -11
  53. package/examples/chart-data.json +0 -5409
  54. package/examples/custom/css/respiratory.css +0 -236
  55. package/examples/custom/js/respiratory.js +0 -242
  56. package/examples/default-data.json +0 -368
  57. package/examples/default-filter-control.json +0 -209
  58. package/examples/default-multi-dataset-shared-filter.json +0 -1729
  59. package/examples/default-multi-dataset.json +0 -506
  60. package/examples/ed-visits-county-file.json +0 -402
  61. package/examples/filters/Alabama.json +0 -72
  62. package/examples/filters/Alaska.json +0 -1737
  63. package/examples/filters/Arkansas.json +0 -4713
  64. package/examples/filters/California.json +0 -212
  65. package/examples/filters/Colorado.json +0 -1500
  66. package/examples/filters/Connecticut.json +0 -559
  67. package/examples/filters/Delaware.json +0 -63
  68. package/examples/filters/DistrictofColumbia.json +0 -63
  69. package/examples/filters/Florida.json +0 -4217
  70. package/examples/filters/States.json +0 -146
  71. package/examples/state-level.json +0 -90136
  72. package/examples/state-points.json +0 -10474
  73. package/examples/temp-example-data.json +0 -130
  74. package/examples/test-dashboard-simple.json +0 -503
  75. package/examples/test-example.json +0 -752
  76. package/examples/test-file.json +0 -147
  77. package/examples/test.json +0 -752
  78. package/examples/testing.json +0 -94456
  79. /package/examples/{data → __data__}/data-with-metadata.json +0 -0
  80. /package/examples/{legend-issue-data.json → __data__/legend-issue-data.json} +0 -0
  81. /package/examples/api-test/{categories.json → __data__/categories.json} +0 -0
  82. /package/examples/api-test/{chart-data.json → __data__/chart-data.json} +0 -0
  83. /package/examples/api-test/{topics.json → __data__/topics.json} +0 -0
  84. /package/examples/api-test/{years.json → __data__/years.json} +0 -0
  85. /package/src/_stories/{Dashboard.Pages.stories.tsx → Dashboard.Pages.smoke.stories.tsx} +0 -0
package/CONFIG.md ADDED
@@ -0,0 +1,172 @@
1
+ # `@cdc/dashboard` Configuration Reference
2
+
3
+ This document describes the supported configuration contract for `@cdc/dashboard`.
4
+
5
+ Shared nested types used by this package are documented in the [`@cdc/core` config reference](https://github.com/CDCgov/cdc-open-viz/blob/main/packages/core/CONFIG.md).
6
+
7
+ To follow those shared types locally, use `packages/core/CONFIG.md` in this monorepo or `node_modules/@cdc/core/CONFIG.md` in an installed app. If neither path is available, use the GitHub link above.
8
+
9
+ ## Organization
10
+
11
+ The config is documented in the order users usually author a dashboard:
12
+
13
+ | Section | Covers |
14
+ | --- | --- |
15
+ | Identity and data source | How the dashboard is identified and where its data comes from |
16
+ | Dashboard shell | Title, theme, and shared dashboard chrome |
17
+ | Layout and visualization placement | Rows, columns, and widget placement |
18
+ | Dashboard filters widget | The `dashboardFilters` visualization that renders shared filters |
19
+ | Shared filters | Dashboard-level filter state and filter options |
20
+ | Table and download controls | Shared table/download settings used by the dashboard shell |
21
+ | Multi-dashboard support | Tabbed dashboard sets and the active tab |
22
+ | Fields You Can Ignore | Runtime, editor, and migrated artifacts |
23
+
24
+ ## Minimum Working Config
25
+
26
+ Use the example in [README.md](./README.md) for the copy-pasteable minimum config. The source of truth lives at `packages/dashboard/examples/minimal-example.json`, and the README block is kept in sync with automated tests.
27
+
28
+ ## Identity and Data Source
29
+
30
+ | Field | Type | Required | Default | Description | Allowed values / Notes |
31
+ | --- | --- | --- | --- | --- | --- |
32
+ | `type` | `string` | Yes | None | Identifies the package. | Must be `dashboard`. |
33
+ | `version` | `string` | No | None | Saved COVE version for migration logic. | Use a semantic version string. |
34
+ | `data` | `object[]` | No | `[]` | Legacy inline data used to seed the dashboard when named datasets are not provided. | An empty array is enough for a dashboard that only renders markup or chrome. |
35
+ | `dataUrl` | `string` | No | None | Remote data source for legacy single-dataset dashboards. | When present, the loader fetches data at runtime. |
36
+ | `datasets` | `Record<string, DataSet>` | No | None | Named datasets used by the dashboard and its child visualizations. | Each child viz points at a dataset with `dataKey`. |
37
+
38
+ Rows, datasets, and child visualizations also use the shared `ConfigureData` fields described in the core reference.
39
+
40
+ ## Dashboard Shell
41
+
42
+ | Field | Type | Required | Default | Description | Allowed values / Notes |
43
+ | --- | --- | --- | --- | --- | --- |
44
+ | `dashboard.title` | `string` | No | `''` | Title shown in the dashboard header and table anchors. | Hidden when empty. |
45
+ | `dashboard.description` | `string` | No | `''` | Optional dashboard description rendered under the title. | Accepts HTML when the consuming app renders trusted markup. |
46
+ | `dashboard.theme` | `string` | No | `theme-blue` | Shared theme token for the dashboard shell. | See shared theme values in `@cdc/core`. |
47
+ | `dashboard.titleStyle` | `string` | No | `small` | Header size/style for the dashboard title. | `legacy`, `large`, `small` |
48
+ | `dashboard.sharedFilters` | `SharedFilter[]` | No | `[]` | Dashboard-level filters that can drive multiple visualizations. | See the Shared Filters section below. |
49
+ | `dashboard.filters` | `any` | No | Deprecated | Legacy filter field accepted during migration. | The loader copies these into `dashboard.sharedFilters` when needed. |
50
+
51
+ ## Layout And Visualization Placement
52
+
53
+ | Field | Type | Required | Default | Description | Allowed values / Notes |
54
+ | --- | --- | --- | --- | --- | --- |
55
+ | `rows` | `ConfigRow[]` | Yes | `[{ columns: [{ width: 12 }] }]` in practice | Layout rows that place widgets on the page. | The dashboard can render without explicit row chrome, but it needs at least one row for visible widgets. |
56
+ | `rows[].columns[]` | `object` | Yes | None | Column slots inside each row. | A column is populated when `widget` points to a visualization key. |
57
+ | `rows[].columns[].width` | `number \| null` | Yes | `null` on empty placeholders | Column width in the dashboard grid. | `12` is a full-width column. |
58
+ | `rows[].columns[].widget` | `string` | No | None | Visualization key rendered in that slot. | Must match a key in `visualizations`. |
59
+ | `rows[].toggle` | `boolean` | No | `false` | Turns a row into a toggle row. | Only one column is shown at a time. |
60
+ | `rows[].equalHeight` | `boolean` | No | `false` | Forces equal-height cards within the row. | TP5 layouts may also trigger equalization automatically. |
61
+ | `rows[].multiVizColumn` | `string` | No | None | Column used to split one visualization into multiple cards. | Used by multi-viz dashboard flows. |
62
+ | `rows[].expandCollapseAllButtons` | `boolean` | No | `false` | Adds expand/collapse-all controls to multi-viz rows. | Only meaningful when `multiVizColumn` is set. |
63
+ | `visualizations` | `Record<string, AnyVisualization>` | Yes | `{}` in practice | Child visualizations rendered by the dashboard. | Each nested config follows the child package contract for `chart`, `map`, `data-bite`, `waffle-chart`, `markup-include`, `filtered-text`, `table`, or `dashboardFilters`. |
64
+
65
+ Rows also accept the shared `ConfigureData` fields from the core reference, which the editor uses when a row owns its own dataset.
66
+
67
+ ## Dashboard Filters Widget
68
+
69
+ The dashboard package includes a `dashboardFilters` visualization that renders shared filters in the dashboard shell.
70
+
71
+ | Field | Type | Required | Default | Description | Allowed values / Notes |
72
+ | --- | --- | --- | --- | --- | --- |
73
+ | `visualizations.*.type` | `string` | Yes | None | Must identify the widget as a dashboard filter panel. | Must be `dashboardFilters`. |
74
+ | `visualizations.*.sharedFilterIndexes` | `number[]` | Yes | None | Indexes into `dashboard.sharedFilters` that this widget renders. | Order matters and matches the visual order in the panel. |
75
+ | `visualizations.*.filterBehavior` | `FilterBehavior` | No | `Filter Change` | Controls whether selections apply immediately or wait for confirmation. | `Apply Button`, `Filter Change` |
76
+ | `visualizations.*.applyFiltersButtonText` | `string` | No | `GO!` | Label for the apply button when apply-button behavior is enabled. | Only used when `filterBehavior` is `Apply Button`. |
77
+ | `visualizations.*.autoLoad` | `boolean` | No | `false` | Lets the widget auto-apply URL-filter changes without waiting for the apply button. | Only relevant when the dashboard includes apply-button behavior elsewhere. |
78
+ | `visualizations.*.showClearButton` | `boolean` | No | `true` | Shows the clear-filters button in apply-button mode. | Only used when `filterBehavior` is `Apply Button`. |
79
+
80
+ ## Shared Filters
81
+
82
+ Dashboard filters are split between the dashboard shell and the `dashboardFilters` widget that renders them.
83
+
84
+ ### Common Filter Fields
85
+
86
+ | Field | Type | Required | Default | Description | Allowed values / Notes |
87
+ | --- | --- | --- | --- | --- | --- |
88
+ | `dashboard.sharedFilters[].key` | `string` | Yes | None | Human-readable filter label and stable key. | Used as the display label and editor key. |
89
+ | `dashboard.sharedFilters[].type` | `string` | No | `''` | Filter mode. | `datafilter`, `urlfilter`, or empty while configuring. |
90
+ | `dashboard.sharedFilters[].filterStyle` | `string` | No | `dropdown` | Filter control style. | `combobox`, `dropdown`, `multi-select`, `nested-dropdown`, `tab-simple` |
91
+ | `dashboard.sharedFilters[].showDropdown` | `boolean` | No | `true` | Shows the filter control in the dashboard. | Hiding the dropdown does not hide nested-dropdown or tab-simple renderers. |
92
+ | `dashboard.sharedFilters[].values` | `string[]` | No | `[]` | Available filter values. | Usually populated at runtime from data or API results. URL filters commonly omit this when saved. |
93
+ | `dashboard.sharedFilters[].active` | `string \| string[]` | No | None | Current filter selection. | Runtime-managed unless the config intentionally seeds a default. |
94
+ | `dashboard.sharedFilters[].queuedActive` | `string \| string[]` | No | None | Temporary selection used by apply-button flows. | Only meaningful for apply-button filter behavior. |
95
+ | `dashboard.sharedFilters[].order` | `string` | No | `asc` | Sort order for generated filter values. | `cust`, `desc`, `asc`, `column` |
96
+ | `dashboard.sharedFilters[].orderedValues` | `string[]` | No | None | Custom display order when `order` is `cust`. | Preserved by editor and runtime sort helpers. |
97
+ | `dashboard.sharedFilters[].parents` | `string[]` | No | `[]` | Parent filter labels for nested filter chains. | Used by cascading URL and data filters. |
98
+ | `dashboard.sharedFilters[].usedBy` | `(string \| number)[]` | No | None | Widgets or rows that consume the filter. | Numbers refer to row indexes; strings refer to visualization keys. |
99
+ | `dashboard.sharedFilters[].defaultValue` | `string` | No | None | Default selection when no other active value is available. | Used by data and nested-dropdown filters. |
100
+ | `dashboard.sharedFilters[].resetLabel` | `string` | No | None | Reset option label. | Often shown as `All`, `Reset`, or similar. |
101
+ | `dashboard.sharedFilters[].labels` | `Record<string, string>` | No | None | Alternate display labels for raw values. | Shared label mapping from `@cdc/core`. |
102
+ | `dashboard.sharedFilters[].selectLimit` | `number` | No | `5` in multi-select UI | Maximum selections allowed in multi-select mode. | Only used when `filterStyle` is `multi-select`. |
103
+ | `dashboard.sharedFilters[].tier` | `number` | No | Runtime-computed | Cascade depth for parent-child filter application. | Assigned automatically from `parents`; not usually authored. |
104
+ | `dashboard.sharedFilters[].displaySubgroupingOnly` | `boolean` | No | `false` | Shows only subgrouping controls for nested-dropdown filters. | Only used by nested dropdown flows. |
105
+
106
+ ### Data Filter Fields
107
+
108
+ | Field | Type | Required | Default | Description | Allowed values / Notes |
109
+ | --- | --- | --- | --- | --- | --- |
110
+ | `dashboard.sharedFilters[].columnName` | `string` | Yes for `datafilter` | None | Source column used to generate filter values. | Must exist in the active dataset. |
111
+ | `dashboard.sharedFilters[].setBy` | `string` | No | None | Visualization key that seeds the filter from its selected datum. | Only used by data filters. |
112
+ | `dashboard.sharedFilters[].setByQueryParameter` | `string` | No | None | Query-string parameter used to seed the active value. | Useful for deep links and parent-child filter flows. |
113
+ | `dashboard.sharedFilters[].subGrouping` | `SubGrouping` | No | None | Nested dropdown subgroup state. | Used by nested-dropdown filters. |
114
+
115
+ ### URL Filter Fields
116
+
117
+ | Field | Type | Required | Default | Description | Allowed values / Notes |
118
+ | --- | --- | --- | --- | --- | --- |
119
+ | `dashboard.sharedFilters[].apiFilter` | `APIFilter` | Yes for API-backed URL filters | None | Metadata for remote option loading. | See notes below. |
120
+ | `dashboard.sharedFilters[].filterBy` | `string` | No | None | URL filter behavior. | `Query String` or `File Name` |
121
+ | `dashboard.sharedFilters[].queryParameter` | `string` | No | None | Query-string parameter name to update. | Used by `Query String` URL filters. |
122
+ | `dashboard.sharedFilters[].datasetKey` | `string` | No | None | Dataset key whose filename should be rewritten. | Required when `filterBy` is `File Name`. |
123
+ | `dashboard.sharedFilters[].fileName` | `string` | No | None | File-name template for file-name URL filters. | Can include `${query}` as a placeholder for the active filter value. |
124
+ | `dashboard.sharedFilters[].whitespaceReplacement` | `string` | No | `Keep Spaces` | How spaces are rewritten in file-name filters. | `Keep Spaces`, `Remove Spaces`, `Replace With Underscore` |
125
+
126
+ ### `APIFilter`
127
+
128
+ | Field | Type | Required | Default | Description | Allowed values / Notes |
129
+ | --- | --- | --- | --- | --- | --- |
130
+ | `apiEndpoint` | `string` | Yes | None | Endpoint used to fetch filter options. | Must resolve to JSON data. |
131
+ | `valueSelector` | `string` | Yes | None | Field used as the stored filter value. | Required. |
132
+ | `textSelector` | `string` | Yes in shape, often blank | `''` | Field used as the visible filter label. | Can be empty when the API returns a single value field. |
133
+ | `subgroupValueSelector` | `string` | No | None | Nested subgroup value field for nested dropdowns. | Only used when nested subgrouping is enabled. |
134
+ | `subgroupTextSelector` | `string` | No | None | Nested subgroup label field for nested dropdowns. | Only used when nested subgrouping is enabled. |
135
+
136
+ ### `SubGrouping`
137
+
138
+ | Field | Type | Required | Default | Description | Allowed values / Notes |
139
+ | --- | --- | --- | --- | --- | --- |
140
+ | `columnName` | `string` | No | `''` | Column used for subgroup option generation. | Used by nested dropdown filters. |
141
+ | `active` | `string` | No | `''` | Current subgroup selection. | Runtime-managed. |
142
+ | `order` | `string` | No | `asc` | Sort order for subgroup values. | `cust`, `desc`, `asc`, `column` |
143
+ | `setByQueryParameter` | `string` | No | None | Query string parameter used to seed the subgroup. | Used in URL filter flows. |
144
+ | `valuesLookup` | `Record<string, { orderedValues?: string[]; values: string[] }>` | No | `{}` | Cached nested values used by the editor/runtime. | Usually runtime-managed. |
145
+
146
+ ## Table And Download Controls
147
+
148
+ `@cdc/dashboard` uses the shared `Table` structure from the core reference. In this package, the dashboard shell honors the shared table flags plus `table.downloadImageButton` and `table.downloadPdfButton` for the image/PDF download buttons.
149
+
150
+ The runtime defaults are the dashboard shell table settings from `packages/dashboard/src/data/initial-state.js`: `show: true`, `showDownloadUrl: false`, `showDownloadLinkBelow: true`, and `showVertical: true`.
151
+
152
+ ## Multi-Dashboard Support
153
+
154
+ | Field | Type | Required | Default | Description | Allowed values / Notes |
155
+ | --- | --- | --- | --- | --- | --- |
156
+ | `multiDashboards` | `MultiDashboard[]` | No | None | Optional tabbed dashboard set. | Each entry contains its own `dashboard`, `rows`, `visualizations`, and `label`. |
157
+ | `activeDashboard` | `number` | No | `0` when multi-dashboard mode is initialized | Index of the active dashboard tab. | Runtime-managed as the active tab changes. |
158
+ | `multiDashboards[].label` | `string` | Yes | None | Label shown on the dashboard tab. | Required for each dashboard slot. |
159
+
160
+ ## Fields You Can Ignore
161
+
162
+ These fields often appear in saved configs, editor exports, or migration output, but consumers usually do not need to author them:
163
+
164
+ | Field or group | Why you can ignore it |
165
+ | --- | --- |
166
+ | `runtime.*` | Internal runtime state created during load and render. |
167
+ | `visualizations.*.formattedData`, `visualizations.*.originalFormattedData`, `visualizations.*.runtime` | Generated data and runtime artifacts owned by the loader. |
168
+ | `visualizations.*.editing`, `visualizations.*.showEditorPanel`, `visualizations.*.newViz`, `visualizations.*.openModal` | Editor state, not consumer config. |
169
+ | `visualizations.*.uid`, `visualizations.*.visualizationType` | Editor/runtime identifiers that are injected or normalized internally. |
170
+ | `datasets.*.dataFileSize`, `datasets.*.dataFileName`, `datasets.*.dataFileFormat`, `datasets.*.dataFileSourceType`, `datasets.*.runtimeDataUrl` | Runtime or file metadata. |
171
+ | `rows[].uuid`, `rows[].columns[].hide`, `rows[].columns[].toggleName`, `rows[].columns[].equalHeight`, `rows[].originalMultiVizColumn` | Layout bookkeeping that may be injected or updated by the editor. |
172
+ | `dashboard.filters` | Legacy migration field replaced by `dashboard.sharedFilters`. |
package/README.md CHANGED
@@ -2,35 +2,75 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@cdc/dashboard)](https://www.npmjs.com/package/@cdc/dashboard)
4
4
 
5
- `<CdcDashboard />` is a React component produced by the CDC for combining multiple visualizations into a single module. Some supported visualization types are CdcMap and CdcChart. This package is part of the larger [CDC Open Visualization](https://github.com/CDCgov/cdc-open-viz) project.
5
+ `<CdcDashboard />` combines multiple visualizations into a single dashboard shell.
6
+ The primary configuration reference is [CONFIG.md](./CONFIG.md).
6
7
 
7
- ### Installation and Usage
8
+ ## Installation
8
9
 
9
- 1. Install the package in your React project `npm install @cdc/dashboard`
10
- 2. Import the component and begin using in your code.
10
+ ```bash
11
+ npm install @cdc/dashboard
12
+ ```
11
13
 
12
- ```JSX
13
- import CdcChart from '@cdc/dashboard'
14
+ ## Quick Start
14
15
 
15
- function App() {
16
+ Use the package by passing a `config` object directly:
16
17
 
17
- return (
18
- <div className="App">
19
- <CdcDashboard config={configObj} />
20
- </div>
21
- );
18
+ <!-- README_EXAMPLE_CONFIG_START -->
19
+ ```jsx
20
+ import CdcDashboard from '@cdc/dashboard'
21
+
22
+ const config = {
23
+ type: 'dashboard',
24
+ version: '4.26.4',
25
+ dashboard: {
26
+ theme: 'theme-blue',
27
+ title: 'Dashboard Example',
28
+ titleStyle: 'small',
29
+ sharedFilters: []
30
+ },
31
+ data: [],
32
+ rows: [
33
+ {
34
+ columns: [
35
+ {
36
+ width: 12,
37
+ widget: 'markup-1'
38
+ }
39
+ ]
40
+ }
41
+ ],
42
+ visualizations: {
43
+ 'markup-1': {
44
+ type: 'markup-include',
45
+ theme: 'theme-blue',
46
+ contentEditor: {
47
+ inlineHTML: '<p>Minimal dashboard example</p>',
48
+ showHeader: true,
49
+ srcUrl: '',
50
+ title: 'Dashboard Example',
51
+ useInlineHTML: true
52
+ }
53
+ }
54
+ }
22
55
  }
23
56
 
24
- export default App;
57
+ function App() {
58
+ return <CdcDashboard config={config} />
59
+ }
60
+
61
+ export default App
25
62
  ```
63
+ <!-- README_EXAMPLE_CONFIG_END -->
64
+
65
+ ## Configuration
26
66
 
27
- Note, you must pass in a configuration object. Configuration objects can be created with the [Editor package](https://github.com/CDCgov/cdc-open-viz/tree/main/packages/editor).
67
+ The primary reference for authoring configs is [CONFIG.md](./CONFIG.md).
28
68
 
29
- Sample config data can be found in [packages/dashboard/examples](https://github.com/CDCgov/cdc-open-viz/tree/integration/packages/dashboard/examples).
69
+ If you are reading this in a context where relative Markdown links do not open correctly, use the [GitHub copy of the dashboard config reference](https://github.com/CDCgov/cdc-open-viz/blob/main/packages/dashboard/CONFIG.md).
30
70
 
31
- ### Properties
71
+ ## Properties
32
72
 
33
- | Property | Type | Description |
34
- | --------- | ------ | --------------------------------------------------------------------------------------------------------------------------------- |
35
- | config | String | A JavaScript object with the configuration for the dashboard. Pass either this or the configUrl property to setup your dashboard. |
36
- | configUrl | String | Pass a URL to a .json file and it will be consumed and used as the configuration. |
73
+ | Property | Type | Description |
74
+ | --- | --- | --- |
75
+ | `config` | `object` | Dashboard configuration object. Pass this or `configUrl` to initialize the dashboard. |
76
+ | `configUrl` | `string` | URL to a JSON config file that will be fetched at runtime. |