@splunk/visualization-encoding-parsers 25.3.3 → 25.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AreaParser.js +2 -2
- package/AreaParser.js.map +1 -1
- package/BarParser.js +2 -2
- package/BarParser.js.map +1 -1
- package/Base.js +9 -18
- package/Base.js.map +1 -1
- package/BubbleParser.js +2 -2
- package/BubbleParser.js.map +1 -1
- package/ChoroplethParser.js +2 -2
- package/ChoroplethParser.js.map +1 -1
- package/ColumnParser.js +2 -2
- package/ColumnParser.js.map +1 -1
- package/FillerGaugeParser.js +2 -2
- package/FillerGaugeParser.js.map +1 -1
- package/LineParser.js +2 -2
- package/LineParser.js.map +1 -1
- package/MarkerGaugeParser.js +2 -2
- package/MarkerGaugeParser.js.map +1 -1
- package/PieParser.js +2 -2
- package/PieParser.js.map +1 -1
- package/PunchcardParser.js +2 -2
- package/PunchcardParser.js.map +1 -1
- package/ScatterParser.js +2 -2
- package/ScatterParser.js.map +1 -1
- package/ShapeParser.js +2 -2
- package/ShapeParser.js.map +1 -1
- package/SingleValueIconParser.js +2 -2
- package/SingleValueIconParser.js.map +1 -1
- package/SingleValueParser.js +9 -9
- package/SingleValueParser.js.map +1 -1
- package/SingleValueRadialParser.js +2 -2
- package/SingleValueRadialParser.js.map +1 -1
- package/TableParser.js +4 -4
- package/TableParser.js.map +1 -1
- package/package.json +3 -3
package/AreaParser.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 16);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -106,7 +106,7 @@ module.exports = require("@splunk/visualization-encoding-parsers/Base");
|
|
|
106
106
|
|
|
107
107
|
/***/ }),
|
|
108
108
|
|
|
109
|
-
/***/
|
|
109
|
+
/***/ 16:
|
|
110
110
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
111
111
|
|
|
112
112
|
"use strict";
|
package/AreaParser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/AreaParser.js","webpack:///./src/errorMsgs.js","webpack:///external \"lodash/isEmpty\""],"names":["dataContract","requiredDataSources","name","description","optionalDataSources","initialRequestParams","primary","offset","count","annotation","encoding","x","isRequired","type","default","y","y2","annotationX","annotationLabel","annotationColor","parse","isEmpty","ErrorMsgs","mergeEncoding","parsedProps","baseParse","xFieldName","yFieldName","y2FieldName","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,kD;;;;;;;ACAA,wE;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEO,IAAMA,YAAY,GAAG;AACxBC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Q,WAAW,CAHZ;AAIHP,eAAW,EAAEO,WAAW,CAJrB;AAKHN,mBAAe,EAAEM,WAAW,CALzB;AAMHL,mBAAe,EAAEK,WAAW,CANzB;AAOHE,cAAU,EAAEF,WAAW,CAAXA,OAAW,CAAXA,YAPT;AAO4C;AAC/CG,cAAU,EAAEH,WAAW,CAAXA,OAAW,CAAXA,YART;AAQ4C;AAC/CI,eAAW,EAAEJ,WAAW,CAAXA,OAAW,CAAXA,YATV,GAS8C;;AAT9C,GAAP;AARG,E;;;;;;;;AC3DP;AAAA;AAAA;AAAA;AAAA;AAEO,IAAMF,SAAS,GAAG;AACrBO,iBAAe,EAAEC,+DAAC,CADG,uBACH,CADG;AAErBC,aAAW,EAAED,+DAAC,CAFO,oBAEP,CAFO;AAGrBE,aAAW,EAAEF,+DAAC;AAHO,CAAlB,C;;;;;;;ACFP,2C","file":"AreaParser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s =
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/AreaParser.js","webpack:///./src/errorMsgs.js","webpack:///external \"lodash/isEmpty\""],"names":["dataContract","requiredDataSources","name","description","optionalDataSources","initialRequestParams","primary","offset","count","annotation","encoding","x","isRequired","type","default","y","y2","annotationX","annotationLabel","annotationColor","parse","isEmpty","ErrorMsgs","mergeEncoding","parsedProps","baseParse","xFieldName","yFieldName","y2FieldName","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,kD;;;;;;;ACAA,wE;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEO,IAAMA,YAAY,GAAG;AACxBC,qBAAmB,EAAE,CACjB;AACIC,QAAI,EADR;AAEIC,eAAW,EAAE;AAFjB,GADiB,CADG;AAOxBC,qBAAmB,EAAE,CACjB;AACA;AACA;AACA;AACA;AALiB,GAPG;AAcxBC,sBAAoB,EAAE;AAClBC,WAAO,EAAE;AAAEC,YAAM,EAAR;AAAaC,WAAK,EAAE;AAApB,KADS;AAElBC,cAAU,EAAE;AAAEF,YAAM,EAAR;AAAaC,WAAK,EAAE;AAApB;AAFM,GAdE;AAkBxBE,UAAQ,EAAE;AACNC,KAAC,EAAE;AACCC,gBAAU,EADX;AAECC,UAAI,EAAE,mBAFP,QAEO,CAFP;AAGCC,aAAO,EAAE;AAHV,KADG;AAMNC,KAAC,EAAE;AACCH,gBAAU,EADX;AAECC,UAAI,EAAE,WAFP,QAE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EF,+DAAC;AAHO,CAAlB,C;;;;;;;ACFP,2C","file":"AreaParser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 16);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","import { parse as baseParse, mergeEncoding } from '@splunk/visualization-encoding-parsers/Base';\nimport isEmpty from 'lodash/isEmpty';\nimport { ErrorMsgs } from './errorMsgs';\n\nexport const dataContract = {\n requiredDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization',\n },\n ],\n optionalDataSources: [\n // Note: SCP-14090 disable ui for optional datasources. We may need to add it back later\n // {\n // name: 'annotation',\n // description: 'DataSource that populate event annotations',\n // },\n ],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n annotation: { offset: 0, count: 10000 },\n },\n encoding: {\n x: {\n isRequired: true,\n type: ['time', 'number', 'string'],\n default: 'primary[0]',\n },\n y: {\n isRequired: true,\n type: ['number', 'string'],\n default: 'primary[1:]',\n },\n y2: {\n isRequired: false,\n type: ['number', 'string'],\n },\n annotationX: {\n isRequired: false,\n type: ['time', 'number', 'string'],\n },\n annotationLabel: {\n isRequired: false,\n type: ['string'],\n },\n annotationColor: {\n isRequired: false,\n type: ['string'],\n },\n },\n};\n\n/**\n * Area parse function\n * @param {object} dataSources\n * @param {object} userDefinedEncoding\n * @return {object} props that dashboard/react visualizations can be used.\n * @public\n */\nexport const parse = (dataSources, userDefinedEncoding) => {\n if (isEmpty(dataSources)) {\n throw new Error(ErrorMsgs.NO_DATA_SOURCES);\n }\n\n const encoding = mergeEncoding(dataContract.encoding, userDefinedEncoding);\n const parsedProps = baseParse(dataSources, encoding);\n\n return {\n x: parsedProps.x,\n y: parsedProps.y,\n y2: parsedProps.y2,\n annotationX: parsedProps.annotationX,\n annotationLabel: parsedProps.annotationLabel,\n annotationColor: parsedProps.annotationColor,\n xFieldName: parsedProps['_meta'].fieldNames.x, // eslint-disable-line dot-notation\n yFieldName: parsedProps['_meta'].fieldNames.y, // eslint-disable-line dot-notation\n y2FieldName: parsedProps['_meta'].fieldNames.y2, // eslint-disable-line dot-notation\n };\n};\n","import { _ } from '@splunk/ui-utils/i18n';\n\nexport const ErrorMsgs = {\n NO_DATA_SOURCES: _('No valid dataSources.'),\n NO_ENCODING: _('No valid encoding.'),\n ERROR_PARSE: _('Can not parse data correctly.'),\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
|
package/BarParser.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 17);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -106,7 +106,7 @@ module.exports = require("@splunk/visualization-encoding-parsers/Base");
|
|
|
106
106
|
|
|
107
107
|
/***/ }),
|
|
108
108
|
|
|
109
|
-
/***/
|
|
109
|
+
/***/ 17:
|
|
110
110
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
111
111
|
|
|
112
112
|
"use strict";
|
package/BarParser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/BarParser.js","webpack:///./src/errorMsgs.js","webpack:///external \"lodash/isEmpty\""],"names":["dataContract","requiredDataSources","name","description","initialRequestParams","primary","options","offset","count","requestTotalCount","pageable","encoding","x","isRequired","type","default","y","y2","parse","isEmpty","ErrorMsgs","mergeEncoding","parsedProps","baseParse","xFieldName","yFieldName","y2FieldName","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,kD;;;;;;;ACAA,wE;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEO,IAAMA,YAAY,GAAG;AACxBC,qBAAmB,EAAE,CACjB;AACIC,QAAI,EADR;AAEIC,eAAW,EAAE;AAFjB,GADiB,CADG;AAOxBC,sBAAoB,EAAE;AAClBC,WAAO,EAAE;AAAA,UAACC,OAAD;AAAA,aAAmB;AACxBC,cAAM,EADkB;AAExBC,aAAK,EAAEF,OAAO,CAAPA,SAFiB;AAGxBG,yBAAiB,EAAEH,OAAO,CAACI;AAHH,OAAnB;AAAA;AADS,GAPE;AAcxBC,UAAQ,EAAE;AACNC,KAAC,EAAE;AACCC,gBAAU,EADX;AAECC,UAAI,EAAE,mBAFP,QAEO,CAFP;AAGCC,aAAO,EAAE;AAHV,KADG;AAMNC,KAAC,EAAE;AACCH,gBAAU,EADX;AAECC,UAAI,EAAE,WAFP,QAEO,CAFP;AAGCC,aAAO,EAAE;AAHV,KANG;AAWNE,MAAE,EAAE;AACAJ,gBAAU,EADV;AAEAC,UAAI,EAAE;AAFN;AAXE;AAdc,CAArB;AAgCP;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMI,KAAK,GAAG,SAARA,KAAQ,mCAAsC;AACvD,MAAIC,qDAAO,CAAX,WAAW,CAAX,EAA0B;AACtB,UAAM,UAAUC,oDAAS,CAAzB,eAAM,CAAN;AACH;;AAED,MAAMT,QAAQ,GAAGU,iGAAa,CAACrB,YAAY,CAAb,UAA9B,mBAA8B,CAA9B;AACA,MAAMsB,WAAW,GAAGC,yFAAS,cAA7B,QAA6B,CAA7B;AAEA,SAAO;AACHX,KAAC,EAAEU,WAAW,CADX;AAEHN,KAAC,EAAEM,WAAW,CAFX;AAGHL,MAAE,EAAEK,WAAW,CAHZ;AAIHE,cAAU,EAAEF,WAAW,CAAXA,OAAW,CAAXA,YAJT;AAI4C;AAC/CG,cAAU,EAAEH,WAAW,CAAXA,OAAW,CAAXA,YALT;AAK4C;AAC/CI,eAAW,EAAEJ,WAAW,CAAXA,OAAW,CAAXA,YANV,GAM8C;;AAN9C,GAAP;AARG,E;;;;;;;;AC3CP;AAAA;AAAA;AAAA;AAAA;AAEO,IAAMF,SAAS,GAAG;AACrBO,iBAAe,EAAEC,+DAAC,CADG,uBACH,CADG;AAErBC,aAAW,EAAED,+DAAC,CAFO,oBAEP,CAFO;AAGrBE,aAAW,EAAEF,+DAAC;AAHO,CAAlB,C;;;;;;;ACFP,2C","file":"BarParser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s =
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/BarParser.js","webpack:///./src/errorMsgs.js","webpack:///external \"lodash/isEmpty\""],"names":["dataContract","requiredDataSources","name","description","initialRequestParams","primary","options","offset","count","requestTotalCount","pageable","encoding","x","isRequired","type","default","y","y2","parse","isEmpty","ErrorMsgs","mergeEncoding","parsedProps","baseParse","xFieldName","yFieldName","y2FieldName","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,kD;;;;;;;ACAA,wE;;;;;;;;ACAA;AAAA;AAAA;AAA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XA,OAAW,CAAXA,YANV,GAM8C;;AAN9C,GAAP;AARG,E;;;;;;;;AC3CP;AAAA;AAAA;AAAA;AAAA;AAEO,IAAMF,SAAS,GAAG;AACrBO,iBAAe,EAAEC,+DAAC,CADG,uBACH,CADG;AAErBC,aAAW,EAAED,+DAAC,CAFO,oBAEP,CAFO;AAGrBE,aAAW,EAAEF,+DAAC;AAHO,CAAlB,C;;;;;;;ACFP,2C","file":"BarParser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 17);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","import { parse as baseParse, mergeEncoding } from '@splunk/visualization-encoding-parsers/Base';\nimport isEmpty from 'lodash/isEmpty';\nimport { ErrorMsgs } from './errorMsgs';\n\nexport const dataContract = {\n requiredDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization',\n },\n ],\n initialRequestParams: {\n primary: (options = {}) => ({\n offset: 0,\n count: options.count || 1000,\n requestTotalCount: options.pageable,\n }),\n },\n encoding: {\n x: {\n isRequired: true,\n type: ['time', 'number', 'string'],\n default: 'primary[0]',\n },\n y: {\n isRequired: true,\n type: ['number', 'string'],\n default: 'primary[1:]',\n },\n y2: {\n isRequired: false,\n type: ['number', 'string'],\n },\n },\n};\n\n/**\n * Bar parse function\n * @param {object} dataSources\n * @param {object} userDefinedEncoding\n * @return {object} props that dashboard/react visualizations can be used.\n * @public\n */\nexport const parse = (dataSources, userDefinedEncoding) => {\n if (isEmpty(dataSources)) {\n throw new Error(ErrorMsgs.NO_DATA_SOURCES);\n }\n\n const encoding = mergeEncoding(dataContract.encoding, userDefinedEncoding);\n const parsedProps = baseParse(dataSources, encoding);\n\n return {\n x: parsedProps.x,\n y: parsedProps.y,\n y2: parsedProps.y2,\n xFieldName: parsedProps['_meta'].fieldNames.x, // eslint-disable-line dot-notation\n yFieldName: parsedProps['_meta'].fieldNames.y, // eslint-disable-line dot-notation\n y2FieldName: parsedProps['_meta'].fieldNames.y2, // eslint-disable-line dot-notation\n };\n};\n","import { _ } from '@splunk/ui-utils/i18n';\n\nexport const ErrorMsgs = {\n NO_DATA_SOURCES: _('No valid dataSources.'),\n NO_ENCODING: _('No valid encoding.'),\n ERROR_PARSE: _('Can not parse data correctly.'),\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
|
package/Base.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 33);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ([
|
|
@@ -158,15 +158,10 @@ module.exports = require("lodash/find");
|
|
|
158
158
|
/* 14 */
|
|
159
159
|
/***/ (function(module, exports) {
|
|
160
160
|
|
|
161
|
-
module.exports = require("@splunk/visualizations-shared/console");
|
|
162
|
-
|
|
163
|
-
/***/ }),
|
|
164
|
-
/* 15 */
|
|
165
|
-
/***/ (function(module, exports) {
|
|
166
|
-
|
|
167
161
|
module.exports = require("lodash/isFinite");
|
|
168
162
|
|
|
169
163
|
/***/ }),
|
|
164
|
+
/* 15 */,
|
|
170
165
|
/* 16 */,
|
|
171
166
|
/* 17 */,
|
|
172
167
|
/* 18 */,
|
|
@@ -184,8 +179,7 @@ module.exports = require("lodash/isFinite");
|
|
|
184
179
|
/* 30 */,
|
|
185
180
|
/* 31 */,
|
|
186
181
|
/* 32 */,
|
|
187
|
-
/* 33
|
|
188
|
-
/* 34 */
|
|
182
|
+
/* 33 */
|
|
189
183
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
190
184
|
|
|
191
185
|
"use strict";
|
|
@@ -239,14 +233,10 @@ var isUndefined_default = /*#__PURE__*/__webpack_require__.n(isUndefined_);
|
|
|
239
233
|
var find_ = __webpack_require__(13);
|
|
240
234
|
var find_default = /*#__PURE__*/__webpack_require__.n(find_);
|
|
241
235
|
|
|
242
|
-
// EXTERNAL MODULE: external "@splunk/visualizations-shared/console"
|
|
243
|
-
var console_ = __webpack_require__(14);
|
|
244
|
-
|
|
245
236
|
// CONCATENATED MODULE: ./src/util/format.js
|
|
246
237
|
|
|
247
238
|
|
|
248
239
|
|
|
249
|
-
|
|
250
240
|
var format_hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
251
241
|
var rangeFormat = function rangeFormat(value) {
|
|
252
242
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
@@ -491,7 +481,7 @@ var newFormatterErrorHandler = function newFormatterErrorHandler(maxErrors, hand
|
|
|
491
481
|
* @param {number[]} data the data to be formatted
|
|
492
482
|
*/
|
|
493
483
|
|
|
494
|
-
var
|
|
484
|
+
var getFormatter = function getFormatter(data) {
|
|
495
485
|
var formatCfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
496
486
|
|
|
497
487
|
if (formatCfg.type) {
|
|
@@ -500,8 +490,9 @@ var format_getFormatter = function getFormatter(data) {
|
|
|
500
490
|
// future: should formatters have prepare stage where params are validated
|
|
501
491
|
// and additional formatting context is generated (e.g. min & max value)
|
|
502
492
|
return function (value) {
|
|
503
|
-
return formatters[formatCfg.type](value, formatCfg, data,
|
|
504
|
-
|
|
493
|
+
return formatters[formatCfg.type](value, formatCfg, data, // eslint-disable-next-line no-console
|
|
494
|
+
newFormatterErrorHandler(MAX_LOGGED_FORMATTER_ERRORS, function (msg) {
|
|
495
|
+
return console.warn(msg);
|
|
505
496
|
}));
|
|
506
497
|
};
|
|
507
498
|
}
|
|
@@ -539,7 +530,7 @@ var format_getFormatter = function getFormatter(data) {
|
|
|
539
530
|
};
|
|
540
531
|
};
|
|
541
532
|
// EXTERNAL MODULE: external "lodash/isFinite"
|
|
542
|
-
var isFinite_ = __webpack_require__(
|
|
533
|
+
var isFinite_ = __webpack_require__(14);
|
|
543
534
|
var isFinite_default = /*#__PURE__*/__webpack_require__.n(isFinite_);
|
|
544
535
|
|
|
545
536
|
// CONCATENATED MODULE: ./src/util/types.js
|
|
@@ -908,7 +899,7 @@ var Base_getDataForFieldReference = function getDataForFieldReference(dataSource
|
|
|
908
899
|
var format = fieldReference.format;
|
|
909
900
|
|
|
910
901
|
if (format) {
|
|
911
|
-
formatValue =
|
|
902
|
+
formatValue = getFormatter(fieldData.data, format);
|
|
912
903
|
}
|
|
913
904
|
}
|
|
914
905
|
|
package/Base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/isEmpty\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"lodash/isNumber\"","webpack:///external \"chroma-js\"","webpack:///external \"lodash/isUndefined\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///external \"lodash/findIndex\"","webpack:///external \"lodash/clone\"","webpack:///external \"lodash/find\"","webpack:///external \"@splunk/visualizations-shared/console\"","webpack:///external \"lodash/isFinite\"","webpack:///./src/util/format.js","webpack:///./src/util/types.js","webpack:///./src/Base.js"],"names":["hasOwnProperty","Object","prototype","rangeFormat","ranges","values","Array","Number","floatVal","parseFloat","i","valueIndex","Math","categoryFormat","categories","rangeValueFormat","floatValue","matchValueFormat","matches","defaultValue","undefined","defaultResult","isUndefined","matchResult","find","match","NON_NUMERIC_RANGE_ERROR","VALUES_AND_RANGES_HAVE_DIFFERENT_LENGTH","INVALID_VALUE","colorGradientFormat","colorValues","colorRanges","chroma","data","min","max","a","errorHandler","errorColor","upperVal","lowerVal","tau","value","upperColor","lowerColor","formatters","rangevalue","matchvalue","gradient","MAX_LOGGED_FORMATTER_ERRORS","newFormatterErrorHandler","errorCount","handlerFunc","getFormatter","formatCfg","splunkConsole","console","getDataTypeForPoint","isFinite","isNumber","Date","inferDataTypeFromSample","typeMatches","time","number","string","unknown","dataSample","typeCount","returnType","drawSample","getDataForDataSourceType","fields","columns","parseFieldRangeReference","fieldIndexRangeStr","isFieldIndexRange","fromFieldIndexStr","toFieldIndexStr","fromFieldIndex","toFieldIndex","parseIndexBasedFieldReference","indices","fieldReferenceStr","dataSourceName","fieldRange","fieldIndex","columnIndex","parseNameBasedFieldReference","fieldNameStr","splitedStr","fieldName","getDataForIndexBasedFieldReference","dataForRange","endIndex","isNegative","absoluteIndex","correctedFieldIndex","isNegativeColumnIndex","correctColumnIndex","fieldData","getDataForNameBasedFieldReference","findIndex","field","getDataForFieldReference","fieldReference","dataFromDefault","type","indexBasedRegx","nameBasedRegx","isIndexBasedReference","isNameBasedReference","dataSourceType","format","formatValue","isEmpty","mergeEncoding","userDefinedEncoding","mergedEncoding","defaultEncoding","isDefault","parse","encoding","parsedOutput","_meta","fieldNames","types","clone","replacedKey","dataForFieldReference","entry"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,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module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 34);\n","module.exports = require(\"lodash/isEmpty\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"lodash/isNumber\");","module.exports = require(\"chroma-js\");","module.exports = require(\"lodash/isUndefined\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","module.exports = require(\"lodash/findIndex\");","module.exports = require(\"lodash/clone\");","module.exports = require(\"lodash/find\");","module.exports = require(\"@splunk/visualizations-shared/console\");","module.exports = require(\"lodash/isFinite\");","import chroma from 'chroma-js';\nimport isUndefined from 'lodash/isUndefined';\nimport find from 'lodash/find';\nimport { console as splunkConsole } from '@splunk/visualizations-shared/console';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport const rangeFormat = (value, { ranges, values } = {}) => {\n if (Array.isArray(ranges) && Array.isArray(values) && !Number.isNaN(value)) {\n const floatVal = parseFloat(value);\n for (let i = 0; i < ranges.length; i += 1) {\n // bad range value\n if (Number.isNaN(Number(ranges[i]))) {\n // Could not format value: Ranges are required to be numbers. Falling back to original value\n return value;\n }\n // value is less than the range limit\n if (floatVal <= parseFloat(ranges[i])) {\n const valueIndex = Math.min(i, values.length - 1); // correct the index if there are more range items than values\n if (values[valueIndex]) {\n return values[valueIndex];\n }\n }\n }\n if (floatVal > parseFloat(ranges[ranges.length - 1])) {\n return values[values.length - 1];\n }\n }\n // Could not format value: Ranges and Value are required to be numbers\n return value;\n};\n\nexport const categoryFormat = (value, { categories, values }) => {\n if (!(Array.isArray(categories) && Array.isArray(values) && categories.length === values.length)) {\n // Could not format value: categories & values should be arrays of the same length. Falling back to original value\n return value;\n }\n const valueIndex = categories.indexOf(value);\n if (valueIndex > -1) {\n return values[valueIndex];\n }\n // Could not format value: Category does not exist. Falling back to original value\n return value;\n};\n\n/**\n * based on a range configuration this formatter maps the value to a value specified in a range.\n * the range fitting follows this criteria: `range.from <= value < range.to` so the `to` value is not included\n * A range can be defined as either a closed bound range: `{ from: 10, to: 20, value: 'foo' }`\n * or an open bound range:\n * `{ to: 20, value: 'bar' }` (open lower bound)\n * `{ from: 100, value: 'oof' }` (open upper bound)\n *\n * @param {string} value from data\n * @param {object} formatConfig\n * @param {Object[]} formatConfig.ranges\n */\nexport const rangeValueFormat = (value, { ranges = [] }) => {\n const floatValue = parseFloat(value);\n if (Number.isNaN(Number(value))) {\n return value;\n }\n for (let i = 0; i < ranges.length; i += 1) {\n if (\n // open upper bound: value is bigger than or equal to open upper bound start (from)\n (i === 0 && hasOwnProperty.call(ranges[i], 'from') && floatValue >= ranges[i].from) ||\n // inbetween: value falls into from - to range\n (floatValue >= ranges[i].from && floatValue < ranges[i].to) ||\n // open lower bound: value is smaller than or equal to open lower bound end (to)\n (i === ranges.length - 1 && hasOwnProperty.call(ranges[i], 'to') && floatValue < ranges[i].to)\n ) {\n return ranges[i].value;\n }\n }\n return value;\n};\n\n/**\n * this formatter maps the value to a value specified in a list of potential matches .\n * if the value passed is a match for what is provided in `matches[i].match`, we return that mapped value `matches[i].value`.\n * If there is not match in the array and there is a `defaultValue` provided we return that value. If there is not a match in the list\n * and no defaultValue is passed, we return the original `value`\n * `{ match: 'cherry', value: 'red' }` (exact match)\n *\n * @param {string} value from data\n * @param {object} formatConfig\n * @param {Object[]} formatConfig.matches\n * @param {object} formatConfig.defaultValue\n */\nexport const matchValueFormat = (value, { matches = [], defaultValue = undefined }) => {\n const defaultResult = isUndefined(defaultValue) ? value : defaultValue;\n const matchResult = find(matches, match => match.match && match.match === value);\n\n return isUndefined(matchResult) ? defaultResult : matchResult.value;\n};\n\nexport const NON_NUMERIC_RANGE_ERROR =\n 'Could not format value: Ranges are required to be numbers. Falling back to first color';\nexport const VALUES_AND_RANGES_HAVE_DIFFERENT_LENGTH =\n 'gradient ranges and values must have the same number of elements';\nexport const INVALID_VALUE = 'Could not format value for gradient:';\n\n/**\n * based on ranges and values this formatter maps the value to an interpolated color\n *\n * @param {string} value from data (string representation of number)\n * @param {object} formatConfig\n * @param {number[]} formatConfig.ranges value ranges\n * @param {string[]} formatConfig.values color stops to interpolate from\n * @param {string[]} data the data to be formatted\n * @param errorHandler function\n */\nexport const colorGradientFormat = (value, { ranges, values }, data, errorHandler) => {\n let colorValues = values;\n let colorRanges = ranges;\n function errorColor() {\n return colorValues ? chroma(colorValues[0]).hex().toUpperCase() : '#000';\n }\n if (!Number.isNaN(Number(value))) {\n // set default values for gradient colors if values not explicit\n if (!colorValues) {\n colorValues = ['white', 'red'];\n }\n\n if (colorValues.length === 1) {\n colorValues.unshift('white'); // force color bin to have a lower bound color\n }\n // set default values for ranges if ranges not explicit\n if (!ranges) {\n if (data && data.length > 0) {\n const min = data.length > 0 ? Math.min.apply(null, data) : undefined;\n const max = data.length > 0 ? Math.max.apply(null, data) : undefined;\n colorRanges = [min];\n for (let i = 1; i < colorValues.length - 1; i += 1) {\n colorRanges.push(min + (i * (max - min)) / (colorValues.length - 1));\n }\n colorRanges.push(max);\n } else {\n colorRanges = [0, 1]; // no data values, so just make the range from zero to 1\n }\n }\n\n if (colorRanges.length === 1) {\n colorRanges.push(colorRanges[0]); // force range to be at least two values\n }\n colorRanges.sort((a, b) => a - b); // force ascending order of range stops\n if (colorRanges.length !== colorValues.length) {\n errorHandler(VALUES_AND_RANGES_HAVE_DIFFERENT_LENGTH);\n return errorColor();\n }\n\n const floatVal = parseFloat(value);\n\n // don't let value be outside the allowed range\n if (floatVal > parseFloat(colorRanges[colorRanges.length - 1])) {\n return chroma(colorValues[colorValues.length - 1])\n .hex()\n .toUpperCase(); // high end\n }\n if (floatVal < parseFloat(colorRanges[0])) {\n return chroma(colorValues[0]).hex().toUpperCase(); // low end\n }\n\n // find the color gradient range that the value is inside\n for (let i = 1; i < colorRanges.length; i += 1) {\n // bad range value\n if (Number.isNaN(Number(colorRanges[i]))) {\n // eslint-disable-next-line\n errorHandler(NON_NUMERIC_RANGE_ERROR);\n return errorColor();\n }\n\n const upperVal = colorRanges[i];\n if (floatVal <= upperVal) {\n // if value is inside the bin\n const lowerVal = colorRanges[i - 1];\n let tau = (value - lowerVal) / (upperVal - lowerVal);\n\n // deal with special case when the upper and lower and bounds of the colorRange is equal\n if (upperVal === lowerVal) {\n if (value === 0) {\n // user prolly expects lower end of color range if value is zero\n tau = 0;\n } else {\n tau = 1; // otherwise use the upper bound\n }\n }\n\n const upperColor = colorValues[i];\n const lowerColor = colorValues[i - 1];\n return chroma.scale([lowerColor, upperColor])(tau).hex().toUpperCase();\n }\n }\n }\n // eslint-disable-next-line\n errorHandler(`${INVALID_VALUE} ${value}`);\n return errorColor();\n};\n\nconst formatters = {\n rangevalue: rangeValueFormat,\n matchvalue: matchValueFormat,\n gradient: colorGradientFormat,\n};\n\nexport const MAX_LOGGED_FORMATTER_ERRORS = 10;\nexport const newFormatterErrorHandler = (maxErrors, handlerFunc) => {\n let errorCount = 0;\n return msg => {\n if (errorCount < maxErrors) {\n handlerFunc(msg);\n }\n errorCount += 1;\n };\n};\n\n/**\n * returns a formatter function based on a format config\n * @param {Object} formatCfg formatter config\n * @param {number[]} formatCfg.ranges an array of numeric ranges that will be used to map to values. requires formatCfg.values\n * @param {*[]} formatCfg.values an array of values to map to. can be used with formatCfg.ranges or formatCfg.categories or formatCfg.gradient\n * @param {string[]|number[]} formatCfg.categories an array of categories. categories are used for a 1:1 mapping to values. requires formatCfg.values\n * @param {number[]} data the data to be formatted\n */\nexport const getFormatter = (data, formatCfg = {}) => {\n if (formatCfg.type) {\n if (formatters[formatCfg.type]) {\n // @TODO(pwied):\n // future: should formatters have prepare stage where params are validated\n // and additional formatting context is generated (e.g. min & max value)\n return value =>\n formatters[formatCfg.type](\n value,\n formatCfg,\n data,\n newFormatterErrorHandler(MAX_LOGGED_FORMATTER_ERRORS, msg => splunkConsole.warn(msg))\n );\n }\n return value => value;\n }\n // @TODO(pwied):\n // - remove post beta deadline\n // - move to formatters with type option\n // - leaving it here for now because Choropleth builds on it\n const { ranges, values } = formatCfg;\n if (values) {\n if (ranges) {\n return value => rangeFormat(value, formatCfg);\n }\n\n if (formatCfg.categories) {\n return value => categoryFormat(value, formatCfg);\n }\n }\n // eslint-disable-next-line\n console.warn('Could not find a formatter. Falling back to identity fn');\n return value => value;\n};\n","import isNumber from 'lodash/isNumber';\nimport isFinite from 'lodash/isFinite';\n\n/**\n * getDataTypeForPoint\n * naive implementation of checking for the data type of a single data point\n * number > time > string > unknown\n * starting with number because a Date.parse(number) is a valid date\n *\n * @param {any} dataPoint\n * @return {string} type\n */\nexport const getDataTypeForPoint = dataPoint => {\n if (isFinite(+dataPoint) && isNumber(+dataPoint)) {\n return 'number';\n }\n if (!Number.isNaN(Date.parse(dataPoint))) {\n return 'time';\n }\n if (typeof dataPoint === 'string') {\n return 'string';\n }\n // nulls, objects, etc\n return 'unknown';\n};\n\n/**\n * inferDataTypeFromSample\n * based on a number of data points this function determines the data type for all of them\n * and returns the most common data type (naive type inference)\n *\n * @param {Array} dataSample an array of arbitrary size containing data points of any data type\n * @return {string} type the most common type in the sample\n */\nexport const inferDataTypeFromSample = dataSample => {\n const typeMatches = {\n time: 0,\n number: 0,\n string: 0,\n unknown: 0,\n };\n dataSample.forEach(point => {\n typeMatches[getDataTypeForPoint(point)] += 1;\n });\n let typeCount = -1;\n let returnType = 'unknown';\n Object.keys(typeMatches).forEach(key => {\n if (typeMatches[key] > typeCount) {\n typeCount = typeMatches[key];\n returnType = key;\n }\n });\n return returnType;\n};\n\n/**\n * based on a data array (e.g. one data column) this function returns a tiny sample of it\n * @TODO: very naive approach. there's papers with more advanced techniques but for now this should be very fast\n *\n * @param {Array} data to draw a sample from\n * @return {Array} a sample of the passed data\n */\nexport const drawSample = data => {\n if (data.length > 2) {\n return [data[0], data[Math.floor(data.length / 2)], data[data.length - 1]];\n }\n if (data.length === 2) {\n return [data[0], data[1]];\n }\n // small enough to check everything\n return data;\n};\n","import findIndex from 'lodash/findIndex';\nimport isNumber from 'lodash/isNumber';\nimport isEmpty from 'lodash/isEmpty';\nimport clone from 'lodash/clone';\nimport { getFormatter } from './util/format';\nimport { inferDataTypeFromSample, drawSample } from './util/types';\n\nconst getDataForDataSourceType = (data, dataSourceType) => {\n if (!dataSourceType || !data[dataSourceType] || !data[dataSourceType].data) {\n // @TODO: warn about datasource type not being found\n return {\n fields: [],\n columns: [],\n };\n }\n return data[dataSourceType].data;\n};\n/*\n * parse fieldIndexRangeStr\n * @param {String} fieldIndexRangeStr '0:', '0:5', ':5'\n * @returns {Object} info about parsed range if there is any\n */\nexport const parseFieldRangeReference = fieldIndexRangeStr => {\n if (!fieldIndexRangeStr || fieldIndexRangeStr.indexOf(':') === -1) {\n return {\n isFieldIndexRange: false,\n };\n }\n const [fromFieldIndexStr, toFieldIndexStr] = fieldIndexRangeStr.split(':');\n return {\n isFieldIndexRange: true,\n fromFieldIndex:\n Number.isNaN(Number(fromFieldIndexStr)) || !fromFieldIndexStr ? 0 : Number(fromFieldIndexStr),\n toFieldIndex:\n Number.isNaN(Number(toFieldIndexStr)) || !toFieldIndexStr ? -1 : Number(toFieldIndexStr),\n };\n};\n/*\n * parse fieldReferenceStr to get field index and column index for user defined encoding. e.g. 'primary[1][123]'\n * @param {String} fieldReferenceStr 'primary[1][123]'\n * @returns {Object} { fieldIndex: 1, columnIndex: 123, isFieldIndexRange: true, fromFieldIndexRange: 0, toFieldIndexRange: 3 }\n */\nexport const parseIndexBasedFieldReference = fieldReferenceStr => {\n const indices = fieldReferenceStr\n .replace(/^[A-Za-z0-9]+/, '')\n .replace(/\\[/g, '')\n .replace(/\\]/g, ',')\n .split(',');\n const dataSourceName = fieldReferenceStr.match(/^[A-Za-z0-9]+/)[0];\n const fieldRange = parseFieldRangeReference(indices[0]);\n return {\n dataSourceName,\n fieldIndex: Number.isNaN(Number(indices[0])) || !indices[0] ? null : Number(indices[0]),\n columnIndex: Number.isNaN(Number(indices[1])) || !indices[1] ? null : Number(indices[1]),\n ...fieldRange,\n };\n};\n\n/*\n * parse fieldReferenceStr to get field name and column index for user defined encoding. e.g. 'primary.color[123]'\n * @param {String} fieldReferenceStr 'primary.color[123]'\n * @returns {Object} { fieldName: 'color', columnIndex: 123 }\n */\nexport const parseNameBasedFieldReference = fieldReferenceStr => {\n const dataSourceName = fieldReferenceStr.match(/^[A-Za-z0-9]+/)[0];\n const fieldNameStr = fieldReferenceStr.split('.')[1];\n const splitedStr = fieldNameStr.split('[');\n const fieldName = splitedStr[0];\n const columnIndex = splitedStr[1] ? Number(splitedStr[1].replace(']', '')) : null;\n\n return { dataSourceName, fieldName, columnIndex };\n};\n\nconst getDataForIndexBasedFieldReference = (data, fieldReferenceStr) => {\n const { fields, columns } = data;\n const {\n dataSourceName,\n isFieldIndexRange,\n fromFieldIndex,\n toFieldIndex,\n fieldIndex,\n columnIndex,\n } = parseIndexBasedFieldReference(fieldReferenceStr);\n\n if (isFieldIndexRange) {\n const dataForRange = [];\n if (fromFieldIndex > -1) {\n const endIndex =\n toFieldIndex > -1 ? Math.min(fields.length - 1, toFieldIndex) : fields.length + toFieldIndex;\n for (let i = fromFieldIndex; i <= endIndex; i += 1) {\n dataForRange.push(\n getDataForIndexBasedFieldReference(data, `${dataSourceName}[${i}][${columnIndex}]`)\n );\n }\n return dataForRange;\n }\n }\n\n if (isNumber(fieldIndex)) {\n const isNegative = fieldIndex < 0;\n const absoluteIndex = Math.abs(fieldIndex);\n if (\n (isNegative && absoluteIndex > fields.length) ||\n (!isNegative && fieldIndex > fields.length - 1)\n ) {\n // The field index is out of bounds\n return {};\n }\n const correctedFieldIndex = isNegative ? fields.length - absoluteIndex : fieldIndex;\n const fieldName =\n typeof fields[correctedFieldIndex] === 'object'\n ? fields[correctedFieldIndex].name\n : fields[correctedFieldIndex];\n\n let fieldData;\n if (isNumber(columnIndex)) {\n const isNegativeColumnIndex = columnIndex < 0;\n\n if (\n (isNegativeColumnIndex && columnIndex < -columns[correctedFieldIndex].length) ||\n columnIndex >= columns[correctedFieldIndex].length\n ) {\n // The column index is out of bounds\n return {};\n }\n const correctColumnIndex = isNegativeColumnIndex\n ? columns[correctedFieldIndex].length + columnIndex\n : columnIndex;\n fieldData = columns[correctedFieldIndex].map(\n () => columns[correctedFieldIndex][correctColumnIndex]\n );\n } else {\n fieldData = columns[correctedFieldIndex];\n }\n return {\n fieldName,\n data: fieldData,\n };\n }\n return {};\n};\n\nconst getDataForNameBasedFieldReference = (data, fieldReferenceStr) => {\n const { fields, columns } = data;\n const { fieldName, columnIndex } = parseNameBasedFieldReference(fieldReferenceStr); // <datasource>.<fieldname>[0]\n\n if (fieldName) {\n const fieldIndex = findIndex(fields, field =>\n typeof field === 'object' ? field.name === fieldName : field === fieldName\n );\n if (fieldIndex > -1) {\n let fieldData;\n if (isNumber(columnIndex)) {\n const isNegativeColumnIndex = columnIndex < 0;\n\n if (\n (isNegativeColumnIndex && columnIndex < -columns[fieldIndex].length) ||\n columnIndex >= columns[fieldIndex].length\n ) {\n // The column index is out of bounds\n return {};\n }\n const correctColumnIndex = isNegativeColumnIndex\n ? columns[fieldIndex].length + columnIndex\n : columnIndex;\n fieldData = columns[fieldIndex].map(() => columns[fieldIndex][correctColumnIndex]);\n } else {\n fieldData = columns[fieldIndex];\n }\n return {\n fieldName,\n data: fieldData,\n };\n }\n // eslint-disable-next-line\n console.warn(`field '${fieldName}' not available.`);\n return {};\n }\n return {};\n};\n\nconst getDataForFieldReference = (dataSources, fieldReference) => {\n let fieldReferenceStr = fieldReference;\n let formatValue;\n if (Array.isArray(fieldReference) && !fieldReference.isDefault) {\n return fieldReference.map(ref => getDataForFieldReference(dataSources, ref));\n }\n // if the reference is a default and there is multiple default fields to fall back\n if (fieldReference.isDefault && Array.isArray(fieldReference.field)) {\n // iterate through all defaults and check whether the data type matches the expected type\n for (let i = 0; i < fieldReference.field.length; i += 1) {\n fieldReferenceStr = fieldReference.field[i];\n const dataFromDefault = getDataForFieldReference(dataSources, fieldReferenceStr);\n if (Array.isArray(dataFromDefault.data)) {\n const type = inferDataTypeFromSample(drawSample(dataFromDefault.data));\n if (fieldReference.type.indexOf(type) > -1) {\n return dataFromDefault;\n }\n }\n }\n // if none of the defaults matched the data type use the last default\n }\n if (typeof fieldReference === 'object') {\n const { field } = fieldReference;\n if (field && !Array.isArray(field)) {\n fieldReferenceStr = field;\n }\n }\n\n const indexBasedRegx = /^[A-Za-z0-9_]+\\[.*\\].*$/;\n const nameBasedRegx = /^[A-Za-z0-9_]+\\..*$/;\n const isIndexBasedReference = indexBasedRegx.test(fieldReferenceStr);\n const isNameBasedReference = nameBasedRegx.test(fieldReferenceStr);\n\n if (!isIndexBasedReference && !isNameBasedReference) {\n // Unable to parse the encoding. Please verify the encoding format is correct\n return {};\n }\n\n const dataSourceType = fieldReferenceStr.match(/^(.*?)(\\.|\\[)/)[1];\n const data = getDataForDataSourceType(dataSources, dataSourceType);\n let fieldData;\n\n if (isIndexBasedReference) {\n fieldData = getDataForIndexBasedFieldReference(data, fieldReferenceStr);\n } else {\n fieldData = getDataForNameBasedFieldReference(data, fieldReferenceStr);\n }\n\n if (typeof fieldReference === 'object') {\n const { format } = fieldReference;\n if (format) {\n formatValue = getFormatter(fieldData.data, format);\n }\n }\n\n if (formatValue && !isEmpty(fieldData)) {\n return {\n fieldName: fieldData.fieldName,\n data: fieldData.data.map(formatValue),\n };\n }\n return fieldData;\n};\n\nexport const mergeEncoding = (defaultEncoding, userDefinedEncoding = {}) => {\n const mergedEncoding = { ...userDefinedEncoding };\n Object.keys(defaultEncoding).forEach(key => {\n if (\n isEmpty(userDefinedEncoding[key]) &&\n defaultEncoding[key].isRequired &&\n defaultEncoding[key].default\n ) {\n mergedEncoding[key] =\n typeof defaultEncoding[key].default === 'object' &&\n !Array.isArray(defaultEncoding[key].default)\n ? {\n ...defaultEncoding[key].default,\n isDefault: true,\n type: defaultEncoding[key].type,\n }\n : {\n field: defaultEncoding[key].default,\n isDefault: true,\n type: defaultEncoding[key].type,\n };\n }\n });\n return mergedEncoding;\n};\n\nexport const parse = (dataSources, encoding = {}) => {\n const parsedOutput = {\n _meta: {\n fieldNames: {},\n types: {},\n },\n };\n\n Object.keys(encoding).forEach(key => {\n let fieldReference = clone(encoding[key]);\n\n // handle the case for encoding field reference, for example fill: 'encoding.trend'\n if (\n typeof fieldReference === 'object' &&\n fieldReference.field &&\n fieldReference.field.indexOf('encoding') === 0\n ) {\n const replacedKey = fieldReference.field.split('.')[1];\n\n // return for the below invalid cases\n // `encoding.z` if `z` is not a valid field in encoding\n if (!encoding[replacedKey]) {\n // eslint-disable-next-line\n console.warn(`${key} field cannot refer to 'encoding.${replacedKey}'.`);\n }\n // if `z` is an object configuration in encoding simply extract the field when refering `encoding.z`\n const field =\n typeof encoding[replacedKey] === 'object'\n ? encoding[replacedKey].field\n : encoding[replacedKey];\n fieldReference = {\n ...fieldReference,\n field,\n };\n }\n\n const dataForFieldReference = getDataForFieldReference(dataSources, fieldReference);\n\n if (Array.isArray(dataForFieldReference)) {\n parsedOutput[key] = dataForFieldReference.map(entry => entry.data);\n parsedOutput._meta.fieldNames[key] = dataForFieldReference.map(entry => entry.fieldName); // eslint-disable-line no-underscore-dangle\n // eslint-disable-next-line no-underscore-dangle\n parsedOutput._meta.types[key] = dataForFieldReference.map(entry =>\n inferDataTypeFromSample(drawSample(entry.data))\n );\n } else {\n const { fieldName, data } = dataForFieldReference;\n if (fieldName) {\n parsedOutput[key] = data;\n parsedOutput._meta.fieldNames[key] = fieldName; // eslint-disable-line no-underscore-dangle\n // eslint-disable-next-line no-underscore-dangle\n parsedOutput._meta.types[key] = inferDataTypeFromSample(drawSample(data));\n }\n }\n });\n\n return parsedOutput;\n};\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/isEmpty\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"lodash/isNumber\"","webpack:///external \"chroma-js\"","webpack:///external \"lodash/isUndefined\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///external \"lodash/findIndex\"","webpack:///external \"lodash/clone\"","webpack:///external \"lodash/find\"","webpack:///external \"lodash/isFinite\"","webpack:///./src/util/format.js","webpack:///./src/util/types.js","webpack:///./src/Base.js"],"names":["hasOwnProperty","Object","prototype","rangeFormat","ranges","values","Array","Number","floatVal","parseFloat","i","valueIndex","Math","categoryFormat","categories","rangeValueFormat","floatValue","matchValueFormat","matches","defaultValue","undefined","defaultResult","isUndefined","matchResult","find","match","NON_NUMERIC_RANGE_ERROR","VALUES_AND_RANGES_HAVE_DIFFERENT_LENGTH","INVALID_VALUE","colorGradientFormat","colorValues","colorRanges","chroma","data","min","max","a","errorHandler","errorColor","upperVal","lowerVal","tau","value","upperColor","lowerColor","formatters","rangevalue","matchvalue","gradient","MAX_LOGGED_FORMATTER_ERRORS","newFormatterErrorHandler","errorCount","handlerFunc","getFormatter","formatCfg","console","getDataTypeForPoint","isFinite","isNumber","Date","inferDataTypeFromSample","typeMatches","time","number","string","unknown","dataSample","typeCount","returnType","drawSample","getDataForDataSourceType","fields","columns","parseFieldRangeReference","fieldIndexRangeStr","isFieldIndexRange","fromFieldIndexStr","toFieldIndexStr","fromFieldIndex","toFieldIndex","parseIndexBasedFieldReference","indices","fieldReferenceStr","dataSourceName","fieldRange","fieldIndex","columnIndex","parseNameBasedFieldReference","fieldNameStr","splitedStr","fieldName","getDataForIndexBasedFieldReference","dataForRange","endIndex","isNegative","absoluteIndex","correctedFieldIndex","isNegativeColumnIndex","correctColumnIndex","fieldData","getDataForNameBasedFieldReference","findIndex","field","getDataForFieldReference","fieldReference","dataFromDefault","type","indexBasedRegx","nameBasedRegx","isIndexBasedReference","isNameBasedReference","dataSourceType","format","formatValue","isEmpty","mergeEncoding","userDefinedEncoding","mergedEncoding","defaultEncoding","isDefault","parse","encoding","parsedOutput","_meta","fieldNames","types","clone","replacedKey","dataForFieldReference","entry"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;AClFA,2C;;;;;;ACAA,0D;;;;;;ACAA,4C;;;;;;ACAA,sC;;;;;;ACAA,+C;;;;;;;ACAA,kE;;;;;;ACAA,iE;;;;;;ACAA,6C;;;;;;ACAA,yC;;;;;;ACAA,wC;;;;;;ACAA,4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;IAEQA,qB,GAAmBC,MAAM,CAACC,SAAPD,CAAnBD,c;AAED,IAAMG,WAAW,GAAG,SAAdA,WAAc,QAAoC;AAAA,iFAAP,EAAO;AAAA,MAA1BC,MAA0B,QAA1BA,MAA0B;AAAA,MAAlBC,MAAkB,QAAlBA,MAAkB;;AAC3D,MAAIC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T;AAF9B,OAED,CAArCP,CAFsC,CAEoD;AAC1F;;AACAA,kBAAY,CAAZA,mBAAgC,qBAAqB,CAArB,IAA0B,iBAAK;AAAA,eAC3D9D,uBAAuB,CAACS,UAAU,CAAC4D,KAAK,CADmB,IACzB,CAAX,CADoC;AAA/DP,OAAgC,CAAhCA;AAJJ,WAOO;AAAA,UACKhC,SADL,GACyBsC,qBADzB;AAAA,UACgB/F,IADhB,GACyB+F,qBADzB;;AAEH,qBAAe;AACXN,oBAAY,CAAZA,GAAY,CAAZA;AACAA,oBAAY,CAAZA,wBAFW,SAEXA,CAFW,CAEqC;AAChD;;AACAA,oBAAY,CAAZA,mBAAgC9D,uBAAuB,CAACS,UAAU,CAAlEqD,IAAkE,CAAX,CAAvDA;AACH;AACJ;AA7CLzH;AAgDA;AAxDG,E","file":"Base.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 33);\n","module.exports = require(\"lodash/isEmpty\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"lodash/isNumber\");","module.exports = require(\"chroma-js\");","module.exports = require(\"lodash/isUndefined\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","module.exports = require(\"lodash/findIndex\");","module.exports = require(\"lodash/clone\");","module.exports = require(\"lodash/find\");","module.exports = require(\"lodash/isFinite\");","import chroma from 'chroma-js';\nimport isUndefined from 'lodash/isUndefined';\nimport find from 'lodash/find';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport const rangeFormat = (value, { ranges, values } = {}) => {\n if (Array.isArray(ranges) && Array.isArray(values) && !Number.isNaN(value)) {\n const floatVal = parseFloat(value);\n for (let i = 0; i < ranges.length; i += 1) {\n // bad range value\n if (Number.isNaN(Number(ranges[i]))) {\n // Could not format value: Ranges are required to be numbers. Falling back to original value\n return value;\n }\n // value is less than the range limit\n if (floatVal <= parseFloat(ranges[i])) {\n const valueIndex = Math.min(i, values.length - 1); // correct the index if there are more range items than values\n if (values[valueIndex]) {\n return values[valueIndex];\n }\n }\n }\n if (floatVal > parseFloat(ranges[ranges.length - 1])) {\n return values[values.length - 1];\n }\n }\n // Could not format value: Ranges and Value are required to be numbers\n return value;\n};\n\nexport const categoryFormat = (value, { categories, values }) => {\n if (!(Array.isArray(categories) && Array.isArray(values) && categories.length === values.length)) {\n // Could not format value: categories & values should be arrays of the same length. Falling back to original value\n return value;\n }\n const valueIndex = categories.indexOf(value);\n if (valueIndex > -1) {\n return values[valueIndex];\n }\n // Could not format value: Category does not exist. Falling back to original value\n return value;\n};\n\n/**\n * based on a range configuration this formatter maps the value to a value specified in a range.\n * the range fitting follows this criteria: `range.from <= value < range.to` so the `to` value is not included\n * A range can be defined as either a closed bound range: `{ from: 10, to: 20, value: 'foo' }`\n * or an open bound range:\n * `{ to: 20, value: 'bar' }` (open lower bound)\n * `{ from: 100, value: 'oof' }` (open upper bound)\n *\n * @param {string} value from data\n * @param {object} formatConfig\n * @param {Object[]} formatConfig.ranges\n */\nexport const rangeValueFormat = (value, { ranges = [] }) => {\n const floatValue = parseFloat(value);\n if (Number.isNaN(Number(value))) {\n return value;\n }\n for (let i = 0; i < ranges.length; i += 1) {\n if (\n // open upper bound: value is bigger than or equal to open upper bound start (from)\n (i === 0 && hasOwnProperty.call(ranges[i], 'from') && floatValue >= ranges[i].from) ||\n // inbetween: value falls into from - to range\n (floatValue >= ranges[i].from && floatValue < ranges[i].to) ||\n // open lower bound: value is smaller than or equal to open lower bound end (to)\n (i === ranges.length - 1 && hasOwnProperty.call(ranges[i], 'to') && floatValue < ranges[i].to)\n ) {\n return ranges[i].value;\n }\n }\n return value;\n};\n\n/**\n * this formatter maps the value to a value specified in a list of potential matches .\n * if the value passed is a match for what is provided in `matches[i].match`, we return that mapped value `matches[i].value`.\n * If there is not match in the array and there is a `defaultValue` provided we return that value. If there is not a match in the list\n * and no defaultValue is passed, we return the original `value`\n * `{ match: 'cherry', value: 'red' }` (exact match)\n *\n * @param {string} value from data\n * @param {object} formatConfig\n * @param {Object[]} formatConfig.matches\n * @param {object} formatConfig.defaultValue\n */\nexport const matchValueFormat = (value, { matches = [], defaultValue = undefined }) => {\n const defaultResult = isUndefined(defaultValue) ? value : defaultValue;\n const matchResult = find(matches, match => match.match && match.match === value);\n\n return isUndefined(matchResult) ? defaultResult : matchResult.value;\n};\n\nexport const NON_NUMERIC_RANGE_ERROR =\n 'Could not format value: Ranges are required to be numbers. Falling back to first color';\nexport const VALUES_AND_RANGES_HAVE_DIFFERENT_LENGTH =\n 'gradient ranges and values must have the same number of elements';\nexport const INVALID_VALUE = 'Could not format value for gradient:';\n\n/**\n * based on ranges and values this formatter maps the value to an interpolated color\n *\n * @param {string} value from data (string representation of number)\n * @param {object} formatConfig\n * @param {number[]} formatConfig.ranges value ranges\n * @param {string[]} formatConfig.values color stops to interpolate from\n * @param {string[]} data the data to be formatted\n * @param errorHandler function\n */\nexport const colorGradientFormat = (value, { ranges, values }, data, errorHandler) => {\n let colorValues = values;\n let colorRanges = ranges;\n function errorColor() {\n return colorValues ? chroma(colorValues[0]).hex().toUpperCase() : '#000';\n }\n if (!Number.isNaN(Number(value))) {\n // set default values for gradient colors if values not explicit\n if (!colorValues) {\n colorValues = ['white', 'red'];\n }\n\n if (colorValues.length === 1) {\n colorValues.unshift('white'); // force color bin to have a lower bound color\n }\n // set default values for ranges if ranges not explicit\n if (!ranges) {\n if (data && data.length > 0) {\n const min = data.length > 0 ? Math.min.apply(null, data) : undefined;\n const max = data.length > 0 ? Math.max.apply(null, data) : undefined;\n colorRanges = [min];\n for (let i = 1; i < colorValues.length - 1; i += 1) {\n colorRanges.push(min + (i * (max - min)) / (colorValues.length - 1));\n }\n colorRanges.push(max);\n } else {\n colorRanges = [0, 1]; // no data values, so just make the range from zero to 1\n }\n }\n\n if (colorRanges.length === 1) {\n colorRanges.push(colorRanges[0]); // force range to be at least two values\n }\n colorRanges.sort((a, b) => a - b); // force ascending order of range stops\n if (colorRanges.length !== colorValues.length) {\n errorHandler(VALUES_AND_RANGES_HAVE_DIFFERENT_LENGTH);\n return errorColor();\n }\n\n const floatVal = parseFloat(value);\n\n // don't let value be outside the allowed range\n if (floatVal > parseFloat(colorRanges[colorRanges.length - 1])) {\n return chroma(colorValues[colorValues.length - 1])\n .hex()\n .toUpperCase(); // high end\n }\n if (floatVal < parseFloat(colorRanges[0])) {\n return chroma(colorValues[0]).hex().toUpperCase(); // low end\n }\n\n // find the color gradient range that the value is inside\n for (let i = 1; i < colorRanges.length; i += 1) {\n // bad range value\n if (Number.isNaN(Number(colorRanges[i]))) {\n // eslint-disable-next-line\n errorHandler(NON_NUMERIC_RANGE_ERROR);\n return errorColor();\n }\n\n const upperVal = colorRanges[i];\n if (floatVal <= upperVal) {\n // if value is inside the bin\n const lowerVal = colorRanges[i - 1];\n let tau = (value - lowerVal) / (upperVal - lowerVal);\n\n // deal with special case when the upper and lower and bounds of the colorRange is equal\n if (upperVal === lowerVal) {\n if (value === 0) {\n // user prolly expects lower end of color range if value is zero\n tau = 0;\n } else {\n tau = 1; // otherwise use the upper bound\n }\n }\n\n const upperColor = colorValues[i];\n const lowerColor = colorValues[i - 1];\n return chroma.scale([lowerColor, upperColor])(tau).hex().toUpperCase();\n }\n }\n }\n // eslint-disable-next-line\n errorHandler(`${INVALID_VALUE} ${value}`);\n return errorColor();\n};\n\nconst formatters = {\n rangevalue: rangeValueFormat,\n matchvalue: matchValueFormat,\n gradient: colorGradientFormat,\n};\n\nexport const MAX_LOGGED_FORMATTER_ERRORS = 10;\nexport const newFormatterErrorHandler = (maxErrors, handlerFunc) => {\n let errorCount = 0;\n return msg => {\n if (errorCount < maxErrors) {\n handlerFunc(msg);\n }\n errorCount += 1;\n };\n};\n\n/**\n * returns a formatter function based on a format config\n * @param {Object} formatCfg formatter config\n * @param {number[]} formatCfg.ranges an array of numeric ranges that will be used to map to values. requires formatCfg.values\n * @param {*[]} formatCfg.values an array of values to map to. can be used with formatCfg.ranges or formatCfg.categories or formatCfg.gradient\n * @param {string[]|number[]} formatCfg.categories an array of categories. categories are used for a 1:1 mapping to values. requires formatCfg.values\n * @param {number[]} data the data to be formatted\n */\nexport const getFormatter = (data, formatCfg = {}) => {\n if (formatCfg.type) {\n if (formatters[formatCfg.type]) {\n // @TODO(pwied):\n // future: should formatters have prepare stage where params are validated\n // and additional formatting context is generated (e.g. min & max value)\n return value =>\n formatters[formatCfg.type](\n value,\n formatCfg,\n data,\n // eslint-disable-next-line no-console\n newFormatterErrorHandler(MAX_LOGGED_FORMATTER_ERRORS, msg => console.warn(msg))\n );\n }\n return value => value;\n }\n // @TODO(pwied):\n // - remove post beta deadline\n // - move to formatters with type option\n // - leaving it here for now because Choropleth builds on it\n const { ranges, values } = formatCfg;\n if (values) {\n if (ranges) {\n return value => rangeFormat(value, formatCfg);\n }\n\n if (formatCfg.categories) {\n return value => categoryFormat(value, formatCfg);\n }\n }\n // eslint-disable-next-line\n console.warn('Could not find a formatter. Falling back to identity fn');\n return value => value;\n};\n","import isNumber from 'lodash/isNumber';\nimport isFinite from 'lodash/isFinite';\n\n/**\n * getDataTypeForPoint\n * naive implementation of checking for the data type of a single data point\n * number > time > string > unknown\n * starting with number because a Date.parse(number) is a valid date\n *\n * @param {any} dataPoint\n * @return {string} type\n */\nexport const getDataTypeForPoint = dataPoint => {\n if (isFinite(+dataPoint) && isNumber(+dataPoint)) {\n return 'number';\n }\n if (!Number.isNaN(Date.parse(dataPoint))) {\n return 'time';\n }\n if (typeof dataPoint === 'string') {\n return 'string';\n }\n // nulls, objects, etc\n return 'unknown';\n};\n\n/**\n * inferDataTypeFromSample\n * based on a number of data points this function determines the data type for all of them\n * and returns the most common data type (naive type inference)\n *\n * @param {Array} dataSample an array of arbitrary size containing data points of any data type\n * @return {string} type the most common type in the sample\n */\nexport const inferDataTypeFromSample = dataSample => {\n const typeMatches = {\n time: 0,\n number: 0,\n string: 0,\n unknown: 0,\n };\n dataSample.forEach(point => {\n typeMatches[getDataTypeForPoint(point)] += 1;\n });\n let typeCount = -1;\n let returnType = 'unknown';\n Object.keys(typeMatches).forEach(key => {\n if (typeMatches[key] > typeCount) {\n typeCount = typeMatches[key];\n returnType = key;\n }\n });\n return returnType;\n};\n\n/**\n * based on a data array (e.g. one data column) this function returns a tiny sample of it\n * @TODO: very naive approach. there's papers with more advanced techniques but for now this should be very fast\n *\n * @param {Array} data to draw a sample from\n * @return {Array} a sample of the passed data\n */\nexport const drawSample = data => {\n if (data.length > 2) {\n return [data[0], data[Math.floor(data.length / 2)], data[data.length - 1]];\n }\n if (data.length === 2) {\n return [data[0], data[1]];\n }\n // small enough to check everything\n return data;\n};\n","import findIndex from 'lodash/findIndex';\nimport isNumber from 'lodash/isNumber';\nimport isEmpty from 'lodash/isEmpty';\nimport clone from 'lodash/clone';\nimport { getFormatter } from './util/format';\nimport { inferDataTypeFromSample, drawSample } from './util/types';\n\nconst getDataForDataSourceType = (data, dataSourceType) => {\n if (!dataSourceType || !data[dataSourceType] || !data[dataSourceType].data) {\n // @TODO: warn about datasource type not being found\n return {\n fields: [],\n columns: [],\n };\n }\n return data[dataSourceType].data;\n};\n/*\n * parse fieldIndexRangeStr\n * @param {String} fieldIndexRangeStr '0:', '0:5', ':5'\n * @returns {Object} info about parsed range if there is any\n */\nexport const parseFieldRangeReference = fieldIndexRangeStr => {\n if (!fieldIndexRangeStr || fieldIndexRangeStr.indexOf(':') === -1) {\n return {\n isFieldIndexRange: false,\n };\n }\n const [fromFieldIndexStr, toFieldIndexStr] = fieldIndexRangeStr.split(':');\n return {\n isFieldIndexRange: true,\n fromFieldIndex:\n Number.isNaN(Number(fromFieldIndexStr)) || !fromFieldIndexStr ? 0 : Number(fromFieldIndexStr),\n toFieldIndex:\n Number.isNaN(Number(toFieldIndexStr)) || !toFieldIndexStr ? -1 : Number(toFieldIndexStr),\n };\n};\n/*\n * parse fieldReferenceStr to get field index and column index for user defined encoding. e.g. 'primary[1][123]'\n * @param {String} fieldReferenceStr 'primary[1][123]'\n * @returns {Object} { fieldIndex: 1, columnIndex: 123, isFieldIndexRange: true, fromFieldIndexRange: 0, toFieldIndexRange: 3 }\n */\nexport const parseIndexBasedFieldReference = fieldReferenceStr => {\n const indices = fieldReferenceStr\n .replace(/^[A-Za-z0-9]+/, '')\n .replace(/\\[/g, '')\n .replace(/\\]/g, ',')\n .split(',');\n const dataSourceName = fieldReferenceStr.match(/^[A-Za-z0-9]+/)[0];\n const fieldRange = parseFieldRangeReference(indices[0]);\n return {\n dataSourceName,\n fieldIndex: Number.isNaN(Number(indices[0])) || !indices[0] ? null : Number(indices[0]),\n columnIndex: Number.isNaN(Number(indices[1])) || !indices[1] ? null : Number(indices[1]),\n ...fieldRange,\n };\n};\n\n/*\n * parse fieldReferenceStr to get field name and column index for user defined encoding. e.g. 'primary.color[123]'\n * @param {String} fieldReferenceStr 'primary.color[123]'\n * @returns {Object} { fieldName: 'color', columnIndex: 123 }\n */\nexport const parseNameBasedFieldReference = fieldReferenceStr => {\n const dataSourceName = fieldReferenceStr.match(/^[A-Za-z0-9]+/)[0];\n const fieldNameStr = fieldReferenceStr.split('.')[1];\n const splitedStr = fieldNameStr.split('[');\n const fieldName = splitedStr[0];\n const columnIndex = splitedStr[1] ? Number(splitedStr[1].replace(']', '')) : null;\n\n return { dataSourceName, fieldName, columnIndex };\n};\n\nconst getDataForIndexBasedFieldReference = (data, fieldReferenceStr) => {\n const { fields, columns } = data;\n const {\n dataSourceName,\n isFieldIndexRange,\n fromFieldIndex,\n toFieldIndex,\n fieldIndex,\n columnIndex,\n } = parseIndexBasedFieldReference(fieldReferenceStr);\n\n if (isFieldIndexRange) {\n const dataForRange = [];\n if (fromFieldIndex > -1) {\n const endIndex =\n toFieldIndex > -1 ? Math.min(fields.length - 1, toFieldIndex) : fields.length + toFieldIndex;\n for (let i = fromFieldIndex; i <= endIndex; i += 1) {\n dataForRange.push(\n getDataForIndexBasedFieldReference(data, `${dataSourceName}[${i}][${columnIndex}]`)\n );\n }\n return dataForRange;\n }\n }\n\n if (isNumber(fieldIndex)) {\n const isNegative = fieldIndex < 0;\n const absoluteIndex = Math.abs(fieldIndex);\n if (\n (isNegative && absoluteIndex > fields.length) ||\n (!isNegative && fieldIndex > fields.length - 1)\n ) {\n // The field index is out of bounds\n return {};\n }\n const correctedFieldIndex = isNegative ? fields.length - absoluteIndex : fieldIndex;\n const fieldName =\n typeof fields[correctedFieldIndex] === 'object'\n ? fields[correctedFieldIndex].name\n : fields[correctedFieldIndex];\n\n let fieldData;\n if (isNumber(columnIndex)) {\n const isNegativeColumnIndex = columnIndex < 0;\n\n if (\n (isNegativeColumnIndex && columnIndex < -columns[correctedFieldIndex].length) ||\n columnIndex >= columns[correctedFieldIndex].length\n ) {\n // The column index is out of bounds\n return {};\n }\n const correctColumnIndex = isNegativeColumnIndex\n ? columns[correctedFieldIndex].length + columnIndex\n : columnIndex;\n fieldData = columns[correctedFieldIndex].map(\n () => columns[correctedFieldIndex][correctColumnIndex]\n );\n } else {\n fieldData = columns[correctedFieldIndex];\n }\n return {\n fieldName,\n data: fieldData,\n };\n }\n return {};\n};\n\nconst getDataForNameBasedFieldReference = (data, fieldReferenceStr) => {\n const { fields, columns } = data;\n const { fieldName, columnIndex } = parseNameBasedFieldReference(fieldReferenceStr); // <datasource>.<fieldname>[0]\n\n if (fieldName) {\n const fieldIndex = findIndex(fields, field =>\n typeof field === 'object' ? field.name === fieldName : field === fieldName\n );\n if (fieldIndex > -1) {\n let fieldData;\n if (isNumber(columnIndex)) {\n const isNegativeColumnIndex = columnIndex < 0;\n\n if (\n (isNegativeColumnIndex && columnIndex < -columns[fieldIndex].length) ||\n columnIndex >= columns[fieldIndex].length\n ) {\n // The column index is out of bounds\n return {};\n }\n const correctColumnIndex = isNegativeColumnIndex\n ? columns[fieldIndex].length + columnIndex\n : columnIndex;\n fieldData = columns[fieldIndex].map(() => columns[fieldIndex][correctColumnIndex]);\n } else {\n fieldData = columns[fieldIndex];\n }\n return {\n fieldName,\n data: fieldData,\n };\n }\n // eslint-disable-next-line\n console.warn(`field '${fieldName}' not available.`);\n return {};\n }\n return {};\n};\n\nconst getDataForFieldReference = (dataSources, fieldReference) => {\n let fieldReferenceStr = fieldReference;\n let formatValue;\n if (Array.isArray(fieldReference) && !fieldReference.isDefault) {\n return fieldReference.map(ref => getDataForFieldReference(dataSources, ref));\n }\n // if the reference is a default and there is multiple default fields to fall back\n if (fieldReference.isDefault && Array.isArray(fieldReference.field)) {\n // iterate through all defaults and check whether the data type matches the expected type\n for (let i = 0; i < fieldReference.field.length; i += 1) {\n fieldReferenceStr = fieldReference.field[i];\n const dataFromDefault = getDataForFieldReference(dataSources, fieldReferenceStr);\n if (Array.isArray(dataFromDefault.data)) {\n const type = inferDataTypeFromSample(drawSample(dataFromDefault.data));\n if (fieldReference.type.indexOf(type) > -1) {\n return dataFromDefault;\n }\n }\n }\n // if none of the defaults matched the data type use the last default\n }\n if (typeof fieldReference === 'object') {\n const { field } = fieldReference;\n if (field && !Array.isArray(field)) {\n fieldReferenceStr = field;\n }\n }\n\n const indexBasedRegx = /^[A-Za-z0-9_]+\\[.*\\].*$/;\n const nameBasedRegx = /^[A-Za-z0-9_]+\\..*$/;\n const isIndexBasedReference = indexBasedRegx.test(fieldReferenceStr);\n const isNameBasedReference = nameBasedRegx.test(fieldReferenceStr);\n\n if (!isIndexBasedReference && !isNameBasedReference) {\n // Unable to parse the encoding. Please verify the encoding format is correct\n return {};\n }\n\n const dataSourceType = fieldReferenceStr.match(/^(.*?)(\\.|\\[)/)[1];\n const data = getDataForDataSourceType(dataSources, dataSourceType);\n let fieldData;\n\n if (isIndexBasedReference) {\n fieldData = getDataForIndexBasedFieldReference(data, fieldReferenceStr);\n } else {\n fieldData = getDataForNameBasedFieldReference(data, fieldReferenceStr);\n }\n\n if (typeof fieldReference === 'object') {\n const { format } = fieldReference;\n if (format) {\n formatValue = getFormatter(fieldData.data, format);\n }\n }\n\n if (formatValue && !isEmpty(fieldData)) {\n return {\n fieldName: fieldData.fieldName,\n data: fieldData.data.map(formatValue),\n };\n }\n return fieldData;\n};\n\nexport const mergeEncoding = (defaultEncoding, userDefinedEncoding = {}) => {\n const mergedEncoding = { ...userDefinedEncoding };\n Object.keys(defaultEncoding).forEach(key => {\n if (\n isEmpty(userDefinedEncoding[key]) &&\n defaultEncoding[key].isRequired &&\n defaultEncoding[key].default\n ) {\n mergedEncoding[key] =\n typeof defaultEncoding[key].default === 'object' &&\n !Array.isArray(defaultEncoding[key].default)\n ? {\n ...defaultEncoding[key].default,\n isDefault: true,\n type: defaultEncoding[key].type,\n }\n : {\n field: defaultEncoding[key].default,\n isDefault: true,\n type: defaultEncoding[key].type,\n };\n }\n });\n return mergedEncoding;\n};\n\nexport const parse = (dataSources, encoding = {}) => {\n const parsedOutput = {\n _meta: {\n fieldNames: {},\n types: {},\n },\n };\n\n Object.keys(encoding).forEach(key => {\n let fieldReference = clone(encoding[key]);\n\n // handle the case for encoding field reference, for example fill: 'encoding.trend'\n if (\n typeof fieldReference === 'object' &&\n fieldReference.field &&\n fieldReference.field.indexOf('encoding') === 0\n ) {\n const replacedKey = fieldReference.field.split('.')[1];\n\n // return for the below invalid cases\n // `encoding.z` if `z` is not a valid field in encoding\n if (!encoding[replacedKey]) {\n // eslint-disable-next-line\n console.warn(`${key} field cannot refer to 'encoding.${replacedKey}'.`);\n }\n // if `z` is an object configuration in encoding simply extract the field when refering `encoding.z`\n const field =\n typeof encoding[replacedKey] === 'object'\n ? encoding[replacedKey].field\n : encoding[replacedKey];\n fieldReference = {\n ...fieldReference,\n field,\n };\n }\n\n const dataForFieldReference = getDataForFieldReference(dataSources, fieldReference);\n\n if (Array.isArray(dataForFieldReference)) {\n parsedOutput[key] = dataForFieldReference.map(entry => entry.data);\n parsedOutput._meta.fieldNames[key] = dataForFieldReference.map(entry => entry.fieldName); // eslint-disable-line no-underscore-dangle\n // eslint-disable-next-line no-underscore-dangle\n parsedOutput._meta.types[key] = dataForFieldReference.map(entry =>\n inferDataTypeFromSample(drawSample(entry.data))\n );\n } else {\n const { fieldName, data } = dataForFieldReference;\n if (fieldName) {\n parsedOutput[key] = data;\n parsedOutput._meta.fieldNames[key] = fieldName; // eslint-disable-line no-underscore-dangle\n // eslint-disable-next-line no-underscore-dangle\n parsedOutput._meta.types[key] = inferDataTypeFromSample(drawSample(data));\n }\n }\n });\n\n return parsedOutput;\n};\n"],"sourceRoot":""}
|
package/BubbleParser.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 18);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -106,7 +106,7 @@ module.exports = require("@splunk/visualization-encoding-parsers/Base");
|
|
|
106
106
|
|
|
107
107
|
/***/ }),
|
|
108
108
|
|
|
109
|
-
/***/
|
|
109
|
+
/***/ 18:
|
|
110
110
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
111
111
|
|
|
112
112
|
"use strict";
|
package/BubbleParser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/BubbleParser.js","webpack:///./src/errorMsgs.js","webpack:///external \"lodash/isEmpty\""],"names":["dataContract","requiredDataSources","name","description","initialRequestParams","primary","offset","count","encoding","x","isRequired","type","default","y","size","category","parse","isEmpty","ErrorMsgs","mergeEncoding","parsedProps","baseParse","xFieldName","yFieldName","categoryFieldName","sizeFieldName","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,kD;;;;;;;ACAA,wE;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEO,IAAMA,YAAY,GAAG;AACxBC,qBAAmB,EAAE,CACjB;AACIC,QAAI,EADR;AAEIC,eAAW,EAAE;AAFjB,GADiB,CADG;AAOxBC,sBAAoB,EAAE;AAClBC,WAAO,EAAE;AAAEC,YAAM,EAAR;AAAaC,WAAK,EAAE;AAApB;AADS,GAPE;AAUxBC,UAAQ,EAAE;AACNC,KAAC,EAAE;AACCC,gBAAU,EADX;AAECC,UAAI,EAAE,WAFP,QAEO,CAFP;AAGCC,aAAO,EAAE;AAHV,KADG;AAMNC,KAAC,EAAE;AACCH,gBAAU,EADX;AAECC,UAAI,EAAE,WAFP,QAEO,CAFP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tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s =
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/BubbleParser.js","webpack:///./src/errorMsgs.js","webpack:///external \"lodash/isEmpty\""],"names":["dataContract","requiredDataSources","name","description","initialRequestParams","primary","offset","count","encoding","x","isRequired","type","default","y","size","category","parse","isEmpty","ErrorMsgs","mergeEncoding","parsedProps","baseParse","xFieldName","yFieldName","categoryFieldName","sizeFieldName","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,kD;;;;;;;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AAU,EAAEH,WAAW,CAAXA,OAAW,CAAXA,YANT;AAM4C;AAC/CI,qBAAiB,EAAEJ,WAAW,CAAXA,OAAW,CAAXA,YAPhB;AAO0D;AAC7DK,iBAAa,EAAEL,WAAW,CAAXA,OAAW,CAAXA,YARZ,KAQkD;;AARlD,GAAP;AARG,E;;;;;;;;AC5CP;AAAA;AAAA;AAAA;AAAA;AAEO,IAAMF,SAAS,GAAG;AACrBQ,iBAAe,EAAEC,+DAAC,CADG,uBACH,CADG;AAErBC,aAAW,EAAED,+DAAC,CAFO,oBAEP,CAFO;AAGrBE,aAAW,EAAEF,+DAAC;AAHO,CAAlB,C;;;;;;;ACFP,2C","file":"BubbleParser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 18);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","import { parse as baseParse, mergeEncoding } from '@splunk/visualization-encoding-parsers/Base';\nimport isEmpty from 'lodash/isEmpty';\nimport { ErrorMsgs } from './errorMsgs';\n\nexport const dataContract = {\n requiredDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization',\n },\n ],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n encoding: {\n x: {\n isRequired: true,\n type: ['number', 'string'],\n default: 'primary[0]',\n },\n y: {\n isRequired: true,\n type: ['number', 'string'],\n default: 'primary[1]',\n },\n size: {\n isRequired: true,\n type: ['number', 'string'],\n default: 'primary[2]',\n },\n category: {\n isRequired: false,\n type: ['number', 'string'],\n },\n },\n};\n\n/**\n * Bubble parse function\n * @param {object} dataSources\n * @param {object} userDefinedEncoding\n * @return {object} props that dashboard/react visualizations can be used.\n * @public\n */\nexport const parse = (dataSources, userDefinedEncoding) => {\n if (isEmpty(dataSources)) {\n throw new Error(ErrorMsgs.NO_DATA_SOURCES);\n }\n\n const encoding = mergeEncoding(dataContract.encoding, userDefinedEncoding);\n const parsedProps = baseParse(dataSources, encoding);\n\n return {\n x: parsedProps.x,\n y: parsedProps.y,\n category: parsedProps.category,\n size: parsedProps.size,\n xFieldName: parsedProps['_meta'].fieldNames.x, // eslint-disable-line dot-notation\n yFieldName: parsedProps['_meta'].fieldNames.y, // eslint-disable-line dot-notation\n categoryFieldName: parsedProps['_meta'].fieldNames.category, // eslint-disable-line dot-notation\n sizeFieldName: parsedProps['_meta'].fieldNames.size, // eslint-disable-line dot-notation\n };\n};\n","import { _ } from '@splunk/ui-utils/i18n';\n\nexport const ErrorMsgs = {\n NO_DATA_SOURCES: _('No valid dataSources.'),\n NO_ENCODING: _('No valid encoding.'),\n ERROR_PARSE: _('Can not parse data correctly.'),\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
|
package/ChoroplethParser.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 19);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -99,7 +99,7 @@ module.exports = require("@splunk/visualization-encoding-parsers/Base");
|
|
|
99
99
|
|
|
100
100
|
/***/ }),
|
|
101
101
|
|
|
102
|
-
/***/
|
|
102
|
+
/***/ 19:
|
|
103
103
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
104
104
|
|
|
105
105
|
"use strict";
|
package/ChoroplethParser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/ChoroplethParser.js"],"names":["dataContract","requiredDataSources","optionalDataSources","name","description","initialRequestParams","primary","offset","count","encoding","featureId","isRequired","type","default","value","fill","field","format","values","parse","mergeEncoding","parsedProps","baseParse"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,wE;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAMA,YAAY,GAAG;AACxBC,qBAAmB,EADK;AAExBC,qBAAmB,EAAE,CACjB;AACIC,QAAI,EADR;AAEIC,eAAW,EAAE;AAFjB,GADiB,CAFG;AAQxBC,sBAAoB,EAAE;AAClBC,WAAO,EAAE;AAAEC,YAAM,EAAR;AAAaC,WAAK,EAAE;AAApB;AADS,GARE;AAWxBC,UAAQ,EAAE;AACNC,aAAS,EAAE;AACPC,gBAAU,EADH;AAEPC,UAAI,EAAE,CAFC,QAED,CAFC;AAGPC,aAAO,EAAE;AAHF,KADL;AAMNC,SAAK,EAAE;AACHH,gBAAU,EADP;AAEHC,UAAI,EAAE,CAFH,QAEG,CAFH;AAGHC,aAAO,EAAE;AAHN,KAND;AAWNE,QAAI,EAAE;AACFJ,gBAAU,EADR;AAEFC,UAAI,EAAE,WAFJ,QAEI,CAFJ;AAGFC,aAAO,EAAE;AACLG,aAAK,EADA;AAELC,cAAM,EAAE;AACJL,cAAI,EADA;AAEJM,gBAAM,EAAE;AAFJ;AAFH;AAHP;AAXA;AAXc,CAArB;AAoCP;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMC,KAAK,GAAG,SAARA,KAAQ,mCAAsC;AACvD,MAAMV,QAAQ,GAAGW,iGAAa,CAACpB,YAAY,CAAb,UAA9B,mBAA8B,CAA9B;AACA,MAAMqB,WAAW,GAAGC,yFAAS,cAA7B,QAA6B,CAA7B;AAEA,SAAO;AACHP,QAAI,EAAEM,WAAW,CADd;AAEHP,SAAK,EAAEO,WAAW,CAFf;AAGHX,aAAS,EAAEW,WAAW,CAACX;AAHpB,GAAP;AAJG,E","file":"ChoroplethParser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s =
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/ChoroplethParser.js"],"names":["dataContract","requiredDataSources","optionalDataSources","name","description","initialRequestParams","primary","offset","count","encoding","featureId","isRequired","type","default","value","fill","field","format","values","parse","mergeEncoding","parsedProps","baseParse"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,wE;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAMA,YAAY,GAAG;AACxBC,qBAAmB,EADK;AAExBC,qBAAmB,EAAE,CACjB;AACIC,QAAI,EADR;AAEIC,eAAW,EAAE;AAFjB,GADiB,CAFG;AAQxBC,sBAAoB,EAAE;AAClBC,WAAO,EAAE;AAAEC,YAAM,EAAR;AAAaC,WAAK,EAAE;AAApB;AADS,GARE;AAWxBC,UAAQ,EAAE;AACNC,aAAS,EAAE;AACPC,gBAAU,EADH;AAEPC,UAAI,EAAE,CAFC,QAED,CAFC;AAGPC,aAAO,EAAE;AAHF,KADL;AAMNC,SAAK,EAAE;AACHH,gBAAU,EADP;AAEHC,UAAI,EAAE,CAFH,QAEG,CAFH;AAGHC,aAAO,EAAE;AAHN,KAND;AAWNE,QAAI,EAAE;AACFJ,gBAAU,EADR;AAEFC,UAAI,EAAE,WAFJ,QAEI,CAFJ;AAGFC,aAAO,EAAE;AACLG,aAAK,EADA;AAELC,cAAM,EAAE;AACJL,cAAI,EADA;AAEJM,gBAAM,EAAE;AAFJ;AAFH;AAHP;AAXA;AAXc,CAArB;AAoCP;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMC,KAAK,GAAG,SAARA,KAAQ,mCAAsC;AACvD,MAAMV,QAAQ,GAAGW,iGAAa,CAACpB,YAAY,CAAb,UAA9B,mBAA8B,CAA9B;AACA,MAAMqB,WAAW,GAAGC,yFAAS,cAA7B,QAA6B,CAA7B;AAEA,SAAO;AACHP,QAAI,EAAEM,WAAW,CADd;AAEHP,SAAK,EAAEO,WAAW,CAFf;AAGHX,aAAS,EAAEW,WAAW,CAACX;AAHpB,GAAP;AAJG,E","file":"ChoroplethParser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 19);\n","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","import { parse as baseParse, mergeEncoding } from '@splunk/visualization-encoding-parsers/Base';\n\nexport const dataContract = {\n requiredDataSources: [],\n optionalDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization',\n },\n ],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n encoding: {\n featureId: {\n isRequired: true,\n type: ['string'],\n default: 'primary[0]',\n },\n value: {\n isRequired: true,\n type: ['number'],\n default: 'primary[1]',\n },\n fill: {\n isRequired: true,\n type: ['number', 'string'],\n default: {\n field: 'primary[1]',\n format: {\n type: 'gradient',\n values: ['#7EEFDA', '#6484F6', '#C093F9', '#293873'],\n },\n },\n },\n },\n};\n\n/**\n * Choropleth parse function\n * @param {object} dataSources\n * @param {object} encoding\n * @return {object} props that dashboard/react visualizations can be used.\n * @public\n */\nexport const parse = (dataSources, userDefinedEncoding) => {\n const encoding = mergeEncoding(dataContract.encoding, userDefinedEncoding);\n const parsedProps = baseParse(dataSources, encoding);\n\n return {\n fill: parsedProps.fill,\n value: parsedProps.value,\n featureId: parsedProps.featureId,\n };\n};\n"],"sourceRoot":""}
|
package/ColumnParser.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 20);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -123,7 +123,7 @@ var ErrorMsgs = {
|
|
|
123
123
|
|
|
124
124
|
/***/ }),
|
|
125
125
|
|
|
126
|
-
/***/
|
|
126
|
+
/***/ 20:
|
|
127
127
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
128
128
|
|
|
129
129
|
"use strict";
|