@antv/g2plot
Version:
G2 Plot, a market of plots built with the Grammar of Graphics'
31 lines • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var g2_1 = require("@antv/g2");
var LinePointLabels = /** @class */ (function (_super) {
tslib_1.__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;
}(g2_1.ElementLabels));
g2_1.registerElementLabels('point', LinePointLabels);
//# sourceMappingURL=point-label.js.map