@splunk/visualization-encoding-parsers 25.7.2 → 25.8.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/LineParser.js CHANGED
@@ -143,7 +143,8 @@ var dataContract = {
143
143
  name: 'primary',
144
144
  description: 'DataSource that powers the visualization'
145
145
  }],
146
- optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
146
+ optionalDataSources: [
147
+ // Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
147
148
  // {
148
149
  // name: 'annotation',
149
150
  // description: 'DataSource that populate event annotations',
@@ -188,6 +189,7 @@ var dataContract = {
188
189
  }
189
190
  }
190
191
  };
192
+
191
193
  /**
192
194
  * Line parse function
193
195
  * @param {object} dataSources
@@ -195,12 +197,10 @@ var dataContract = {
195
197
  * @return {object} props that dashboard/react visualizations can be used.
196
198
  * @public
197
199
  */
198
-
199
200
  var parse = function parse(dataSources, userDefinedEncoding) {
200
201
  if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(dataSources)) {
201
202
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].NO_DATA_SOURCES);
202
203
  }
203
-
204
204
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["mergeEncoding"])(dataContract.encoding, userDefinedEncoding);
205
205
  var parsedProps = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["parse"])(dataSources, encoding);
206
206
  return {
@@ -215,7 +215,6 @@ var parse = function parse(dataSources, userDefinedEncoding) {
215
215
  yFieldName: parsedProps['_meta'].fieldNames.y,
216
216
  // eslint-disable-line dot-notation
217
217
  y2FieldName: parsedProps['_meta'].fieldNames.y2 // eslint-disable-line dot-notation
218
-
219
218
  };
220
219
  };
221
220
 
package/LineParser.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/errorMsgs.js","webpack:///./src/LineParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","optionalDataSources","initialRequestParams","primary","offset","count","annotation","encoding","x","isRequired","type","default","y","y2","annotationX","annotationLabel","annotationColor","parse","isEmpty","mergeEncoding","parsedProps","baseParse","xFieldName","yFieldName","y2FieldName"],"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;AAEO,IAAMA,SAAS,GAAG;AACrBC,iBAAe,EAAEC,+DAAC,CADG,uBACH,CADG;AAErBC,aAAW,EAAED,+DAAC,CAFO,oBAEP,CAFO;AAGrBE,aAAW,EAAEF,+DAAC;AAHO,CAAlB,C;;;;;;;;ACFP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEO,IAAMG,YAAY,GAAG;AACxBC,qBAAmB,EAAE,CACjB;AACIC,QAAI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AAEM,WAAW,CAJrB;AAKHL,mBAAe,EAAEK,WAAW,CALzB;AAMHJ,mBAAe,EAAEI,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,2C","file":"LineParser.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 = 22);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","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 * Line 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","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/errorMsgs.js","webpack:///./src/LineParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","optionalDataSources","initialRequestParams","primary","offset","count","annotation","encoding","x","isRequired","type","default","y","y2","annotationX","annotationLabel","annotationColor","parse","dataSources","userDefinedEncoding","isEmpty","Error","mergeEncoding","parsedProps","baseParse","xFieldName","fieldNames","yFieldName","y2FieldName"],"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;AAA0C;AAEnC,IAAMA,SAAS,GAAG;EACrBC,eAAe,EAAEC,+DAAC,CAAC,uBAAuB,CAAC;EAC3CC,WAAW,EAAED,+DAAC,CAAC,oBAAoB,CAAC;EACpCE,WAAW,EAAEF,+DAAC,CAAC,+BAA+B;AAClD,CAAC,C;;;;;;;;ACND;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAgG;AAC3D;AACG;AAEjC,IAAMG,YAAY,GAAG;EACxBC,mBAAmB,EAAE,CACjB;IACIC,IAAI,EAAE,SAAS;IACfC,WAAW,EAAE;EACjB,CAAC,CACJ;EACDC,mBAAmB,EAAE;IACjB;IACA;IACA;IACA;IACA;EAAA,CACH;EACDC,oBAAoB,EAAE;IAClBC,OAAO,EAAE;MAAEC,MAAM,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAM,CAAC;IACpCC,UAAU,EAAE;MAAEF,MAAM,EAAE,CAAC;MAAEC,KAAK,EAA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W;IACpCC,eAAe,EAAEQ,WAAW,CAACR,eAAe;IAC5CC,eAAe,EAAEO,WAAW,CAACP,eAAe;IAC5CS,UAAU,EAAEF,WAAW,CAAC,OAAO,CAAC,CAACG,UAAU,CAAClB,CAAC;IAAE;IAC/CmB,UAAU,EAAEJ,WAAW,CAAC,OAAO,CAAC,CAACG,UAAU,CAACd,CAAC;IAAE;IAC/CgB,WAAW,EAAEL,WAAW,CAAC,OAAO,CAAC,CAACG,UAAU,CAACb,EAAE,CAAE;EACrD,CAAC;AACL,CAAC,C;;;;;;;AC9ED,2C","file":"LineParser.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 = 22);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","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 * Line 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","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
@@ -158,6 +158,7 @@ var dataContract = {
158
158
  }
159
159
  }
160
160
  };
161
+
161
162
  /**
162
163
  * MarkerGauge parse function
163
164
  * @param {object} dataSources
@@ -165,12 +166,10 @@ var dataContract = {
165
166
  * @return {object} props that dashboard/react visualizations can be used.
166
167
  * @public
167
168
  */
168
-
169
169
  var parse = function parse(dataSources, userDefinedEncoding) {
170
170
  if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(dataSources)) {
171
171
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].NO_DATA_SOURCES);
172
172
  }
173
-
174
173
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["mergeEncoding"])(dataContract.encoding, userDefinedEncoding);
175
174
  var parsedProps = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["parse"])(dataSources, encoding);
176
175
  return {
@@ -178,7 +177,6 @@ var parse = function parse(dataSources, userDefinedEncoding) {
178
177
  valueFieldName: parsedProps['_meta'].fieldNames.value,
179
178
  // eslint-disable-line dot-notation
180
179
  valueType: parsedProps['_meta'].types.value // eslint-disable-line dot-notation
181
-
182
180
  };
183
181
  };
184
182
 
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/errorMsgs.js","webpack:///./src/MarkerGaugeParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","optionalDataSources","initialRequestParams","primary","offset","count","encoding","value","isRequired","type","default","parse","isEmpty","mergeEncoding","parsedProps","baseParse","parseInt","valueFieldName","valueType"],"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,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,WAAW,CAAXA,OAAW,CAAXA,OAHR,MAG0C;;AAH1C,GAAP;AARG,E;;;;;;;AC/BP,2C","file":"MarkerGaugeParser.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 = 23);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","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 initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n encoding: {\n value: {\n isRequired: true,\n type: 'number',\n default: 'primary[0][-1]',\n },\n },\n};\n\n/**\n * MarkerGauge 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 value: parseInt(parsedProps.value, 10),\n valueFieldName: parsedProps['_meta'].fieldNames.value, // eslint-disable-line dot-notation\n valueType: parsedProps['_meta'].types.value, // eslint-disable-line dot-notation\n };\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/errorMsgs.js","webpack:///./src/MarkerGaugeParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","optionalDataSources","initialRequestParams","primary","offset","count","encoding","value","isRequired","type","default","parse","dataSources","userDefinedEncoding","isEmpty","Error","mergeEncoding","parsedProps","baseParse","parseInt","valueFieldName","fieldNames","valueType","types"],"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;AAA0C;AAEnC,IAAMA,SAAS,GAAG;EACrBC,eAAe,EAAEC,+DAAC,CAAC,uBAAuB,C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// 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 = 23);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","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 initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n encoding: {\n value: {\n isRequired: true,\n type: 'number',\n default: 'primary[0][-1]',\n },\n },\n};\n\n/**\n * MarkerGauge 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 value: parseInt(parsedProps.value, 10),\n valueFieldName: parsedProps['_meta'].fieldNames.value, // eslint-disable-line dot-notation\n valueType: parsedProps['_meta'].types.value, // eslint-disable-line dot-notation\n };\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
package/PieParser.js CHANGED
@@ -164,11 +164,9 @@ var dataContract = {
164
164
  };
165
165
  var parse = function parse(dataSources) {
166
166
  var userDefinedEncoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
167
-
168
167
  if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(dataSources)) {
169
168
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].NO_DATA_SOURCES);
170
169
  }
171
-
172
170
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_1__["mergeEncoding"])(dataContract.encodings, userDefinedEncoding);
173
171
  var data = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_1__["parse"])(dataSources, encoding);
174
172
  return {
@@ -177,7 +175,6 @@ var parse = function parse(dataSources) {
177
175
  labelTitle: data['_meta'].fieldNames.label,
178
176
  // eslint-disable-line dot-notation
179
177
  valueTitle: data['_meta'].fieldNames.value // eslint-disable-line dot-notation
180
-
181
178
  };
182
179
  };
183
180
 
package/PieParser.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/errorMsgs.js","webpack:///./src/PieParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","initialRequestParams","primary","offset","count","encodings","value","isRequired","type","default","label","parse","userDefinedEncoding","isEmpty","encoding","mergeEncoding","data","baseParse","labelTitle","valueTitle"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA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D,MAAIC,qDAAO,CAAX,WAAW,CAAX,EAA0B;AACtB,UAAM,UAAUrB,oDAAS,CAAzB,eAAM,CAAN;AACH;;AAED,MAAMsB,QAAQ,GAAGC,iGAAa,CAAClB,YAAY,CAAb,WAA9B,mBAA8B,CAA9B;AACA,MAAMmB,IAAI,GAAGC,yFAAS,cAAtB,QAAsB,CAAtB;AACA,SAAO;AACHX,SAAK,EAAEU,IAAI,CADR;AAEHN,SAAK,EAAEM,IAAI,CAFR;AAGHE,cAAU,EAAEF,IAAI,CAAJA,OAAI,CAAJA,YAHT;AAGyC;AAC5CG,cAAU,EAAEH,IAAI,CAAJA,OAAI,CAAJA,YAJT,MAIyC;;AAJzC,GAAP;AAPG,E;;;;;;;AC5BP,2C","file":"PieParser.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 = 24);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","import isEmpty from 'lodash/isEmpty';\nimport { parse as baseParse, mergeEncoding } from '@splunk/visualization-encoding-parsers/Base';\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 encodings: {\n value: {\n isRequired: true,\n type: ['number'],\n default: 'primary[1]',\n },\n label: {\n isRequired: true,\n type: ['string'],\n default: 'primary[0]',\n },\n },\n};\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.encodings, userDefinedEncoding);\n const data = baseParse(dataSources, encoding);\n return {\n value: data.value,\n label: data.label,\n labelTitle: data['_meta'].fieldNames.label, // eslint-disable-line dot-notation\n valueTitle: data['_meta'].fieldNames.value, // eslint-disable-line dot-notation\n };\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/errorMsgs.js","webpack:///./src/PieParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","initialRequestParams","primary","offset","count","encodings","value","isRequired","type","default","label","parse","dataSources","userDefinedEncoding","arguments","length","undefined","isEmpty","Error","encoding","mergeEncoding","data","baseParse","labelTitle","fieldNames","valueTitle"],"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;Q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QAAQ,GAAGC,iGAAa,CAACvB,YAAY,CAACQ,SAAS,EAAEQ,mBAAmB,CAAC;EAC3E,IAAMQ,IAAI,GAAGC,yFAAS,CAACV,WAAW,EAAEO,QAAQ,CAAC;EAC7C,OAAO;IACHb,KAAK,EAAEe,IAAI,CAACf,KAAK;IACjBI,KAAK,EAAEW,IAAI,CAACX,KAAK;IACjBa,UAAU,EAAEF,IAAI,CAAC,OAAO,CAAC,CAACG,UAAU,CAACd,KAAK;IAAE;IAC5Ce,UAAU,EAAEJ,IAAI,CAAC,OAAO,CAAC,CAACG,UAAU,CAAClB,KAAK,CAAE;EAChD,CAAC;AACL,CAAC,C;;;;;;;ACzCD,2C","file":"PieParser.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 = 24);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","import isEmpty from 'lodash/isEmpty';\nimport { parse as baseParse, mergeEncoding } from '@splunk/visualization-encoding-parsers/Base';\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 encodings: {\n value: {\n isRequired: true,\n type: ['number'],\n default: 'primary[1]',\n },\n label: {\n isRequired: true,\n type: ['string'],\n default: 'primary[0]',\n },\n },\n};\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.encodings, userDefinedEncoding);\n const data = baseParse(dataSources, encoding);\n return {\n value: data.value,\n label: data.label,\n labelTitle: data['_meta'].fieldNames.label, // eslint-disable-line dot-notation\n valueTitle: data['_meta'].fieldNames.value, // eslint-disable-line dot-notation\n };\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
@@ -172,6 +172,7 @@ var dataContract = {
172
172
  }
173
173
  }
174
174
  };
175
+
175
176
  /**
176
177
  * Punchcard parse function
177
178
  * @param {object} dataSources
@@ -179,28 +180,22 @@ var dataContract = {
179
180
  * @return {object} props that dashboard/react visualizations can be used.
180
181
  * @public
181
182
  */
182
-
183
183
  var parse = function parse(dataSources, userDefinedEncoding) {
184
184
  if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(dataSources)) {
185
185
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].NO_DATA_SOURCES);
186
186
  }
187
-
188
187
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["mergeEncoding"])(dataContract.encoding, userDefinedEncoding);
189
188
  var parsedProps = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["parse"])(dataSources, encoding);
190
189
  var parsedSize = parsedProps.size;
191
-
192
190
  if (typeof parsedProps.size[0] === 'string') {
193
191
  parsedSize = parsedProps.size.map(function (sizeValue) {
194
192
  var parsedSizeNum = Number(sizeValue);
195
-
196
193
  if (Number.isNaN(Number(parsedSizeNum))) {
197
194
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].ERROR_PARSE);
198
195
  }
199
-
200
196
  return parsedSizeNum;
201
197
  });
202
198
  }
203
-
204
199
  return {
205
200
  x: parsedProps.x,
206
201
  y: parsedProps.y,
@@ -213,7 +208,6 @@ var parse = function parse(dataSources, userDefinedEncoding) {
213
208
  categoryFieldName: parsedProps['_meta'].fieldNames.category,
214
209
  // eslint-disable-line dot-notation
215
210
  sizeFieldName: parsedProps['_meta'].fieldNames.size // eslint-disable-line dot-notation
216
-
217
211
  };
218
212
  };
219
213
 
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/errorMsgs.js","webpack:///./src/PunchcardParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","initialRequestParams","primary","offset","count","encoding","x","isRequired","type","default","y","size","category","parse","isEmpty","mergeEncoding","parsedProps","baseParse","parsedSize","parsedSizeNum","Number","xFieldName","yFieldName","categoryFieldName","sizeFieldName"],"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;;;Q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A9B;AACA,MAAMmB,WAAW,GAAGC,yFAAS,cAA7B,QAA6B,CAA7B;AACA,MAAIC,UAAU,GAAGF,WAAW,CAA5B;;AAEA,MAAI,OAAOA,WAAW,CAAXA,KAAP,CAAOA,CAAP,KAAJ,UAA6C;AACzCE,cAAU,GAAG,WAAW,CAAX,SAAqB,qBAAa;AAC3C,UAAMC,aAAa,GAAGC,MAAM,CAA5B,SAA4B,CAA5B;;AACA,UAAIA,MAAM,CAANA,MAAaA,MAAM,CAAvB,aAAuB,CAAnBA,CAAJ,EAAyC;AACrC,cAAM,UAAU5B,oDAAS,CAAzB,WAAM,CAAN;AACH;;AACD;AALJ0B,KAAa,CAAbA;AAOH;;AAED,SAAO;AACHZ,KAAC,EAAEU,WAAW,CADX;AAEHN,KAAC,EAAEM,WAAW,CAFX;AAGHL,QAAI,EAHD;AAIHC,YAAQ,EAAEI,WAAW,CAJlB;AAKHK,cAAU,EAAEL,WAAW,CAAXA,OAAW,CAAXA,YALT;AAK4C;AAC/CM,cAAU,EAAEN,WAAW,CAAXA,OAAW,CAAXA,YANT;AAM4C;AAC/CO,qBAAiB,EAAEP,WAAW,CAAXA,OAAW,CAAXA,YAPhB;AAO0D;AAC7DQ,iBAAa,EAAER,WAAW,CAAXA,OAAW,CAAXA,YARZ,KAQkD;;AARlD,GAAP;AAnBG,E;;;;;;;AC7CP,2C","file":"PunchcardParser.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 = 25);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","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'],\n default: 'primary[2]',\n },\n category: {\n isRequired: false,\n type: ['string'],\n default: 'primary[3]',\n },\n },\n};\n\n/**\n * Punchcard 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 let parsedSize = parsedProps.size;\n\n if (typeof parsedProps.size[0] === 'string') {\n parsedSize = parsedProps.size.map(sizeValue => {\n const parsedSizeNum = Number(sizeValue);\n if (Number.isNaN(Number(parsedSizeNum))) {\n throw new Error(ErrorMsgs.ERROR_PARSE);\n }\n return parsedSizeNum;\n });\n }\n\n return {\n x: parsedProps.x,\n y: parsedProps.y,\n size: parsedSize,\n category: parsedProps.category,\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","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/errorMsgs.js","webpack:///./src/PunchcardParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","initialRequestParams","primary","offset","count","encoding","x","isRequired","type","default","y","size","category","parse","dataSources","userDefinedEncoding","isEmpty","Error","mergeEncoding","parsedProps","baseParse","parsedSize","map","sizeValue","parsedSizeNum","Number","isNaN","xFieldName","fieldNames","yFieldName","categoryFieldName","sizeFieldName"],"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;AAA0C;AAEnC,IAAMA,SAAS,GAAG;EACrBC,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AmB,CAAC;EAC1E,IAAMI,WAAW,GAAGC,yFAAS,CAACN,WAAW,EAAET,QAAQ,CAAC;EACpD,IAAIgB,UAAU,GAAGF,WAAW,CAACR,IAAI;EAEjC,IAAI,OAAOQ,WAAW,CAACR,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;IACzCU,UAAU,GAAGF,WAAW,CAACR,IAAI,CAACW,GAAG,CAAC,UAAAC,SAAS,EAAI;MAC3C,IAAMC,aAAa,GAAGC,MAAM,CAACF,SAAS,CAAC;MACvC,IAAIE,MAAM,CAACC,KAAK,CAACD,MAAM,CAACD,aAAa,CAAC,CAAC,EAAE;QACrC,MAAM,IAAIP,KAAK,CAACzB,oDAAS,CAACI,WAAW,CAAC;MAC1C;MACA,OAAO4B,aAAa;IACxB,CAAC,CAAC;EACN;EAEA,OAAO;IACHlB,CAAC,EAAEa,WAAW,CAACb,CAAC;IAChBI,CAAC,EAAES,WAAW,CAACT,CAAC;IAChBC,IAAI,EAAEU,UAAU;IAChBT,QAAQ,EAAEO,WAAW,CAACP,QAAQ;IAC9Be,UAAU,EAAER,WAAW,CAAC,OAAO,CAAC,CAACS,UAAU,CAACtB,CAAC;IAAE;IAC/CuB,UAAU,EAAEV,WAAW,CAAC,OAAO,CAAC,CAACS,UAAU,CAAClB,CAAC;IAAE;IAC/CoB,iBAAiB,EAAEX,WAAW,CAAC,OAAO,CAAC,CAACS,UAAU,CAAChB,QAAQ;IAAE;IAC7DmB,aAAa,EAAEZ,WAAW,CAAC,OAAO,CAAC,CAACS,UAAU,CAACjB,IAAI,CAAE;EACzD,CAAC;AACL,CAAC,C;;;;;;;AC1ED,2C","file":"PunchcardParser.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 = 25);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","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'],\n default: 'primary[2]',\n },\n category: {\n isRequired: false,\n type: ['string'],\n default: 'primary[3]',\n },\n },\n};\n\n/**\n * Punchcard 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 let parsedSize = parsedProps.size;\n\n if (typeof parsedProps.size[0] === 'string') {\n parsedSize = parsedProps.size.map(sizeValue => {\n const parsedSizeNum = Number(sizeValue);\n if (Number.isNaN(Number(parsedSizeNum))) {\n throw new Error(ErrorMsgs.ERROR_PARSE);\n }\n return parsedSizeNum;\n });\n }\n\n return {\n x: parsedProps.x,\n y: parsedProps.y,\n size: parsedSize,\n category: parsedProps.category,\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","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
package/ScatterParser.js CHANGED
@@ -167,6 +167,7 @@ var dataContract = {
167
167
  }
168
168
  }
169
169
  };
170
+
170
171
  /**
171
172
  * Scatter parse function
172
173
  * @param {object} dataSources
@@ -174,12 +175,10 @@ var dataContract = {
174
175
  * @return {object} props that dashboard/react visualizations can be used.
175
176
  * @public
176
177
  */
177
-
178
178
  var parse = function parse(dataSources, userDefinedEncoding) {
179
179
  if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(dataSources)) {
180
180
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].NO_DATA_SOURCES);
181
181
  }
182
-
183
182
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["mergeEncoding"])(dataContract.encoding, userDefinedEncoding);
184
183
  var parsedProps = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["parse"])(dataSources, encoding);
185
184
  return {
@@ -191,7 +190,6 @@ var parse = function parse(dataSources, userDefinedEncoding) {
191
190
  yFieldName: parsedProps['_meta'].fieldNames.y,
192
191
  // eslint-disable-line dot-notation
193
192
  categoryFieldName: parsedProps['_meta'].fieldNames.category // eslint-disable-line dot-notation
194
-
195
193
  };
196
194
  };
197
195
 
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/errorMsgs.js","webpack:///./src/ScatterParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","initialRequestParams","primary","offset","count","encoding","x","isRequired","type","default","y","category","parse","isEmpty","mergeEncoding","parsedProps","baseParse","xFieldName","yFieldName","categoryFieldName"],"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;AAEO,IAAMA,SAAS,GAAG;AACrBC,iBAAe,EAAEC,+DAAC,CADG,uBACH,CADG;AAErBC,aAAW,EAAED,+DAAC,CAFO,oBAEP,CAFO;AAGrBE,aAAW,EAAEF,+DAAC;AAHO,CAAlB,C;;;;;;;;ACFP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEO,IAAMG,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;AAGCC,aAAO,EAAE;AAHV,KANG;AAWNE,YAAQ,EAAE;AACNJ,gBAAU,EADJ;AAENC,UAAI,EAAE,WAFA,QAEA,CAFA;AAGNC,aAAO,EAAE;AAHH;AAXJ;AAVc,CAArB;AA6BP;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMG,KAAK,GAAG,SAARA,KAAQ,mCAAsC;AACvD,MAAIC,qDAAO,CAAX,WAAW,CAAX,EAA0B;AACtB,UAAM,UAAUrB,oDAAS,CAAzB,eAAM,CAAN;AACH;;AAED,MAAMa,QAAQ,GAAGS,iGAAa,CAACjB,YAAY,CAAb,UAA9B,mBAA8B,CAA9B;AACA,MAAMkB,WAAW,GAAGC,yFAAS,cAA7B,QAA6B,CAA7B;AAEA,SAAO;AACHV,KAAC,EAAES,WAAW,CADX;AAEHL,KAAC,EAAEK,WAAW,CAFX;AAGHJ,YAAQ,EAAEI,WAAW,CAHlB;AAIHE,cAAU,EAAEF,WAAW,CAAXA,OAAW,CAAXA,YAJT;AAI4C;AAC/CG,cAAU,EAAEH,WAAW,CAAXA,OAAW,CAAXA,YALT;AAK4C;AAC/CI,qBAAiB,EAAEJ,WAAW,CAAXA,OAAW,CAAXA,YANhB,SAM0D;;AAN1D,GAAP;AARG,E;;;;;;;ACxCP,2C","file":"ScatterParser.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 = 26);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","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 category: {\n isRequired: false,\n type: ['number', 'string'],\n default: 'primary[2]',\n },\n },\n};\n\n/**\n * Scatter 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 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 };\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/errorMsgs.js","webpack:///./src/ScatterParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","initialRequestParams","primary","offset","count","encoding","x","isRequired","type","default","y","category","parse","dataSources","userDefinedEncoding","isEmpty","Error","mergeEncoding","parsedProps","baseParse","xFieldName","fieldNames","yFieldName","categoryFieldName"],"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;AAA0C;AAEnC,IAAMA,SAAS,GAAG;EACrBC,eAAe,EAAEC,+DAAC,CAAC,uBAAuB,CAAC;EAC3CC,WAAW,EAAED,+DAAC,CAAC,oBAAoB,CAAC;EACpCE,WAAW,EAAEF,+DAAC,CAAC,+BAA+B;A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,WAAW,CAAC,OAAO,CAAC,CAACG,UAAU,CAACf,CAAC;IAAE;IAC/CgB,UAAU,EAAEJ,WAAW,CAAC,OAAO,CAAC,CAACG,UAAU,CAACX,CAAC;IAAE;IAC/Ca,iBAAiB,EAAEL,WAAW,CAAC,OAAO,CAAC,CAACG,UAAU,CAACV,QAAQ,CAAE;EACjE,CAAC;AACL,CAAC,C;;;;;;;ACxDD,2C","file":"ScatterParser.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 = 26);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","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 category: {\n isRequired: false,\n type: ['number', 'string'],\n default: 'primary[2]',\n },\n },\n};\n\n/**\n * Scatter 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 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 };\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
package/ShapeParser.js CHANGED
@@ -220,6 +220,7 @@ var dataContract = {
220
220
  }
221
221
  }
222
222
  };
223
+
223
224
  /**
224
225
  * Shape parse function
225
226
  * @param {object} dataSources
@@ -227,16 +228,13 @@ var dataContract = {
227
228
  * @return {object} props that dashboard/react visualizations can be used.
228
229
  * @public
229
230
  */
230
-
231
231
  var parse = function parse(dataSources, userDefinedEncoding) {
232
232
  if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(dataSources)) {
233
233
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].NO_DATA_SOURCES);
234
234
  }
235
-
236
235
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["mergeEncoding"])(dataContract.encoding, userDefinedEncoding);
237
236
  var props = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["parse"])(dataSources, encoding);
238
237
  var parsedProps = {};
239
-
240
238
  try {
241
239
  Object.keys(props).forEach(function (encodingKey) {
242
240
  var encodingValue = props[encodingKey];
@@ -246,7 +244,6 @@ var parse = function parse(dataSources, userDefinedEncoding) {
246
244
  } catch (err) {
247
245
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].ERROR_PARSE);
248
246
  }
249
-
250
247
  return {
251
248
  fill: parsedProps.fill,
252
249
  stroke: parsedProps.stroke
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/errorMsgs.js","webpack:///./src/ShapeParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","optionalDataSources","name","description","initialRequestParams","primary","offset","count","encoding","fill","isRequired","type","default","field","format","ranges","from","value","to","stroke","parse","isEmpty","mergeEncoding","props","baseParse","parsedProps","Object","encodingValue","valueIndex"],"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;AAEO,IAAMA,SAAS,GAAG;AACrBC,iBAAe,EAAEC,+DAAC,CADG,uBACH,CADG;AAErBC,aAAW,EAAED,+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BAAI,EADR;AAEIE,cAAE,EAFN;AAGID,iBAAK,EAAE;AAHX,WALI,EAUJ;AACID,gBAAI,EADR;AAEIE,cAAE,EAFN;AAGID,iBAAK,EAAE;AAHX,WAVI,EAeJ;AACID,gBAAI,EADR;AAEIE,cAAE,EAFN;AAGID,iBAAK,EAAE;AAHX,WAfI,EAoBJ;AACID,gBAAI,EADR;AAEIE,cAAE,EAFN;AAGID,iBAAK,EAAE;AAHX,WApBI,EAyBJ;AACIC,cAAE,EADN;AAEID,iBAAK,EAAE;AAFX,WAzBI;AAFJ;AAFH;AAHL;AAzCF;AAXc,CAArB;AA+FP;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMG,KAAK,GAAG,SAARA,KAAQ,mCAAsC;AACvD,MAAIC,qDAAO,CAAX,WAAW,CAAX,EAA0B;AACtB,UAAM,UAAU3B,oDAAS,CAAzB,eAAM,CAAN;AACH;;AAED,MAAMc,QAAQ,GAAGc,iGAAa,CAACvB,YAAY,CAAb,UAA9B,mBAA8B,CAA9B;AACA,MAAMwB,KAAK,GAAGC,yFAAS,cAAvB,QAAuB,CAAvB;AACA,MAAMC,WAAW,GAAjB;;AACA,MAAI;AACAC,UAAM,CAANA,oBAA2B,uBAAe;AACtC,UAAMC,aAAa,GAAGJ,KAAK,CAA3B,WAA2B,CAA3B;AACA,UAAMK,UAAU,GAAGD,aAAa,CAAbA,SAAnB;AACAF,iBAAW,CAAXA,WAAW,CAAXA,GAA2BE,aAAa,CAAxCF,UAAwC,CAAxCA;AAHJC;AADJ,IAME,YAAY;AACV,UAAM,UAAUhC,oDAAS,CAAzB,WAAM,CAAN;AACH;;AAED,SAAO;AACHe,QAAI,EAAEgB,WAAW,CADd;AAEHN,UAAM,EAAEM,WAAW,CAACN;AAFjB,GAAP;AAlBG,E;;;;;;;AC3GP,2C","file":"ShapeParser.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 = 27);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","// Todo: may need separate based on different shapes later\nimport { 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 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 fill: {\n isRequired: false,\n type: ['string'],\n default: {\n field: 'primary[0]',\n format: {\n type: 'rangevalue',\n ranges: [\n {\n from: 100,\n value: '#cb3b43',\n },\n {\n from: 70,\n to: 100,\n value: '#ff7152',\n },\n {\n from: 50,\n to: 70,\n value: '#fc9850',\n },\n {\n from: 30,\n to: 50,\n value: '#f4df7a',\n },\n {\n from: 10,\n to: 30,\n value: '#4beba8',\n },\n {\n to: 10,\n value: '#5fbcff',\n },\n ],\n },\n },\n },\n stroke: {\n isRequired: false,\n type: ['string'],\n default: {\n field: 'primary[0]',\n format: {\n type: 'rangevalue',\n ranges: [\n {\n from: 100,\n value: '#cb3b43',\n },\n {\n from: 70,\n to: 100,\n value: '#ff7152',\n },\n {\n from: 50,\n to: 70,\n value: '#fc9850',\n },\n {\n from: 30,\n to: 50,\n value: '#f4df7a',\n },\n {\n from: 10,\n to: 30,\n value: '#4beba8',\n },\n {\n to: 10,\n value: '#5fbcff',\n },\n ],\n },\n },\n },\n },\n};\n\n/**\n * Shape 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 props = baseParse(dataSources, encoding);\n const parsedProps = {};\n try {\n Object.keys(props).forEach(encodingKey => {\n const encodingValue = props[encodingKey];\n const valueIndex = encodingValue.length - 1;\n parsedProps[encodingKey] = encodingValue[valueIndex];\n });\n } catch (err) {\n throw new Error(ErrorMsgs.ERROR_PARSE);\n }\n\n return {\n fill: parsedProps.fill,\n stroke: parsedProps.stroke,\n };\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///./src/errorMsgs.js","webpack:///./src/ShapeParser.js","webpack:///external \"lodash/isEmpty\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","optionalDataSources","name","description","initialRequestParams","primary","offset","count","encoding","fill","isRequired","type","default","field","format","ranges","from","value","to","stroke","parse","dataSources","userDefinedEncoding","isEmpty","Error","mergeEncoding","props","baseParse","parsedProps","Object","keys","forEach","encodingKey","encodingValue","valueIndex","length","err"],"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;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CAAC;EAC9C;EAEA,IAAMa,QAAQ,GAAGiB,iGAAa,CAAC1B,YAAY,CAACS,QAAQ,EAAEc,mBAAmB,CAAC;EAC1E,IAAMI,KAAK,GAAGC,yFAAS,CAACN,WAAW,EAAEb,QAAQ,CAAC;EAC9C,IAAMoB,WAAW,GAAG,CAAC,CAAC;EACtB,IAAI;IACAC,MAAM,CAACC,IAAI,CAACJ,KAAK,CAAC,CAACK,OAAO,CAAC,UAAAC,WAAW,EAAI;MACtC,IAAMC,aAAa,GAAGP,KAAK,CAACM,WAAW,CAAC;MACxC,IAAME,UAAU,GAAGD,aAAa,CAACE,MAAM,GAAG,CAAC;MAC3CP,WAAW,CAACI,WAAW,CAAC,GAAGC,aAAa,CAACC,UAAU,CAAC;IACxD,CAAC,CAAC;EACN,CAAC,CAAC,OAAOE,GAAG,EAAE;IACV,MAAM,IAAIZ,KAAK,CAAC9B,oDAAS,CAACI,WAAW,CAAC;EAC1C;EAEA,OAAO;IACHW,IAAI,EAAEmB,WAAW,CAACnB,IAAI;IACtBU,MAAM,EAAES,WAAW,CAACT;EACxB,CAAC;AACL,CAAC,C;;;;;;;ACjID,2C","file":"ShapeParser.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 = 27);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","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","// Todo: may need separate based on different shapes later\nimport { 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 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 fill: {\n isRequired: false,\n type: ['string'],\n default: {\n field: 'primary[0]',\n format: {\n type: 'rangevalue',\n ranges: [\n {\n from: 100,\n value: '#cb3b43',\n },\n {\n from: 70,\n to: 100,\n value: '#ff7152',\n },\n {\n from: 50,\n to: 70,\n value: '#fc9850',\n },\n {\n from: 30,\n to: 50,\n value: '#f4df7a',\n },\n {\n from: 10,\n to: 30,\n value: '#4beba8',\n },\n {\n to: 10,\n value: '#5fbcff',\n },\n ],\n },\n },\n },\n stroke: {\n isRequired: false,\n type: ['string'],\n default: {\n field: 'primary[0]',\n format: {\n type: 'rangevalue',\n ranges: [\n {\n from: 100,\n value: '#cb3b43',\n },\n {\n from: 70,\n to: 100,\n value: '#ff7152',\n },\n {\n from: 50,\n to: 70,\n value: '#fc9850',\n },\n {\n from: 30,\n to: 50,\n value: '#f4df7a',\n },\n {\n from: 10,\n to: 30,\n value: '#4beba8',\n },\n {\n to: 10,\n value: '#5fbcff',\n },\n ],\n },\n },\n },\n },\n};\n\n/**\n * Shape 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 props = baseParse(dataSources, encoding);\n const parsedProps = {};\n try {\n Object.keys(props).forEach(encodingKey => {\n const encodingValue = props[encodingKey];\n const valueIndex = encodingValue.length - 1;\n parsedProps[encodingKey] = encodingValue[valueIndex];\n });\n } catch (err) {\n throw new Error(ErrorMsgs.ERROR_PARSE);\n }\n\n return {\n fill: parsedProps.fill,\n stroke: parsedProps.stroke,\n };\n};\n","module.exports = require(\"lodash/isEmpty\");"],"sourceRoot":""}
@@ -185,14 +185,15 @@ var dataContract = {
185
185
  }]
186
186
  }
187
187
  }
188
- } // todo: add it back later
188
+ }
189
+ // todo: add it back later
189
190
  // icon: {
190
191
  // isRequired: false,
191
192
  // type: ['string'],
192
193
  // },
193
-
194
194
  }
195
195
  };
196
+
196
197
  /**
197
198
  * Single Value Icon parse function
198
199
  * @param {object} dataSources
@@ -200,17 +201,14 @@ var dataContract = {
200
201
  * @return {object} props that dashboard/react visualizations can be used.
201
202
  * @public
202
203
  */
203
-
204
204
  var parse = function parse(dataSources, userDefinedEncoding) {
205
205
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["mergeEncoding"])(dataContract.encoding, userDefinedEncoding);
206
206
  var props = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["parse"])(dataSources, encoding);
207
207
  var parsedProps = {};
208
-
209
208
  try {
210
209
  Object.keys(props).forEach(function (encodingKey) {
211
210
  var encodingValue = props[encodingKey];
212
211
  var valueIndex = encodingValue.length - 1;
213
-
214
212
  if (encodingKey === 'trend') {
215
213
  parsedProps.value = encodingValue[valueIndex];
216
214
  parsedProps.deltaValue = encodingValue.length === 1 ? null : encodingValue[valueIndex] - encodingValue[valueIndex - 1];
@@ -222,7 +220,6 @@ var parse = function parse(dataSources, userDefinedEncoding) {
222
220
  } catch (err) {
223
221
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_1__["ErrorMsgs"].ERROR_PARSE);
224
222
  }
225
-
226
223
  return {
227
224
  value: parsedProps.value,
228
225
  deltaValue: parsedProps.deltaValue,