UNPKG

@antv/g2plot

Version:

G2 Plot, a market of plots built with the Grammar of Graphics'

29 lines 1.13 kB
import { __extends } from "tslib"; import { ElementLabels, registerElementLabels } from '@antv/g2'; var LinePointLabels = /** @class */ (function (_super) { __extends(LinePointLabels, _super); function LinePointLabels() { return _super !== null && _super.apply(this, arguments) || this; } LinePointLabels.prototype.showLabels = function (points, shapes) { _super.prototype.showLabels.call(this, points, shapes); var renderer = this.get('labelsRenderer'); var labels = renderer.get('group').get('children'); var view = this.get('element').get('view'); var anchorsBBox = renderer.get('items').map(function (item) { return { x: item.start.x - 4, y: item.start.y - 4, width: 8, height: 8, }; }); /*layout(labels, anchorsBBox, view.get('panelRange'), { nsweeps: 10, });*/ view.get('canvas').draw(); }; return LinePointLabels; }(ElementLabels)); registerElementLabels('point', LinePointLabels); //# sourceMappingURL=point-label.js.map