@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.
- package/CONFIG.md +169 -0
- package/README.md +42 -17
- package/dist/cdcchart.js +34725 -33730
- package/examples/feature/bar/additional-column-tooltip.json +3 -3
- package/examples/feature/deviation/planet-deviation-config.json +2 -2
- package/examples/feature/paired-bar/paired-bar-example.json +2 -2
- package/examples/feature/tests-case-rate/case-rate-example-config.json +2 -2
- package/examples/feature/tests-covid/covid-confidence-example-config.json +2 -2
- package/examples/feature/tests-covid/covid-example-config.json +2 -2
- package/examples/feature/tests-cutoff/cutoff-example-config.json +2 -2
- package/examples/feature/tests-non-numerics/planet-pie-example-config-nonnumeric.json +2 -2
- package/examples/metadata-variables.json +1 -1
- package/examples/minimal-example.json +24 -0
- package/examples/private/test2.json +35012 -0
- package/package.json +4 -4
- package/src/CdcChartComponent.tsx +9 -6
- package/src/_stories/{Chart.HTMLInDataTable.stories.tsx → Chart.HTMLInDataTable.smoke.stories.tsx} +10 -0
- package/src/_stories/Chart.Minimal.smoke.stories.tsx +25 -0
- package/src/_stories/{Chart.SmallMultiples.stories.tsx → Chart.SmallMultiples.smoke.stories.tsx} +17 -1
- package/src/_stories/{Chart.stories.tsx → Chart.smoke.stories.tsx} +12 -0
- package/src/_stories/{Chart.tooltip.stories.tsx → Chart.tooltip.smoke.stories.tsx} +68 -0
- package/src/_stories/ChartBar.Editor.stories.tsx +88 -85
- package/src/_stories/ChartEditor.Editor.stories.tsx +23 -0
- package/src/_stories/ChartLine.DashedDates.smoke.stories.tsx +23 -0
- package/src/_stories/_mock/line_chart_dashed_dates.json +276 -0
- package/src/_stories/_mock/paired-bar-abbr.json +1 -1
- package/src/_stories/_mock/paired-bar.json +1 -1
- package/src/components/Annotations/components/AnnotationDraggable.tsx +1 -1
- package/src/components/AreaChart/components/AreaChart.Stacked.jsx +10 -2
- package/src/components/Axis/BottomAxis.tsx +1 -1
- package/src/components/Axis/LeftAxis.tsx +2 -4
- package/src/components/Axis/LeftAxisGridlines.tsx +1 -3
- package/src/components/BarChart/components/BarChart.Horizontal.tsx +9 -5
- package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +9 -5
- package/src/components/BarChart/components/BarChart.StackedVertical.tsx +9 -5
- package/src/components/BarChart/components/BarChart.Vertical.tsx +9 -6
- package/src/components/BarChart/components/BarChart.tsx +2 -6
- package/src/components/BarChart/helpers/useBarChart.ts +1 -1
- package/src/components/BoxPlot/BoxPlot.Vertical.tsx +3 -3
- package/src/components/EditorPanel/EditorPanel.tsx +633 -908
- package/src/components/EditorPanel/EditorPanelContext.ts +1 -1
- package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +216 -165
- package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +168 -116
- package/src/components/EditorPanel/components/Panels/Panel.Regions.tsx +154 -109
- package/src/components/EditorPanel/components/Panels/Panel.Sankey.tsx +3 -3
- package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +12 -26
- package/src/components/EditorPanel/useEditorPermissions.ts +1 -10
- package/src/components/Forecasting/Forecasting.tsx +2 -2
- package/src/components/HorizonChart/HorizonChart.tsx +10 -2
- package/src/components/HoverLine/HoverLine.tsx +6 -8
- package/src/components/Legend/Legend.Component.tsx +4 -4
- package/src/components/Legend/LegendGroup/LegendGroup.styles.css +5 -0
- package/src/components/Legend/LegendGroup/LegendGroup.tsx +3 -1
- package/src/components/Legend/helpers/index.ts +0 -2
- package/src/components/LineChart/LineChartProps.ts +1 -0
- package/src/components/LineChart/components/LineChart.BumpCircle.tsx +3 -2
- package/src/components/LineChart/index.tsx +11 -4
- package/src/components/LinearChart/VisualizationRenderer.tsx +11 -1
- package/src/components/LinearChart/tests/LinearChart.test.tsx +147 -0
- package/src/components/LinearChart.tsx +98 -41
- package/src/components/PairedBarChart.jsx +2 -2
- package/src/components/PieChart/PieChart.tsx +11 -9
- package/src/components/Regions/components/Regions.tsx +30 -20
- package/src/components/ScatterPlot/ScatterPlot.jsx +19 -17
- package/src/components/SmallMultiples/SmallMultipleTile.tsx +1 -0
- package/src/components/Sparkline/components/SparkLine.tsx +1 -1
- package/src/components/WarmingStripes/WarmingStripes.tsx +5 -3
- package/src/data/initial-state.js +1 -0
- package/src/helpers/calculateLeftYAxisWidth.ts +193 -0
- package/src/helpers/tests/tooltipHelpers.test.ts +151 -0
- package/src/helpers/tooltipHelpers.ts +176 -0
- package/src/hooks/useHighlightedBars.ts +9 -16
- package/src/hooks/useProgrammaticTooltip.ts +16 -2
- package/src/hooks/useSmallMultipleSynchronization.ts +3 -4
- package/src/hooks/useTooltip.tsx +167 -38
- package/src/test/CdcChart.test.jsx +24 -0
- package/src/types/ChartConfig.ts +1 -0
- package/LICENSE +0 -201
- package/examples/chart-regression-2.json +0 -2360
- package/examples/feature/__data__/age-adjusted-rates.json +0 -1486
- package/examples/feature/__data__/city-temperature.json +0 -2198
- package/examples/feature/bar/Barchart_with_negative.json +0 -34
- package/examples/feature/boxplot/box-plot-data.json +0 -71
- package/examples/feature/boxplot/boxplot-data.json +0 -156
- package/examples/feature/combo/combochart-categories_are_numbers .json +0 -18
- package/examples/feature/forest-plot/log.json +0 -26
- package/examples/feature/tests-date-exclusions/date-exclusions-data.json +0 -162
- package/examples/region-issue.json +0 -2065
- package/examples/xaxis.json +0 -493
- /package/examples/{data → __data__}/data-with-metadata.json +0 -0
- /package/examples/feature/bar/{tall-data.json → __data__/tall-data.json} +0 -0
- /package/examples/feature/deviation/{planet-deviation-data.json → __data__/planet-deviation-data.json} +0 -0
- /package/examples/feature/paired-bar/{paired-bar-data.json → __data__/paired-bar-data.json} +0 -0
- /package/examples/feature/paired-bar/{paired-bar-formatted.json → __data__/paired-bar-formatted.json} +0 -0
- /package/examples/feature/tests-case-rate/{case-rate-example-data.json → __data__/case-rate-example-data.json} +0 -0
- /package/examples/feature/tests-covid/{covid-example-data-confidence.json → __data__/covid-example-data-confidence.json} +0 -0
- /package/examples/feature/tests-covid/{covid-example-data.json → __data__/covid-example-data.json} +0 -0
- /package/examples/feature/tests-cutoff/{cutoff-example-data.json → __data__/cutoff-example-data.json} +0 -0
- /package/examples/feature/tests-non-numerics/{planet-example-data-nonnumeric.json → __data__/planet-example-data-nonnumeric.json} +0 -0
- /package/src/_stories/{Chart.Anchors.stories.tsx → Chart.Anchors.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.BoxPlot.stories.tsx → Chart.BoxPlot.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.CI.stories.tsx → Chart.CI.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.Combo.stories.tsx → Chart.Combo.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.CustomColors.stories.tsx → Chart.CustomColors.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.Defaults.stories.tsx → Chart.Defaults.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.DynamicSeries.stories.tsx → Chart.DynamicSeries.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.Filters.stories.tsx → Chart.Filters.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.Forecast.stories.tsx → Chart.Forecast.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.Legend.Gradient.stories.tsx → Chart.Legend.Gradient.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.Patterns.stories.tsx → Chart.Patterns.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.PreserveDecimals.stories.tsx → Chart.PreserveDecimals.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.Regions.Categorical.stories.tsx → Chart.Regions.Categorical.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.Regions.DateScale.stories.tsx → Chart.Regions.DateScale.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.Regions.DateTimeScale.stories.tsx → Chart.Regions.DateTimeScale.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.ScatterPlot.stories.tsx → Chart.ScatterPlot.smoke.stories.tsx} +0 -0
- /package/src/_stories/{Chart.SmallestLeftAxisMax.stories.tsx → Chart.SmallestLeftAxisMax.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartAnnotation.stories.tsx → ChartAnnotation.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartAxisLabels.stories.tsx → ChartAxisLabels.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartAxisTitles.stories.tsx → ChartAxisTitles.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartBrush.Matrix.Continuous.stories.tsx → ChartBrush.Matrix.Continuous.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartBrush.Matrix.Date.stories.tsx → ChartBrush.Matrix.Date.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartBrush.Matrix.DateTime.stories.tsx → ChartBrush.Matrix.DateTime.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartBrush.stories.tsx → ChartBrush.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartLine.QuadrantAngles.stories.tsx → ChartLine.QuadrantAngles.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartLine.Suppression.stories.tsx → ChartLine.Suppression.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartLine.Symbols.stories.tsx → ChartLine.Symbols.smoke.stories.tsx} +0 -0
- /package/src/_stories/{ChartPrefixSuffix.stories.tsx → ChartPrefixSuffix.smoke.stories.tsx} +0 -0
- /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/
|
|
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
|
+
}
|