From 1ee2f732fb71c686626d16ae2730cd91c2c0d0d2 Mon Sep 17 00:00:00 2001 From: ilyabrower Date: Fri, 24 Nov 2023 14:50:39 +0100 Subject: [PATCH] [d3-chart] fixed types for children render function in tooltips (#924) ## Motivation and Context #923 ## How has this been tested? ## Screenshots (if appropriate): ## Types of changes - [X] Bug fix (non-breaking change which fixes an issue). - [ ] New feature (non-breaking change which adds functionality). - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). - [ ] Nice improve. ## Checklist: - [X] My code follows the code style of this project. - [X] I have updated the documentation accordingly or it's not required. - [X] Unit tests are not broken. - [X] I have added changelog note to corresponding `CHANGELOG.md` file with planned publish date. - [ ] I have added new unit tests on added of fixed functionality. --- semcore/d3-chart/CHANGELOG.md | 6 ++++++ semcore/d3-chart/src/types/Hover.d.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/semcore/d3-chart/CHANGELOG.md b/semcore/d3-chart/CHANGELOG.md index 1148a14170..bf2dc313e4 100644 --- a/semcore/d3-chart/CHANGELOG.md +++ b/semcore/d3-chart/CHANGELOG.md @@ -2,6 +2,12 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/). +## [3.19.5] - 2023-11-24 + +### Fixed + +- Correct types for `Tooltip`s children render function. + ## [3.18.4] - 2023-11-21 ### Changed diff --git a/semcore/d3-chart/src/types/Hover.d.ts b/semcore/d3-chart/src/types/Hover.d.ts index f06cf67495..c0e0c2a9c6 100644 --- a/semcore/d3-chart/src/types/Hover.d.ts +++ b/semcore/d3-chart/src/types/Hover.d.ts @@ -22,9 +22,9 @@ type HoverTooltip = (( y?: Y; children: (props: { /** Index in `data` array of the current item */ - xIndex: X extends string ? string : never; + xIndex: X extends string ? number : never; /** Index in `data` array of the current item */ - yIndex: Y extends string ? string : never; + yIndex: Y extends string ? number : never; }) => { children: ReturnEl }; } & Omit, ) => ReturnEl) &