@cdc/dashboard 4.24.1 → 4.24.2

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 (53) hide show
  1. package/dist/cdcdashboard.js +117195 -108041
  2. package/examples/{private/DEV-6574.json → DEV-6574.json} +8 -8
  3. package/examples/filters/Alabama.json +72 -0
  4. package/examples/zika.json +2274 -0
  5. package/index.html +5 -3
  6. package/package.json +9 -9
  7. package/src/CdcDashboard.tsx +124 -991
  8. package/src/CdcDashboardComponent.tsx +903 -0
  9. package/src/_stories/Dashboard.stories.tsx +2 -2
  10. package/src/components/Column.tsx +15 -12
  11. package/src/components/Header/Header.tsx +18 -4
  12. package/src/components/MultiConfigTabs/MultiConfigTabs.tsx +106 -0
  13. package/src/components/MultiConfigTabs/MultiTabs.tsx +30 -0
  14. package/src/components/MultiConfigTabs/index.tsx +8 -0
  15. package/src/components/MultiConfigTabs/multiconfigtabs.styles.css +32 -0
  16. package/src/components/Widget.tsx +25 -9
  17. package/src/helpers/generateValuesForFilter.ts +1 -1
  18. package/src/helpers/getUpdateConfig.ts +6 -2
  19. package/src/helpers/processData.ts +13 -0
  20. package/src/helpers/processDataLegacy.ts +14 -0
  21. package/src/{index.jsx → index.tsx} +2 -2
  22. package/src/scss/editor-panel.scss +14 -11
  23. package/src/scss/grid.scss +4 -6
  24. package/src/scss/main.scss +2 -8
  25. package/src/store/dashboard.actions.ts +10 -4
  26. package/src/store/dashboard.reducer.ts +74 -3
  27. package/src/types/ConfigRow.ts +6 -0
  28. package/src/types/Dashboard.ts +11 -0
  29. package/src/types/{Config.ts → DashboardConfig.ts} +8 -14
  30. package/src/types/InitialState.ts +10 -0
  31. package/src/types/MultiDashboard.ts +11 -0
  32. package/examples/private/DEV-5189-2.json +0 -935
  33. package/examples/private/DEV-5189.json +0 -1266
  34. package/examples/private/dash-scaling.json +0 -45325
  35. package/examples/private/epi-chart.json +0 -813
  36. package/examples/private/epi-dash.json +0 -457
  37. package/examples/private/epi-new.json +0 -994
  38. package/examples/private/filters/Alabama.json +0 -4217
  39. package/examples/private/new-epi-csv.json +0 -358
  40. package/examples/private/new-epi.json +0 -358
  41. package/examples/private/no-lines.json +0 -8432
  42. package/examples/private/tick-bold-data.json +0 -82325
  43. package/examples/private/tick-bold.json +0 -164678
  44. package/examples/private/visits.json +0 -9985
  45. /package/examples/{private/filters → filters}/Alaska.json +0 -0
  46. /package/examples/{private/filters → filters}/Arkansas.json +0 -0
  47. /package/examples/{private/filters → filters}/California.json +0 -0
  48. /package/examples/{private/filters → filters}/Colorado.json +0 -0
  49. /package/examples/{private/filters → filters}/Connecticut.json +0 -0
  50. /package/examples/{private/filters → filters}/Delaware.json +0 -0
  51. /package/examples/{private/filters → filters}/DistrictofColumbia.json +0 -0
  52. /package/examples/{private/filters → filters}/Florida.json +0 -0
  53. /package/examples/{private/filters → filters}/States.json +0 -0
@@ -0,0 +1,6 @@
1
+ export type ConfigRow = {
2
+ equalHeight?: boolean
3
+ width: number | null
4
+ widget?: string
5
+ uuid?: string | number
6
+ }[] & { uuid?: string | number }
@@ -0,0 +1,11 @@
1
+ import { DataSet } from './DataSet'
2
+ import { SharedFilter } from './SharedFilter'
3
+
4
+ export type Dashboard = {
5
+ sharedFilters: SharedFilter[]
6
+ datasets: Record<string, DataSet>
7
+ description: any
8
+ title: any
9
+ theme: any
10
+ filters: any
11
+ }
@@ -1,29 +1,23 @@
1
1
  import { Series } from '@cdc/core/types/Series'
2
2
  import { Runtime } from '@cdc/core/types/Runtime'
3
3
  import { DataSet } from './DataSet'
4
- import { SharedFilter } from './SharedFilter'
4
+ import { ConfigRow } from './ConfigRow'
5
5
  import { Visualization } from '@cdc/core/types/Visualization'
6
6
  import { Table } from '@cdc/core/types/Table'
7
7
  import { FilterBehavior } from '@cdc/core/types/FilterBehavior'
8
+ import { Dashboard } from './Dashboard'
8
9
 
9
- export type Config = DataSet & {
10
- dashboard: {
11
- sharedFilters: SharedFilter[]
12
- datasets: Record<string, DataSet>
13
- description: any
14
- title: any
15
- theme: any
16
- filters: any
17
- }
10
+ export type DashboardConfig = DataSet & {
11
+ dashboard: Dashboard
18
12
  confidenceKeys: Record<string, any>
19
- visualizations: {
20
- [vizKey: string]: Visualization
21
- }
13
+ visualizations: Record<string, Visualization>
22
14
  series: Series
23
15
  datasets: Record<string, DataSet>
24
16
  dataFileName: string
25
17
  table: Table
26
- rows: any[]
18
+ rows: ConfigRow[]
27
19
  filterBehavior: FilterBehavior
28
20
  runtime: Runtime
21
+ downloadImageButton: boolean
22
+ downloadPdfButton: boolean
29
23
  }
@@ -0,0 +1,10 @@
1
+ import { DashboardConfig } from './DashboardConfig'
2
+
3
+ export type InitialState = {
4
+ config: DashboardConfig
5
+ data: Object
6
+ loading: boolean
7
+ filteredData: Object
8
+ preview: boolean
9
+ tabSelected: number
10
+ }
@@ -0,0 +1,11 @@
1
+ import { Visualization } from '@cdc/core/types/Visualization'
2
+ import { Dashboard } from './Dashboard'
3
+ import { DashboardConfig } from './DashboardConfig'
4
+ import { ConfigRow } from './ConfigRow'
5
+
6
+ export type MultiDashboard = { dashboard: Dashboard; rows: ConfigRow[]; visualizations: Record<string, Visualization>; label: string }
7
+
8
+ export type MultiDashboardConfig = DashboardConfig & {
9
+ multiDashboards?: MultiDashboard[]
10
+ activeDashboard?: number // index of the active MultiDashboard
11
+ }