Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Charts: Allow typechecking of tests and stories
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { RenderTooltipParams } from '@visx/xychart/lib/components/Tooltip';
import { ChartStoryArgs } from '../../../stories';
import { DataPointDate } from '../../../types';
import LineChart from '../line-chart';
import { lineChartMetaArgs, lineChartStoryArgs } from './config';
import type { Meta, StoryFn, StoryObj } from '@storybook/react';
Expand Down Expand Up @@ -57,7 +59,7 @@ CrosshairHorizontal.args = {
export const Custom: StoryObj< typeof LineChart > = Template.bind( {} );
Custom.args = {
...tooltipStoryArgs,
renderTooltip: ( { tooltipData } ) => {
renderTooltip: ( { tooltipData }: RenderTooltipParams< DataPointDate > ) => {
const nearestDatum = tooltipData?.nearestDatum?.datum;
if ( ! nearestDatum ) return null;

Expand Down
3 changes: 1 addition & 2 deletions projects/js-packages/charts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
"outDir": "dist",
"rootDir": "src"
},
"include": [ "src" ],
"exclude": [ "tests", "**/*.test.*", "stories", "**/*.stories.*" ]
"include": [ "src" ]
}
Loading