@cdc/chart 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 (128) hide show
  1. package/CONFIG.md +169 -0
  2. package/README.md +42 -17
  3. package/dist/cdcchart.js +34725 -33730
  4. package/examples/feature/bar/additional-column-tooltip.json +3 -3
  5. package/examples/feature/deviation/planet-deviation-config.json +2 -2
  6. package/examples/feature/paired-bar/paired-bar-example.json +2 -2
  7. package/examples/feature/tests-case-rate/case-rate-example-config.json +2 -2
  8. package/examples/feature/tests-covid/covid-confidence-example-config.json +2 -2
  9. package/examples/feature/tests-covid/covid-example-config.json +2 -2
  10. package/examples/feature/tests-cutoff/cutoff-example-config.json +2 -2
  11. package/examples/feature/tests-non-numerics/planet-pie-example-config-nonnumeric.json +2 -2
  12. package/examples/metadata-variables.json +1 -1
  13. package/examples/minimal-example.json +24 -0
  14. package/examples/private/test2.json +35012 -0
  15. package/package.json +4 -4
  16. package/src/CdcChartComponent.tsx +9 -6
  17. package/src/_stories/{Chart.HTMLInDataTable.stories.tsx → Chart.HTMLInDataTable.smoke.stories.tsx} +10 -0
  18. package/src/_stories/Chart.Minimal.smoke.stories.tsx +25 -0
  19. package/src/_stories/{Chart.SmallMultiples.stories.tsx → Chart.SmallMultiples.smoke.stories.tsx} +17 -1
  20. package/src/_stories/{Chart.stories.tsx → Chart.smoke.stories.tsx} +12 -0
  21. package/src/_stories/{Chart.tooltip.stories.tsx → Chart.tooltip.smoke.stories.tsx} +68 -0
  22. package/src/_stories/ChartBar.Editor.stories.tsx +88 -85
  23. package/src/_stories/ChartEditor.Editor.stories.tsx +23 -0
  24. package/src/_stories/ChartLine.DashedDates.smoke.stories.tsx +23 -0
  25. package/src/_stories/_mock/line_chart_dashed_dates.json +276 -0
  26. package/src/_stories/_mock/paired-bar-abbr.json +1 -1
  27. package/src/_stories/_mock/paired-bar.json +1 -1
  28. package/src/components/Annotations/components/AnnotationDraggable.tsx +1 -1
  29. package/src/components/AreaChart/components/AreaChart.Stacked.jsx +10 -2
  30. package/src/components/Axis/BottomAxis.tsx +1 -1
  31. package/src/components/Axis/LeftAxis.tsx +2 -4
  32. package/src/components/Axis/LeftAxisGridlines.tsx +1 -3
  33. package/src/components/BarChart/components/BarChart.Horizontal.tsx +9 -5
  34. package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +9 -5
  35. package/src/components/BarChart/components/BarChart.StackedVertical.tsx +9 -5
  36. package/src/components/BarChart/components/BarChart.Vertical.tsx +9 -6
  37. package/src/components/BarChart/components/BarChart.tsx +2 -6
  38. package/src/components/BarChart/helpers/useBarChart.ts +1 -1
  39. package/src/components/BoxPlot/BoxPlot.Vertical.tsx +3 -3
  40. package/src/components/EditorPanel/EditorPanel.tsx +633 -908
  41. package/src/components/EditorPanel/EditorPanelContext.ts +1 -1
  42. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +216 -165
  43. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +168 -116
  44. package/src/components/EditorPanel/components/Panels/Panel.Regions.tsx +154 -109
  45. package/src/components/EditorPanel/components/Panels/Panel.Sankey.tsx +3 -3
  46. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +12 -26
  47. package/src/components/EditorPanel/useEditorPermissions.ts +1 -10
  48. package/src/components/Forecasting/Forecasting.tsx +2 -2
  49. package/src/components/HorizonChart/HorizonChart.tsx +10 -2
  50. package/src/components/HoverLine/HoverLine.tsx +6 -8
  51. package/src/components/Legend/Legend.Component.tsx +4 -4
  52. package/src/components/Legend/LegendGroup/LegendGroup.styles.css +5 -0
  53. package/src/components/Legend/LegendGroup/LegendGroup.tsx +3 -1
  54. package/src/components/Legend/helpers/index.ts +0 -2
  55. package/src/components/LineChart/LineChartProps.ts +1 -0
  56. package/src/components/LineChart/components/LineChart.BumpCircle.tsx +3 -2
  57. package/src/components/LineChart/index.tsx +11 -4
  58. package/src/components/LinearChart/VisualizationRenderer.tsx +11 -1
  59. package/src/components/LinearChart/tests/LinearChart.test.tsx +147 -0
  60. package/src/components/LinearChart.tsx +98 -41
  61. package/src/components/PairedBarChart.jsx +2 -2
  62. package/src/components/PieChart/PieChart.tsx +11 -9
  63. package/src/components/Regions/components/Regions.tsx +30 -20
  64. package/src/components/ScatterPlot/ScatterPlot.jsx +19 -17
  65. package/src/components/SmallMultiples/SmallMultipleTile.tsx +1 -0
  66. package/src/components/Sparkline/components/SparkLine.tsx +1 -1
  67. package/src/components/WarmingStripes/WarmingStripes.tsx +5 -3
  68. package/src/data/initial-state.js +1 -0
  69. package/src/helpers/calculateLeftYAxisWidth.ts +193 -0
  70. package/src/helpers/tests/tooltipHelpers.test.ts +151 -0
  71. package/src/helpers/tooltipHelpers.ts +176 -0
  72. package/src/hooks/useHighlightedBars.ts +9 -16
  73. package/src/hooks/useProgrammaticTooltip.ts +16 -2
  74. package/src/hooks/useSmallMultipleSynchronization.ts +3 -4
  75. package/src/hooks/useTooltip.tsx +167 -38
  76. package/src/test/CdcChart.test.jsx +24 -0
  77. package/src/types/ChartConfig.ts +1 -0
  78. package/LICENSE +0 -201
  79. package/examples/chart-regression-2.json +0 -2360
  80. package/examples/feature/__data__/age-adjusted-rates.json +0 -1486
  81. package/examples/feature/__data__/city-temperature.json +0 -2198
  82. package/examples/feature/bar/Barchart_with_negative.json +0 -34
  83. package/examples/feature/boxplot/box-plot-data.json +0 -71
  84. package/examples/feature/boxplot/boxplot-data.json +0 -156
  85. package/examples/feature/combo/combochart-categories_are_numbers .json +0 -18
  86. package/examples/feature/forest-plot/log.json +0 -26
  87. package/examples/feature/tests-date-exclusions/date-exclusions-data.json +0 -162
  88. package/examples/region-issue.json +0 -2065
  89. package/examples/xaxis.json +0 -493
  90. /package/examples/{data → __data__}/data-with-metadata.json +0 -0
  91. /package/examples/feature/bar/{tall-data.json → __data__/tall-data.json} +0 -0
  92. /package/examples/feature/deviation/{planet-deviation-data.json → __data__/planet-deviation-data.json} +0 -0
  93. /package/examples/feature/paired-bar/{paired-bar-data.json → __data__/paired-bar-data.json} +0 -0
  94. /package/examples/feature/paired-bar/{paired-bar-formatted.json → __data__/paired-bar-formatted.json} +0 -0
  95. /package/examples/feature/tests-case-rate/{case-rate-example-data.json → __data__/case-rate-example-data.json} +0 -0
  96. /package/examples/feature/tests-covid/{covid-example-data-confidence.json → __data__/covid-example-data-confidence.json} +0 -0
  97. /package/examples/feature/tests-covid/{covid-example-data.json → __data__/covid-example-data.json} +0 -0
  98. /package/examples/feature/tests-cutoff/{cutoff-example-data.json → __data__/cutoff-example-data.json} +0 -0
  99. /package/examples/feature/tests-non-numerics/{planet-example-data-nonnumeric.json → __data__/planet-example-data-nonnumeric.json} +0 -0
  100. /package/src/_stories/{Chart.Anchors.stories.tsx → Chart.Anchors.smoke.stories.tsx} +0 -0
  101. /package/src/_stories/{Chart.BoxPlot.stories.tsx → Chart.BoxPlot.smoke.stories.tsx} +0 -0
  102. /package/src/_stories/{Chart.CI.stories.tsx → Chart.CI.smoke.stories.tsx} +0 -0
  103. /package/src/_stories/{Chart.Combo.stories.tsx → Chart.Combo.smoke.stories.tsx} +0 -0
  104. /package/src/_stories/{Chart.CustomColors.stories.tsx → Chart.CustomColors.smoke.stories.tsx} +0 -0
  105. /package/src/_stories/{Chart.Defaults.stories.tsx → Chart.Defaults.smoke.stories.tsx} +0 -0
  106. /package/src/_stories/{Chart.DynamicSeries.stories.tsx → Chart.DynamicSeries.smoke.stories.tsx} +0 -0
  107. /package/src/_stories/{Chart.Filters.stories.tsx → Chart.Filters.smoke.stories.tsx} +0 -0
  108. /package/src/_stories/{Chart.Forecast.stories.tsx → Chart.Forecast.smoke.stories.tsx} +0 -0
  109. /package/src/_stories/{Chart.Legend.Gradient.stories.tsx → Chart.Legend.Gradient.smoke.stories.tsx} +0 -0
  110. /package/src/_stories/{Chart.Patterns.stories.tsx → Chart.Patterns.smoke.stories.tsx} +0 -0
  111. /package/src/_stories/{Chart.PreserveDecimals.stories.tsx → Chart.PreserveDecimals.smoke.stories.tsx} +0 -0
  112. /package/src/_stories/{Chart.Regions.Categorical.stories.tsx → Chart.Regions.Categorical.smoke.stories.tsx} +0 -0
  113. /package/src/_stories/{Chart.Regions.DateScale.stories.tsx → Chart.Regions.DateScale.smoke.stories.tsx} +0 -0
  114. /package/src/_stories/{Chart.Regions.DateTimeScale.stories.tsx → Chart.Regions.DateTimeScale.smoke.stories.tsx} +0 -0
  115. /package/src/_stories/{Chart.ScatterPlot.stories.tsx → Chart.ScatterPlot.smoke.stories.tsx} +0 -0
  116. /package/src/_stories/{Chart.SmallestLeftAxisMax.stories.tsx → Chart.SmallestLeftAxisMax.smoke.stories.tsx} +0 -0
  117. /package/src/_stories/{ChartAnnotation.stories.tsx → ChartAnnotation.smoke.stories.tsx} +0 -0
  118. /package/src/_stories/{ChartAxisLabels.stories.tsx → ChartAxisLabels.smoke.stories.tsx} +0 -0
  119. /package/src/_stories/{ChartAxisTitles.stories.tsx → ChartAxisTitles.smoke.stories.tsx} +0 -0
  120. /package/src/_stories/{ChartBrush.Matrix.Continuous.stories.tsx → ChartBrush.Matrix.Continuous.smoke.stories.tsx} +0 -0
  121. /package/src/_stories/{ChartBrush.Matrix.Date.stories.tsx → ChartBrush.Matrix.Date.smoke.stories.tsx} +0 -0
  122. /package/src/_stories/{ChartBrush.Matrix.DateTime.stories.tsx → ChartBrush.Matrix.DateTime.smoke.stories.tsx} +0 -0
  123. /package/src/_stories/{ChartBrush.stories.tsx → ChartBrush.smoke.stories.tsx} +0 -0
  124. /package/src/_stories/{ChartLine.QuadrantAngles.stories.tsx → ChartLine.QuadrantAngles.smoke.stories.tsx} +0 -0
  125. /package/src/_stories/{ChartLine.Suppression.stories.tsx → ChartLine.Suppression.smoke.stories.tsx} +0 -0
  126. /package/src/_stories/{ChartLine.Symbols.stories.tsx → ChartLine.Symbols.smoke.stories.tsx} +0 -0
  127. /package/src/_stories/{ChartPrefixSuffix.stories.tsx → ChartPrefixSuffix.smoke.stories.tsx} +0 -0
  128. /package/src/_stories/{TechAdoptionWithLinks.stories.tsx → TechAdoptionWithLinks.smoke.stories.tsx} +0 -0
@@ -360,8 +360,8 @@
360
360
  "isStacked": false
361
361
  },
362
362
  "visualizationType": "Bar",
363
- "dataUrl": "examples/feature/bar/tall-data.json",
364
- "dataFileName": "tall-data.json",
363
+ "dataUrl": "examples/feature/bar/__data__/tall-data.json",
364
+ "dataFileName": "__data__/tall-data.json",
365
365
  "dataFileSourceType": "file",
366
366
  "dataDescription": {
367
367
  "horizontal": false,
@@ -443,4 +443,4 @@
443
443
  "Flu-upper_ci": 67
444
444
  }
445
445
  ]
446
- }
446
+ }
@@ -155,7 +155,7 @@
155
155
  "accent": true,
156
156
  "background": true
157
157
  },
158
- "dataUrl": "/examples/feature/deviation/planet-deviation-data.json",
158
+ "dataUrl": "/examples/feature/deviation/__data__/planet-deviation-data.json",
159
159
  "visualizationType": "Deviation Bar",
160
160
  "series": [
161
161
  {
@@ -165,4 +165,4 @@
165
165
  }
166
166
  ],
167
167
  "dataCutoff": "0.5"
168
- }
168
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "Paired Bar Chart Example",
3
- "dataUrl": "/examples/feature/paired-bar/paired-bar-data.json",
3
+ "dataUrl": "/examples/feature/paired-bar/__data__/paired-bar-data.json",
4
4
  "animate": true,
5
5
  "animateReplay": true,
6
6
  "visualizationType": "Paired Bar",
@@ -53,4 +53,4 @@
53
53
  "runtime": {
54
54
  "horizontal": true
55
55
  }
56
- }
56
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Case Rate Data",
3
3
  "theme": "theme-blue",
4
- "dataUrl": "/examples/feature/tests-case-rate/case-rate-example-data.json",
4
+ "dataUrl": "/examples/feature/tests-case-rate/__data__/case-rate-example-data.json",
5
5
  "visualizationType": "Bar",
6
6
  "visualizationSubType": "horizontal",
7
7
  "series": [],
@@ -33,4 +33,4 @@
33
33
  "expanded": true,
34
34
  "download": true
35
35
  }
36
- }
36
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "Confidence Age-adjusted COVID-19-associated hospitalization rates by race and ethnicity — COVID-NET, March 1–December 26, 2020",
3
- "dataUrl": "/examples/feature/tests-covid/covid-example-data-confidence.json",
3
+ "dataUrl": "/examples/feature/tests-covid/__data__/covid-example-data-confidence.json",
4
4
  "visualizationType": "Bar",
5
5
  "fontSize": "small",
6
6
  "series": [
@@ -37,4 +37,4 @@
37
37
  "label": "Age-adjusted COVID-19-associated hospitalization rates by race and ethnicity",
38
38
  "expanded": true
39
39
  }
40
- }
40
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Non Configdence Age-adjusted COVID-19-associated hospitalization rates by race and ethnicity — COVID-NET, March 1–December 26, 2020",
3
3
  "theme": "theme-brown",
4
- "dataUrl": "/examples/feature/tests-covid/covid-example-data.json",
4
+ "dataUrl": "/examples/feature/tests-covid/__data__/covid-example-data.json",
5
5
  "visualizationType": "Bar",
6
6
  "visualizationSubType": "horizontal",
7
7
  "series": [
@@ -37,4 +37,4 @@
37
37
  "expanded": true,
38
38
  "download": true
39
39
  }
40
- }
40
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Data Cutoff Example (< 0.1)",
3
3
  "theme": "theme-blue",
4
- "dataUrl": "/examples/feature/tests-cutoff/cutoff-example-data.json",
4
+ "dataUrl": "/examples/feature/tests-cutoff/__data__/cutoff-example-data.json",
5
5
  "animate": true,
6
6
  "animateReplay": true,
7
7
  "visualizationType": "Line",
@@ -39,4 +39,4 @@
39
39
  "expanded": true,
40
40
  "download": true
41
41
  }
42
- }
42
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "Planet Radius (Pie Example)",
3
- "dataUrl": "/examples/feature/tests-non-numerics/planet-example-data-nonnumeric.json",
3
+ "dataUrl": "/examples/feature/tests-non-numerics/__data__/planet-example-data-nonnumeric.json",
4
4
  "animate": true,
5
5
  "animateReplay": true,
6
6
  "visualizationType": "Pie",
@@ -27,4 +27,4 @@
27
27
  "label": "Data Table",
28
28
  "expanded": false
29
29
  }
30
- }
30
+ }
@@ -6,7 +6,7 @@
6
6
  "visualizationType": "Bar",
7
7
  "visualizationSubType": "regular",
8
8
  "orientation": "vertical",
9
- "dataUrl": "/examples/data/data-with-metadata.json",
9
+ "dataUrl": "/examples/__data__/data-with-metadata.json",
10
10
  "enableMarkupVariables": true,
11
11
  "markupVariables": [
12
12
  {
@@ -0,0 +1,24 @@
1
+ {
2
+ "version": "4.26.4",
3
+ "type": "chart",
4
+ "visualizationType": "Bar",
5
+ "title": "Minimal Chart",
6
+ "data": [
7
+ {
8
+ "category": "A",
9
+ "value": 1
10
+ },
11
+ {
12
+ "category": "B",
13
+ "value": 2
14
+ }
15
+ ],
16
+ "xAxis": {
17
+ "dataKey": "category"
18
+ },
19
+ "series": [
20
+ {
21
+ "dataKey": "value"
22
+ }
23
+ ]
24
+ }