render()

in src/components/ZoomableSVGGroup.js [331:371]


  render() {
    const {
      width,
      height,
      children,
      disabled,
      style = {},
      transform = '',
      // omit these from the passthrough
      /* eslint-disable no-unused-vars */
      canvasHeight, canvasWidth, minScale,
      maxScale, panLimit, onZoom, onPan, zoomSpeed,
      /* esline-enable no-unused-vars */
      ...passthrough
    } = this.props;
    const { matrix, scale } = this.state;

    const eventHandler = eventName => (...args) => {
      this[eventName](...args);
      this.props[eventName](...args);
    };

    const zoomProps = { transform };

    if (!disabled && ZoomableSVGGroup.isValidMatrix(matrix)) {
      Object.assign(zoomProps, {
        ...ZOOMABLE_SVG_GROUP_EVENT_NAMES.reduce((obj, eventName) => ({
          ...obj,
          [eventName]: eventHandler(eventName),
        }), {}),
        style: Object.assign({}, style, {
          transformOrigin: '0 0 0',
          cursor: 'default',
          pointerEvents: 'all',
        }),
        transform: `matrix(${matrix.join(' ')}) ${transform}`,
      });
    }

    return (
      <g ref={/* istanbul ignore next */(c) => { this.el = c; }} {...passthrough} {...zoomProps}>