Skip to content

Commit

Permalink
fix(flamegraph): solve animation regression occurring with 6db2677 (#…
Browse files Browse the repository at this point in the history
…1541)

Mandatory nature of the internal `animation` property is restored, and the `animation: {duration}` in the chart specification API reaches the render code again

fix #1540
  • Loading branch information
monfera authored Dec 30, 2021
1 parent 59002df commit 5ec6037
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface AnimKeyframe {
/** @public */
export interface AnimationConfig {
/** @alpha */
animation?: {
animation: {
duration: TimeMs;
keyframes?: Array<AnimKeyframe>;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export const nullShapeViewModel = (
width: 0,
height: 0,
},
animation: { duration: 0 },
});

/** @internal */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export function shapeViewModel(
clockwiseSectors,
maxRowCount,
specialFirstInnermostSector,
animation,
} = spec;
const {
emptySizeRatio,
Expand Down Expand Up @@ -511,6 +512,7 @@ export function shapeViewModel(
pickQuads,
outerRadius,
chartDimensions,
animation,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const defaultProps = {
radiusOutside: 128,
fillRectangleWidth: Infinity,
fillRectangleHeight: Infinity,
animation: { duration: 0 },
};

/**
Expand Down Expand Up @@ -128,5 +129,6 @@ export const Partition: React.FunctionComponent<SpecRequiredProps & SpecOptional
| 'radiusOutside'
| 'fillRectangleWidth'
| 'fillRectangleHeight'
| 'animation'
>(defaultProps),
);
2 changes: 2 additions & 0 deletions packages/charts/src/mocks/specs/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class MockSeriesSpec {
fillLabel: {},
},
],
animation: { duration: 0 },
data: [],
};

Expand Down Expand Up @@ -177,6 +178,7 @@ export class MockSeriesSpec {
fillLabel: {},
},
],
animation: { duration: 0 },
data: [],
};

Expand Down

0 comments on commit 5ec6037

Please sign in to comment.