import { Size } from '@devexpress/dx-react-core' ; import { ARGUMENT_DOMAIN , VALUE_DOMAIN , } from '../../constants' ; import { BBoxes , BBoxesChange , RangesCache , NumberArray , } from '../../types' ; const isEqual = ( { width : firstWidth , height : firstHeight } , { width : secondWidth , height : secondHeight } ) => firstWidth === secondWidth && firstHeight === secondHeight ; internal export const bBoxes = ( prevBBoxes , { bBox , placeholder } ) => { if ( isEqual ( prevBBoxes [ placeholder ] || { } , bBox ) ) return prevBBoxes ; return { ... prevBBoxes , [ placeholder ] : bBox } ; } ; internal export const getRanges = ( paneSize , rotated ) : RangesCache => { const horRange = [ 0 , paneSize . width ] ; const verRange = [ paneSize . height , 0 ] ; return { [ ARGUMENT_DOMAIN ] : rotated ? verRange : horRange , [ VALUE_DOMAIN ] : rotated ? horRange : verRange , } ; } ;