@splunk/visualizations 25.0.1 → 25.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_custom_base_layer_tile_server.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
- package/Area.config.js +141 -152
- package/Area.config.js.map +1 -1
- package/Area.js +334 -431
- package/Area.js.map +1 -1
- package/Bar.config.js +143 -148
- package/Bar.config.js.map +1 -1
- package/Bar.js +336 -427
- package/Bar.js.map +1 -1
- package/Bubble.config.js +130 -117
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +325 -398
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +86 -80
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +305 -385
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +139 -146
- package/Column.config.js.map +1 -1
- package/Column.js +332 -425
- package/Column.js.map +1 -1
- package/Ellipse.config.js +86 -80
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +288 -368
- package/Ellipse.js.map +1 -1
- package/FillerGauge.config.js +91 -85
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +296 -376
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +74 -74
- package/Image.config.js.map +1 -1
- package/Image.js +710 -798
- package/Image.js.map +1 -1
- package/Line.config.js +139 -137
- package/Line.config.js.map +1 -1
- package/Line.js +332 -416
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +112 -112
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +320 -405
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +101 -95
- package/Map.config.js.map +1 -1
- package/Map.js +472 -518
- package/Map.js.map +1 -1
- package/Markdown.config.js +113 -113
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +500 -574
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +192 -193
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +1200 -1289
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +138 -138
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +292 -376
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +133 -133
- package/Pie.config.js.map +1 -1
- package/Pie.js +496 -584
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +139 -139
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +315 -399
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +267 -260
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +499 -580
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +150 -143
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +316 -390
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +130 -117
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +547 -623
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +119 -113
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +523 -604
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +19 -19
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +128 -120
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +343 -420
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +215 -178
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +668 -749
- package/SingleValueRadial.js.map +1 -1
- package/Table.config.js +150 -151
- package/Table.config.js.map +1 -1
- package/Table.js +772 -854
- package/Table.js.map +1 -1
- package/common/Charting.js +11 -11
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +2 -2
- package/common/ChartingApi.js.map +1 -1
- package/common/EventsDoc.js +12 -12
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +8 -8
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +8 -8
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +51 -352
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +22 -22
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +4 -4
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +2 -2
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +19 -19
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +4 -4
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +4 -4
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +13 -13
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +8 -8
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +17 -18
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/hocUtils.js +6 -86
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/{JSONSchemaUtils.js → mapUtils.js} +89 -29
- package/common/utils/mapUtils.js.map +1 -0
- package/common/utils/singleValueUtils.js +14 -12
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +8 -8
- package/common/utils/testHelper.js.map +1 -1
- package/common/withDashboardViz.js +120 -207
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +12 -12
- package/.loki/reference/chrome_docker_PureVisualizations_SvgChoroplethDynamic_SVG_Of_Size_Greater_Than_2_MB_Render.png +0 -0
- package/common/utils/JSONSchemaUtils.js.map +0 -1
package/common/gaugeUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"lodash\"","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///./src/common/gaugeUtils.ts","webpack:///external \"@splunk/visualizations-shared/colorConstants\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA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AC1B,QAAI,UAAU,CAAC,YAAD,CAAV,KAA6B,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","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 = 70);\n","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"lodash\");","module.exports = require(\"@splunk/ui-utils/i18n\");","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\");"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"lodash\"","webpack:///./src/common/gaugeUtils.ts","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/visualizations-shared/colorConstants\""],"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,qE;;;;;;;ACAA,mC;;;;;;;;;;;;;;;;;ACAA;;AACA;;AAKA;;AAEa,0BAAkB,EAAlB;AACA,yBAAiB,EAAjB;AACb,IAAM,wBAAwB,GAAG,CAAjC;AACA,IAAM,wBAAwB,GAAG,GAAjC;AAEA;;;;;;;AAOG;;AACI,IAAM,aAAa,GAAG,SAAhB,aAAgB;AAAA,MAAG,cAAH,QAAG,cAAH;AA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A9B,CAAJ;AAAA,GAFjB,EAGK,KAHL,EADoC;AAAA,CAAjC;;AAAM,mCAAwB,wBAAxB,C;;;;;;;ACzjBb,kD;;;;;;;ACAA,yE","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 = 69);\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/ui-utils/i18n\");","module.exports = require(\"@splunk/visualizations-shared/colorConstants\");"],"sourceRoot":""}
|
package/common/shapeUtils.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 71);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -99,7 +99,7 @@ module.exports = require("styled-components");
|
|
|
99
99
|
|
|
100
100
|
/***/ }),
|
|
101
101
|
|
|
102
|
-
/***/
|
|
102
|
+
/***/ 26:
|
|
103
103
|
/***/ (function(module, exports) {
|
|
104
104
|
|
|
105
105
|
module.exports = require("@splunk/themes/variables");
|
|
@@ -113,7 +113,7 @@ module.exports = require("lodash");
|
|
|
113
113
|
|
|
114
114
|
/***/ }),
|
|
115
115
|
|
|
116
|
-
/***/
|
|
116
|
+
/***/ 71:
|
|
117
117
|
/***/ (function(module, exports, __webpack_require__) {
|
|
118
118
|
|
|
119
119
|
"use strict";
|
|
@@ -128,11 +128,11 @@ var lodash_1 = __webpack_require__(3);
|
|
|
128
128
|
|
|
129
129
|
var styled_components_1 = __webpack_require__(2);
|
|
130
130
|
|
|
131
|
-
var pick_1 = __webpack_require__(
|
|
131
|
+
var pick_1 = __webpack_require__(72);
|
|
132
132
|
|
|
133
|
-
var variables_1 = __webpack_require__(
|
|
133
|
+
var variables_1 = __webpack_require__(26);
|
|
134
134
|
|
|
135
|
-
var propUtils_1 = __webpack_require__(
|
|
135
|
+
var propUtils_1 = __webpack_require__(73); // map for new options names to old option names
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
var shapeOptionsMapping = {
|
|
@@ -190,14 +190,14 @@ exports.getStyledShape = getStyledShape;
|
|
|
190
190
|
|
|
191
191
|
/***/ }),
|
|
192
192
|
|
|
193
|
-
/***/
|
|
193
|
+
/***/ 72:
|
|
194
194
|
/***/ (function(module, exports) {
|
|
195
195
|
|
|
196
196
|
module.exports = require("@splunk/themes/pick");
|
|
197
197
|
|
|
198
198
|
/***/ }),
|
|
199
199
|
|
|
200
|
-
/***/
|
|
200
|
+
/***/ 73:
|
|
201
201
|
/***/ (function(module, exports) {
|
|
202
202
|
|
|
203
203
|
module.exports = require("@splunk/visualizations-shared/propUtils");
|
package/common/shapeUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"styled-components\"","webpack:///external \"@splunk/themes/variables\"","webpack:///external \"lodash\"","webpack:///./src/common/shapeUtils.ts","webpack:///external \"@splunk/themes/pick\"","webpack:///external \"@splunk/visualizations-shared/propUtils\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA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AAE,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,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 =
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"styled-components\"","webpack:///external \"@splunk/themes/variables\"","webpack:///external \"lodash\"","webpack:///./src/common/shapeUtils.ts","webpack:///external \"@splunk/themes/pick\"","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,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AA,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,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 = 71);\n","module.exports = require(\"styled-components\");","module.exports = require(\"@splunk/themes/variables\");","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/visualizations-shared/propUtils\");"],"sourceRoot":""}
|
|
@@ -87,36 +87,35 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 6);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ([
|
|
94
94
|
/* 0 */
|
|
95
95
|
/***/ (function(module, exports) {
|
|
96
96
|
|
|
97
|
-
module.exports = require("
|
|
97
|
+
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
98
98
|
|
|
99
99
|
/***/ }),
|
|
100
|
-
/* 1
|
|
100
|
+
/* 1 */,
|
|
101
|
+
/* 2 */,
|
|
102
|
+
/* 3 */,
|
|
103
|
+
/* 4 */
|
|
101
104
|
/***/ (function(module, exports) {
|
|
102
105
|
|
|
103
|
-
module.exports = require("
|
|
106
|
+
module.exports = require("lodash");
|
|
104
107
|
|
|
105
108
|
/***/ }),
|
|
106
|
-
/* 2 */,
|
|
107
|
-
/* 3 */,
|
|
108
|
-
/* 4 */,
|
|
109
109
|
/* 5 */,
|
|
110
|
-
/* 6
|
|
111
|
-
/* 7 */
|
|
110
|
+
/* 6 */
|
|
112
111
|
/***/ (function(module, exports, __webpack_require__) {
|
|
113
112
|
|
|
114
113
|
"use strict";
|
|
115
114
|
|
|
116
115
|
|
|
117
|
-
var _toConsumableArray = __webpack_require__(
|
|
116
|
+
var _toConsumableArray = __webpack_require__(7);
|
|
118
117
|
|
|
119
|
-
var _defineProperty = __webpack_require__(
|
|
118
|
+
var _defineProperty = __webpack_require__(0);
|
|
120
119
|
|
|
121
120
|
var __rest = this && this.__rest || function (s, e) {
|
|
122
121
|
var t = {};
|
|
@@ -134,13 +133,13 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
134
133
|
Object.defineProperty(exports, "__esModule", {
|
|
135
134
|
value: true
|
|
136
135
|
});
|
|
137
|
-
exports.insertLayout = exports.
|
|
136
|
+
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
138
137
|
|
|
139
|
-
var lodash_1 = __webpack_require__(
|
|
138
|
+
var lodash_1 = __webpack_require__(4);
|
|
140
139
|
|
|
141
|
-
var schemaUtils_1 = __webpack_require__(
|
|
140
|
+
var schemaUtils_1 = __webpack_require__(8);
|
|
142
141
|
|
|
143
|
-
var VizBehavior_1 = __webpack_require__(
|
|
142
|
+
var VizBehavior_1 = __webpack_require__(9);
|
|
144
143
|
|
|
145
144
|
var dynamicOptionsDSLType = {
|
|
146
145
|
type: 'string',
|
|
@@ -344,19 +343,19 @@ var insertLayout = function insertLayout(layout, index) {
|
|
|
344
343
|
exports.insertLayout = insertLayout;
|
|
345
344
|
|
|
346
345
|
/***/ }),
|
|
347
|
-
/*
|
|
346
|
+
/* 7 */
|
|
348
347
|
/***/ (function(module, exports) {
|
|
349
348
|
|
|
350
349
|
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
351
350
|
|
|
352
351
|
/***/ }),
|
|
353
|
-
/*
|
|
352
|
+
/* 8 */
|
|
354
353
|
/***/ (function(module, exports) {
|
|
355
354
|
|
|
356
355
|
module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
357
356
|
|
|
358
357
|
/***/ }),
|
|
359
|
-
/*
|
|
358
|
+
/* 9 */
|
|
360
359
|
/***/ (function(module, exports, __webpack_require__) {
|
|
361
360
|
|
|
362
361
|
"use strict";
|
|
@@ -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 \"@babel/runtime/helpers/toConsumableArray\"","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;;AAEA;;AAWA,IAAM,qBAAqB,GAAG;AAC1B,MAAI,EAAE,QADoB;AAE1B,SAAO,EAAE;AAFiB,CAA9B;A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;;;;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 type { JSONSchema7Definition } from 'json-schema';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\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((opt): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [opt]: patternProperties[opt] }),\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 * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\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 enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = vizConfig;\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\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 uncollapseEditorConfig,\n};\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","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 \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"lodash\"","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","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;QAC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A,oCAGrB,WAHqB;AAGrB,eAHqB;AAAA;;AAAA,sCAMrB,MAAM,CAAC,KAAP,CAAa,CAAb,EAAgB,KAAhB,CANqB,GAQrB,WARqB,qBAUrB,MAAM,CAAC,KAAP,CAAa,KAAb,CAVqB;AAAA,CAArB;;AAAM,uBAAY,YAAZ,C;;;;;;ACxOb,qE;;;;;;ACAA,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 = 6);\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"lodash\");","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { isDynamicOption } from '@splunk/visualizations-shared/configUtils';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\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((opt): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [opt]: patternProperties[opt] }),\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 * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\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 enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = vizConfig;\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\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 getInitialPreset,\n generatePrecisionValues,\n uncollapseEditorConfig,\n isDynamicOption,\n};\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","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":""}
|
package/common/utils/hocUtils.js
CHANGED
|
@@ -87,42 +87,21 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 10);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
|
-
/******/ (
|
|
94
|
-
/* 0 */
|
|
95
|
-
/***/ (function(module, exports) {
|
|
93
|
+
/******/ ({
|
|
96
94
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/***/ }),
|
|
100
|
-
/* 1 */,
|
|
101
|
-
/* 2 */,
|
|
102
|
-
/* 3 */,
|
|
103
|
-
/* 4 */,
|
|
104
|
-
/* 5 */,
|
|
105
|
-
/* 6 */,
|
|
106
|
-
/* 7 */,
|
|
107
|
-
/* 8 */,
|
|
108
|
-
/* 9 */,
|
|
109
|
-
/* 10 */,
|
|
110
|
-
/* 11 */
|
|
95
|
+
/***/ 10:
|
|
111
96
|
/***/ (function(module, exports, __webpack_require__) {
|
|
112
97
|
|
|
113
98
|
"use strict";
|
|
114
99
|
|
|
115
100
|
|
|
116
|
-
var _typeof = __webpack_require__(12);
|
|
117
|
-
|
|
118
101
|
Object.defineProperty(exports, "__esModule", {
|
|
119
102
|
value: true
|
|
120
103
|
});
|
|
121
|
-
exports.
|
|
122
|
-
|
|
123
|
-
var lodash_1 = __webpack_require__(0);
|
|
124
|
-
|
|
125
|
-
var mapUtils_1 = __webpack_require__(13);
|
|
104
|
+
exports.extendStaticWrapperProps = void 0;
|
|
126
105
|
/**
|
|
127
106
|
* @method extendStaticWrapperProps
|
|
128
107
|
* @param {Object} props
|
|
@@ -130,7 +109,6 @@ var mapUtils_1 = __webpack_require__(13);
|
|
|
130
109
|
* @param {DashboardVizType} props.Visualization
|
|
131
110
|
*/
|
|
132
111
|
|
|
133
|
-
|
|
134
112
|
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
135
113
|
var Wrapper = _ref.Wrapper,
|
|
136
114
|
Visualization = _ref.Visualization;
|
|
@@ -144,66 +122,8 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
144
122
|
};
|
|
145
123
|
|
|
146
124
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
147
|
-
/**
|
|
148
|
-
* helper to deeply merge objects while preserving arrays in earlier source objects
|
|
149
|
-
* deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object
|
|
150
|
-
* this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).
|
|
151
|
-
* Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair
|
|
152
|
-
* will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.
|
|
153
|
-
*
|
|
154
|
-
* @method deepMergeWithArrayPrimitiveOverrides
|
|
155
|
-
* @param {Object} initial - target object to merge values into
|
|
156
|
-
* @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
|
|
157
|
-
*
|
|
158
|
-
* @returns {Object}
|
|
159
|
-
*/
|
|
160
|
-
|
|
161
|
-
var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
|
|
162
|
-
var clone = lodash_1.cloneDeep(initial);
|
|
163
|
-
|
|
164
|
-
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
165
|
-
sources[_key - 1] = arguments[_key];
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
sources.forEach(function (sourceToApply) {
|
|
169
|
-
Object.keys(sourceToApply).forEach(function (sourceKey) {
|
|
170
|
-
if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
|
|
171
|
-
clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
|
|
175
|
-
clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
|
|
176
|
-
} else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
|
|
177
|
-
// If option is an array of objects
|
|
178
|
-
for (var i = 0; i < clone[sourceKey].length; i += 1) {
|
|
179
|
-
if (_typeof(clone[sourceKey][i]) === 'object') {
|
|
180
|
-
var closestMatchIdx = mapUtils_1.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
|
|
181
|
-
|
|
182
|
-
if (closestMatchIdx > -1) {
|
|
183
|
-
clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
return clone;
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
|
|
194
|
-
|
|
195
|
-
/***/ }),
|
|
196
|
-
/* 12 */
|
|
197
|
-
/***/ (function(module, exports) {
|
|
198
|
-
|
|
199
|
-
module.exports = require("@babel/runtime/helpers/typeof");
|
|
200
|
-
|
|
201
|
-
/***/ }),
|
|
202
|
-
/* 13 */
|
|
203
|
-
/***/ (function(module, exports) {
|
|
204
|
-
|
|
205
|
-
module.exports = require("@splunk/visualizations-shared/mapUtils");
|
|
206
125
|
|
|
207
126
|
/***/ })
|
|
208
|
-
|
|
127
|
+
|
|
128
|
+
/******/ });
|
|
209
129
|
//# sourceMappingURL=hocUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack
|
|
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;AACA,aAAO,CAAC,IAAD,CAAP,GAAgB,aAAa,CAAC,IAAD,CAA7B;AACH;AACJ,GALD;AAMH,CAbM;;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 = 10);\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 // eslint-disable-next-line no-param-reassign\n Wrapper[prop] = Visualization[prop];\n }\n });\n};\n"],"sourceRoot":""}
|