Skip to content

Commit

Permalink
refactor(components): type dataset to recognize that pointRadius is…
Browse files Browse the repository at this point in the history
… unnecessary here
  • Loading branch information
fengelniederhammer committed Jul 12, 2024
1 parent f7af2c9 commit 1cef69d
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Chart, type ChartConfiguration, registerables, type TooltipItem } from 'chart.js';
import { Chart, type ChartConfiguration, type ChartDataset, registerables, type TooltipItem } from 'chart.js';
import { BarWithErrorBar, BarWithErrorBarsController } from 'chartjs-chart-error-bars';

import { maxInData } from './prevalence-over-time';
Expand Down Expand Up @@ -71,10 +71,17 @@ const getDataset = (
prevalenceOverTimeVariant: PrevalenceOverTimeVariantData,
index: number,
confidenceIntervalMethod: ConfidenceIntervalMethod,
) => {
): ChartDataset<
typeof BarWithErrorBarsController.id,
{
x: string;
yMin: number | undefined;
yMax: number | undefined;
y: number;
}[]
> => {
return {
borderWidth: 1,
pointRadius: 0,
label: prevalenceOverTimeVariant.displayName,
backgroundColor: singleGraphColorRGBAById(index, 0.3),
borderColor: singleGraphColorRGBAById(index),
Expand Down

0 comments on commit 1cef69d

Please sign in to comment.