@netdata/charts
Version:
Netdata frontend SDK and chart utilities
20 lines (19 loc) • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getRowPointValue = exports.getPointValue = void 0;
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
var getPointValue = exports.getPointValue = function getPointValue(cell, point) {
var valueKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "value";
if (cell === null || _typeof(cell) !== "object") return valueKey === "value" ? cell : undefined;
if (Array.isArray(cell)) {
var valueIndex = point === null || point === void 0 ? void 0 : point[valueKey];
return typeof valueIndex === "number" ? cell[valueIndex] : undefined;
}
return cell[valueKey];
};
var getRowPointValue = exports.getRowPointValue = function getRowPointValue(row, index, point) {
var valueKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "value";
return getPointValue(row === null || row === void 0 ? void 0 : row[index], point, valueKey);
};