11import defaults from 'lodash/defaults' ;
2- import { Helpers , PaddingProps , TextSize } from 'victory-core' ;
2+ import { Helpers , TextSize } from 'victory-core' ;
33import { VictoryLegend } from 'victory-legend' ;
44import { ChartLegendProps } from '../ChartLegend/ChartLegend' ;
55import { ChartCommonStyles } from '../ChartTheme/ChartStyles' ;
66import { ChartThemeDefinition } from '../ChartTheme/ChartTheme' ;
77import { getLabelTextSize } from '../ChartUtils/chart-label' ;
88import { getPieOrigin } from './chart-origin' ;
99import * as React from 'react' ;
10+ import { ElementPadding } from 'victory-core/src/victory-util/helpers' ;
1011
1112interface ChartLegendInterface {
1213 allowWrap ?: boolean ; // Allow legend items to wrap to the next line
@@ -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 ) )
0 commit comments