diff --git a/packages/polaris-viz-core/src/components/LineSeries/components/AnimatedArea/AnimatedArea.tsx b/packages/polaris-viz-core/src/components/LineSeries/components/AnimatedArea/AnimatedArea.tsx index b47a52721..432a6439b 100644 --- a/packages/polaris-viz-core/src/components/LineSeries/components/AnimatedArea/AnimatedArea.tsx +++ b/packages/polaris-viz-core/src/components/LineSeries/components/AnimatedArea/AnimatedArea.tsx @@ -21,7 +21,7 @@ export function AnimatedArea({ const springConfig = useSpringConfig({ shouldAnimate: !immediate, - animationDelay: delay, + animationDelay: immediate ? 0 : delay, mountedSpringConfig: LINES_TRANSITION_CONFIG, unmountedSpringConfig: LINES_LOAD_ANIMATION_CONFIG, }); diff --git a/packages/polaris-viz-core/src/components/LineSeries/components/AnimatedLine/AnimatedLine.tsx b/packages/polaris-viz-core/src/components/LineSeries/components/AnimatedLine/AnimatedLine.tsx index c9f7b7093..e9b7a1a80 100644 --- a/packages/polaris-viz-core/src/components/LineSeries/components/AnimatedLine/AnimatedLine.tsx +++ b/packages/polaris-viz-core/src/components/LineSeries/components/AnimatedLine/AnimatedLine.tsx @@ -31,7 +31,7 @@ export function AnimatedLine({ const springConfig = useSpringConfig({ shouldAnimate: !immediate, - animationDelay: delay, + animationDelay: immediate ? 0 : delay, mountedSpringConfig: LINES_TRANSITION_CONFIG, unmountedSpringConfig: LINES_LOAD_ANIMATION_CONFIG, }); diff --git a/packages/polaris-viz/CHANGELOG.md b/packages/polaris-viz/CHANGELOG.md index b0df037ac..748f84aaf 100644 --- a/packages/polaris-viz/CHANGELOG.md +++ b/packages/polaris-viz/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Fixed + +- Fixed issue where stacked ``, `` & `` would still have a staggered delay when rendering bars/groups if `isAnimated: false`. ## [9.18.1] - 2023-11-14 diff --git a/packages/polaris-viz/src/components/StackedAreaChart/components/Area/AnimatedArea.tsx b/packages/polaris-viz/src/components/StackedAreaChart/components/Area/AnimatedArea.tsx index e3407e2db..2730281bd 100644 --- a/packages/polaris-viz/src/components/StackedAreaChart/components/Area/AnimatedArea.tsx +++ b/packages/polaris-viz/src/components/StackedAreaChart/components/Area/AnimatedArea.tsx @@ -37,7 +37,7 @@ export function AnimatedArea({ const springConfig = useSpringConfig({ shouldAnimate, - animationDelay: delay, + animationDelay: shouldAnimate ? delay : 0, mountedSpringConfig: AREAS_TRANSITION_CONFIG, unmountedSpringConfig: AREAS_LOAD_ANIMATION_CONFIG, }); diff --git a/packages/polaris-viz/src/components/VerticalBarChart/components/StackedBarGroups/components/Stack/Stack.tsx b/packages/polaris-viz/src/components/VerticalBarChart/components/StackedBarGroups/components/Stack/Stack.tsx index 414616670..3e4f2fbf2 100644 --- a/packages/polaris-viz/src/components/VerticalBarChart/components/StackedBarGroups/components/Stack/Stack.tsx +++ b/packages/polaris-viz/src/components/VerticalBarChart/components/StackedBarGroups/components/Stack/Stack.tsx @@ -73,7 +73,7 @@ export function Stack({ transform: `scale(1, 1)`, }, config: BARS_TRANSITION_CONFIG, - delay: animationDelay, + delay: shouldAnimate ? animationDelay : 0, default: {immediate: !shouldAnimate}, });