Skip to content

Commit 9c88a1c

Browse files
authored
fix(charts): fix Victory 37.3.4 issues (#11356)
1 parent 6768c65 commit 9c88a1c

File tree

7 files changed

+237
-235
lines changed

7 files changed

+237
-235
lines changed

packages/react-charts/package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,23 @@
4545
"peerDependencies": {
4646
"react": "^17 || ^18",
4747
"react-dom": "^17 || ^18",
48-
"victory-area": "^37.3.3",
49-
"victory-axis": "^37.3.2",
50-
"victory-bar": "^37.3.2",
51-
"victory-box-plot": "^37.3.2",
48+
"victory-area": "^37.3.4",
49+
"victory-axis": "^37.3.4",
50+
"victory-bar": "^37.3.4",
51+
"victory-box-plot": "^37.3.4",
5252
"victory-chart": "^37.3.3",
53-
"victory-core": "^37.3.2",
53+
"victory-core": "^37.3.4",
5454
"victory-create-container": "^37.3.4",
55-
"victory-cursor-container": "^37.3.2",
56-
"victory-group": "^37.3.2",
57-
"victory-legend": "^37.3.2",
58-
"victory-line": "^37.3.2",
59-
"victory-pie": "^37.3.2",
60-
"victory-scatter": "^37.3.2",
61-
"victory-stack": "^37.3.2",
62-
"victory-tooltip": "^37.3.2",
63-
"victory-voronoi-container": "^37.3.2",
64-
"victory-zoom-container": "^37.3.2"
55+
"victory-cursor-container": "^37.3.4",
56+
"victory-group": "^37.3.4",
57+
"victory-legend": "^37.3.4",
58+
"victory-line": "^37.3.4",
59+
"victory-pie": "^37.3.4",
60+
"victory-scatter": "^37.3.4",
61+
"victory-stack": "^37.3.4",
62+
"victory-tooltip": "^37.3.4",
63+
"victory-voronoi-container": "^37.3.4",
64+
"victory-zoom-container": "^37.3.4"
6565
},
6666
"peerDependenciesMeta": {
6767
"victory-area": {

packages/react-charts/src/victory/components/ChartBar/ChartBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,4 +482,4 @@ export const ChartBar: React.FunctionComponent<ChartBarProps> = ({
482482
ChartBar.displayName = 'ChartBar';
483483

484484
// Note: VictoryBar.getDomain & VictoryBar.role must be hoisted
485-
hoistNonReactStatics(ChartBar, VictoryBar);
485+
hoistNonReactStatics(ChartBar, VictoryBar, { getBaseProps: true });

packages/react-charts/src/victory/components/ChartUtils/chart-legend.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import defaults from 'lodash/defaults';
2-
import { Helpers, PaddingProps, TextSize } from 'victory-core';
2+
import { Helpers, TextSize } from 'victory-core';
3+
import { ElementPadding } from 'victory-core/src/victory-util/helpers';
34
import { VictoryLegend } from 'victory-legend';
45
import { ChartLegendProps } from '../ChartLegend/ChartLegend';
56
import { ChartCommonStyles } from '../ChartTheme/ChartStyles';
@@ -17,7 +18,7 @@ interface ChartLegendInterface {
1718
height: number; // Overall height of SVG
1819
legendComponent: React.ReactElement<any>; // The base legend component to render
1920
orientation?: 'horizontal' | 'vertical'; // Orientation of legend
20-
padding: PaddingProps; // Chart padding
21+
padding: ElementPadding; // Chart padding
2122
patternScale?: string[]; // Legend symbol patterns
2223
position: 'bottom' | 'bottom-left' | 'right'; // The legend position
2324
theme: ChartThemeDefinition; // The theme that will be applied to the chart
@@ -41,7 +42,7 @@ interface ChartLegendPositionInterface {
4142
legendOrientation: 'horizontal' | 'vertical'; // Orientation of legend
4243
legendPosition: 'bottom' | 'bottom-left' | 'right'; // Position of legend
4344
legendProps: any; // The legend props used to determine width
44-
padding?: PaddingProps; // Chart padding
45+
padding?: ElementPadding; // Chart padding
4546
theme: ChartThemeDefinition; // The theme that will be applied to the chart
4647
width?: number; // Overall width of SVG
4748
}
@@ -187,7 +188,7 @@ const doesLegendFit = ({
187188
theme,
188189
width
189190
}: ChartLegendPositionInterface) => {
190-
const { left, right } = Helpers.getPadding({ padding });
191+
const { left, right } = Helpers.getPadding(padding);
191192
const chartSize = {
192193
height, // Fixed size
193194
width: width - left - right
@@ -322,7 +323,7 @@ const getBulletLegendY = ({
322323
theme,
323324
width
324325
}: ChartLegendPositionInterface) => {
325-
const { left, right } = Helpers.getPadding({ padding });
326+
const { left, right } = Helpers.getPadding(padding);
326327
const chartSize = {
327328
height, // Fixed size
328329
width: width - left - right
@@ -363,7 +364,7 @@ const getChartLegendX = ({
363364
theme,
364365
width
365366
}: ChartLegendPositionInterface) => {
366-
const { top, bottom, left, right } = Helpers.getPadding({ padding });
367+
const { top, bottom, left, right } = Helpers.getPadding(padding);
367368
const chartSize = {
368369
height: Math.abs(height - (bottom + top)),
369370
width: Math.abs(width - (left + right))
@@ -402,7 +403,7 @@ const getChartLegendY = ({
402403
theme,
403404
width
404405
}: ChartLegendPositionInterface) => {
405-
const { top, bottom, left, right } = Helpers.getPadding({ padding });
406+
const { top, bottom, left, right } = Helpers.getPadding(padding);
406407
const chartSize = {
407408
height: Math.abs(height - (bottom + top)),
408409
width: Math.abs(width - (left + right))

packages/react-charts/src/victory/components/ChartUtils/chart-origin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface ChartPieOriginInterface {
1212
* @private
1313
*/
1414
export const getPieOrigin = ({ height, padding, width }: ChartPieOriginInterface) => {
15-
const { top, bottom, left, right } = Helpers.getPadding({ padding });
15+
const { top, bottom, left, right } = Helpers.getPadding(padding);
1616
const radius = Helpers.getRadius({ height, width, padding });
1717
const offsetX = (width - radius * 2 - left - right) / 2;
1818
const offsetY = (height - radius * 2 - top - bottom) / 2;

packages/react-charts/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"compilerOptions": {
44
"rootDir": "./src",
55
"outDir": "./dist/esm",
6-
"tsBuildInfoFile": "dist/esm.tsbuildinfo"
6+
"tsBuildInfoFile": "dist/esm.tsbuildinfo",
7+
"noImplicitAny": false,
78
},
89
"include": [
910
"./src/*",

packages/react-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@patternfly/react-table": "workspace:^",
3434
"@patternfly/react-templates": "workspace:^",
3535
"@patternfly/react-tokens": "workspace:^",
36-
"victory": "^37.3.2"
36+
"victory": "^37.3.4"
3737
},
3838
"devDependencies": {
3939
"@patternfly/documentation-framework": "^6.0.15",

0 commit comments

Comments
 (0)