@splunk/visualization-encoding-parsers
Advanced tools
Comparing version
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 16); | ||
/******/ return __webpack_require__(__webpack_require__.s = 17); | ||
/******/ }) | ||
@@ -110,3 +110,3 @@ /************************************************************************/ | ||
/***/ 16: | ||
/***/ 17: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -113,0 +113,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 17); | ||
/******/ return __webpack_require__(__webpack_require__.s = 18); | ||
/******/ }) | ||
@@ -110,3 +110,3 @@ /************************************************************************/ | ||
/***/ 17: | ||
/***/ 18: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -113,0 +113,0 @@ |
68
Base.js
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 33); | ||
/******/ return __webpack_require__(__webpack_require__.s = 34); | ||
/******/ }) | ||
@@ -119,3 +119,3 @@ /************************************************************************/ | ||
module.exports = require("chroma-js"); | ||
module.exports = require("@babel/runtime/helpers/objectSpread"); | ||
@@ -126,3 +126,3 @@ /***/ }), | ||
module.exports = require("@babel/runtime/helpers/objectSpread"); | ||
module.exports = require("chroma-js"); | ||
@@ -164,6 +164,11 @@ /***/ }), | ||
module.exports = require("@splunk/visualizations-shared/console"); | ||
/***/ }), | ||
/* 15 */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("lodash/isFinite"); | ||
/***/ }), | ||
/* 15 */, | ||
/* 16 */, | ||
@@ -186,3 +191,4 @@ /* 17 */, | ||
/* 32 */, | ||
/* 33 */ | ||
/* 33 */, | ||
/* 34 */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -198,3 +204,3 @@ | ||
// EXTERNAL MODULE: external "@babel/runtime/helpers/objectSpread" | ||
var objectSpread_ = __webpack_require__(7); | ||
var objectSpread_ = __webpack_require__(6); | ||
var objectSpread_default = /*#__PURE__*/__webpack_require__.n(objectSpread_); | ||
@@ -223,3 +229,3 @@ | ||
// EXTERNAL MODULE: external "chroma-js" | ||
var external_chroma_js_ = __webpack_require__(6); | ||
var external_chroma_js_ = __webpack_require__(7); | ||
var external_chroma_js_default = /*#__PURE__*/__webpack_require__.n(external_chroma_js_); | ||
@@ -235,2 +241,5 @@ | ||
// EXTERNAL MODULE: external "@splunk/visualizations-shared/console" | ||
var console_ = __webpack_require__(14); | ||
// CONCATENATED MODULE: ./src/util/format.js | ||
@@ -240,2 +249,3 @@ | ||
var format_hasOwnProperty = Object.prototype.hasOwnProperty; | ||
@@ -350,6 +360,9 @@ var rangeFormat = function rangeFormat(value) { | ||
}; | ||
var NON_NUMERIC_RANGE_ERROR = 'Could not format value: Ranges are required to be numbers. Falling back to first color'; | ||
var VALUES_AND_RANGES_HAVE_DIFFERENT_LENGTH = 'gradient ranges and values must have the same number of elements'; | ||
var INVALID_VALUE = 'Could not format value for gradient:'; | ||
/** | ||
* based on ranges and values this formatter maps the value to an interpolated color | ||
* | ||
* @param {string} value from data | ||
* @param {string} value from data (string representation of number) | ||
* @param {object} formatConfig | ||
@@ -359,5 +372,6 @@ * @param {number[]} formatConfig.ranges value ranges | ||
* @param {string[]} data the data to be formatted | ||
* @param errorHandler function | ||
*/ | ||
var format_colorGradientFormat = function colorGradientFormat(value, _ref5, data) { | ||
var format_colorGradientFormat = function colorGradientFormat(value, _ref5, data, errorHandler) { | ||
var ranges = _ref5.ranges, | ||
@@ -368,2 +382,6 @@ values = _ref5.values; | ||
function errorColor() { | ||
return colorValues ? external_chroma_js_default()(colorValues[0]).hex().toUpperCase() : '#000'; | ||
} | ||
if (!isNaN(value)) { | ||
@@ -405,3 +423,4 @@ // set default values for gradient colors if values not explicit | ||
if (colorRanges.length !== colorValues.length) { | ||
throw new Error('gradient ranges and values must have the same number of elements'); | ||
errorHandler(VALUES_AND_RANGES_HAVE_DIFFERENT_LENGTH); | ||
return errorColor(); | ||
} | ||
@@ -424,4 +443,4 @@ | ||
// eslint-disable-next-line | ||
console.warn('Could not format value: Ranges are required to be numbers. Falling back to first color'); | ||
return external_chroma_js_default()(colorValues[0]).hex().toUpperCase() || '#000'; | ||
errorHandler(NON_NUMERIC_RANGE_ERROR); | ||
return errorColor(); | ||
} | ||
@@ -453,4 +472,4 @@ | ||
console.warn("Could not format value for gradient: ".concat(value)); | ||
return external_chroma_js_default()(colorValues[0]).hex().toUpperCase() || '#000'; | ||
errorHandler("".concat(INVALID_VALUE, " ").concat(value)); | ||
return errorColor(); | ||
}; | ||
@@ -462,2 +481,13 @@ var formatters = { | ||
}; | ||
var MAX_LOGGED_FORMATTER_ERRORS = 10; | ||
var newFormatterErrorHandler = function newFormatterErrorHandler(maxErrors, handlerFunc) { | ||
var errorCount = 0; | ||
return function (msg) { | ||
if (errorCount < maxErrors) { | ||
handlerFunc(msg); | ||
} | ||
errorCount += 1; | ||
}; | ||
}; | ||
/** | ||
@@ -472,3 +502,3 @@ * returns a formatter function based on a format config | ||
var getFormatter = function getFormatter(data) { | ||
var format_getFormatter = function getFormatter(data) { | ||
var formatCfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
@@ -482,3 +512,5 @@ | ||
return function (value) { | ||
return formatters[formatCfg.type](value, formatCfg, data); | ||
return formatters[formatCfg.type](value, formatCfg, data, newFormatterErrorHandler(MAX_LOGGED_FORMATTER_ERRORS, function (msg) { | ||
return console_["console"].warn(msg); | ||
})); | ||
}; | ||
@@ -520,3 +552,3 @@ } | ||
// EXTERNAL MODULE: external "lodash/isFinite" | ||
var isFinite_ = __webpack_require__(14); | ||
var isFinite_ = __webpack_require__(15); | ||
var isFinite_default = /*#__PURE__*/__webpack_require__.n(isFinite_); | ||
@@ -853,3 +885,3 @@ | ||
if (format) { | ||
formatValue = getFormatter(fieldData.data, format); | ||
formatValue = format_getFormatter(fieldData.data, format); | ||
} | ||
@@ -856,0 +888,0 @@ } |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 18); | ||
/******/ return __webpack_require__(__webpack_require__.s = 19); | ||
/******/ }) | ||
@@ -110,3 +110,3 @@ /************************************************************************/ | ||
/***/ 18: | ||
/***/ 19: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -113,0 +113,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 19); | ||
/******/ return __webpack_require__(__webpack_require__.s = 20); | ||
/******/ }) | ||
@@ -103,3 +103,3 @@ /************************************************************************/ | ||
/***/ 19: | ||
/***/ 20: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -106,0 +106,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 20); | ||
/******/ return __webpack_require__(__webpack_require__.s = 21); | ||
/******/ }) | ||
@@ -127,3 +127,3 @@ /************************************************************************/ | ||
/***/ 20: | ||
/***/ 21: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -130,0 +130,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 21); | ||
/******/ return __webpack_require__(__webpack_require__.s = 22); | ||
/******/ }) | ||
@@ -127,3 +127,3 @@ /************************************************************************/ | ||
/***/ 21: | ||
/***/ 22: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -130,0 +130,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 22); | ||
/******/ return __webpack_require__(__webpack_require__.s = 23); | ||
/******/ }) | ||
@@ -127,3 +127,3 @@ /************************************************************************/ | ||
/***/ 22: | ||
/***/ 23: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -130,0 +130,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 23); | ||
/******/ return __webpack_require__(__webpack_require__.s = 24); | ||
/******/ }) | ||
@@ -127,3 +127,3 @@ /************************************************************************/ | ||
/***/ 23: | ||
/***/ 24: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -130,0 +130,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"author": "Splunk", | ||
"version": "18.0.0", | ||
"version": "18.1.0", | ||
"scripts": { | ||
@@ -31,3 +31,3 @@ "build": "NODE_ENV=production webpack --config ./webpack.config.js --bail", | ||
"@splunk/react-docs": "^0.7.0", | ||
"@splunk/visualization-build-tools": "^18.0.0", | ||
"@splunk/visualization-build-tools": "^18.1.0", | ||
"@splunk/webpack-configs": "^4.0.0", | ||
@@ -34,0 +34,0 @@ "babel-jest": "^25.1.0", |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 24); | ||
/******/ return __webpack_require__(__webpack_require__.s = 25); | ||
/******/ }) | ||
@@ -127,3 +127,3 @@ /************************************************************************/ | ||
/***/ 24: | ||
/***/ 25: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -130,0 +130,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 25); | ||
/******/ return __webpack_require__(__webpack_require__.s = 26); | ||
/******/ }) | ||
@@ -127,3 +127,3 @@ /************************************************************************/ | ||
/***/ 25: | ||
/***/ 26: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -130,0 +130,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 26); | ||
/******/ return __webpack_require__(__webpack_require__.s = 27); | ||
/******/ }) | ||
@@ -127,3 +127,3 @@ /************************************************************************/ | ||
/***/ 26: | ||
/***/ 27: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -130,0 +130,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 27); | ||
/******/ return __webpack_require__(__webpack_require__.s = 28); | ||
/******/ }) | ||
@@ -127,3 +127,3 @@ /************************************************************************/ | ||
/***/ 27: | ||
/***/ 28: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -130,0 +130,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 28); | ||
/******/ return __webpack_require__(__webpack_require__.s = 29); | ||
/******/ }) | ||
@@ -127,3 +127,3 @@ /************************************************************************/ | ||
/***/ 28: | ||
/***/ 29: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -130,0 +130,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 29); | ||
/******/ return __webpack_require__(__webpack_require__.s = 30); | ||
/******/ }) | ||
@@ -127,3 +127,10 @@ /************************************************************************/ | ||
/***/ 29: | ||
/***/ 3: | ||
/***/ (function(module, exports) { | ||
module.exports = require("lodash/isEmpty"); | ||
/***/ }), | ||
/***/ 30: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -247,9 +254,2 @@ | ||
/***/ }), | ||
/***/ 3: | ||
/***/ (function(module, exports) { | ||
module.exports = require("lodash/isEmpty"); | ||
/***/ }) | ||
@@ -256,0 +256,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 30); | ||
/******/ return __webpack_require__(__webpack_require__.s = 31); | ||
/******/ }) | ||
@@ -134,3 +134,3 @@ /************************************************************************/ | ||
/***/ 30: | ||
/***/ 31: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -137,0 +137,0 @@ |
@@ -90,3 +90,3 @@ /*! | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 31); | ||
/******/ return __webpack_require__(__webpack_require__.s = 32); | ||
/******/ }) | ||
@@ -110,3 +110,3 @@ /************************************************************************/ | ||
/***/ 15: | ||
/***/ 16: | ||
/***/ (function(module, exports) { | ||
@@ -142,3 +142,3 @@ | ||
/***/ 31: | ||
/***/ 32: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -154,3 +154,3 @@ | ||
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1__); | ||
/* harmony import */ var lodash_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); | ||
/* harmony import */ var lodash_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); | ||
/* harmony import */ var lodash_isArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isArray__WEBPACK_IMPORTED_MODULE_2__); | ||
@@ -157,0 +157,0 @@ /* harmony import */ var _errorMsgs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
382136
0.7%4100
0.64%