Skip to content
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: 3 additions & 4 deletions packages/react-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
"@patternfly/react-tokens": "^4.0.2",
"hoist-non-react-statics": "^3.3.0",
"lodash": "^4.17.15",
"victory": "^33.0.5",
"victory-core": "^33.0.1",
"victory-legend": "^33.0.1"
"victory": "^34.1.3",
"victory-core": "^34.1.3"
},
"peerDependencies": {
"prop-types": "^15.6.1",
Expand All @@ -62,7 +61,7 @@
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@types/lodash": "^4.14.138",
"@types/victory": "^31.0.22",
"@types/victory": "^33.1.4",
"babel-plugin-transform-es2015-modules-umd": "^6.24.1",
"babel-plugin-typescript-to-proptypes": "^0.17.1",
"css": "^2.2.3",
Expand Down
3 changes: 3 additions & 0 deletions packages/react-charts/src/components/Chart/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,10 @@ export const Chart: React.FunctionComponent<ChartProps> = ({
});
};

// Note: containerComponent is required for theme, but @types/victory is missing a prop type
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
<VictoryChart
containerComponent={container}
height={height}
Expand Down
8 changes: 7 additions & 1 deletion packages/react-charts/src/components/ChartArea/ChartArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,13 @@ export const ChartArea: React.FunctionComponent<ChartAreaProps> = ({
theme,
...containerComponent.props
});
return <VictoryArea containerComponent={container} theme={theme} {...rest} />;

// Note: containerComponent is required for theme, but @types/victory is missing a prop type
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
<VictoryArea containerComponent={container} theme={theme} {...rest} />
);
};

// Note: VictoryArea.role must be hoisted
Expand Down
4 changes: 4 additions & 0 deletions packages/react-charts/src/components/ChartAxis/ChartAxis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,11 @@ export const ChartAxis: React.FunctionComponent<ChartAxisProps> = ({
theme,
...containerComponent.props
});

// Note: containerComponent is required for theme, but @types/victory is missing a prop type
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
<VictoryAxis
containerComponent={container}
theme={showGrid ? getAxisTheme(themeColor, themeVariant) : theme}
Expand Down
8 changes: 7 additions & 1 deletion packages/react-charts/src/components/ChartBar/ChartBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,13 @@ export const ChartBar: React.FunctionComponent<ChartBarProps> = ({
theme,
...containerComponent.props
});
return <VictoryBar containerComponent={container} theme={theme} {...rest} />;

// Note: containerComponent is required for theme, but @types/victory is missing a prop type
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
<VictoryBar containerComponent={container} theme={theme} {...rest} />
);
};

// Note: VictoryBar.getDomain & VictoryBar.role must be hoisted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ export const ChartBulletComparativeMeasure: React.FunctionComponent<ChartBulletC
if (horizontal) {
return 0;
}
const result = typeof barWidth === 'function' ? barWidth(data, false) : barWidth;
const result = typeof barWidth === 'function' ? barWidth(data as any) : barWidth;
return result / 2;
},
dy: () => {
if (!horizontal) {
return 0;
}
const result = typeof barWidth === 'function' ? barWidth(data, false) : barWidth;
const result = typeof barWidth === 'function' ? barWidth(data as any) : barWidth;
return -(result / 2);
},
orientation: 'top',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ export const ChartBulletPrimarySegmentedMeasure: React.FunctionComponent<ChartBu
if (horizontal) {
return 0;
}
const result = typeof barWidth === 'function' ? barWidth(data, false) : barWidth;
const result = typeof barWidth === 'function' ? barWidth(data as any) : barWidth;
return result / 2;
},
dy: () => {
if (!horizontal) {
return 0;
}
const result = typeof barWidth === 'function' ? barWidth(data, false) : barWidth;
const result = typeof barWidth === 'function' ? barWidth(data as any) : barWidth;
return -(result / 2);
},
orientation: 'top',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ export const ChartBulletQualitativeRange: React.FunctionComponent<ChartBulletQua
if (horizontal) {
return 0;
}
const result = typeof barWidth === 'function' ? barWidth(data, false) : barWidth;
const result = typeof barWidth === 'function' ? barWidth(data as any) : barWidth;
return result / 2;
},
dy: () => {
if (!horizontal) {
return 0;
}
const result = typeof barWidth === 'function' ? barWidth(data, false) : barWidth;
const result = typeof barWidth === 'function' ? barWidth(data as any) : barWidth;
return -(result / 2);
},
orientation: 'top',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,11 @@ export const ChartGroup: React.FunctionComponent<ChartGroupProps> = ({
...containerComponent.props,
className: getClassName({ className: containerComponent.props.className }) // Override VictoryContainer class name
});

// Note: containerComponent is required for theme, but @types/victory is missing a prop type
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
<VictoryGroup containerComponent={container} theme={theme} {...rest}>
{children}
</VictoryGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,13 @@ export const ChartLegend: React.FunctionComponent<ChartLegendProps> = ({
theme,
...containerComponent.props
});
return <VictoryLegend containerComponent={container} dataComponent={dataComponent} theme={theme} {...rest} />;

// Note: containerComponent is required for theme, but @types/victory is missing a prop type
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
<VictoryLegend containerComponent={container} dataComponent={dataComponent} theme={theme} {...rest} />
);
};

// Note: VictoryLegend.role must be hoisted, but getBaseProps causes error with ChartVoronoiContainer
Expand Down
7 changes: 6 additions & 1 deletion packages/react-charts/src/components/ChartLine/ChartLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,12 @@ export const ChartLine: React.FunctionComponent<ChartLineProps> = ({
theme,
...containerComponent.props
});
return <VictoryLine containerComponent={container} theme={theme} {...rest} />;
// Note: containerComponent is required for theme, but @types/victory is missing a prop type
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
<VictoryLine containerComponent={container} theme={theme} {...rest} />
);
};

// Note: VictoryLine.role must be hoisted
Expand Down
2 changes: 1 addition & 1 deletion packages/react-charts/src/components/ChartPie/ChartPie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ export const ChartPie: React.FunctionComponent<ChartPieProps> = ({
standalone={false}
theme={theme}
width={width}
{...rest}
{...(rest as any)} // @types/victory has a type mismatch with colorScale
/>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,13 @@ export const ChartScatter: React.FunctionComponent<ChartScatterProps> = ({
theme,
...containerComponent.props
});
return <VictoryScatter containerComponent={container} size={size} theme={theme} {...rest} />;

// Note: containerComponent is required for theme, but @types/victory is missing a prop type
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
<VictoryScatter containerComponent={container} size={size} theme={theme} {...rest} />
);
};

// Note: VictoryLine.role must be hoisted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@ export const ChartStack: React.FunctionComponent<ChartStackProps> = ({
...containerComponent.props,
className: getClassName({ className: containerComponent.props.className }) // Override VictoryContainer class name
});

// Note: containerComponent is required for theme, but @types/victory is missing a prop type
return (
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
<VictoryStack containerComponent={container} theme={theme} {...rest}>
{children}
</VictoryStack>
Expand Down
Loading