@netdata/charts
Version:
Netdata frontend SDK and chart utilities
14 lines • 1.06 kB
JavaScript
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); }
export var 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];
};
export var 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);
};