Skip to content

Commit

Permalink
fix(charts): fix Victory 37.3.4 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq committed Dec 18, 2024
1 parent e161ac6 commit dc6a83d
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 235 deletions.
30 changes: 15 additions & 15 deletions packages/react-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@
"peerDependencies": {
"react": "^17 || ^18",
"react-dom": "^17 || ^18",
"victory-area": "^37.3.3",
"victory-axis": "^37.3.2",
"victory-bar": "^37.3.2",
"victory-box-plot": "^37.3.2",
"victory-area": "^37.3.4",
"victory-axis": "^37.3.4",
"victory-bar": "^37.3.4",
"victory-box-plot": "^37.3.4",
"victory-chart": "^37.3.3",
"victory-core": "^37.3.2",
"victory-core": "^37.3.4",
"victory-create-container": "^37.3.4",
"victory-cursor-container": "^37.3.2",
"victory-group": "^37.3.2",
"victory-legend": "^37.3.2",
"victory-line": "^37.3.2",
"victory-pie": "^37.3.2",
"victory-scatter": "^37.3.2",
"victory-stack": "^37.3.2",
"victory-tooltip": "^37.3.2",
"victory-voronoi-container": "^37.3.2",
"victory-zoom-container": "^37.3.2"
"victory-cursor-container": "^37.3.4",
"victory-group": "^37.3.4",
"victory-legend": "^37.3.4",
"victory-line": "^37.3.4",
"victory-pie": "^37.3.4",
"victory-scatter": "^37.3.4",
"victory-stack": "^37.3.4",
"victory-tooltip": "^37.3.4",
"victory-voronoi-container": "^37.3.4",
"victory-zoom-container": "^37.3.4"
},
"peerDependenciesMeta": {
"victory-area": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,4 +482,4 @@ export const ChartBar: React.FunctionComponent<ChartBarProps> = ({
ChartBar.displayName = 'ChartBar';

// Note: VictoryBar.getDomain & VictoryBar.role must be hoisted
hoistNonReactStatics(ChartBar, VictoryBar);
hoistNonReactStatics(ChartBar, VictoryBar, { getBaseProps: true });
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import defaults from 'lodash/defaults';
import { Helpers, PaddingProps, TextSize } from 'victory-core';
import { Helpers, TextSize } from 'victory-core';
import { ElementPadding } from 'victory-core/src/victory-util/helpers';
import { VictoryLegend } from 'victory-legend';
import { ChartLegendProps } from '../ChartLegend/ChartLegend';
import { ChartCommonStyles } from '../ChartTheme/ChartStyles';
Expand All @@ -17,7 +18,7 @@ interface ChartLegendInterface {
height: number; // Overall height of SVG
legendComponent: React.ReactElement<any>; // The base legend component to render
orientation?: 'horizontal' | 'vertical'; // Orientation of legend
padding: PaddingProps; // Chart padding
padding: ElementPadding; // Chart padding
patternScale?: string[]; // Legend symbol patterns
position: 'bottom' | 'bottom-left' | 'right'; // The legend position
theme: ChartThemeDefinition; // The theme that will be applied to the chart
Expand All @@ -41,7 +42,7 @@ interface ChartLegendPositionInterface {
legendOrientation: 'horizontal' | 'vertical'; // Orientation of legend
legendPosition: 'bottom' | 'bottom-left' | 'right'; // Position of legend
legendProps: any; // The legend props used to determine width
padding?: PaddingProps; // Chart padding
padding?: ElementPadding; // Chart padding
theme: ChartThemeDefinition; // The theme that will be applied to the chart
width?: number; // Overall width of SVG
}
Expand Down Expand Up @@ -187,7 +188,7 @@ const doesLegendFit = ({
theme,
width
}: ChartLegendPositionInterface) => {
const { left, right } = Helpers.getPadding({ padding });
const { left, right } = Helpers.getPadding(padding);
const chartSize = {
height, // Fixed size
width: width - left - right
Expand Down Expand Up @@ -322,7 +323,7 @@ const getBulletLegendY = ({
theme,
width
}: ChartLegendPositionInterface) => {
const { left, right } = Helpers.getPadding({ padding });
const { left, right } = Helpers.getPadding(padding);
const chartSize = {
height, // Fixed size
width: width - left - right
Expand Down Expand Up @@ -363,7 +364,7 @@ const getChartLegendX = ({
theme,
width
}: ChartLegendPositionInterface) => {
const { top, bottom, left, right } = Helpers.getPadding({ padding });
const { top, bottom, left, right } = Helpers.getPadding(padding);
const chartSize = {
height: Math.abs(height - (bottom + top)),
width: Math.abs(width - (left + right))
Expand Down Expand Up @@ -402,7 +403,7 @@ const getChartLegendY = ({
theme,
width
}: ChartLegendPositionInterface) => {
const { top, bottom, left, right } = Helpers.getPadding({ padding });
const { top, bottom, left, right } = Helpers.getPadding(padding);
const chartSize = {
height: Math.abs(height - (bottom + top)),
width: Math.abs(width - (left + right))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface ChartPieOriginInterface {
* @private
*/
export const getPieOrigin = ({ height, padding, width }: ChartPieOriginInterface) => {
const { top, bottom, left, right } = Helpers.getPadding({ padding });
const { top, bottom, left, right } = Helpers.getPadding(padding);
const radius = Helpers.getRadius({ height, width, padding });
const offsetX = (width - radius * 2 - left - right) / 2;
const offsetY = (height - radius * 2 - top - bottom) / 2;
Expand Down
3 changes: 2 additions & 1 deletion packages/react-charts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist/esm",
"tsBuildInfoFile": "dist/esm.tsbuildinfo"
"tsBuildInfoFile": "dist/esm.tsbuildinfo",
"noImplicitAny": false,
},
"include": [
"./src/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@patternfly/react-table": "workspace:^",
"@patternfly/react-templates": "workspace:^",
"@patternfly/react-tokens": "workspace:^",
"victory": "^37.3.2"
"victory": "^37.3.4"
},
"devDependencies": {
"@patternfly/documentation-framework": "^6.0.15",
Expand Down
Loading

0 comments on commit dc6a83d

Please sign in to comment.