@cdc/chart 4.25.11 → 4.26.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 (181) hide show
  1. package/CLAUDE.local.md +79 -0
  2. package/dist/{cdcchart-dgT_1dIT.es.js → cdcchart-DQ00cQCm.es.js} +1 -20
  3. package/dist/cdcchart.js +51401 -50814
  4. package/examples/default.json +378 -0
  5. package/examples/feature/__data__/horizon-chart-data.json +373 -0
  6. package/examples/feature/annotations/index.json +3 -6
  7. package/examples/feature/horizon/horizon-chart.json +395 -0
  8. package/examples/feature/pie/planet-pie-example-config.json +48 -2
  9. package/examples/line-chart-states.json +1085 -0
  10. package/examples/private/123.json +694 -0
  11. package/examples/private/DEV-12100.json +1303 -0
  12. package/examples/private/anchor-issue.json +4094 -0
  13. package/examples/private/backwards-slider.json +10430 -0
  14. package/examples/private/cat-y.json +1235 -0
  15. package/examples/private/data-points.json +228 -0
  16. package/examples/private/georgia.csv +160 -0
  17. package/examples/private/height.json +3915 -0
  18. package/examples/private/links.json +569 -0
  19. package/examples/private/quadrant.txt +30 -0
  20. package/examples/private/test-forecast.json +5510 -0
  21. package/examples/private/timeline-data.json +1 -0
  22. package/examples/private/timeline.json +389 -0
  23. package/examples/private/warming-stripe-test.json +2578 -0
  24. package/examples/private/warming-stripes.json +4763 -0
  25. package/examples/radar-chart-simple.json +133 -0
  26. package/examples/radar-chart.json +148 -0
  27. package/examples/tech-adoption-with-links.json +560 -0
  28. package/index.html +1 -36
  29. package/package.json +59 -60
  30. package/src/CdcChartComponent.tsx +206 -89
  31. package/src/_stories/Chart.Anchors.stories.tsx +10 -0
  32. package/src/_stories/Chart.BoxPlot.stories.tsx +7 -0
  33. package/src/_stories/Chart.CI.stories.tsx +13 -0
  34. package/src/_stories/Chart.Combo.stories.tsx +17 -0
  35. package/src/_stories/Chart.CustomColors.stories.tsx +4 -0
  36. package/src/_stories/Chart.DynamicSeries.stories.tsx +19 -0
  37. package/src/_stories/Chart.Filters.stories.tsx +4 -0
  38. package/src/_stories/Chart.Forecast.stories.tsx +4 -0
  39. package/src/_stories/Chart.HTMLInDataTable.stories.tsx +22 -0
  40. package/src/_stories/Chart.Legend.Gradient.stories.tsx +28 -0
  41. package/src/_stories/Chart.Patterns.stories.tsx +4 -0
  42. package/src/_stories/Chart.PreserveDecimals.stories.tsx +25 -0
  43. package/src/_stories/Chart.Regions.Categorical.stories.tsx +161 -0
  44. package/src/_stories/Chart.Regions.DateScale.stories.tsx +216 -0
  45. package/src/_stories/Chart.Regions.DateTimeScale.stories.tsx +312 -0
  46. package/src/_stories/Chart.ScatterPlot.stories.tsx +4 -0
  47. package/src/_stories/Chart.SmallMultiples.stories.tsx +16 -0
  48. package/src/_stories/Chart.stories.tsx +45 -0
  49. package/src/_stories/Chart.tooltip.stories.tsx +7 -0
  50. package/src/_stories/ChartAnnotation.stories.tsx +10 -0
  51. package/src/_stories/ChartAxisLabels.stories.tsx +4 -0
  52. package/src/_stories/ChartAxisTitles.stories.tsx +10 -0
  53. package/src/_stories/ChartBar.Editor.stories.tsx +11 -6
  54. package/src/_stories/ChartBrush.Editor.stories.tsx +295 -0
  55. package/src/_stories/ChartBrush.Matrix.Continuous.stories.tsx +41 -0
  56. package/src/_stories/ChartBrush.Matrix.Date.stories.tsx +114 -0
  57. package/src/_stories/ChartBrush.Matrix.DateTime.stories.tsx +78 -0
  58. package/src/_stories/ChartBrush.stories.tsx +57 -0
  59. package/src/_stories/ChartEditor.Editor.stories.tsx +3 -5
  60. package/src/_stories/ChartEditor.stories.tsx +7 -0
  61. package/src/_stories/ChartLine.QuadrantAngles.stories.tsx +89 -0
  62. package/src/_stories/ChartLine.Suppression.stories.tsx +7 -0
  63. package/src/_stories/ChartLine.Symbols.stories.tsx +4 -0
  64. package/src/_stories/ChartPrefixSuffix.stories.tsx +46 -1
  65. package/src/_stories/TechAdoptionWithLinks.stories.tsx +34 -0
  66. package/src/_stories/_mock/brush_continuous.json +86 -0
  67. package/src/_stories/_mock/brush_date_large.json +176 -0
  68. package/src/_stories/_mock/brush_enabled.json +326 -0
  69. package/src/_stories/_mock/brush_mock.json +2 -69
  70. package/src/_stories/_mock/horizontal-bars-dynamic-y-axis.json +413 -0
  71. package/src/_stories/_mock/line_chart_angle_near_zero_fall.json +195 -0
  72. package/src/_stories/_mock/line_chart_angle_near_zero_rise.json +195 -0
  73. package/src/_stories/_mock/line_chart_angle_q1_steep_upward.json +195 -0
  74. package/src/_stories/_mock/line_chart_angle_q2_gentle_downward.json +195 -0
  75. package/src/_stories/_mock/line_chart_angle_q3_steep_downward.json +195 -0
  76. package/src/_stories/_mock/line_chart_angle_q4_gentle_upward.json +195 -0
  77. package/src/_stories/_mock/line_chart_quadrant_angles.json +264 -0
  78. package/src/components/Annotations/components/AnnotationDraggable.styles.css +11 -17
  79. package/src/components/Annotations/components/AnnotationDraggable.tsx +240 -116
  80. package/src/components/Annotations/components/AnnotationDropdown.styles.css +1 -2
  81. package/src/components/Annotations/components/AnnotationDropdown.tsx +8 -12
  82. package/src/components/Annotations/components/AnnotationList.styles.css +4 -10
  83. package/src/components/Annotations/components/AnnotationList.tsx +5 -4
  84. package/src/components/Annotations/components/findNearestDatum.ts +75 -85
  85. package/src/components/Annotations/helpers/getVisibleAnnotations.ts +38 -0
  86. package/src/components/AreaChart/components/AreaChart.Stacked.jsx +1 -2
  87. package/src/components/Axis/BottomAxis.tsx +270 -0
  88. package/src/components/Axis/Categorical.Axis.tsx +6 -7
  89. package/src/components/Axis/LeftAxis.tsx +404 -0
  90. package/src/components/Axis/LeftAxisGridlines.tsx +77 -0
  91. package/src/components/Axis/PairedBarAxis.tsx +186 -0
  92. package/src/components/Axis/README.md +94 -0
  93. package/src/components/Axis/RightAxis.tsx +108 -0
  94. package/src/components/Axis/axis.constants.ts +21 -0
  95. package/src/components/Axis/index.ts +7 -0
  96. package/src/components/BarChart/components/BarChart.Horizontal.tsx +178 -24
  97. package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +3 -1
  98. package/src/components/BarChart/components/BarChart.StackedVertical.tsx +1 -0
  99. package/src/components/BarChart/components/BarChart.Vertical.tsx +6 -8
  100. package/src/components/BarChart/components/BarChart.tsx +7 -1
  101. package/src/components/BarChart/components/context.tsx +1 -0
  102. package/src/components/BarChart/helpers/useBarChart.ts +14 -2
  103. package/src/components/Brush/BrushSelector.tsx +1390 -0
  104. package/src/components/Brush/MiniChartPreview.tsx +400 -0
  105. package/src/components/DeviationBar.jsx +9 -7
  106. package/src/components/EditorPanel/EditorPanel.tsx +2734 -2595
  107. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +60 -22
  108. package/src/components/EditorPanel/components/Panels/Panel.ForestPlotSettings.tsx +56 -34
  109. package/src/components/EditorPanel/components/Panels/Panel.General.tsx +137 -30
  110. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +2 -0
  111. package/src/components/EditorPanel/components/Panels/Panel.Radar.tsx +353 -0
  112. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +0 -1
  113. package/src/components/EditorPanel/components/Panels/Panel.SmallMultiples.tsx +30 -25
  114. package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +42 -28
  115. package/src/components/EditorPanel/components/Panels/index.tsx +2 -0
  116. package/src/components/EditorPanel/useEditorPermissions.ts +81 -39
  117. package/src/components/HorizonChart/HorizonChart.tsx +131 -0
  118. package/src/components/HorizonChart/components/HorizonBand.tsx +160 -0
  119. package/src/components/HorizonChart/helpers/calculateHorizonBands.ts +27 -0
  120. package/src/components/HorizonChart/helpers/getHorizonLayerColors.ts +40 -0
  121. package/src/components/HorizonChart/index.tsx +3 -0
  122. package/src/components/Legend/Legend.Component.tsx +52 -4
  123. package/src/components/Legend/Legend.tsx +4 -3
  124. package/src/components/Legend/LegendValueRange.tsx +77 -0
  125. package/src/components/Legend/helpers/createFormatLabels.tsx +164 -2
  126. package/src/components/Legend/helpers/generateValueRanges.ts +92 -0
  127. package/src/components/Legend/helpers/index.ts +10 -6
  128. package/src/components/LineChart/helpers/README.md +292 -0
  129. package/src/components/LineChart/helpers/labelPositioning.test.ts +245 -0
  130. package/src/components/LineChart/helpers/labelPositioning.ts +304 -0
  131. package/src/components/LineChart/index.tsx +44 -8
  132. package/src/components/LinearChart/README.md +109 -0
  133. package/src/components/LinearChart/VisualizationRenderer.tsx +267 -0
  134. package/src/components/LinearChart/linearChart.constants.ts +84 -0
  135. package/src/components/LinearChart/tests/LinearChart.test.tsx +201 -0
  136. package/src/components/LinearChart/tests/mockConfigContext.ts +129 -0
  137. package/src/components/LinearChart/utils/tickFormatting.ts +146 -0
  138. package/src/components/LinearChart.tsx +338 -1082
  139. package/src/components/PairedBarChart.jsx +20 -3
  140. package/src/components/PieChart/PieChart.tsx +1 -1
  141. package/src/components/RadarChart/RadarAxis.tsx +78 -0
  142. package/src/components/RadarChart/RadarChart.tsx +298 -0
  143. package/src/components/RadarChart/RadarGrid.tsx +64 -0
  144. package/src/components/RadarChart/RadarPolygon.tsx +91 -0
  145. package/src/components/RadarChart/helpers.ts +83 -0
  146. package/src/components/RadarChart/index.tsx +3 -0
  147. package/src/components/Regions/components/Regions.tsx +365 -122
  148. package/src/components/ScatterPlot/ScatterPlot.jsx +2 -2
  149. package/src/components/SmallMultiples/SmallMultipleTile.tsx +5 -1
  150. package/src/components/WarmingStripes/WarmingStripes.tsx +230 -0
  151. package/src/components/WarmingStripes/WarmingStripesGradientLegend.css +35 -0
  152. package/src/components/WarmingStripes/WarmingStripesGradientLegend.tsx +104 -0
  153. package/src/components/WarmingStripes/index.tsx +3 -0
  154. package/src/data/initial-state.js +17 -2
  155. package/src/helpers/calculateHorizontalBarCategoryLabelWidth.ts +57 -0
  156. package/src/helpers/getExcludedData.ts +4 -0
  157. package/src/helpers/getMinMax.ts +12 -7
  158. package/src/helpers/handleChartAriaLabels.ts +19 -19
  159. package/src/helpers/handleLineType.ts +22 -18
  160. package/src/helpers/sizeHelpers.ts +0 -20
  161. package/src/helpers/smallMultiplesHelpers.ts +1 -1
  162. package/src/hooks/useChartHoverAnalytics.tsx +10 -9
  163. package/src/hooks/useProgrammaticTooltip.ts +23 -2
  164. package/src/hooks/useScales.ts +18 -1
  165. package/src/hooks/useTooltip.tsx +34 -10
  166. package/src/scss/DataTable.scss +0 -4
  167. package/src/scss/main.scss +22 -3
  168. package/src/selectors/README.md +68 -0
  169. package/src/store/chart.reducer.ts +2 -0
  170. package/src/test/CdcChart.test.jsx +1 -1
  171. package/src/types/ChartConfig.ts +21 -0
  172. package/src/types/ChartContext.ts +1 -0
  173. package/src/types/Horizon.ts +64 -0
  174. package/src/types/Label.ts +1 -0
  175. package/src/utils/analyticsTracking.ts +19 -0
  176. package/LICENSE +0 -201
  177. package/src/components/Annotations/components/helpers/index.tsx +0 -46
  178. package/src/components/Brush/BrushChart.tsx +0 -128
  179. package/src/components/Brush/BrushController.tsx +0 -71
  180. package/src/components/Brush/types.tsx +0 -8
  181. package/src/components/BrushChart.tsx +0 -223
@@ -0,0 +1,133 @@
1
+ {
2
+ "type": "chart",
3
+ "title": "Program A vs Program B Performance",
4
+ "showTitle": true,
5
+ "theme": "theme-blue",
6
+ "visualizationType": "Radar",
7
+ "animate": false,
8
+ "heights": {
9
+ "vertical": 400,
10
+ "horizontal": 400
11
+ },
12
+ "xAxis": {
13
+ "dataKey": "Program",
14
+ "label": "Program"
15
+ },
16
+ "yAxis": {
17
+ "dataKey": ""
18
+ },
19
+ "series": [
20
+ {
21
+ "dataKey": "Reach",
22
+ "name": "Reach",
23
+ "type": "Radar",
24
+ "axis": "Left",
25
+ "tooltip": true
26
+ },
27
+ {
28
+ "dataKey": "Engagement",
29
+ "name": "Engagement",
30
+ "type": "Radar",
31
+ "axis": "Left",
32
+ "tooltip": true
33
+ },
34
+ {
35
+ "dataKey": "Effectiveness",
36
+ "name": "Effectiveness",
37
+ "type": "Radar",
38
+ "axis": "Left",
39
+ "tooltip": true
40
+ },
41
+ {
42
+ "dataKey": "Adoption",
43
+ "name": "Adoption",
44
+ "type": "Radar",
45
+ "axis": "Left",
46
+ "tooltip": true
47
+ },
48
+ {
49
+ "dataKey": "Maintenance",
50
+ "name": "Maintenance",
51
+ "type": "Radar",
52
+ "axis": "Left",
53
+ "tooltip": true
54
+ },
55
+ {
56
+ "dataKey": "Cost Efficiency",
57
+ "name": "Cost Efficiency",
58
+ "type": "Radar",
59
+ "axis": "Left",
60
+ "tooltip": true
61
+ }
62
+ ],
63
+ "radar": {
64
+ "gridRings": 4,
65
+ "showGridRings": true,
66
+ "gridRingStyle": "circles",
67
+ "scaleMin": 0,
68
+ "scaleMax": 100,
69
+ "showFill": false,
70
+ "fillOpacity": 0.25,
71
+ "showPoints": true,
72
+ "pointRadius": 5,
73
+ "strokeWidth": 2,
74
+ "axisLabelOffset": 25
75
+ },
76
+ "legend": {
77
+ "hide": false,
78
+ "behavior": "isolate",
79
+ "singleRow": true,
80
+ "position": "bottom",
81
+ "label": ""
82
+ },
83
+ "tooltips": {
84
+ "opacity": 90,
85
+ "singleSeries": false
86
+ },
87
+ "dataFormat": {
88
+ "commas": false,
89
+ "prefix": "",
90
+ "suffix": "",
91
+ "abbreviated": false
92
+ },
93
+ "table": {
94
+ "label": "Data Table",
95
+ "expanded": false,
96
+ "show": true,
97
+ "showDataTableLink": true
98
+ },
99
+ "general": {
100
+ "showDownloadButton": false,
101
+ "palette": {
102
+ "name": "qualitative_bold",
103
+ "version": "2.0",
104
+ "isReversed": false
105
+ }
106
+ },
107
+ "data": [
108
+ {
109
+ "Program": "Program A",
110
+ "Reach": 85,
111
+ "Engagement": 70,
112
+ "Effectiveness": 90,
113
+ "Adoption": 65,
114
+ "Maintenance": 75,
115
+ "Cost Efficiency": 80
116
+ },
117
+ {
118
+ "Program": "Program B",
119
+ "Reach": 60,
120
+ "Engagement": 85,
121
+ "Effectiveness": 70,
122
+ "Adoption": 90,
123
+ "Maintenance": 80,
124
+ "Cost Efficiency": 55
125
+ }
126
+ ],
127
+ "description": "RE-AIM framework comparison of two health intervention programs.",
128
+ "filters": [],
129
+ "exclusions": {
130
+ "active": false,
131
+ "keys": []
132
+ }
133
+ }
@@ -0,0 +1,148 @@
1
+ {
2
+ "type": "chart",
3
+ "title": "Regional Health Performance Indicators",
4
+ "showTitle": true,
5
+ "theme": "theme-blue",
6
+ "visualizationType": "Radar",
7
+ "animate": false,
8
+ "heights": {
9
+ "vertical": 400,
10
+ "horizontal": 400
11
+ },
12
+ "xAxis": {
13
+ "dataKey": "Region",
14
+ "label": "Region"
15
+ },
16
+ "yAxis": {
17
+ "dataKey": ""
18
+ },
19
+ "series": [
20
+ {
21
+ "dataKey": "Vaccination Rate",
22
+ "name": "Vaccination Rate",
23
+ "type": "Radar",
24
+ "axis": "Left",
25
+ "tooltip": true
26
+ },
27
+ {
28
+ "dataKey": "Healthcare Access",
29
+ "name": "Healthcare Access",
30
+ "type": "Radar",
31
+ "axis": "Left",
32
+ "tooltip": true
33
+ },
34
+ {
35
+ "dataKey": "Disease Prevention",
36
+ "name": "Disease Prevention",
37
+ "type": "Radar",
38
+ "axis": "Left",
39
+ "tooltip": true
40
+ },
41
+ {
42
+ "dataKey": "Health Education",
43
+ "name": "Health Education",
44
+ "type": "Radar",
45
+ "axis": "Left",
46
+ "tooltip": true
47
+ },
48
+ {
49
+ "dataKey": "Emergency Response",
50
+ "name": "Emergency Response",
51
+ "type": "Radar",
52
+ "axis": "Left",
53
+ "tooltip": true
54
+ }
55
+ ],
56
+ "radar": {
57
+ "gridRings": 5,
58
+ "showGridRings": true,
59
+ "gridRingStyle": "polygons",
60
+ "scaleMin": 0,
61
+ "scaleMax": 100,
62
+ "showFill": false,
63
+ "fillOpacity": 0.3,
64
+ "showPoints": true,
65
+ "pointRadius": 4,
66
+ "strokeWidth": 2,
67
+ "axisLabelOffset": 20
68
+ },
69
+ "legend": {
70
+ "hide": false,
71
+ "behavior": "highlight",
72
+ "singleRow": true,
73
+ "position": "right",
74
+ "label": "Regions"
75
+ },
76
+ "tooltips": {
77
+ "opacity": 90,
78
+ "singleSeries": false
79
+ },
80
+ "dataFormat": {
81
+ "commas": false,
82
+ "prefix": "",
83
+ "suffix": "%",
84
+ "abbreviated": false
85
+ },
86
+ "table": {
87
+ "label": "Data Table",
88
+ "expanded": true,
89
+ "show": true,
90
+ "showDataTableLink": true
91
+ },
92
+ "general": {
93
+ "showDownloadButton": false,
94
+ "palette": {
95
+ "name": "qualitative_standard",
96
+ "version": "2.0",
97
+ "isReversed": false
98
+ }
99
+ },
100
+ "data": [
101
+ {
102
+ "Region": "Northeast",
103
+ "Vaccination Rate": 85,
104
+ "Healthcare Access": 78,
105
+ "Disease Prevention": 82,
106
+ "Health Education": 75,
107
+ "Emergency Response": 88
108
+ },
109
+ {
110
+ "Region": "Southeast",
111
+ "Vaccination Rate": 72,
112
+ "Healthcare Access": 68,
113
+ "Disease Prevention": 70,
114
+ "Health Education": 65,
115
+ "Emergency Response": 75
116
+ },
117
+ {
118
+ "Region": "Midwest",
119
+ "Vaccination Rate": 78,
120
+ "Healthcare Access": 72,
121
+ "Disease Prevention": 76,
122
+ "Health Education": 70,
123
+ "Emergency Response": 80
124
+ },
125
+ {
126
+ "Region": "Southwest",
127
+ "Vaccination Rate": 70,
128
+ "Healthcare Access": 65,
129
+ "Disease Prevention": 68,
130
+ "Health Education": 72,
131
+ "Emergency Response": 70
132
+ },
133
+ {
134
+ "Region": "West",
135
+ "Vaccination Rate": 82,
136
+ "Healthcare Access": 80,
137
+ "Disease Prevention": 78,
138
+ "Health Education": 85,
139
+ "Emergency Response": 82
140
+ }
141
+ ],
142
+ "description": "Comparison of health performance indicators across five U.S. regions. Each axis represents a different health metric scored on a 0-100 scale.",
143
+ "filters": [],
144
+ "exclusions": {
145
+ "active": false,
146
+ "keys": []
147
+ }
148
+ }