From 50c3ebca4e21d01162c3a70e6811a856e5135054 Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 17 Jun 2024 13:24:11 +0200 Subject: [PATCH 1/2] Remove proptypes from internal component --- .../src/BarChart/BarLabel/BarLabelPlot.tsx | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/packages/x-charts/src/BarChart/BarLabel/BarLabelPlot.tsx b/packages/x-charts/src/BarChart/BarLabel/BarLabelPlot.tsx index 2b14549f2eb5..c11af816ae04 100644 --- a/packages/x-charts/src/BarChart/BarLabel/BarLabelPlot.tsx +++ b/packages/x-charts/src/BarChart/BarLabel/BarLabelPlot.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import PropTypes from 'prop-types'; import { useTransition } from '@react-spring/web'; import type { AnimationData, CompletedBarData } from '../types'; import { BarLabelItem, BarLabelItemProps } from './BarLabelItem'; @@ -66,29 +65,4 @@ function BarLabelPlot(props: BarLabelPlotProps) { ); } -BarLabelPlot.propTypes = { - // ----------------------------- Warning -------------------------------- - // | These PropTypes are generated from the TypeScript type definitions | - // | To update them edit the TypeScript types and run "pnpm proptypes" | - // ---------------------------------------------------------------------- - barLabel: PropTypes.oneOfType([PropTypes.oneOf(['value']), PropTypes.func]), - bars: PropTypes.arrayOf( - PropTypes.shape({ - color: PropTypes.string.isRequired, - dataIndex: PropTypes.number.isRequired, - height: PropTypes.number.isRequired, - layout: PropTypes.oneOf(['horizontal', 'vertical']), - maskId: PropTypes.string.isRequired, - seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired, - value: PropTypes.number, - width: PropTypes.number.isRequired, - x: PropTypes.number.isRequired, - xOrigin: PropTypes.number.isRequired, - y: PropTypes.number.isRequired, - yOrigin: PropTypes.number.isRequired, - }), - ).isRequired, - skipAnimation: PropTypes.bool, -} as any; - export { BarLabelPlot }; From 5c098d864dc30476ad87251d416049cdb7e10abe Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Mon, 17 Jun 2024 14:04:57 +0200 Subject: [PATCH 2/2] Make xOrigin and yOrigin --- packages/x-charts/src/BarChart/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/x-charts/src/BarChart/types.ts b/packages/x-charts/src/BarChart/types.ts index 77fcc1e62688..9631160bc1e9 100644 --- a/packages/x-charts/src/BarChart/types.ts +++ b/packages/x-charts/src/BarChart/types.ts @@ -6,8 +6,8 @@ export type AnimationData = { y: number; width: number; height: number; - yOrigin: number; - xOrigin: number; + yOrigin?: number; + xOrigin?: number; layout: BarSeriesType['layout']; };