UNPKG

@qn-pandora/pandora-visualization

Version:

Pandora 通用可视化库

44 lines (43 loc) 1.7 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import * as React from 'react'; import { LineChart } from '../core/LineChartCore'; import * as style from './style.mless'; var LineChartCom = /** @class */ (function (_super) { __extends(LineChartCom, _super); function LineChartCom() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.ref = null; _this.lineChart = null; _this.setRef = function (ref) { _this.ref = ref; }; return _this; } LineChartCom.prototype.render = function () { return React.createElement("div", { className: style.tooltipLine, ref: this.setRef }); }; LineChartCom.prototype.componentDidMount = function () { if (this.ref) { this.lineChart = new LineChart(this.ref); this.lineChart.render(this.props.data); } }; LineChartCom.prototype.componentWillUnmount = function () { var _a; (_a = this.lineChart) === null || _a === void 0 ? void 0 : _a.dispose(); }; return LineChartCom; }(React.Component)); export { LineChartCom };