@qn-pandora/pandora-visualization
Version:
Pandora 通用可视化库
66 lines (65 loc) • 2.72 kB
JavaScript
;
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 __());
};
})();
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LineChartCom = void 0;
var React = __importStar(require("react"));
var LineChartCore_1 = require("../core/LineChartCore");
var style = __importStar(require("./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 LineChartCore_1.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));
exports.LineChartCom = LineChartCom;