index.js 806 Bytes
Newer Older
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
import React, { Component } from 'react';
import { Tooltip } from 'antd';

import styles from './index.less';

/* eslint no-return-assign: 0 */
class MapChart extends Component {
  getRect() {
    // 0.4657 = 708 / 1520 (img origin size)
    const width = this.root.offsetWidth;
    const height = width * 0.4657;
    return {
      width,
      height,
    };
  }

  render() {
    return (
      <div className={styles.mapChart} ref={n => (this.root = n)}>
        <Tooltip title="等待实现">
          <div className={styles.canvas} ref={n => (this.root = n)}>
            <img src="https://gw.alipayobjects.com/zos/rmsportal/fBcAYoxWIjlUXwDjqvzg.png" alt="map" />
            <div ref={n => (this.node = n)} />
          </div>
        </Tooltip>
      </div>
    );
  }
}

export default MapChart;