# All files / src propShapes.js

100% Statements 8/8
100% Branches 0/0
100% Functions 0/0
100% Lines 8/8

    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
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61

    6x

    6x

    6x

    6x

    6x

    6x

    6x

    6x

     import PropTypes from 'prop-types';

    import {
      TS,
      EVENT_NAME,
      ENTITY_ID,
      META,

      ELAPSED_TIME_SCALE,
      EVENT_COUNT_SCALE,
      EVENT_SEQUENCE_SCALE,
      NODE_SEQUENCE_SCALE,
    } from './constants';

    export const datumShape = PropTypes.shape({
      [TS]: PropTypes.instanceOf(Date).isRequired,
      [EVENT_NAME]: PropTypes.string.isRequired,
      [ENTITY_ID]: PropTypes.string.isRequired,
      [META]: PropTypes.object,
    });

    export const dataShape = PropTypes.arrayOf(datumShape);

    export const nodeShape = PropTypes.shape({
      id: PropTypes.string.isRequired,
      depth: PropTypes.number.isRequired,
      parent: PropTypes.object,
      children: PropTypes.object.isRequired,
      events: PropTypes.object.isRequired,
    });

    export const graphShape = PropTypes.shape({
      nodes: PropTypes.objectOf(nodeShape).isRequired,
      root: nodeShape.isRequired,
      filtered: PropTypes.number.isRequired,
      entityEvents: PropTypes.objectOf(PropTypes.array).isRequired,
    });

    export const linkShape = PropTypes.shape({
      source: nodeShape.isRequired,
      target: nodeShape.isRequired,
    });

    export const scaleShape = PropTypes.shape({
      scale: PropTypes.func.isRequired,
      label: PropTypes.string.isRequired,
      accessor: PropTypes.func.isRequired,
      isTimeScale: PropTypes.bool,
      format: PropTypes.func,
    });

    export const xScaleTypeShape = PropTypes.oneOf([
      ELAPSED_TIME_SCALE,
      EVENT_SEQUENCE_SCALE,
    ]);

    export const yScaleTypeShape = PropTypes.oneOf([
      EVENT_COUNT_SCALE,
      NODE_SEQUENCE_SCALE,
    ]);