Skip to content

Commit

Permalink
[charts] Export data type in onAxisClick(_, data) callback (#15038)
Browse files Browse the repository at this point in the history
  • Loading branch information
clins1994 authored Oct 21, 2024
1 parent 2880c9a commit 361602b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useSeries } from '../hooks/useSeries';
import { useSvgRef } from '../hooks';
import { useCartesianContext } from '../context/CartesianProvider';

type AxisData = {
export type ChartsAxisData = {
dataIndex: number;
axisValue?: number | Date | string;
seriesValues: Record<string, number | null | undefined>;
Expand All @@ -19,7 +19,7 @@ export interface ChartsOnAxisClickHandlerProps {
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
* @param {null | AxisData} data The data about the clicked axis and items associated with it.
*/
onAxisClick?: (event: MouseEvent, data: null | AxisData) => void;
onAxisClick?: (event: MouseEvent, data: null | ChartsAxisData) => void;
}

function ChartsOnAxisClickHandler(props: ChartsOnAxisClickHandlerProps) {
Expand Down
1 change: 1 addition & 0 deletions scripts/x-charts-pro.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
{ "name": "ChartsAxisClasses", "kind": "Interface" },
{ "name": "ChartsAxisClassKey", "kind": "TypeAlias" },
{ "name": "ChartsAxisContentProps", "kind": "TypeAlias" },
{ "name": "ChartsAxisData", "kind": "TypeAlias" },
{ "name": "ChartsAxisHighlight", "kind": "Function" },
{ "name": "chartsAxisHighlightClasses", "kind": "Variable" },
{ "name": "ChartsAxisHighlightClasses", "kind": "Interface" },
Expand Down
1 change: 1 addition & 0 deletions scripts/x-charts.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
{ "name": "ChartsAxisClasses", "kind": "Interface" },
{ "name": "ChartsAxisClassKey", "kind": "TypeAlias" },
{ "name": "ChartsAxisContentProps", "kind": "TypeAlias" },
{ "name": "ChartsAxisData", "kind": "TypeAlias" },
{ "name": "ChartsAxisHighlight", "kind": "Function" },
{ "name": "chartsAxisHighlightClasses", "kind": "Variable" },
{ "name": "ChartsAxisHighlightClasses", "kind": "Interface" },
Expand Down

0 comments on commit 361602b

Please sign in to comment.