@splunk/visualizations 23.2.0 → 23.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/Area.config.js +36 -30
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +243 -203
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +29 -23
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +233 -193
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +36 -23
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +247 -196
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +15 -12
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +201 -148
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +29 -23
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +235 -194
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +23 -20
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +176 -123
  24. package/Ellipse.js.map +1 -1
  25. package/FillerGauge.config.js +803 -0
  26. package/FillerGauge.config.js.map +1 -0
  27. package/FillerGauge.js +3634 -0
  28. package/FillerGauge.js.map +1 -0
  29. package/Image.config.js +13 -6
  30. package/Image.config.js.map +1 -1
  31. package/Image.js +260 -200
  32. package/Image.js.map +1 -1
  33. package/LICENSE.md +14 -0
  34. package/Line.config.js +40 -31
  35. package/Line.config.js.map +1 -1
  36. package/Line.js +248 -202
  37. package/Line.js.map +1 -1
  38. package/LinkGraph.config.js +107 -123
  39. package/LinkGraph.config.js.map +1 -1
  40. package/LinkGraph.js +241 -193
  41. package/LinkGraph.js.map +1 -1
  42. package/Markdown.config.js +95 -3
  43. package/Markdown.config.js.map +1 -1
  44. package/Markdown.js +272 -118
  45. package/Markdown.js.map +1 -1
  46. package/MarkerGauge.config.js +750 -0
  47. package/MarkerGauge.config.js.map +1 -0
  48. package/MarkerGauge.js +3758 -0
  49. package/MarkerGauge.js.map +1 -0
  50. package/ParallelCoordinates.config.js +52 -46
  51. package/ParallelCoordinates.config.js.map +1 -1
  52. package/ParallelCoordinates.js +257 -164
  53. package/ParallelCoordinates.js.map +1 -1
  54. package/Pie.config.js +61 -46
  55. package/Pie.config.js.map +1 -1
  56. package/Pie.js +254 -186
  57. package/Pie.js.map +1 -1
  58. package/Punchcard.config.js +279 -39
  59. package/Punchcard.config.js.map +1 -1
  60. package/Punchcard.js +825 -193
  61. package/Punchcard.js.map +1 -1
  62. package/README.external.md +45 -0
  63. package/README.md +18 -3
  64. package/Rectangle.config.js +89 -107
  65. package/Rectangle.config.js.map +1 -1
  66. package/Rectangle.js +204 -145
  67. package/Rectangle.js.map +1 -1
  68. package/Sankey.config.js +29 -22
  69. package/Sankey.config.js.map +1 -1
  70. package/Sankey.js +250 -186
  71. package/Sankey.js.map +1 -1
  72. package/Scatter.config.js +39 -28
  73. package/Scatter.config.js.map +1 -1
  74. package/Scatter.js +2375 -2434
  75. package/Scatter.js.map +1 -1
  76. package/SingleValue.config.js +37 -29
  77. package/SingleValue.config.js.map +1 -1
  78. package/SingleValue.js +3108 -3174
  79. package/SingleValue.js.map +1 -1
  80. package/SingleValueBasic.js +37 -23
  81. package/SingleValueBasic.js.map +1 -1
  82. package/SingleValueIcon.config.js +36 -28
  83. package/SingleValueIcon.config.js.map +1 -1
  84. package/SingleValueIcon.js +279 -210
  85. package/SingleValueIcon.js.map +1 -1
  86. package/SingleValueRadial.config.js +15 -13
  87. package/SingleValueRadial.config.js.map +1 -1
  88. package/SingleValueRadial.js +299 -253
  89. package/SingleValueRadial.js.map +1 -1
  90. package/Table.config.js +26 -10
  91. package/Table.config.js.map +1 -1
  92. package/Table.js +382 -265
  93. package/Table.js.map +1 -1
  94. package/common/Charting.js +33 -30
  95. package/common/Charting.js.map +1 -1
  96. package/common/ChartingApi.js +4 -4
  97. package/common/ChartingApi.js.map +1 -1
  98. package/common/EventsDoc.js +36 -34
  99. package/common/EventsDoc.js.map +1 -1
  100. package/common/GaugeMajorTicks.js +386 -0
  101. package/common/GaugeMajorTicks.js.map +1 -0
  102. package/common/GaugeValueMarker.js +333 -0
  103. package/common/GaugeValueMarker.js.map +1 -0
  104. package/common/OptionsDoc.js +47 -33
  105. package/common/OptionsDoc.js.map +1 -1
  106. package/common/OverviewDoc.js +376 -0
  107. package/common/OverviewDoc.js.map +1 -0
  108. package/common/SplunkVisualization.js +6 -6
  109. package/common/SplunkVisualization.js.map +1 -1
  110. package/common/SplunkVisualizationApi.js +10 -10
  111. package/common/SplunkVisualizationApi.js.map +1 -1
  112. package/common/ThemesDoc.js +55 -72
  113. package/common/ThemesDoc.js.map +1 -1
  114. package/common/chartingUtils.js +15 -13
  115. package/common/chartingUtils.js.map +1 -1
  116. package/common/docUtils.js +4 -4
  117. package/common/docUtils.js.map +1 -1
  118. package/common/gaugeUtils.js +893 -0
  119. package/common/gaugeUtils.js.map +1 -0
  120. package/common/shapeUtils.js +8 -8
  121. package/common/shapeUtils.js.map +1 -1
  122. package/common/utils/JSONSchemaUtils.js.map +1 -1
  123. package/common/utils/configUtils.js.map +1 -1
  124. package/common/utils/hocUtils.js +57 -3
  125. package/common/utils/hocUtils.js.map +1 -1
  126. package/common/utils/singleValueUtils.js +24 -10
  127. package/common/utils/singleValueUtils.js.map +1 -1
  128. package/common/withDashboardViz.js +158 -95
  129. package/common/withDashboardViz.js.map +1 -1
  130. package/package.json +18 -14
  131. package/common/utils/eventUtils.js +0 -115
  132. package/common/utils/eventUtils.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"lodash\"","webpack:///./src/common/gaugeUtils.ts","webpack:///external \"@splunk/visualizations-shared/colorConstants\"","webpack:///external \"@splunk/ui-utils/i18n\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;Q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A6B,QAAjC,EAA2C;AACvC,gBAAU,CAAC,OAAD,CAAV,GAAsB,IAAtB;AACA,gBAAU,CAAC,UAAD,CAAV,GAAyB,KAAzB;AACH,KAHD,MAGO,IAAI,UAAU,CAAC,YAAD,CAAV,KAA6B,YAAjC,EAA+C;AAClD,gBAAU,CAAC,OAAD,CAAV,GAAsB,IAAtB;AACA,gBAAU,CAAC,UAAD,CAAV,GAAyB,IAAzB;AACH,KAHM,MAGA;AACH,gBAAU,CAAC,OAAD,CAAV,GAAsB,KAAtB;AACA,gBAAU,CAAC,UAAD,CAAV,GAAyB,KAAzB;AACH;AACJ;;AACD,SAAO,cAAK,UAAL,EAAiB,CAAC,YAAD,CAAjB,CAAP;AACH,CAnBM;;AAAM,+BAAoB,oBAApB;AAqBb;;;;;;AAMG;;AACI,IAAM,wBAAwB,GAAG,SAA3B,wBAA2B,CAAC,eAAD;AAAA,SACpC,eAAM,oBAAY,eAAZ,CAAN,EACK,IADL,CACU,iBAAO;AAAA,WAAI,6BAAqB,OAArB,EAA8B,OAA9B,CAAJ;AAAA,GADjB,EAEK,IAFL,CAEU,iBAAO;AAAA,WAAI,6BAAqB,OAArB,EAA8B,OAA9B,CAAJ;AAAA,GAFjB,EAGK,KAHL,EADoC;AAAA,CAAjC;;AAAM,mCAAwB,wBAAxB,C;;;;;;;ACzjBb,yE;;;;;;;ACAA,kD","file":"gaugeUtils.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 = 68);\n","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"lodash\");","import { chain, mapKeys, omit, uniqBy } from 'lodash';\nimport {\n SEMANTIC_SUCCESS,\n SEMANTIC_WARNING,\n SEMANTIC_ERROR,\n} from '@splunk/visualizations-shared/colorConstants';\nimport { _ } from '@splunk/ui-utils/i18n';\n\nexport const GAUGE_THICKNESS = 50;\nexport const FILL_THICKNESS = 38;\nconst GRADIENT_STOP_OFFSET_MIN = 0;\nconst GRADIENT_STOP_OFFSET_MAX = 100;\n\n/**\n * get width for the whole gauge viz for horizontal or vertical view\n * @method getGaugeWidth\n * @param {Object} input\n * @param {Number} containerWidth\n * @param {String} orientation\n * @return {Number} width\n */\nexport const getGaugeWidth = ({ containerWidth, orientation }) =>\n orientation === 'vertical' ? GAUGE_THICKNESS : containerWidth * 0.8;\n\n/**\n * get height for the whole gauge viz for horizontal or vertical view\n * @method getGaugeHeight\n * @param {Object} input\n * @param {Number} containerHeight\n * @param {String} orientation\n * @return {Number} height\n */\nexport const getGaugeHeight = ({ containerHeight, orientation }) =>\n orientation === 'vertical' ? containerHeight * 0.8 : GAUGE_THICKNESS;\n\n/**\n * get how long the gauge shoud be.\n * In horizontal view, gauge length equals to gauge width. In vertical view, it equals to gauge height.\n * @method getGaugeLength\n * @param {Object} input\n * @param {Number} input.containerWidth\n * @param {Number} input.containerHeight\n * @param {String} input.orientation\n * @return {Number} gaugeLength\n */\nexport const getGaugeLength = ({ containerWidth, containerHeight, orientation }) =>\n orientation === 'vertical'\n ? getGaugeHeight({ containerHeight, orientation })\n : getGaugeWidth({ containerWidth, orientation });\n\n/**\n * get start x and y for rendering gauge\n * @method getGaugeStartPosition\n * @param {Object} input\n * @param {Number} containerWidth\n * @param {Number} containerHeight\n * @param {Number} gaugeLength\n * @param {String} orientation\n * @return {Object} position\n * @return {Number} position.gaugeStartX\n * @return {Number} position.gaugeStartY\n */\nexport const getGaugeStartPosition = ({ containerWidth, containerHeight, gaugeLength, orientation }) => {\n // for horizontal view\n let gaugeStartX = (containerWidth - gaugeLength) / 2.0;\n let gaugeStartY = (containerHeight - GAUGE_THICKNESS) / 2.0;\n\n if (orientation === 'vertical') {\n gaugeStartX = (containerWidth - GAUGE_THICKNESS) / 2.0;\n gaugeStartY = (containerHeight - gaugeLength) / 2.0;\n }\n\n return { gaugeStartX, gaugeStartY };\n};\n\n/**\n * get dimensions for the whole gauge viz,\n * which can be useful to calculate background bar and major ticks positions.\n * @method getGaugeDimensions\n * @param {Object} input\n * @param {Number} input.containerWidth\n * @param {Number} input.containerHeight\n * @param {String} input.orientation 'horizontal' or 'vertical'\n * @return {Object} gaugeDimensions\n * @return {Number} gaugeDimensions.gaugeLength how long the gauge shoud be in horizontal or vertical orientation.\n * @return {Number} gaugeDimensions.gaugeStartX start x to render gauge\n * @return {Number} gaugeDimensions.gaugeStartY start y to render gauge\n * @return {Number} gaugeDimensions.gaugeWidth natural width of gauge\n * @return {Number} gaugeDimensions.gaugeHeight natural height of gauge\n */\nexport const getGaugeDimensions = ({ containerWidth, containerHeight, orientation }) => {\n const gaugeLength = getGaugeLength({ containerWidth, containerHeight, orientation });\n const { gaugeStartX, gaugeStartY } = getGaugeStartPosition({\n containerWidth,\n containerHeight,\n gaugeLength,\n orientation,\n });\n const gaugeWidth = getGaugeWidth({ containerWidth, orientation });\n const gaugeHeight = getGaugeHeight({ containerHeight, orientation });\n\n return {\n gaugeLength,\n gaugeStartX,\n gaugeStartY,\n gaugeWidth,\n gaugeHeight,\n };\n};\n\n/**\n * if gaugeColor is not specified, auto assign a gauge color to the fill bar\n * based on how much percentage the value is taken between min and max\n * @method assignGaugeColor\n * @params\n * */\nexport const assignGaugeColor = ({ value, min, max }) => {\n const rate = (value - min) / (max - min);\n\n if (rate <= 0.3) {\n return SEMANTIC_SUCCESS;\n }\n if (rate > 0.3 && rate <= 0.6) {\n return SEMANTIC_WARNING;\n }\n\n return SEMANTIC_ERROR;\n};\n\n/**\n * get inner bar length in gauge\n * @method getGaugeBarLength\n * @param {Object} input\n * @param {Number} input.gaugeLength\n * @param {Number} input.value\n * @param {Number} input.min\n * @param {Number} input.max\n * @return {Number} gaugeBarLength\n */\nexport const getGaugeBarLength = ({ gaugeLength, value, min, max }) => {\n if (max < min) {\n return null;\n }\n\n if (value >= max) {\n return gaugeLength;\n }\n\n if (value < min) {\n return 0;\n }\n\n return (gaugeLength * (value - min)) / (max - min);\n};\n\n/**\n * get x and y position for rendering inner bar in gauge\n * @method getGaugeBarStartPositions\n * @param {Object} input\n * @param {Number} input.gaugeStartX\n * @param {Number} input.gaugeStartY\n * @param {Number} input.gaugeWidth\n * @param {Number} input.gaugeHeight\n * @param {Number} input.gaugeBarLength\n * @param {String} input.orientation\n * @return {Object} position\n * @return {Number} position.gaugeBarX\n * @return {Number} position.gaugeBarY\n */\nexport const getGaugeBarStartPositions = ({\n gaugeStartX,\n gaugeStartY,\n gaugeWidth,\n gaugeHeight,\n gaugeBarLength,\n orientation,\n}) => {\n let gaugeBarX = gaugeStartX;\n let gaugeBarY = gaugeStartY;\n\n if (orientation === 'vertical') {\n gaugeBarX += (gaugeWidth - FILL_THICKNESS) / 2;\n gaugeBarY += gaugeHeight - gaugeBarLength;\n } else {\n gaugeBarY += (gaugeHeight - FILL_THICKNESS) / 2;\n }\n\n return {\n gaugeBarX,\n gaugeBarY,\n };\n};\n\n/**\n * get width of inner bar in gauge\n * @method getGaugeBarWidth\n * @param {Object} input\n * @param {Number} input.gaugeBarLength\n * @param {String} orientation\n * @return {Number} gaugeBarWidth\n */\nexport const getGaugeBarWidth = ({ gaugeBarLength, orientation }) =>\n orientation === 'vertical' ? FILL_THICKNESS : gaugeBarLength;\n\n/**\n * get height of inner bar in gauge\n * @method getGaugeBarWidth\n * @param {Object} input\n * @param {Number} input.gaugeBarLength\n * @param {String} orientation\n * @return {Number} gaugeBarHeight\n */\nexport const getGaugeBarHeight = ({ gaugeBarLength, orientation }) =>\n orientation === 'vertical' ? gaugeBarLength : FILL_THICKNESS;\n\n/**\n * get dimensions for the fill bar in the gauge\n * @method getFillBarDimensions\n * @param {Object} input\n * @param {Number} input.gaugeLength\n * @param {Number} input.gaugeStartX\n * @param {Number} input.gaugeStartY\n * @param {Number} input.gaugeWidth,\n * @param {Number} input.gaugeHeight,\n * @param {Number} input.value,\n * @param {Number} input.min,\n * @param {Number} input.max,\n * @param {String} input.orientation\n * @return {Object} fillBarDimensions\n * @return {Number} fillBarDimensions.fillBarLength\n * @return {Number} fillBarDimensions.fillBarX\n * @return {Number} fillBarDimensions.fillBarY\n * @return {Number} fillBarDimensions.fillBarWidth\n * @return {Number} fillBarDimensions.fillBarHeight\n */\nexport const getFillBarDimensions = ({\n gaugeLength,\n gaugeStartX,\n gaugeStartY,\n gaugeWidth,\n gaugeHeight,\n value,\n min,\n max,\n orientation,\n}) => {\n const gaugeBarLength = getGaugeBarLength({ gaugeLength, value, max, min });\n const { gaugeBarX: fillBarX, gaugeBarY: fillBarY } = getGaugeBarStartPositions({\n gaugeStartX,\n gaugeStartY,\n gaugeWidth,\n gaugeHeight,\n gaugeBarLength,\n orientation,\n });\n const fillBarWidth = getGaugeBarWidth({ gaugeBarLength, orientation });\n const fillBarHeight = getGaugeBarHeight({ gaugeBarLength, orientation });\n\n return {\n fillBarLength: gaugeBarLength,\n fillBarX,\n fillBarY,\n fillBarWidth,\n fillBarHeight,\n };\n};\n\n/**\n * get position x and y for value marker in filler gauge\n * @method getFillerGaugeValueMarkerPositions\n * @param {Object} input\n * @param {Number} input.fillBarX\n * @param {Number} input.fillBarY\n * @param {Number} input.fillBarLength\n * @param {String} input.orientation\n * @return {Object} position\n * @return {Number} position.valueMarkerX\n * @return {Number} position.valueMarkerY\n */\nexport const getFillerGaugeValueMarkerPositions = ({ fillBarX, fillBarY, fillBarLength, orientation }) => {\n let valueMarkerX = fillBarX;\n let valueMarkerY = fillBarY;\n\n if (orientation === 'vertical') {\n valueMarkerX -= (GAUGE_THICKNESS - FILL_THICKNESS) / 4;\n } else {\n valueMarkerX += fillBarLength;\n valueMarkerY -= (GAUGE_THICKNESS - FILL_THICKNESS) / 4;\n }\n\n return {\n valueMarkerX,\n valueMarkerY,\n };\n};\n\n/**\n * get dimensions for the marker bar in the gauge\n * @method getMarkerBarDimensions\n * @param {Object} input\n * @param {Number} input.gaugeLength\n * @param {Number} input.gaugeStartX\n * @param {Number} input.gaugeStartY\n * @param {Number} input.gaugeWidth,\n * @param {Number} input.gaugeHeight,\n * @param {String} input.orientation\n * @return {Object} markerBarDimensions\n * @return {Number} markerBarDimensions.markerBarLength\n * @return {Number} markerBarDimensions.markerBarX\n * @return {Number} markerBarDimensions.markerBarY\n * @return {Number} markerBarDimensions.markerBarWidth\n * @return {Number} markerBarDimensions.markerBarHeight\n */\nexport const getMarkerBarDimensions = ({\n gaugeLength,\n gaugeStartX,\n gaugeStartY,\n gaugeWidth,\n gaugeHeight,\n orientation,\n}) => {\n const gaugeBarLength = gaugeLength; // For marker gauge, inner marker bar spans the entire gauge\n const { gaugeBarX: markerBarX, gaugeBarY: markerBarY } = getGaugeBarStartPositions({\n gaugeStartX,\n gaugeStartY,\n gaugeWidth,\n gaugeHeight,\n gaugeBarLength,\n orientation,\n });\n const markerBarWidth = getGaugeBarWidth({ gaugeBarLength, orientation });\n const markerBarHeight = getGaugeBarHeight({ gaugeBarLength, orientation });\n\n return {\n markerBarLength: gaugeBarLength,\n markerBarX,\n markerBarY,\n markerBarWidth,\n markerBarHeight,\n };\n};\n\n/**\n * get position x and y for value marker in marker gauge\n * @method getMarkerGaugeValueMarkerPositions\n * @param {Object} input\n * @param {Number} input.markerBarX\n * @param {Number} input.markerBarY\n * @param {Number} input.markerBarHeight\n * @param {Number} input.markerBarLength\n * @param {Number} input.value\n * @param {Number} input.min\n * @param {Number} input.max\n * @param {String} input.orientation\n * @return {Object} position\n * @return {Number} position.valueMarkerX\n * @return {Number} position.valueMarkerY\n */\nexport const getMarkerGaugeValueMarkerPositions = ({\n markerBarX,\n markerBarY,\n markerBarHeight,\n markerBarLength: gaugeLength,\n orientation,\n value,\n min,\n max,\n}) => {\n let valueMarkerX = markerBarX;\n let valueMarkerY = markerBarY;\n if (orientation === 'vertical') {\n valueMarkerY += markerBarHeight - getGaugeBarLength({ gaugeLength, value, max, min });\n valueMarkerX -= (GAUGE_THICKNESS - FILL_THICKNESS) / 4;\n } else {\n valueMarkerX += getGaugeBarLength({ gaugeLength, value, max, min });\n valueMarkerY -= (GAUGE_THICKNESS - FILL_THICKNESS) / 4;\n }\n\n return {\n valueMarkerX,\n valueMarkerY,\n };\n};\n\n/**\n * sort the ranges in ascending order\n * @method getSortedRanges\n * @param {Array} ranges\n * @return {Array} sortedRanges\n */\nexport const getSortedRanges = ranges => ranges.sort((a, b) => a.from - b.from);\n\n/**\n * validate whether ranges prop is valid - continuous ranges, range.to < range.from, range.from != range.to\n * @method validateRanges\n * @param {Array} ranges\n * @return {String} error\n */\nexport const validateRanges = ranges => {\n if (!ranges.length) {\n return _('Prop \"ranges\" is missing entries');\n }\n\n // check whether a range has \"from\" >= \"to\" eg: 10 - 10, 100 - 10, -20 - -10 are invalid\n if (ranges.some(range => range.from >= range.to)) {\n return _('Prop \"ranges\" has invalid entries: invalid range');\n }\n\n // check whether ranges have duplicate \"from/to\" eg: 0 - 50, 25 - 50\n if (ranges.length !== uniqBy(ranges, 'to').length || ranges.length !== uniqBy(ranges, 'from').length) {\n return _('Prop \"ranges\" has invalid entries: duplicate values');\n }\n\n const sortedRanges = getSortedRanges(ranges);\n\n // check whether ranges are continuous eg: 0 - 10, 10 - 20, 20 - 30\n for (let i = 1; i < sortedRanges.length; i += 1) {\n if (sortedRanges[i].from !== sortedRanges[i - 1].to) {\n return _('Prop \"ranges\" has invalid entries: discontinuous ranges');\n }\n }\n\n return null;\n};\n\n/**\n * calculate min and max value of gauge\n * @method getGaugeRange\n * @param {Array} ranges\n * @return {Object} gaugeRange\n * @return {Number} gaugeRange.min\n * @return {Number} gaugeRange.max\n */\nexport const getGaugeRange = ranges => {\n const min = Math.min(...ranges.map(range => range.from));\n const max = Math.max(...ranges.map(range => range.to));\n return { min, max };\n};\n\n/**\n * calculate stop offsets for linear gradient\n * @method getGradientStopOffsets\n * @param {Array} ranges\n * @param {String} orientation\n * @return {Array} cumulativeOffsets\n */\nexport const getGradientStopOffsets = ({ ranges, orientation }) => {\n const { min, max } = getGaugeRange(ranges);\n const offsetScale = (GRADIENT_STOP_OFFSET_MAX - GRADIENT_STOP_OFFSET_MIN) / (max - min);\n let offsets = ranges.map(range => Math.abs(range.from - range.to) * offsetScale);\n // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed\n offsets = orientation === 'vertical' ? offsets.reverse() : offsets;\n const cumulativeOffsets = [];\n offsets.reduce((accumulator, currentValue, idx) => {\n cumulativeOffsets[idx] = accumulator + currentValue;\n return cumulativeOffsets[idx];\n }, 0);\n return cumulativeOffsets;\n};\n\n/**\n * calculate stop colors for linear gradient\n * @method getGradientStopColors\n * @param {Array} ranges\n * @param {String} orientation\n * @return {Array} stopColors\n */\nexport const getGradientStopColors = ({ ranges, orientation }) => {\n const stopColors = ranges.map(range => range.value);\n // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed\n return orientation === 'vertical' ? stopColors.reverse() : stopColors;\n};\n\n/**\n * calculate linear gradient stops from ranges\n * @method getGradientStops\n * @param {Object} input\n * @param {Array} ranges\n * @param {String} orientation\n * @return {Array} stops\n */\nexport const getGradientStops = ({ ranges, orientation }) => {\n const stops = [];\n const offsets = getGradientStopOffsets({ ranges, orientation });\n const stopColors = getGradientStopColors({ ranges, orientation });\n // Initialize stops with the first color stop\n stops.push({ offset: `${offsets[0]}%`, stopColor: stopColors[0] });\n // Add the remaining color stops with gradient change at each stop\n for (let i = 1; i < ranges.length; i += 1) {\n stops.push({ offset: `${offsets[i - 1]}%`, stopColor: stopColors[i] });\n stops.push({ offset: `${offsets[i]}%`, stopColor: stopColors[i] });\n }\n return stops;\n};\n\n/**\n * calculate linear gradient dimensions\n * @method getGradientDimensions\n * @param {String} orientation\n * @return {Object} dimensions\n * @return {String} dimensions.x1\n * @return {String} dimensions.y1\n * @return {String} dimensions.x2\n * @return {String} dimensions.y2\n */\nexport const getGradientDimensions = orientation => {\n const x1 = '0%';\n const y1 = '0%';\n const x2 = orientation === 'horizontal' ? '100%' : '0%';\n const y2 = orientation === 'horizontal' ? '0%' : '100%';\n return { x1, y1, x2, y2 };\n};\n\ninterface GaugeOptions {\n [key: string]: any;\n}\n\n// map for new options names to old option names\nconst gaugeOptionsMapping = {\n majorTickInterval: 'majorUnit',\n gaugeRanges: 'ranges',\n};\n\n/**\n * Helper method to update the option names which can be mapped to pure component options\n * @method mapToOldKey\n * @param {Object} options\n * @returns {Object}\n */\nexport const mapToOldKey = (options: GaugeOptions): GaugeOptions =>\n mapKeys(options, (val, key) => (gaugeOptionsMapping[key] ? gaugeOptionsMapping[key] : key));\n\ntype LabelOrValue = 'label' | 'value';\n\n/**\n * Helper method to map labelDisplay and valueDisplay options to pure component option names\n * @method mapToOldKey\n * @param {string} labelOrValue\n * @param {Object} options\n * @returns {Object}\n */\nexport const mapValueLabelDisplay = (labelOrValue: LabelOrValue, options: GaugeOptions): GaugeOptions => {\n const rangeOrValue: string = labelOrValue === 'value' ? 'Value' : 'Range';\n const showKey: string = labelOrValue === 'value' ? 'showValue' : 'showLabels';\n const percentKey = `usePercentage${rangeOrValue}`;\n const optionString = `${labelOrValue}Display`;\n const newOptions = { ...options };\n if (newOptions[optionString]) {\n if (newOptions[optionString] === 'number') {\n newOptions[showKey] = true;\n newOptions[percentKey] = false;\n } else if (newOptions[optionString] === 'percentage') {\n newOptions[showKey] = true;\n newOptions[percentKey] = true;\n } else {\n newOptions[showKey] = false;\n newOptions[percentKey] = false;\n }\n }\n return omit(newOptions, [optionString]);\n};\n\n/**\n * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that pure component accepts\n * This is for options that has new key name and can not directly be mapped with pure component props\n * @method convertToGaugeProperties\n * @param {Object} originalOptions\n * @returns {Object}\n */\nexport const convertToGaugeProperties = (originalOptions: GaugeOptions): GaugeOptions =>\n chain(mapToOldKey(originalOptions))\n .thru(options => mapValueLabelDisplay('label', options))\n .thru(options => mapValueLabelDisplay('value', options))\n .value();\n","module.exports = require(\"@splunk/visualizations-shared/colorConstants\");","module.exports = require(\"@splunk/ui-utils/i18n\");"],"sourceRoot":""}
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 54);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 70);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -106,7 +106,7 @@ module.exports = require("lodash");
106
106
 
107
107
  /***/ }),
108
108
 
109
- /***/ 54:
109
+ /***/ 70:
110
110
  /***/ (function(module, exports, __webpack_require__) {
111
111
 
112
112
  "use strict";
@@ -121,11 +121,11 @@ var lodash_1 = __webpack_require__(3);
121
121
 
122
122
  var styled_components_1 = __webpack_require__(2);
123
123
 
124
- var pick_1 = __webpack_require__(55);
124
+ var pick_1 = __webpack_require__(71);
125
125
 
126
- var variables_1 = __webpack_require__(56);
126
+ var variables_1 = __webpack_require__(72);
127
127
 
128
- var propUtils_1 = __webpack_require__(57); // map for new options names to old option names
128
+ var propUtils_1 = __webpack_require__(73); // map for new options names to old option names
129
129
 
130
130
 
131
131
  var shapeOptionsMapping = {
@@ -183,21 +183,21 @@ exports.getStyledShape = getStyledShape;
183
183
 
184
184
  /***/ }),
185
185
 
186
- /***/ 55:
186
+ /***/ 71:
187
187
  /***/ (function(module, exports) {
188
188
 
189
189
  module.exports = require("@splunk/themes/pick");
190
190
 
191
191
  /***/ }),
192
192
 
193
- /***/ 56:
193
+ /***/ 72:
194
194
  /***/ (function(module, exports) {
195
195
 
196
196
  module.exports = require("@splunk/themes/variables");
197
197
 
198
198
  /***/ }),
199
199
 
200
- /***/ 57:
200
+ /***/ 73:
201
201
  /***/ (function(module, exports) {
202
202
 
203
203
  module.exports = require("@splunk/visualizations-shared/propUtils");
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"styled-components\"","webpack:///external \"lodash\"","webpack:///./src/common/shapeUtils.ts","webpack:///external \"@splunk/themes/pick\"","webpack:///external \"@splunk/themes/variables\"","webpack:///external \"@splunk/visualizations-shared/propUtils\""],"names":[],"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,8C;;;;;;;ACAA,mC;;;;;;;;;;;;;;;ACAA;;AACA;;AACA;;AACA;;AACA,0C,CAMA;;;AACA,IAAM,mBAAmB,GAAG;AACxB,WAAS,EAAE,MADa;AAExB,aAAW,EAAE,QAFW;AAGxB,iBAAe,EAAE,iBAHO;AAIxB,iBAAe,EAAE;AAJO,CAA5B;AAOA;;;;;AAKG;;AACI,IAAM,WAAW,GAAG,SAAd,WAAc,CAAC,OAAD;AAAA,SACvB,iBAAQ,OAAR,EAAiB,UAAC,GAAD,EAAM,GAAN;AAAA,WAAe,mBAAmB,CAAC,GAAD,CAAnB,GAA2B,mBAAmB,CAAC,GAAD,CAA9C,GAAsD,GAArE;AAAA,GAAjB,CADuB;AAAA,CAApB;;AAAM,sBAAW,WAAX;AAKb;;;;AAIG;;AACI,IAAM,cAAc,GAAG,SAAjB,cAAiB,CAAC,KAAD;AAAA,SAAkB,4BAAO,KAAP,CAAlB;AAAA;AAAA;AAAA,6CAClB,eAAK;AAAA,WACR,KAAK,CAAC,IAAN,IAAc,wBAAY,KAAK,CAAC,IAAlB,CAAf,IACA,eAAK;AACD,gBAAU,EAAE;AACR,aAAK,EAAE,oBAAU,MADT;AAER,YAAI,EAAE,oBAAU;AAFR,OADX;AAKD,YAAM,EAAE,oBAAU;AALjB,KAAL,EAMG,KANH,CAFS;AAAA,GADa,EAUhB,eAAK;AAAA,WACV,KAAK,CAAC,MAAN,IAAgB,wBAAY,KAAK,CAAC,MAAlB,CAAjB,IACA,eAAK;AACD,gBAAU,EAAE;AACR,YAAI,EAAE,oBAAU,MADR;AAER,aAAK,EAAE,oBAAU;AAFT,OADX;AAKD,YAAM,EAAE,oBAAU;AALjB,KAAL,EAMG,KANH,CAFW;AAAA,GAVW,EAmBhB,eAAK;AAAA,WAAK,KAAK,CAAC,OAAN,GAAgB,SAAhB,GAA4B,SAAjC;AAAA,GAnBW;AAAA,CAAvB;;AAAM,yBAAc,cAAd,C;;;;;;;AClCb,gD;;;;;;;ACAA,qD;;;;;;;ACAA,oE","file":"shapeUtils.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 = 54);\n","module.exports = require(\"styled-components\");","module.exports = require(\"lodash\");","import { mapKeys } from 'lodash';\nimport styled from 'styled-components';\nimport pick from '@splunk/themes/pick';\nimport variables from '@splunk/themes/variables';\nimport { formatColor } from '@splunk/visualizations-shared/propUtils';\n\ninterface ShapeOptions {\n [key: string]: any;\n}\n\n// map for new options names to old option names\nconst shapeOptionsMapping = {\n fillColor: 'fill',\n strokeColor: 'stroke',\n strokeDashStyle: 'strokeDasharray',\n strokeJoinStyle: 'strokeLinejoin',\n};\n\n/**\n * Helper method to update the option names to old option names\n * @method mapToOldKey\n * @param {Object} options\n * @returns {Object}\n */\nexport const mapToOldKey = (options: ShapeOptions): ShapeOptions =>\n mapKeys(options, (val, key) => (shapeOptionsMapping[key] ? shapeOptionsMapping[key] : key));\n\ntype Shape = 'ellipse' | 'rect';\n\n/**\n * Helper method to get styled component for ellipse or rectangle\n * @method mapToOldKey\n * @param {Shape} shape\n */\nexport const getStyledShape = (shape: Shape) => styled(shape)`\n fill: ${props =>\n (props.fill && formatColor(props.fill)) ||\n pick({\n enterprise: {\n light: variables.gray80,\n dark: variables.gray25,\n },\n prisma: variables.backgroundColorSidebar,\n })(props)};\n stroke: ${props =>\n (props.stroke && formatColor(props.stroke)) ||\n pick({\n enterprise: {\n dark: variables.gray80,\n light: variables.textColor,\n },\n prisma: variables.neutral500,\n })(props)};\n cursor: ${props => (props.onClick ? 'pointer' : 'inherit')};\n`;\n","module.exports = require(\"@splunk/themes/pick\");","module.exports = require(\"@splunk/themes/variables\");","module.exports = require(\"@splunk/visualizations-shared/propUtils\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"styled-components\"","webpack:///external \"lodash\"","webpack:///./src/common/shapeUtils.ts","webpack:///external \"@splunk/themes/pick\"","webpack:///external \"@splunk/themes/variables\"","webpack:///external \"@splunk/visualizations-shared/propUtils\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA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MG,KANH,CAFS;AAAA,GADa,EAUhB,eAAK;AAAA,WACV,KAAK,CAAC,MAAN,IAAgB,wBAAY,KAAK,CAAC,MAAlB,CAAjB,IACA,eAAK;AACD,gBAAU,EAAE;AACR,YAAI,EAAE,oBAAU,MADR;AAER,aAAK,EAAE,oBAAU;AAFT,OADX;AAKD,YAAM,EAAE,oBAAU;AALjB,KAAL,EAMG,KANH,CAFW;AAAA,GAVW,EAmBhB,eAAK;AAAA,WAAK,KAAK,CAAC,OAAN,GAAgB,SAAhB,GAA4B,SAAjC;AAAA,GAnBW;AAAA,CAAvB;;AAAM,yBAAc,cAAd,C;;;;;;;AClCb,gD;;;;;;;ACAA,qD;;;;;;;ACAA,oE","file":"shapeUtils.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 = 70);\n","module.exports = require(\"styled-components\");","module.exports = require(\"lodash\");","import { mapKeys } from 'lodash';\nimport styled from 'styled-components';\nimport pick from '@splunk/themes/pick';\nimport variables from '@splunk/themes/variables';\nimport { formatColor } from '@splunk/visualizations-shared/propUtils';\n\ninterface ShapeOptions {\n [key: string]: any;\n}\n\n// map for new options names to old option names\nconst shapeOptionsMapping = {\n fillColor: 'fill',\n strokeColor: 'stroke',\n strokeDashStyle: 'strokeDasharray',\n strokeJoinStyle: 'strokeLinejoin',\n};\n\n/**\n * Helper method to update the option names to old option names\n * @method mapToOldKey\n * @param {Object} options\n * @returns {Object}\n */\nexport const mapToOldKey = (options: ShapeOptions): ShapeOptions =>\n mapKeys(options, (val, key) => (shapeOptionsMapping[key] ? shapeOptionsMapping[key] : key));\n\ntype Shape = 'ellipse' | 'rect';\n\n/**\n * Helper method to get styled component for ellipse or rectangle\n * @method mapToOldKey\n * @param {Shape} shape\n */\nexport const getStyledShape = (shape: Shape) => styled(shape)`\n fill: ${props =>\n (props.fill && formatColor(props.fill)) ||\n pick({\n enterprise: {\n light: variables.gray80,\n dark: variables.gray25,\n },\n prisma: variables.backgroundColorSidebar,\n })(props)};\n stroke: ${props =>\n (props.stroke && formatColor(props.stroke)) ||\n pick({\n enterprise: {\n dark: variables.gray80,\n light: variables.textColor,\n },\n prisma: variables.neutral500,\n })(props)};\n cursor: ${props => (props.onClick ? 'pointer' : 'inherit')};\n`;\n","module.exports = require(\"@splunk/themes/pick\");","module.exports = require(\"@splunk/themes/variables\");","module.exports = require(\"@splunk/visualizations-shared/propUtils\");"],"sourceRoot":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///./src/common/utils/JSONSchemaUtils.ts"],"names":[],"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,mC;;;;;;;;;;;;;;;ACCA;;AAIO,IAAM,uBAAuB,GAAG,SAA1B,uBAA0B,CACnC,aADmC;AAAA,MAEnC,SAFmC,uEAEvB,SAFuB;AAAA,SAInC,MAAM,CAAC,IAAP,CAAY,aAAZ,EAA2B,MAA3B,CAAkC,UAAC,KAAD,EAAiC,CAAjC,EAA+D;AAC7F,QAAI,aAAI,aAAa,CAAC,CAAD,CAAjB,EAAsB,SAAtB,CAAJ,EAAsC;AAClC,WAAK,CAAC,CAAD,CAAL,GAAW,aAAa,CAAC,CAAD,CAAb,CAAiB,SAAjB,CAAX;AACH,KAFD,MAEO,IAAI,aAAI,aAAJ,EAAmB,CAAC,CAAD,EAAI,MAAJ,CAAnB,MAAoC,QAApC,IAAgD,aAAI,aAAa,CAAC,CAAD,CAAjB,EAAsB,YAAtB,CAApD,EAAyF;AAC5F,UAAM,YAAY,GAAG,gCAAwB,aAAa,CAAC,CAAD,CAAb,CAAiB,UAAzC,EAAqD,SAArD,CAArB;;AACA,UAAI,CAAC,iBAAQ,YAAR,CAAL,EAA4B;AACxB,aAAK,CAAC,CAAD,CAAL,GAAW,YAAX;AACH;AACJ;;AACD,WAAO,KAAP;AACH,GAVD,EAUG,EAVH,CAJmC;AAAA,CAAhC;;AAAM,kCAAuB,uBAAvB,C","file":"JSONSchemaUtils.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 = 6);\n","module.exports = require(\"lodash\");","import { JSONSchema7Definition } from 'json-schema';\nimport { has, isEmpty, get } from 'lodash';\nimport { KV } from '../interfaces/Object';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\n\nexport const pickFieldFromJSONSchema = (\n optionsSchema: OptionsSchema | JSONSchema7Definition,\n fieldName = 'default'\n): KV =>\n Object.keys(optionsSchema).reduce((accum: Record<string, unknown>, k): Record<string, unknown> => {\n if (has(optionsSchema[k], fieldName)) {\n accum[k] = optionsSchema[k][fieldName];\n } else if (get(optionsSchema, [k, 'type']) === 'object' && has(optionsSchema[k], 'properties')) {\n const nestedSchema = pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);\n if (!isEmpty(nestedSchema)) {\n accum[k] = nestedSchema;\n }\n }\n return accum;\n }, {});\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///./src/common/utils/JSONSchemaUtils.ts"],"names":[],"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,mC;;;;;;;;;;;;;;;ACCA;;AAIO,IAAM,uBAAuB,GAAG,SAA1B,uBAA0B,CACnC,aADmC;AAAA,MAEnC,SAFmC,uEAEvB,SAFuB;AAAA,SAInC,MAAM,CAAC,IAAP,CAAY,aAAZ,EAA2B,MAA3B,CAAkC,UAAC,KAAD,EAAiC,CAAjC,EAA+D;AAC7F,QAAI,aAAI,aAAa,CAAC,CAAD,CAAjB,EAAsB,SAAtB,CAAJ,EAAsC;AAClC,WAAK,CAAC,CAAD,CAAL,GAAW,aAAa,CAAC,CAAD,CAAb,CAAiB,SAAjB,CAAX;AACH,KAFD,MAEO,IAAI,aAAI,aAAJ,EAAmB,CAAC,CAAD,EAAI,MAAJ,CAAnB,MAAoC,QAApC,IAAgD,aAAI,aAAa,CAAC,CAAD,CAAjB,EAAsB,YAAtB,CAApD,EAAyF;AAC5F,UAAM,YAAY,GAAG,gCAAwB,aAAa,CAAC,CAAD,CAAb,CAAiB,UAAzC,EAAqD,SAArD,CAArB;;AACA,UAAI,CAAC,iBAAQ,YAAR,CAAL,EAA4B;AACxB,aAAK,CAAC,CAAD,CAAL,GAAW,YAAX;AACH;AACJ;;AACD,WAAO,KAAP;AACH,GAVD,EAUG,EAVH,CAJmC;AAAA,CAAhC;;AAAM,kCAAuB,uBAAvB,C","file":"JSONSchemaUtils.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 = 6);\n","module.exports = require(\"lodash\");","import type { JSONSchema7Definition } from 'json-schema';\nimport { has, isEmpty, get } from 'lodash';\nimport { KV } from '../interfaces/Object';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\n\nexport const pickFieldFromJSONSchema = (\n optionsSchema: OptionsSchema | JSONSchema7Definition,\n fieldName = 'default'\n): KV =>\n Object.keys(optionsSchema).reduce((accum: Record<string, unknown>, k): Record<string, unknown> => {\n if (has(optionsSchema[k], fieldName)) {\n accum[k] = optionsSchema[k][fieldName];\n } else if (get(optionsSchema, [k, 'type']) === 'object' && has(optionsSchema[k], 'properties')) {\n const nestedSchema = pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);\n if (!isEmpty(nestedSchema)) {\n accum[k] = nestedSchema;\n }\n }\n return accum;\n }, {});\n"],"sourceRoot":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"@splunk/visualizations-shared/schemaUtils\"","webpack:///./src/common/interfaces/VizBehavior.ts"],"names":[],"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,mC;;;;;;ACAA,kE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AACA;;AACA;;AAWA,IAAM,qBAAqB,GAAG;AAC1B,MAAI,EAAE,QADoB;AAE1B,SAAO,EAAE;AAFiB,CAA9B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;AAIH,GAdM,CAAP;AAeH;;AA0BG;AAnBJ;;;;;AAKG;;AACH,SAAS,uBAAT,CAAiC,kBAAjC,EAA2D;AACvD,SAAO,eAAM,CAAN,EAAS,kBAAkB,GAAG,CAA9B,EAAiC,GAAjC,CACH,UAAC,CAAD;AAAA,WAAyB;AACrB,WAAK,YAAK,CAAL,gBAAY,CAAC,GAAG,CAAJ,GAAQ,GAAR,GAAc,EAA1B,SAA+B,IAAI,MAAJ,CAAW,CAAX,CAA/B,MADgB;AAErB,WAAK,EAAE;AAFc,KAAzB;AAAA,GADG,CAAP;AAMH;;AAOG,0D;;;;;;ACnMJ,sE;;;;;;;;;;;;;ACAA,IAAY,WAAZ;;AAAA,WAAY,WAAZ,EAAuB;AACnB;;;;;;;;;;AAUG;AACH;AACA;AACA;;;;AAIG;;AACH;AACA;AACH,CArBD,EAAY,WAAW,GAAX,8CAAW,EAAX,CAAZ,E","file":"configUtils.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 = 7);\n","module.exports = require(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { JSONSchema7Definition } from 'json-schema';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\nconst dynamicOptionsDSLType = {\n type: 'string',\n pattern: DYNAMIC_OPTIONS_DSL_PATTERN,\n} as const;\n\n/**\n * Helper function to extend an options schema with dynamic options DSL\n * @param optionsSchema a visualization's options schema\n * @returns an updated options schema that additionally allows strings starting with > for each option\n */\nfunction enhanceOptionsSchemaWithDynamicOptions(\n optionsSchema: OptionsSchema | JSONSchema7Definition\n): OptionsSchema {\n const enhancedOptionsSchema: OptionsSchema = {};\n Object.keys(optionsSchema).forEach((key): void => {\n const {\n // The next a few are schema annotations, we should leave them as is.\n // Note: in reality we don't use `readOnly`, `writeOnly` or `examples`, but they are listed here for completeness.\n // Ref: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01\n title,\n description,\n readOnly,\n writeOnly,\n examples,\n default: defaultValue,\n // The next a few need special care\n type,\n properties,\n patternProperties,\n // The rest should be handled together\n ...remainingSchemaEntry\n } = optionsSchema[key];\n\n const annotations = {\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n ...(readOnly !== undefined && { readOnly }),\n ...(writeOnly !== undefined && { writeOnly }),\n ...(examples !== undefined && { examples }),\n ...(defaultValue !== undefined && { default: defaultValue }),\n };\n\n if (type === 'object') {\n enhancedOptionsSchema[key] = {\n ...remainingSchemaEntry,\n ...annotations,\n type,\n ...(properties && { properties: enhanceOptionsSchemaWithDynamicOptions(properties) }),\n };\n if (patternProperties) {\n let enhancedPatternProperties = {};\n Object.keys(patternProperties).forEach((key): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [key]: patternProperties[key] }),\n };\n });\n enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;\n }\n } else {\n enhancedOptionsSchema[key] = {\n ...annotations,\n anyOf: [\n // we can't assume `type` is always there because there are `enum` and `const`.\n { ...(type !== undefined && { type }), ...remainingSchemaEntry },\n dynamicOptionsDSLType,\n ],\n };\n }\n });\n return enhancedOptionsSchema;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = vizConfig;\n if (vizConfig.supports.indexOf(VizBehavior.DYNAMIC_OPTIONS) !== -1) {\n enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);\n }\n return enhancedConfig;\n}\n\nfunction isDynamicOption(option?: string): boolean {\n return (option && typeof option === 'string' && option.trim().startsWith('>')) || false;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport {\n enhanceConfig,\n enhanceOptionsSchemaWithDynamicOptions,\n isDynamicOption,\n getInitialPreset,\n generatePrecisionValues,\n};\n","module.exports = require(\"@splunk/visualizations-shared/schemaUtils\");","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"@splunk/visualizations-shared/schemaUtils\"","webpack:///./src/common/interfaces/VizBehavior.ts"],"names":[],"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,mC;;;;;;ACAA,kE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AACA;;AACA;;AAWA,IAAM,qBAAqB,GAAG;AAC1B,MAAI,EAAE,QADoB;AAE1B,SAAO,EAAE;AAFiB,CAA9B;AAKA;;;;AAIG;;AACH,SAAS,sCAAT,CACI,aADJ,EACwD;AAEpD,MAAM,qBAAqB,GAAkB,EAA7C;AACA,QAAM,CAAC,IAAP,CAAY,aAAZ,EAA2B,OAA3B,CAAmC,UAAC,GAAD,EAAc;AACvC,aAgBF,aAA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A,WAAyB;AACrB,WAAK,YAAK,CAAL,gBAAY,CAAC,GAAG,CAAJ,GAAQ,GAAR,GAAc,EAA1B,SAA+B,IAAI,MAAJ,CAAW,CAAX,CAA/B,MADgB;AAErB,WAAK,EAAE;AAFc,KAAzB;AAAA,GADG,CAAP;AAMH;;AAOG,0D;;;;;;ACnMJ,sE;;;;;;;;;;;;;ACAA,IAAY,WAAZ;;AAAA,WAAY,WAAZ,EAAuB;AACnB;;;;;;;;;;AAUG;AACH;AACA;AACA;;;;AAIG;;AACH;AACA;AACH,CArBD,EAAY,WAAW,GAAX,8CAAW,EAAX,CAAZ,E","file":"configUtils.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 = 7);\n","module.exports = require(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport type { JSONSchema7Definition } from 'json-schema';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\nconst dynamicOptionsDSLType = {\n type: 'string',\n pattern: DYNAMIC_OPTIONS_DSL_PATTERN,\n} as const;\n\n/**\n * Helper function to extend an options schema with dynamic options DSL\n * @param optionsSchema a visualization's options schema\n * @returns an updated options schema that additionally allows strings starting with > for each option\n */\nfunction enhanceOptionsSchemaWithDynamicOptions(\n optionsSchema: OptionsSchema | JSONSchema7Definition\n): OptionsSchema {\n const enhancedOptionsSchema: OptionsSchema = {};\n Object.keys(optionsSchema).forEach((key): void => {\n const {\n // The next a few are schema annotations, we should leave them as is.\n // Note: in reality we don't use `readOnly`, `writeOnly` or `examples`, but they are listed here for completeness.\n // Ref: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01\n title,\n description,\n readOnly,\n writeOnly,\n examples,\n default: defaultValue,\n // The next a few need special care\n type,\n properties,\n patternProperties,\n // The rest should be handled together\n ...remainingSchemaEntry\n } = optionsSchema[key];\n\n const annotations = {\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n ...(readOnly !== undefined && { readOnly }),\n ...(writeOnly !== undefined && { writeOnly }),\n ...(examples !== undefined && { examples }),\n ...(defaultValue !== undefined && { default: defaultValue }),\n };\n\n if (type === 'object') {\n enhancedOptionsSchema[key] = {\n ...remainingSchemaEntry,\n ...annotations,\n type,\n ...(properties && { properties: enhanceOptionsSchemaWithDynamicOptions(properties) }),\n };\n if (patternProperties) {\n let enhancedPatternProperties = {};\n Object.keys(patternProperties).forEach((key): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [key]: patternProperties[key] }),\n };\n });\n enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;\n }\n } else {\n enhancedOptionsSchema[key] = {\n ...annotations,\n anyOf: [\n // we can't assume `type` is always there because there are `enum` and `const`.\n { ...(type !== undefined && { type }), ...remainingSchemaEntry },\n dynamicOptionsDSLType,\n ],\n };\n }\n });\n return enhancedOptionsSchema;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = vizConfig;\n if (vizConfig.supports.indexOf(VizBehavior.DYNAMIC_OPTIONS) !== -1) {\n enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);\n }\n return enhancedConfig;\n}\n\nfunction isDynamicOption(option?: string): boolean {\n return (option && typeof option === 'string' && option.trim().startsWith('>')) || false;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport {\n enhanceConfig,\n enhanceOptionsSchemaWithDynamicOptions,\n isDynamicOption,\n getInitialPreset,\n generatePrecisionValues,\n};\n","module.exports = require(\"@splunk/visualizations-shared/schemaUtils\");","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n}\n"],"sourceRoot":""}
@@ -87,21 +87,32 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 11);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 10);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
94
94
 
95
- /***/ 11:
95
+ /***/ 0:
96
+ /***/ (function(module, exports) {
97
+
98
+ module.exports = require("lodash");
99
+
100
+ /***/ }),
101
+
102
+ /***/ 10:
96
103
  /***/ (function(module, exports, __webpack_require__) {
97
104
 
98
105
  "use strict";
99
106
 
100
107
 
108
+ var _typeof = __webpack_require__(11);
109
+
101
110
  Object.defineProperty(exports, "__esModule", {
102
111
  value: true
103
112
  });
104
- exports.extendStaticWrapperProps = void 0;
113
+ exports.deepMergeWithArrayOverrides = exports.extendStaticWrapperProps = void 0;
114
+
115
+ var lodash_1 = __webpack_require__(0);
105
116
  /**
106
117
  * @method extendStaticWrapperProps
107
118
  * @param {Object} props
@@ -109,6 +120,7 @@ exports.extendStaticWrapperProps = void 0;
109
120
  * @param {DashboardVizType} props.Visualization
110
121
  */
111
122
 
123
+
112
124
  var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
113
125
  var Wrapper = _ref.Wrapper,
114
126
  Visualization = _ref.Visualization;
@@ -121,6 +133,48 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
121
133
  };
122
134
 
123
135
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
136
+ /**
137
+ * helper to deeply merge objects while preserving arrays in earlier source objects
138
+ * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays will be preserved if already present in the resultant merged object
139
+ * this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)
140
+ *
141
+ * @method deepMergeWithArrayOverrides
142
+ * @param {Object} initial - target object to merge values into
143
+ * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones
144
+ *
145
+ * @returns {Object}
146
+ */
147
+
148
+ var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial) {
149
+ var clone = lodash_1.cloneDeep(initial);
150
+
151
+ for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
152
+ sources[_key - 1] = arguments[_key];
153
+ }
154
+
155
+ sources.forEach(function (sourceToApply) {
156
+ Object.keys(sourceToApply).forEach(function (sourceKey) {
157
+ if (!clone.hasOwnProperty(sourceKey)) {
158
+ clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
159
+ } // object merging excluding arrays
160
+
161
+
162
+ if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
163
+ clone[sourceKey] = exports.deepMergeWithArrayOverrides(clone[sourceKey], sourceToApply[sourceKey]);
164
+ }
165
+ });
166
+ });
167
+ return clone;
168
+ };
169
+
170
+ exports.deepMergeWithArrayOverrides = deepMergeWithArrayOverrides;
171
+
172
+ /***/ }),
173
+
174
+ /***/ 11:
175
+ /***/ (function(module, exports) {
176
+
177
+ module.exports = require("@babel/runtime/helpers/typeof");
124
178
 
125
179
  /***/ })
126
180
 
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/common/utils/hocUtils.ts"],"names":[],"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;;;;;;;;;;;;;;;AC9EA;;;;;AAKG;;AACI,IAAM,wBAAwB,GAAG,SAA3B,wBAA2B,OAK7B;AAAA,MAJP,OAIO,QAJP,OAIO;AAAA,MAHP,aAGO,QAHP,aAGO;AACP,MAAM,gBAAgB,GAAG,CAAC,WAAD,EAAc,cAAd,EAA8B,QAA9B,CAAzB;AACA,kBAAgB,CAAC,OAAjB,CAAyB,UAAC,IAAD,EAAuB;AAC5C,QAAI,aAAa,CAAC,IAAD,CAAjB,EAAyB;AACrB,aAAO,CAAC,IAAD,CAAP,GAAgB,aAAa,CAAC,IAAD,CAA7B;AACH;AACJ,GAJD;AAKH,CAZM;;AAAM,mCAAwB,wBAAxB,C","file":"hocUtils.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 = 11);\n","import { DashboardVizProps } from '../interfaces/DashboardVizProps';\n\nexport type DashboardVizType = React.ComponentType<DashboardVizProps>;\n\n/**\n * @method extendStaticWrapperProps\n * @param {Object} props\n * @param {DashboardVizType} props.Wrapper\n * @param {DashboardVizType} props.Visualization\n */\nexport const extendStaticWrapperProps = ({\n Wrapper,\n Visualization,\n}: {\n [key: string]: DashboardVizType;\n}): void => {\n const extendProperties = ['propTypes', 'defaultProps', 'config'];\n extendProperties.forEach((prop: string): void => {\n if (Visualization[prop]) {\n Wrapper[prop] = Visualization[prop];\n }\n });\n};\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///./src/common/utils/hocUtils.ts","webpack:///external \"@babel/runtime/helpers/typeof\""],"names":[],"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,mC;;;;;;;;;;;;;;;;;ACAA;AAKA;;;;;AAKG;;;AACI,IAAM,wBAAwB,GAAG,SAA3B,wBAA2B,OAK7B;AAAA,MAJP,OAIO,QAJP,OAIO;AAAA,MAHP,aAGO,QAHP,aAGO;AACP,MAAM,gBAAgB,GAAG,CAAC,WAAD,EAAc,cAAd,EAA8B,QAA9B,CAAzB;AACA,kBAAgB,CAAC,OAAjB,CAAyB,UAAC,IAAD,EAAuB;AAC5C,QAAI,aAAa,CAAC,IAAD,CAAjB,EAAyB;AACrB,aAAO,CAAC,IAAD,CAAP,GAAgB,aAAa,CAAC,IAAD,CAA7B;AACH;AACJ,GAJD;AAKH,CAZM;;AAAM,mCAAwB,wBAAxB;AAcb;;;;;;;;;;AAUG;;AACI,IAAM,2BAA2B,GAAG,SAA9B,2BAA8B,CAAC,OAAD,EAAwB;AAC/D,MAAM,KAAK,GAAG,mBAAU,OAAV,CAAd;;AAD+D,oCAAX,OAAW;AAAX,WAAW;AAAA;;AAE/D,SAAO,CAAC,OAAR,CAAgB,uBAAa,EAAG;AAC5B,UAAM,CAAC,IAAP,CAAY,aAAZ,EAA2B,OAA3B,CAAmC,mBAAS,EAAG;AAC3C,UAAI,CAAC,KAAK,CAAC,cAAN,CAAqB,SAArB,CAAL,EAAsC;AAClC,aAAK,CAAC,SAAD,CAAL,GAAmB,mBAAU,aAAa,CAAC,SAAD,CAAvB,CAAnB;AACH,OAH0C,CAI3C;;;AACA,UACI,KAAK,CAAC,SAAD,CAAL,IACA,QAAO,KAAK,CAAC,SAAD,CAAZ,MAA4B,QAD5B,IAEA,CAAC,KAAK,CAAC,OAAN,CAAc,KAAK,CAAC,SAAD,CAAnB,CAFD,IAGA,QAAO,aAAa,CAAC,SAAD,CAApB,MAAoC,QAJxC,EAKE;AACE,aAAK,CAAC,SAAD,CAAL,GAAmB,oCAA4B,KAAK,CAAC,SAAD,CAAjC,EAA8C,aAAa,CAAC,SAAD,CAA3D,CAAnB;AACH;AACJ,KAbD;AAcH,GAfD;AAgBA,SAAO,KAAP;AACH,CAnBM;;AAAM,sCAA2B,2BAA3B,C;;;;;;;ACpCb,0D","file":"hocUtils.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 = 10);\n","module.exports = require(\"lodash\");","import { cloneDeep } from 'lodash';\nimport { DashboardVizProps } from '../interfaces/DashboardVizProps';\n\nexport type DashboardVizType = React.ComponentType<DashboardVizProps>;\n\n/**\n * @method extendStaticWrapperProps\n * @param {Object} props\n * @param {DashboardVizType} props.Wrapper\n * @param {DashboardVizType} props.Visualization\n */\nexport const extendStaticWrapperProps = ({\n Wrapper,\n Visualization,\n}: {\n [key: string]: DashboardVizType;\n}): void => {\n const extendProperties = ['propTypes', 'defaultProps', 'config'];\n extendProperties.forEach((prop: string): void => {\n if (Visualization[prop]) {\n Wrapper[prop] = Visualization[prop];\n }\n });\n};\n\n/**\n * helper to deeply merge objects while preserving arrays in earlier source objects\n * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays will be preserved if already present in the resultant merged object\n * this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)\n *\n * @method deepMergeWithArrayOverrides\n * @param {Object} initial - target object to merge values into\n * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones\n *\n * @returns {Object}\n */\nexport const deepMergeWithArrayOverrides = (initial, ...sources) => {\n const clone = cloneDeep(initial);\n sources.forEach(sourceToApply => {\n Object.keys(sourceToApply).forEach(sourceKey => {\n if (!clone.hasOwnProperty(sourceKey)) {\n clone[sourceKey] = cloneDeep(sourceToApply[sourceKey]);\n }\n // object merging excluding arrays\n if (\n clone[sourceKey] &&\n typeof clone[sourceKey] === 'object' &&\n !Array.isArray(clone[sourceKey]) &&\n typeof sourceToApply[sourceKey] === 'object'\n ) {\n clone[sourceKey] = deepMergeWithArrayOverrides(clone[sourceKey], sourceToApply[sourceKey]);\n }\n });\n });\n return clone;\n};\n","module.exports = require(\"@babel/runtime/helpers/typeof\");"],"sourceRoot":""}
@@ -470,24 +470,38 @@ var getTrendText = function getTrendText(_ref6) {
470
470
  shouldUseThousandSeparators = _ref6.shouldUseThousandSeparators,
471
471
  shouldAbbreviateTrendValue = _ref6.shouldAbbreviateTrendValue;
472
472
 
473
+ var compute = function compute(value) {
474
+ return computeText({
475
+ value: value,
476
+ numberPrecision: numberPrecision,
477
+ shouldUseThousandSeparators: shouldUseThousandSeparators,
478
+ shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
479
+ });
480
+ };
481
+
473
482
  if (trendValue === '' || !Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__["isNumerial"])(trendValue)) {
474
483
  return '';
475
484
  }
476
485
 
477
- var value = trendValue;
478
486
  var showPercent = trendDisplay === 'percent';
479
487
 
480
- if (showPercent) {
481
- value = Number(majorValue) !== Number(trendValue) ? trendValue / (majorValue - trendValue) * 100 : 0;
488
+ if (!showPercent) {
489
+ return compute(trendValue);
482
490
  }
483
491
 
484
- var trendText = computeText({
485
- value: value,
486
- numberPrecision: numberPrecision,
487
- shouldUseThousandSeparators: shouldUseThousandSeparators,
488
- shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
489
- });
490
- return showPercent ? "".concat(trendText, "%") : trendText;
492
+ var diff = Math.abs(trendValue - majorValue);
493
+ var val = Math.round(trendValue / diff * 100);
494
+
495
+ if (trendValue === 0 && diff === 0) {
496
+ val = 0;
497
+ }
498
+
499
+ if (!Number.isFinite(val)) {
500
+ return 'N/A';
501
+ }
502
+
503
+ var text = compute(val);
504
+ return "".concat(text, "%");
491
505
  };
492
506
  /**
493
507
  * Helper to determine the font size for an element