@splunk/visualization-encoding-parsers 26.0.0 → 26.1.1

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.
@@ -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/FillerGaugeParser.js","webpack:///external \"lodash/isEmpty\"","webpack:///external \"@babel/runtime/helpers/toConsumableArray\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","optionalDataSources","initialRequestParams","primary","offset","count","encoding","value","isRequired","type","default","gaugeColor","field","format","ranges","from","to","parse","dataSources","userDefinedEncoding","isEmpty","Error","mergeEncoding","parsedProps","baseParse","Object","keys","forEach","encodingKey","encodingValue","valueIndex","length","min","Math","apply","_toConsumableArray","map","range","undefined","max","parseInt","valueFieldName","fieldNames","gaugeColorFieldName","valueType","types","gaugeColorType"],"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;;;;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AGsB,SAAS;EAElF,OAAO;IACH/B,KAAK,EAAEiC,QAAQ,CAACjB,WAAW,CAAChB,KAAK,EAAE,EAAE,CAAC;IACtCI,UAAU,EAAEY,WAAW,CAACZ,UAAU;IAClCqB,GAAG,EAAHA,GAAG;IACHO,GAAG,EAAHA,GAAG;IACHE,cAAc,EAAElB,WAAW,CAAC,OAAO,CAAC,CAACmB,UAAU,CAACnC,KAAK;IAAE;IACvDoC,mBAAmB,EAAEpB,WAAW,CAAC,OAAO,CAAC,CAACmB,UAAU,CAAC/B,UAAU;IAAE;IACjEiC,SAAS,EAAErB,WAAW,CAAC,OAAO,CAAC,CAACsB,KAAK,CAACtC,KAAK;IAAE;IAC7CuC,cAAc,EAAEvB,WAAW,CAAC,OAAO,CAAC,CAACsB,KAAK,CAAClC,UAAU,CAAE;EAC3D,CAAC;AACL,CAAC,C;;;;;;;AC9FD,2C;;;;;;;ACAA,qE","file":"FillerGaugeParser.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 = 21);\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 gaugeColor: {\n isRequired: true,\n type: 'string',\n default: {\n field: 'encoding.value',\n format: {\n type: 'rangevalue',\n ranges: [\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 from: 0,\n to: 10,\n value: '#5fbcff',\n },\n ],\n },\n },\n },\n },\n};\n\n/**\n * FillerGauge 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 Object.keys(encoding).forEach(encodingKey => {\n const encodingValue = parsedProps[encodingKey];\n const valueIndex = encodingValue.length - 1;\n parsedProps[encodingKey] = parsedProps[encodingKey][valueIndex];\n });\n const ranges = (encoding.gaugeColor.format && encoding.gaugeColor.format.ranges) || [];\n const min = ranges.length ? Math.min(...ranges.map(range => range.from)) : undefined;\n const max = ranges.length ? Math.max(...ranges.map(range => range.to)) : undefined;\n\n return {\n value: parseInt(parsedProps.value, 10),\n gaugeColor: parsedProps.gaugeColor,\n min,\n max,\n valueFieldName: parsedProps['_meta'].fieldNames.value, // eslint-disable-line dot-notation\n gaugeColorFieldName: parsedProps['_meta'].fieldNames.gaugeColor, // eslint-disable-line dot-notation\n valueType: parsedProps['_meta'].types.value, // eslint-disable-line dot-notation\n gaugeColorType: parsedProps['_meta'].types.gaugeColor, // eslint-disable-line dot-notation\n };\n};\n","module.exports = require(\"lodash/isEmpty\");","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");"],"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/FillerGaugeParser.js","webpack:///external \"lodash/isEmpty\"","webpack:///external \"@babel/runtime/helpers/toConsumableArray\""],"names":["ErrorMsgs","NO_DATA_SOURCES","_","NO_ENCODING","ERROR_PARSE","dataContract","requiredDataSources","name","description","optionalDataSources","initialRequestParams","primary","offset","count","encoding","value","isRequired","type","default","gaugeColor","field","format","ranges","from","to","parse","isEmpty","mergeEncoding","parsedProps","baseParse","Object","encodingValue","valueIndex","min","Math","range","max","parseInt","valueFieldName","gaugeColorFieldName","valueType","gaugeColorType"],"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,IA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P;AAhBG,E;;;;;;;ACpEP,2C;;;;;;;ACAA,qE","file":"FillerGaugeParser.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 = 21);\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 gaugeColor: {\n isRequired: true,\n type: 'string',\n default: {\n field: 'encoding.value',\n format: {\n type: 'rangevalue',\n ranges: [\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 from: 0,\n to: 10,\n value: '#5fbcff',\n },\n ],\n },\n },\n },\n },\n};\n\n/**\n * FillerGauge 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 Object.keys(encoding).forEach(encodingKey => {\n const encodingValue = parsedProps[encodingKey];\n const valueIndex = encodingValue.length - 1;\n parsedProps[encodingKey] = parsedProps[encodingKey][valueIndex];\n });\n const ranges = (encoding.gaugeColor.format && encoding.gaugeColor.format.ranges) || [];\n const min = ranges.length ? Math.min(...ranges.map(range => range.from)) : undefined;\n const max = ranges.length ? Math.max(...ranges.map(range => range.to)) : undefined;\n\n return {\n value: parseInt(parsedProps.value, 10),\n gaugeColor: parsedProps.gaugeColor,\n min,\n max,\n valueFieldName: parsedProps['_meta'].fieldNames.value, // eslint-disable-line dot-notation\n gaugeColorFieldName: parsedProps['_meta'].fieldNames.gaugeColor, // eslint-disable-line dot-notation\n valueType: parsedProps['_meta'].types.value, // eslint-disable-line dot-notation\n gaugeColorType: parsedProps['_meta'].types.gaugeColor, // eslint-disable-line dot-notation\n };\n};\n","module.exports = require(\"lodash/isEmpty\");","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");"],"sourceRoot":""}
package/LineParser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -143,8 +143,7 @@ var dataContract = {
143
143
  name: 'primary',
144
144
  description: 'DataSource that powers the visualization'
145
145
  }],
146
- optionalDataSources: [
147
- // Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
146
+ optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
148
147
  // {
149
148
  // name: 'annotation',
150
149
  // description: 'DataSource that populate event annotations',
@@ -189,7 +188,6 @@ var dataContract = {
189
188
  }
190
189
  }
191
190
  };
192
-
193
191
  /**
194
192
  * Line parse function
195
193
  * @param {object} dataSources
@@ -197,10 +195,12 @@ var dataContract = {
197
195
  * @return {object} props that dashboard/react visualizations can be used.
198
196
  * @public
199
197
  */
198
+
200
199
  var parse = function parse(dataSources, userDefinedEncoding) {
201
200
  if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(dataSources)) {
202
201
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].NO_DATA_SOURCES);
203
202
  }
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,6 +215,7 @@ 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
+
218
219
  };
219
220
  };
220
221
 
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","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;MAAE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W,CAACT,WAAW;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":""}
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,EADR;AAEIC,eAAW,EAAE;AAFjB,GADiB,CADG;AAOxBC,qBAAmB,EAAE,CACjB;AACA;AACA;AACA;AACA;AALiB,GAPG;AAcxBC,sBAAoB,EAAE;AAClBC,WAAO,EAAE;AAAEC,YAAM,EAAR;AAAaC,WAAK,EAAE;AAApB,KADS;AAElBC,cAAU,EAAE;AAAEF,YAAM,EAAR;AAAaC,WAAK,EAAE;AAAp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,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,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -158,7 +158,6 @@ var dataContract = {
158
158
  }
159
159
  }
160
160
  };
161
-
162
161
  /**
163
162
  * MarkerGauge parse function
164
163
  * @param {object} dataSources
@@ -166,10 +165,12 @@ var dataContract = {
166
165
  * @return {object} props that dashboard/react visualizations can be used.
167
166
  * @public
168
167
  */
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
+
173
174
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["mergeEncoding"])(dataContract.encoding, userDefinedEncoding);
174
175
  var parsedProps = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["parse"])(dataSources, encoding);
175
176
  return {
@@ -177,6 +178,7 @@ var parse = function parse(dataSources, userDefinedEncoding) {
177
178
  valueFieldName: parsedProps['_meta'].fieldNames.value,
178
179
  // eslint-disable-line dot-notation
179
180
  valueType: parsedProps['_meta'].types.value // eslint-disable-line dot-notation
181
+
180
182
  };
181
183
  };
182
184
 
@@ -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","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;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AAK;IAAE;IACvDe,SAAS,EAAEL,WAAW,CAAC,OAAO,CAAC,CAACM,KAAK,CAAChB,KAAK,CAAE;EACjD,CAAC;AACL,CAAC,C;;;;;;;AC5CD,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","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,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,qBAAmB,EAPK;AAQxBC,sBAAoB,EAAE;AAClBC,WAAO,EAAE;AAAEC,YAAM,EAAR;AAAaC,WAAK,EAAE;AAApB;AADS,GARE;AAWxBC,UAAQ,EAAE;AACNC,SAAK,EAAE;AACHC,gBAAU,EADP;AAEHC,UAAI,EAFD;AAGHC,aAAO,EAAE;AAHN;AADD;AAXc,CAArB;AAoBP;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMC,KAAK,GAAG,SAARA,KAAQ,mCAAsC;AACvD,MAAIC,qDAAO,CAAX,WAAW,CAAX,EAA0B;AACtB,UAAM,UAAUpB,oDAAS,CAAzB,eAAM,CAAN;AACH;;AAED,MAAMc,QAAQ,GAAGO,iGAAa,CAAChB,YAAY,CAAb,UAA9B,mBAA8B,CAA9B;AACA,MAAMiB,WAAW,GAAGC,yFAAS,cAA7B,QAA6B,CAA7B;AAEA,SAAO;AACHR,SAAK,EAAES,QAAQ,CAACF,WAAW,CAAZ,OADZ,EACY,CADZ;AAEHG,kBAAc,EAAEH,WAAW,CAAXA,OAAW,CAAXA,YAFb;AAEoD;AACvDI,aAAS,EAAEJ,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":""}
package/PieParser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -164,9 +164,11 @@ var dataContract = {
164
164
  };
165
165
  var parse = function parse(dataSources) {
166
166
  var userDefinedEncoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
167
+
167
168
  if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(dataSources)) {
168
169
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].NO_DATA_SOURCES);
169
170
  }
171
+
170
172
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_1__["mergeEncoding"])(dataContract.encodings, userDefinedEncoding);
171
173
  var data = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_1__["parse"])(dataSources, encoding);
172
174
  return {
@@ -175,6 +177,7 @@ var parse = function parse(dataSources) {
175
177
  labelTitle: data['_meta'].fieldNames.label,
176
178
  // eslint-disable-line dot-notation
177
179
  valueTitle: data['_meta'].fieldNames.value // eslint-disable-line dot-notation
180
+
178
181
  };
179
182
  };
180
183
 
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","dataSources","userDefinedEncoding","arguments","length","undefined","isEmpty","Error","encoding","mergeEncoding","data","baseParse","labelTitle","fieldNames","valueTitle"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;Q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ChBC,OAAO,EAAE;IACb;EACJ;AACJ,CAAC;AAEM,IAAME,KAAK,GAAG,SAARA,KAAKA,CAAIC,WAAW,EAA+B;EAAA,IAA7BC,mBAAmB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACvD,IAAIG,qDAAO,CAACL,WAAW,CAAC,EAAE;IACtB,MAAM,IAAIM,KAAK,CAAC1B,oDAAS,CAACC,eAAe,CAAC;EAC9C;EAEA,IAAM0B,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":""}
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;QAC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P,EAAO;;AAC5D,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,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -172,7 +172,6 @@ var dataContract = {
172
172
  }
173
173
  }
174
174
  };
175
-
176
175
  /**
177
176
  * Punchcard parse function
178
177
  * @param {object} dataSources
@@ -180,22 +179,28 @@ var dataContract = {
180
179
  * @return {object} props that dashboard/react visualizations can be used.
181
180
  * @public
182
181
  */
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
+
187
188
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["mergeEncoding"])(dataContract.encoding, userDefinedEncoding);
188
189
  var parsedProps = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["parse"])(dataSources, encoding);
189
190
  var parsedSize = parsedProps.size;
191
+
190
192
  if (typeof parsedProps.size[0] === 'string') {
191
193
  parsedSize = parsedProps.size.map(function (sizeValue) {
192
194
  var parsedSizeNum = Number(sizeValue);
195
+
193
196
  if (Number.isNaN(Number(parsedSizeNum))) {
194
197
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].ERROR_PARSE);
195
198
  }
199
+
196
200
  return parsedSizeNum;
197
201
  });
198
202
  }
203
+
199
204
  return {
200
205
  x: parsedProps.x,
201
206
  y: parsedProps.y,
@@ -208,6 +213,7 @@ var parse = function parse(dataSources, userDefinedEncoding) {
208
213
  categoryFieldName: parsedProps['_meta'].fieldNames.category,
209
214
  // eslint-disable-line dot-notation
210
215
  sizeFieldName: parsedProps['_meta'].fieldNames.size // eslint-disable-line dot-notation
216
+
211
217
  };
212
218
  };
213
219
 
@@ -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","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;QA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X,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":""}
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;;Q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;;;;;;;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":""}
package/ScatterParser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -167,7 +167,6 @@ var dataContract = {
167
167
  }
168
168
  }
169
169
  };
170
-
171
170
  /**
172
171
  * Scatter parse function
173
172
  * @param {object} dataSources
@@ -175,10 +174,12 @@ var dataContract = {
175
174
  * @return {object} props that dashboard/react visualizations can be used.
176
175
  * @public
177
176
  */
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
+
182
183
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["mergeEncoding"])(dataContract.encoding, userDefinedEncoding);
183
184
  var parsedProps = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["parse"])(dataSources, encoding);
184
185
  return {
@@ -190,6 +191,7 @@ var parse = function parse(dataSources, userDefinedEncoding) {
190
191
  yFieldName: parsedProps['_meta'].fieldNames.y,
191
192
  // eslint-disable-line dot-notation
192
193
  categoryFieldName: parsedProps['_meta'].fieldNames.category // eslint-disable-line dot-notation
194
+
193
195
  };
194
196
  };
195
197
 
@@ -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","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;;;;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AES,mBAAmB,CAAC;EAC1E,IAAMI,WAAW,GAAGC,yFAAS,CAACN,WAAW,EAAER,QAAQ,CAAC;EAEpD,OAAO;IACHC,CAAC,EAAEY,WAAW,CAACZ,CAAC;IAChBI,CAAC,EAAEQ,WAAW,CAACR,CAAC;IAChBC,QAAQ,EAAEO,WAAW,CAACP,QAAQ;IAC9BS,UAAU,EAAEF,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":""}
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;Q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AXJ;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":""}
package/ShapeParser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -220,7 +220,6 @@ var dataContract = {
220
220
  }
221
221
  }
222
222
  };
223
-
224
223
  /**
225
224
  * Shape parse function
226
225
  * @param {object} dataSources
@@ -228,13 +227,16 @@ var dataContract = {
228
227
  * @return {object} props that dashboard/react visualizations can be used.
229
228
  * @public
230
229
  */
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
+
235
236
  var encoding = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["mergeEncoding"])(dataContract.encoding, userDefinedEncoding);
236
237
  var props = Object(_splunk_visualization_encoding_parsers_Base__WEBPACK_IMPORTED_MODULE_0__["parse"])(dataSources, encoding);
237
238
  var parsedProps = {};
239
+
238
240
  try {
239
241
  Object.keys(props).forEach(function (encodingKey) {
240
242
  var encodingValue = props[encodingKey];
@@ -244,6 +246,7 @@ var parse = function parse(dataSources, userDefinedEncoding) {
244
246
  } catch (err) {
245
247
  throw new Error(_errorMsgs__WEBPACK_IMPORTED_MODULE_2__["ErrorMsgs"].ERROR_PARSE);
246
248
  }
249
+
247
250
  return {
248
251
  fill: parsedProps.fill,
249
252
  stroke: parsedProps.stroke