UNPKG

@antv/g2plot

Version:

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

24 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var g2_1 = require("@antv/g2"); var column_label_1 = require("../../../column/component/label/column-label"); var StackColumnLabels = /** @class */ (function (_super) { tslib_1.__extends(StackColumnLabels, _super); function StackColumnLabels() { return _super !== null && _super.apply(this, arguments) || this; } StackColumnLabels.prototype.adjustPosition = function (label, shape) { var labelRange = label.getBBox(); var shapeRange = shape.getBBox(); if (shapeRange.height <= labelRange.height) { label.attr('opacity', 0); label.attr('fillOpacity', 0); label.attr('strokeOpacity', 0); label.set('capture', false); } }; return StackColumnLabels; }(column_label_1.ColumnLabels)); g2_1.registerElementLabels('stackColumnLabel', StackColumnLabels); //# sourceMappingURL=stack-column-label.js.map