# All files / src/components AggregatePanelClipPath.jsx

83.33% Statements 5/6
100% Branches 0/0
0% Functions 0/1
83.33% Lines 5/6

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42

    1x

    1x

    1x
    1x

    1x
     import React from 'react';
    import PropTypes from 'prop-types';

    import { CLIP_ID as id } from '../constants';

    const propTypes = {
      x: PropTypes.number,
      y: PropTypes.number,
      width: PropTypes.number.isRequired,
      height: PropTypes.number.isRequired,
    };

    const defaultProps = {
      x: 0,
      y: 0,
    };

    export default function AggregatePanelClipPath({
      x,
      y,
      width,
      height,
    }) {
      return (
        <defs>
          <clipPath id={id}>
            <rect
              x={x}
              y={y}
              width={width}
              height={height}
            />
          </clipPath>
        </defs>
      );
    }

    AggregatePanelClipPath.propTypes = propTypes;
    AggregatePanelClipPath.defaultProps = defaultProps;

    export const CLIP_ID = id;