UNPKG

@gooddata/react-components

Version:

GoodData.UI - A powerful JavaScript library for building analytical applications

23 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // (C) 2007-2018 GoodData Corporation var helpers_1 = require("../../helpers"); var dataLabelsHelpers_1 = require("../../dataLabelsHelpers"); function autohideLabelsOverlappingItsShape(chart, hideFunction, showFunction) { if (hideFunction === void 0) { hideFunction = dataLabelsHelpers_1.hideDataLabel; } if (showFunction === void 0) { showFunction = dataLabelsHelpers_1.showDataLabel; } var visibleSeries = helpers_1.getVisibleSeries(chart); var visiblePoints = helpers_1.getDataPoints(visibleSeries); visiblePoints.forEach(function (point) { if (point) { if (dataLabelsHelpers_1.isLabelOverlappingItsShape(point) || dataLabelsHelpers_1.intersectsParentLabel(point, visiblePoints)) { hideFunction(point); } else { showFunction(point); } } }); } exports.default = autohideLabelsOverlappingItsShape; //# sourceMappingURL=autohideLabelsOverlappingItsShape.js.map