Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed RenderInnerValueContent type to include active index #1597

Merged
merged 1 commit into from
Oct 2, 2023
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
7 changes: 6 additions & 1 deletion packages/polaris-viz/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

### Changed

- Changed `RenderInnerValueContent` type to include active index


## [9.13.0] - 2023-09-26

Expand Down
1 change: 1 addition & 0 deletions packages/polaris-viz/src/components/DonutChart/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export function Chart({
</svg>
<InnerValue
activeValue={activeValue}
activeIndex={activeIndex}
isAnimated={shouldAnimate}
totalValue={totalValue}
comparisonMetric={comparisonMetric}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import styles from '../../DonutChart.scss';

interface Props {
activeValue: number | null | undefined;
activeIndex: number;
labelFormatter: LabelFormatter;
isAnimated: boolean;
totalValue: number;
Expand All @@ -20,6 +21,7 @@ interface Props {

export function InnerValue({
activeValue,
activeIndex,
comparisonMetric,
labelFormatter,
isAnimated,
Expand Down Expand Up @@ -52,6 +54,7 @@ export function InnerValue({

const innerContent = renderInnerValueContent?.({
activeValue,
activeIndex,
animatedTotalValue,
totalValue,
}) ?? (
Expand Down
1 change: 1 addition & 0 deletions packages/polaris-viz/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export type SortedBarChartData = (number | null)[][];

export interface InnerValueContents {
activeValue: number | null | undefined;
activeIndex: number;
animatedTotalValue: ReactNode;
totalValue: number;
}
Expand Down