@splunk/visualizations 25.0.0 → 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.
Files changed (181) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_basic.png +0 -0
  2. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_custom_base_layer_tile_server.png +0 -0
  3. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_dynamic_color.png +0 -0
  4. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_static_color.png +0 -0
  5. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_static_color_with_no_seriesColors.png +0 -0
  6. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_off.png +0 -0
  7. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_unit_metric.png +0 -0
  8. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
  9. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  10. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
  11. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  12. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  13. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  14. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  15. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
  16. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
  17. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  18. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  19. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
  20. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
  21. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  22. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  23. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
  24. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  25. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
  26. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
  27. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  28. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  29. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  30. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  31. package/.loki/reference/chrome_docker_Visualizations_Line_Line_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  32. package/.loki/reference/chrome_docker_Visualizations_Line_Line_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  33. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Basic_Map.png +0 -0
  34. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer.png +0 -0
  35. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET.png +0 -0
  36. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET_Dynamic_Coloring.png +0 -0
  37. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Internal_Fields.png +0 -0
  38. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Static_Coloring.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_Dynamic_Coloring.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Dynamic_coloring.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Result_Limit_Set_To_3.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Restricted_Zoom.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Set_Map_tiles.png +0 -0
  45. package/Area.config.js +166 -152
  46. package/Area.config.js.map +1 -1
  47. package/Area.js +362 -433
  48. package/Area.js.map +1 -1
  49. package/Bar.config.js +168 -148
  50. package/Bar.config.js.map +1 -1
  51. package/Bar.js +364 -429
  52. package/Bar.js.map +1 -1
  53. package/Bubble.config.js +155 -117
  54. package/Bubble.config.js.map +1 -1
  55. package/Bubble.js +353 -400
  56. package/Bubble.js.map +1 -1
  57. package/ChoroplethSvg.config.js +112 -82
  58. package/ChoroplethSvg.config.js.map +1 -1
  59. package/ChoroplethSvg.js +336 -391
  60. package/ChoroplethSvg.js.map +1 -1
  61. package/Column.config.js +164 -146
  62. package/Column.config.js.map +1 -1
  63. package/Column.js +360 -427
  64. package/Column.js.map +1 -1
  65. package/Ellipse.config.js +111 -80
  66. package/Ellipse.config.js.map +1 -1
  67. package/Ellipse.js +317 -371
  68. package/Ellipse.js.map +1 -1
  69. package/FillerGauge.config.js +117 -86
  70. package/FillerGauge.config.js.map +1 -1
  71. package/FillerGauge.js +324 -378
  72. package/FillerGauge.js.map +1 -1
  73. package/Image.config.js +100 -76
  74. package/Image.config.js.map +1 -1
  75. package/Image.js +725 -789
  76. package/Image.js.map +1 -1
  77. package/Line.config.js +164 -137
  78. package/Line.config.js.map +1 -1
  79. package/Line.js +360 -418
  80. package/Line.js.map +1 -1
  81. package/LinkGraph.config.js +137 -112
  82. package/LinkGraph.config.js.map +1 -1
  83. package/LinkGraph.js +351 -410
  84. package/LinkGraph.js.map +1 -1
  85. package/Map.config.js +140 -97
  86. package/Map.config.js.map +1 -1
  87. package/Map.js +517 -523
  88. package/Map.js.map +1 -1
  89. package/Markdown.config.js +138 -115
  90. package/Markdown.config.js.map +1 -1
  91. package/Markdown.js +502 -553
  92. package/Markdown.js.map +1 -1
  93. package/MarkerGauge.config.js +218 -195
  94. package/MarkerGauge.config.js.map +1 -1
  95. package/MarkerGauge.js +2926 -3098
  96. package/MarkerGauge.js.map +1 -1
  97. package/ParallelCoordinates.config.js +158 -133
  98. package/ParallelCoordinates.config.js.map +1 -1
  99. package/ParallelCoordinates.js +319 -377
  100. package/ParallelCoordinates.js.map +1 -1
  101. package/Pie.config.js +160 -136
  102. package/Pie.config.js.map +1 -1
  103. package/Pie.js +1316 -1492
  104. package/Pie.js.map +1 -1
  105. package/Punchcard.config.js +164 -141
  106. package/Punchcard.config.js.map +1 -1
  107. package/Punchcard.js +344 -404
  108. package/Punchcard.js.map +1 -1
  109. package/Rectangle.config.js +280 -248
  110. package/Rectangle.config.js.map +1 -1
  111. package/Rectangle.js +1247 -1303
  112. package/Rectangle.js.map +1 -1
  113. package/Sankey.config.js +175 -143
  114. package/Sankey.config.js.map +1 -1
  115. package/Sankey.js +377 -426
  116. package/Sankey.js.map +1 -1
  117. package/Scatter.config.js +156 -117
  118. package/Scatter.config.js.map +1 -1
  119. package/Scatter.js +550 -601
  120. package/Scatter.js.map +1 -1
  121. package/SingleValue.config.js +147 -115
  122. package/SingleValue.config.js.map +1 -1
  123. package/SingleValue.js +542 -598
  124. package/SingleValue.js.map +1 -1
  125. package/SingleValueBasic.js +19 -19
  126. package/SingleValueBasic.js.map +1 -1
  127. package/SingleValueIcon.config.js +154 -120
  128. package/SingleValueIcon.config.js.map +1 -1
  129. package/SingleValueIcon.js +373 -424
  130. package/SingleValueIcon.js.map +1 -1
  131. package/SingleValueRadial.config.js +143 -111
  132. package/SingleValueRadial.config.js.map +1 -1
  133. package/SingleValueRadial.js +612 -668
  134. package/SingleValueRadial.js.map +1 -1
  135. package/Table.config.js +176 -152
  136. package/Table.config.js.map +1 -1
  137. package/Table.js +740 -797
  138. package/Table.js.map +1 -1
  139. package/common/Charting.js +11 -11
  140. package/common/Charting.js.map +1 -1
  141. package/common/ChartingApi.js +2 -2
  142. package/common/ChartingApi.js.map +1 -1
  143. package/common/EventsDoc.js +12 -12
  144. package/common/EventsDoc.js.map +1 -1
  145. package/common/GaugeMajorTicks.js +8 -8
  146. package/common/GaugeMajorTicks.js.map +1 -1
  147. package/common/GaugeValueMarker.js +8 -8
  148. package/common/GaugeValueMarker.js.map +1 -1
  149. package/common/OptionsDoc.js +51 -327
  150. package/common/OptionsDoc.js.map +1 -1
  151. package/common/OverviewDoc.js +22 -22
  152. package/common/OverviewDoc.js.map +1 -1
  153. package/common/SplunkVisualization.js +4 -4
  154. package/common/SplunkVisualization.js.map +1 -1
  155. package/common/SplunkVisualizationApi.js +2 -2
  156. package/common/SplunkVisualizationApi.js.map +1 -1
  157. package/common/ThemesDoc.js +19 -19
  158. package/common/ThemesDoc.js.map +1 -1
  159. package/common/chartingUtils.js +4 -4
  160. package/common/chartingUtils.js.map +1 -1
  161. package/common/docUtils.js +4 -4
  162. package/common/docUtils.js.map +1 -1
  163. package/common/gaugeUtils.js +13 -13
  164. package/common/gaugeUtils.js.map +1 -1
  165. package/common/shapeUtils.js +8 -8
  166. package/common/shapeUtils.js.map +1 -1
  167. package/common/utils/configUtils.js +42 -18
  168. package/common/utils/configUtils.js.map +1 -1
  169. package/common/utils/hocUtils.js +6 -86
  170. package/common/utils/hocUtils.js.map +1 -1
  171. package/common/utils/{JSONSchemaUtils.js → mapUtils.js} +89 -29
  172. package/common/utils/mapUtils.js.map +1 -0
  173. package/common/utils/singleValueUtils.js +14 -12
  174. package/common/utils/singleValueUtils.js.map +1 -1
  175. package/common/utils/testHelper.js +8 -8
  176. package/common/utils/testHelper.js.map +1 -1
  177. package/common/withDashboardViz.js +120 -207
  178. package/common/withDashboardViz.js.map +1 -1
  179. package/package.json +12 -12
  180. package/.loki/reference/chrome_docker_PureVisualizations_SvgChoroplethDynamic_SVG_Of_Size_Greater_Than_2_MB_Render.png +0 -0
  181. package/common/utils/JSONSchemaUtils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"@babel/runtime/helpers/extends\"","webpack:///external \"@splunk/visualizations-shared/numberUtils\"","webpack:///external \"styled-components\"","webpack:///./src/common/GaugeValueMarker.jsx"],"names":["MARKER_THICKNESS","MARKER_INNER_LENGTH","MARKER_LABEL_WIDTH","MARKER_LABEL_HEIGHT","RADIUS","DELTA_LENGTH","ValueMarkerRect","styled","props","ValueMarkerLabelRect","ValueMarkerLabel","positionValueMarkerRect","x","y","orientation","valueMarkerRectLength","hLength","vLength","markerStartX","markerStartY","innerHLength","innerVLength","innerStartX","innerStartY","positionLabel","length","labelRectX","labelRectY","labelX","labelY","ValueMarker","min","max","value","showValue","usePercentageValue","valueMarkerFillColor","valueMarkerLabelFillColor","formatNumber","useThousandSeparators","useTrendUnits","T","string"],"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,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AAKI,UAAM,EALV;AAMI,MAAE,EANN;AAOI,MAAE,EAPN;AAQI,wBAAoB,EAAEE;AAR1B,IADJ,eAWI;AACI,iBADJ;AAEI,KAAC,EAFL;AAGI,KAAC,EAHL;AAII,6BAAyB,EAAEC;AAJ/B,KAMKF,kBAAkB,aACV,CAAEF,KAAK,IAAID,GAAG,GAAb,GAAM,CAALC,GAAF,aADU,CACV,CADU,SAEbK,8FAAY,WAAW;AACnBC,yBAAqB,EADF;AAEnBC,iBAAa,EAAE;AAFI,GAAX,CARtB,CAXJ,CAPR,CADJ;AAvBJ;;AA6DAV,WAAW,CAAXA,YAAwB;AACpBlB,GAAC,EAAE6B,iDAAC,CADgB;AAEpB5B,GAAC,EAAE4B,iDAAC,CAFgB;AAGpBhB,QAAM,EAAEgB,iDAAC,CAHW;AAIpBV,KAAG,EAAEU,iDAAC,CAJc;AAKpBT,KAAG,EAAES,iDAAC,CALc;AAMpBR,OAAK,EAAEQ,iDAAC,CANY;AAOpB3B,aAAW,EAAE2B,iDAAC,CAPM;AAQpBP,WAAS,EAAEO,iDAAC,CARQ;AASpBN,oBAAkB,EAAEM,iDAAC,CATD;AAUpBL,sBAAoB,EAAEK,iDAAC,CAVH;AAWpBJ,2BAAyB,EAAEI,iDAAC,CAACC;AAXT,CAAxBZ;AAcAA,WAAW,CAAXA,eAA2B;AACvBC,KAAG,EADoB;AAEvBC,KAAG,EAFoB;AAGvBlB,aAAW,EAHY;AAIvBoB,WAAS,EAJc;AAKvBC,oBAAkB,EAAE;AALG,CAA3BL;AAQA,4E","file":"GaugeValueMarker.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 = 50);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@splunk/visualizations-shared/numberUtils\");","module.exports = require(\"styled-components\");","import React from 'react';\nimport T from 'prop-types';\nimport styled from 'styled-components';\nimport { formatNumber } from '@splunk/visualizations-shared/numberUtils';\n\nconst MARKER_THICKNESS = 15;\nconst MARKER_INNER_LENGTH = 30;\n\nconst MARKER_LABEL_WIDTH = 60;\nconst MARKER_LABEL_HEIGHT = 25;\nconst RADIUS = 2;\nconst DELTA_LENGTH = 12;\n\nconst ValueMarkerRect = styled.path`\n stroke-width: 2px;\n fill: ${props => props.valueMarkerFillColor};\n`;\n\nconst ValueMarkerLabelRect = styled.rect`\n fill: ${props => props.valueMarkerFillColor};\n`;\n\nconst ValueMarkerLabel = styled.text`\n fill: ${props => props.valueMarkerLabelFillColor};\n font-size: 14px;\n font-family: Splunk Platform Sans, sans-serif;\n line-height: 16px;\n text-anchor: middle;\n text-align: center;\n dominant-baseline: middle;\n`;\n\n/**\n * calculate the path of Value Marker shape\n * @method positionValueMarkerRect\n * @param {Object} input\n * @param {Number} input.x\n * @param {Number} input.y\n * @param {String} input.orientation\n * @param {Number} input.valueMarkerRectLength\n * @return {String} d containing a series of path commands that define the path to be\n */\nexport const positionValueMarkerRect = ({ x, y, orientation, valueMarkerRectLength }) => {\n let hLength = MARKER_THICKNESS;\n let vLength = valueMarkerRectLength;\n let markerStartX = x - MARKER_THICKNESS;\n const markerStartY = y;\n\n let innerHLength = hLength / 3;\n let innerVLength = MARKER_INNER_LENGTH;\n let innerStartX = markerStartX + innerHLength;\n let innerStartY = markerStartY + 7;\n\n if (orientation === 'vertical') {\n hLength = valueMarkerRectLength;\n vLength = MARKER_THICKNESS;\n markerStartX = x;\n\n innerHLength = MARKER_INNER_LENGTH;\n innerVLength = vLength / 3;\n innerStartX = markerStartX + 7;\n innerStartY = markerStartY + innerVLength;\n }\n\n return (\n `M${markerStartX},${markerStartY}h${hLength}a${RADIUS},${RADIUS} 0 0 1 ${RADIUS},${RADIUS}v${\n vLength - 2 * RADIUS\n }a${RADIUS},${RADIUS} 0 0 1 ${-RADIUS},${RADIUS}h${-hLength}a${RADIUS},${RADIUS} 0 0 1 ${-RADIUS},${-RADIUS}v${\n 2 * RADIUS - vLength\n }a${RADIUS},${RADIUS} 0 0 1 ${RADIUS},${-RADIUS}z` +\n `M${innerStartX},${innerStartY}v${\n innerVLength - RADIUS\n }a${RADIUS},${RADIUS} 0 0 0 ${RADIUS},${RADIUS}h${\n innerHLength - 2 * RADIUS\n }a${RADIUS},${RADIUS} 0 0 0 ${RADIUS},${-RADIUS}v${\n RADIUS - innerVLength\n }a${RADIUS},${RADIUS} 0 0 0 ${-RADIUS},${-RADIUS}h${\n 2 * RADIUS - innerHLength\n }a${RADIUS},${RADIUS} 0 0 0 ${-RADIUS},${RADIUS}z`\n );\n};\n\n/**\n * calculate the position of value marker label\n * @method positionLabel\n * @param {Object} input\n * @param {Number} input.x\n * @param {Number} input.y\n * @param {Number} input.length gauge thickness\n * @param {String} input.orientation\n * @return {Object} positions\n * @return {Number} positions.labelRectX x of value marker label rect\n * @return {Number} positions.labelRectY y of value marker label rect\n * @return {Number} positions.labelX x of value marker label text\n * @return {Number} positions.labelY y of value marker label text\n */\nexport const positionLabel = ({ x, y, length, orientation }) => {\n // for horizontal view\n let labelRectX = x - MARKER_THICKNESS / 2 - MARKER_LABEL_WIDTH / 2;\n let labelRectY = y + length;\n if (orientation === 'vertical') {\n labelRectX = x + length;\n labelRectY = y - (MARKER_LABEL_HEIGHT - MARKER_THICKNESS) / 2;\n }\n const labelX = labelRectX + MARKER_LABEL_WIDTH / 2;\n const labelY = labelRectY + MARKER_LABEL_HEIGHT / 2;\n return { labelRectX, labelRectY, labelX, labelY };\n};\n\nconst ValueMarker = ({ ...props }) => {\n const {\n x,\n y,\n length,\n min,\n max,\n value,\n orientation,\n showValue,\n usePercentageValue,\n valueMarkerFillColor,\n valueMarkerLabelFillColor,\n } = props;\n\n const valueMarkerRectLength = length + DELTA_LENGTH;\n const { labelRectX, labelRectY, labelX, labelY } = positionLabel({\n x,\n y,\n length,\n orientation,\n });\n\n return (\n <g>\n <ValueMarkerRect\n data-test=\"value-marker-rect\"\n d={positionValueMarkerRect({ x, y, orientation, valueMarkerRectLength })}\n valueMarkerFillColor={valueMarkerFillColor}\n />\n {showValue && (\n <g>\n <ValueMarkerLabelRect\n data-test=\"value-marker-label-rect\"\n x={labelRectX}\n y={labelRectY}\n width={MARKER_LABEL_WIDTH}\n height={MARKER_LABEL_HEIGHT}\n rx={RADIUS}\n ry={RADIUS}\n valueMarkerFillColor={valueMarkerFillColor}\n />\n <ValueMarkerLabel\n data-test=\"value-marker-label\"\n x={labelX}\n y={labelY}\n valueMarkerLabelFillColor={valueMarkerLabelFillColor}\n >\n {usePercentageValue\n ? `${((value / (max - min)) * 100).toFixed(2)}%`\n : formatNumber(value, 0, {\n useThousandSeparators: true,\n useTrendUnits: true,\n })}\n </ValueMarkerLabel>\n </g>\n )}\n </g>\n );\n};\n\nValueMarker.propTypes = {\n x: T.number,\n y: T.number,\n length: T.number,\n min: T.number,\n max: T.number,\n value: T.number,\n orientation: T.string,\n showValue: T.bool,\n usePercentageValue: T.bool,\n valueMarkerFillColor: T.string,\n valueMarkerLabelFillColor: T.string,\n};\n\nValueMarker.defaultProps = {\n min: 0,\n max: 100,\n orientation: 'horizontal',\n showValue: true,\n usePercentageValue: false,\n};\n\nexport default ValueMarker;\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"@splunk/visualizations-shared/numberUtils\"","webpack:///external \"styled-components\"","webpack:///./src/common/GaugeValueMarker.jsx","webpack:///external \"@babel/runtime/helpers/extends\""],"names":["MARKER_THICKNESS","MARKER_INNER_LENGTH","MARKER_LABEL_WIDTH","MARKER_LABEL_HEIGHT","RADIUS","DELTA_LENGTH","ValueMarkerRect","styled","props","ValueMarkerLabelRect","ValueMarkerLabel","positionValueMarkerRect","x","y","orientation","valueMarkerRectLength","hLength","vLength","markerStartX","markerStartY","innerHLength","innerVLength","innerStartX","innerStartY","positionLabel","length","labelRectX","labelRectY","labelX","labelY","ValueMarker","min","max","value","showValue","usePercentageValue","valueMarkerFillColor","valueMarkerLabelFillColor","formatNumber","useThousandSeparators","useTrendUnits","T","string"],"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,kC;;;;;;;ACAA,uC;;;;;;;ACAA,sE;;;;;;;ACAA,8C;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AAEA,IAAMA,gBAAgB,GAAtB;AACA,IAAMC,mBAAmB,GAAzB;AAEA,IAAMC,kBAAkB,GAAxB;AACA,IAAMC,mBAAmB,GAAzB;AACA,IAAMC,MAAM,GAAZ;AACA,IAAMC,YAAY,GAAlB;AAEA,IAAMC,eAAe,GAAGC,wDAAM,CAAT,IAAGA,CAAH,UAAGA,CA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;AACpBlB,GAAC,EAAE6B,iDAAC,CADgB;AAEpB5B,GAAC,EAAE4B,iDAAC,CAFgB;AAGpBhB,QAAM,EAAEgB,iDAAC,CAHW;AAIpBV,KAAG,EAAEU,iDAAC,CAJc;AAKpBT,KAAG,EAAES,iDAAC,CALc;AAMpBR,OAAK,EAAEQ,iDAAC,CANY;AAOpB3B,aAAW,EAAE2B,iDAAC,CAPM;AAQpBP,WAAS,EAAEO,iDAAC,CARQ;AASpBN,oBAAkB,EAAEM,iDAAC,CATD;AAUpBL,sBAAoB,EAAEK,iDAAC,CAVH;AAWpBJ,2BAAyB,EAAEI,iDAAC,CAACC;AAXT,CAAxBZ;AAcAA,WAAW,CAAXA,eAA2B;AACvBC,KAAG,EADoB;AAEvBC,KAAG,EAFoB;AAGvBlB,aAAW,EAHY;AAIvBoB,WAAS,EAJc;AAKvBC,oBAAkB,EAAE;AALG,CAA3BL;AAQA,4E;;;;;;;AChMA,2D","file":"GaugeValueMarker.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 = 50);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"@splunk/visualizations-shared/numberUtils\");","module.exports = require(\"styled-components\");","import React from 'react';\nimport T from 'prop-types';\nimport styled from 'styled-components';\nimport { formatNumber } from '@splunk/visualizations-shared/numberUtils';\n\nconst MARKER_THICKNESS = 15;\nconst MARKER_INNER_LENGTH = 30;\n\nconst MARKER_LABEL_WIDTH = 60;\nconst MARKER_LABEL_HEIGHT = 25;\nconst RADIUS = 2;\nconst DELTA_LENGTH = 12;\n\nconst ValueMarkerRect = styled.path`\n stroke-width: 2px;\n fill: ${props => props.valueMarkerFillColor};\n`;\n\nconst ValueMarkerLabelRect = styled.rect`\n fill: ${props => props.valueMarkerFillColor};\n`;\n\nconst ValueMarkerLabel = styled.text`\n fill: ${props => props.valueMarkerLabelFillColor};\n font-size: 14px;\n font-family: Splunk Platform Sans, sans-serif;\n line-height: 16px;\n text-anchor: middle;\n text-align: center;\n dominant-baseline: middle;\n`;\n\n/**\n * calculate the path of Value Marker shape\n * @method positionValueMarkerRect\n * @param {Object} input\n * @param {Number} input.x\n * @param {Number} input.y\n * @param {String} input.orientation\n * @param {Number} input.valueMarkerRectLength\n * @return {String} d containing a series of path commands that define the path to be\n */\nexport const positionValueMarkerRect = ({ x, y, orientation, valueMarkerRectLength }) => {\n let hLength = MARKER_THICKNESS;\n let vLength = valueMarkerRectLength;\n let markerStartX = x - MARKER_THICKNESS;\n const markerStartY = y;\n\n let innerHLength = hLength / 3;\n let innerVLength = MARKER_INNER_LENGTH;\n let innerStartX = markerStartX + innerHLength;\n let innerStartY = markerStartY + 7;\n\n if (orientation === 'vertical') {\n hLength = valueMarkerRectLength;\n vLength = MARKER_THICKNESS;\n markerStartX = x;\n\n innerHLength = MARKER_INNER_LENGTH;\n innerVLength = vLength / 3;\n innerStartX = markerStartX + 7;\n innerStartY = markerStartY + innerVLength;\n }\n\n return (\n `M${markerStartX},${markerStartY}h${hLength}a${RADIUS},${RADIUS} 0 0 1 ${RADIUS},${RADIUS}v${\n vLength - 2 * RADIUS\n }a${RADIUS},${RADIUS} 0 0 1 ${-RADIUS},${RADIUS}h${-hLength}a${RADIUS},${RADIUS} 0 0 1 ${-RADIUS},${-RADIUS}v${\n 2 * RADIUS - vLength\n }a${RADIUS},${RADIUS} 0 0 1 ${RADIUS},${-RADIUS}z` +\n `M${innerStartX},${innerStartY}v${\n innerVLength - RADIUS\n }a${RADIUS},${RADIUS} 0 0 0 ${RADIUS},${RADIUS}h${\n innerHLength - 2 * RADIUS\n }a${RADIUS},${RADIUS} 0 0 0 ${RADIUS},${-RADIUS}v${\n RADIUS - innerVLength\n }a${RADIUS},${RADIUS} 0 0 0 ${-RADIUS},${-RADIUS}h${\n 2 * RADIUS - innerHLength\n }a${RADIUS},${RADIUS} 0 0 0 ${-RADIUS},${RADIUS}z`\n );\n};\n\n/**\n * calculate the position of value marker label\n * @method positionLabel\n * @param {Object} input\n * @param {Number} input.x\n * @param {Number} input.y\n * @param {Number} input.length gauge thickness\n * @param {String} input.orientation\n * @return {Object} positions\n * @return {Number} positions.labelRectX x of value marker label rect\n * @return {Number} positions.labelRectY y of value marker label rect\n * @return {Number} positions.labelX x of value marker label text\n * @return {Number} positions.labelY y of value marker label text\n */\nexport const positionLabel = ({ x, y, length, orientation }) => {\n // for horizontal view\n let labelRectX = x - MARKER_THICKNESS / 2 - MARKER_LABEL_WIDTH / 2;\n let labelRectY = y + length;\n if (orientation === 'vertical') {\n labelRectX = x + length;\n labelRectY = y - (MARKER_LABEL_HEIGHT - MARKER_THICKNESS) / 2;\n }\n const labelX = labelRectX + MARKER_LABEL_WIDTH / 2;\n const labelY = labelRectY + MARKER_LABEL_HEIGHT / 2;\n return { labelRectX, labelRectY, labelX, labelY };\n};\n\nconst ValueMarker = ({ ...props }) => {\n const {\n x,\n y,\n length,\n min,\n max,\n value,\n orientation,\n showValue,\n usePercentageValue,\n valueMarkerFillColor,\n valueMarkerLabelFillColor,\n } = props;\n\n const valueMarkerRectLength = length + DELTA_LENGTH;\n const { labelRectX, labelRectY, labelX, labelY } = positionLabel({\n x,\n y,\n length,\n orientation,\n });\n\n return (\n <g>\n <ValueMarkerRect\n data-test=\"value-marker-rect\"\n d={positionValueMarkerRect({ x, y, orientation, valueMarkerRectLength })}\n valueMarkerFillColor={valueMarkerFillColor}\n />\n {showValue && (\n <g>\n <ValueMarkerLabelRect\n data-test=\"value-marker-label-rect\"\n x={labelRectX}\n y={labelRectY}\n width={MARKER_LABEL_WIDTH}\n height={MARKER_LABEL_HEIGHT}\n rx={RADIUS}\n ry={RADIUS}\n valueMarkerFillColor={valueMarkerFillColor}\n />\n <ValueMarkerLabel\n data-test=\"value-marker-label\"\n x={labelX}\n y={labelY}\n valueMarkerLabelFillColor={valueMarkerLabelFillColor}\n >\n {usePercentageValue\n ? `${((value / (max - min)) * 100).toFixed(2)}%`\n : formatNumber(value, 0, {\n useThousandSeparators: true,\n useTrendUnits: true,\n })}\n </ValueMarkerLabel>\n </g>\n )}\n </g>\n );\n};\n\nValueMarker.propTypes = {\n x: T.number,\n y: T.number,\n length: T.number,\n min: T.number,\n max: T.number,\n value: T.number,\n orientation: T.string,\n showValue: T.bool,\n usePercentageValue: T.bool,\n valueMarkerFillColor: T.string,\n valueMarkerLabelFillColor: T.string,\n};\n\nValueMarker.defaultProps = {\n min: 0,\n max: 100,\n orientation: 'horizontal',\n showValue: true,\n usePercentageValue: false,\n};\n\nexport default ValueMarker;\n","module.exports = require(\"@babel/runtime/helpers/extends\");"],"sourceRoot":""}
@@ -90,65 +90,29 @@ module.exports =
90
90
  /******/ return __webpack_require__(__webpack_require__.s = 51);
91
91
  /******/ })
92
92
  /************************************************************************/
93
- /******/ ([
94
- /* 0 */
95
- /***/ (function(module, exports) {
96
-
97
- module.exports = require("react");
98
-
99
- /***/ }),
100
- /* 1 */
101
- /***/ (function(module, exports) {
102
-
103
- module.exports = require("prop-types");
104
-
105
- /***/ }),
106
- /* 2 */
107
- /***/ (function(module, exports) {
108
-
109
- module.exports = require("styled-components");
110
-
111
- /***/ }),
112
- /* 3 */
113
- /***/ (function(module, exports) {
114
-
115
- module.exports = require("lodash");
93
+ /******/ ({
116
94
 
117
- /***/ }),
118
- /* 4 */,
119
- /* 5 */
95
+ /***/ 0:
120
96
  /***/ (function(module, exports) {
121
97
 
122
- module.exports = require("@splunk/react-ui/Heading");
98
+ module.exports = require("react");
123
99
 
124
100
  /***/ }),
125
- /* 6 */,
126
- /* 7 */
127
- /***/ (function(module, exports) {
128
101
 
129
- module.exports = require("@splunk/ui-utils/i18n");
130
-
131
- /***/ }),
132
- /* 8 */
102
+ /***/ 1:
133
103
  /***/ (function(module, exports) {
134
104
 
135
- module.exports = require("@babel/runtime/helpers/defineProperty");
105
+ module.exports = require("prop-types");
136
106
 
137
107
  /***/ }),
138
- /* 9 */
139
- /***/ (function(module, exports) {
140
-
141
- module.exports = require("@babel/runtime/helpers/typeof");
142
108
 
143
- /***/ }),
144
- /* 10 */,
145
- /* 11 */
109
+ /***/ 10:
146
110
  /***/ (function(module, exports, __webpack_require__) {
147
111
 
148
112
  "use strict";
149
113
 
150
114
 
151
- var _typeof = __webpack_require__(9);
115
+ var _typeof = __webpack_require__(12);
152
116
 
153
117
  Object.defineProperty(exports, "__esModule", {
154
118
  value: true
@@ -474,102 +438,57 @@ var componentStoriesToInclude = function componentStoriesToInclude(stories) {
474
438
  exports.componentStoriesToInclude = componentStoriesToInclude;
475
439
 
476
440
  /***/ }),
477
- /* 12 */,
478
- /* 13 */,
479
- /* 14 */,
480
- /* 15 */
441
+
442
+ /***/ 12:
481
443
  /***/ (function(module, exports) {
482
444
 
483
- module.exports = require("@babel/runtime/helpers/slicedToArray");
445
+ module.exports = require("@babel/runtime/helpers/typeof");
484
446
 
485
447
  /***/ }),
486
- /* 16 */
448
+
449
+ /***/ 15:
487
450
  /***/ (function(module, exports) {
488
451
 
489
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
452
+ module.exports = require("@babel/runtime/helpers/slicedToArray");
490
453
 
491
454
  /***/ }),
492
- /* 17 */
455
+
456
+ /***/ 16:
493
457
  /***/ (function(module, exports) {
494
458
 
495
459
  module.exports = require("@splunk/react-ui/Markdown");
496
460
 
497
461
  /***/ }),
498
- /* 18 */
462
+
463
+ /***/ 17:
499
464
  /***/ (function(module, exports) {
500
465
 
501
466
  module.exports = require("lodash/isEmpty");
502
467
 
503
468
  /***/ }),
504
- /* 19 */,
505
- /* 20 */
506
- /***/ (function(module, exports, __webpack_require__) {
507
469
 
508
- "use strict";
470
+ /***/ 2:
471
+ /***/ (function(module, exports) {
509
472
 
473
+ module.exports = require("styled-components");
510
474
 
511
- Object.defineProperty(exports, "__esModule", {
512
- value: true
513
- });
514
- exports.VizBehavior = void 0;
515
- var VizBehavior;
516
-
517
- (function (VizBehavior) {
518
- /**
519
- * Dynamic Options Behavior.
520
- * This allows visualization options to be powered by data
521
- *
522
- * **Example**
523
- *
524
- * sparklineValues: ">primary|seriesByIndex(0)"
525
- * would configure sparklineValues with an array of data points
526
- * coming from the first series in the primary datasource
527
- *
528
- */
529
- VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
530
- VizBehavior["EVENTS"] = "events";
531
- /**
532
- * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
533
- * missing.
534
- * @type {string}
535
- */
536
-
537
- VizBehavior["PLACEHOLDER"] = "placeholder";
538
- VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
539
- })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
475
+ /***/ }),
476
+
477
+ /***/ 3:
478
+ /***/ (function(module, exports) {
479
+
480
+ module.exports = require("lodash");
540
481
 
541
482
  /***/ }),
542
- /* 21 */,
543
- /* 22 */,
544
- /* 23 */,
545
- /* 24 */,
546
- /* 25 */,
547
- /* 26 */,
548
- /* 27 */,
549
- /* 28 */,
550
- /* 29 */,
551
- /* 30 */,
552
- /* 31 */,
553
- /* 32 */,
554
- /* 33 */,
555
- /* 34 */,
556
- /* 35 */,
557
- /* 36 */,
558
- /* 37 */,
559
- /* 38 */,
560
- /* 39 */,
561
- /* 40 */,
562
- /* 41 */,
563
- /* 42 */,
564
- /* 43 */,
565
- /* 44 */,
566
- /* 45 */,
567
- /* 46 */,
568
- /* 47 */,
569
- /* 48 */,
570
- /* 49 */,
571
- /* 50 */,
572
- /* 51 */
483
+
484
+ /***/ 5:
485
+ /***/ (function(module, exports) {
486
+
487
+ module.exports = require("@splunk/react-ui/Heading");
488
+
489
+ /***/ }),
490
+
491
+ /***/ 51:
573
492
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
574
493
 
575
494
  "use strict";
@@ -579,25 +498,25 @@ __webpack_require__.r(__webpack_exports__);
579
498
  /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
580
499
  /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
581
500
  /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);
582
- /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
501
+ /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
583
502
  /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_2__);
584
503
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
585
504
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
586
505
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1);
587
506
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
588
- /* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18);
507
+ /* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17);
589
508
  /* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5__);
590
509
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);
591
510
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_6__);
592
511
  /* harmony import */ var _splunk_react_ui_Heading__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5);
593
512
  /* harmony import */ var _splunk_react_ui_Heading__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Heading__WEBPACK_IMPORTED_MODULE_7__);
594
- /* harmony import */ var _splunk_react_ui_Markdown__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17);
513
+ /* harmony import */ var _splunk_react_ui_Markdown__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(16);
595
514
  /* harmony import */ var _splunk_react_ui_Markdown__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Markdown__WEBPACK_IMPORTED_MODULE_8__);
596
515
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2);
597
516
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_9__);
598
517
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(3);
599
518
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__);
600
- /* harmony import */ var _storybook_utils_storybookUtils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(11);
519
+ /* harmony import */ var _storybook_utils_storybookUtils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(10);
601
520
  /* harmony import */ var _storybook_utils_storybookUtils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_storybook_utils_storybookUtils__WEBPACK_IMPORTED_MODULE_11__);
602
521
 
603
522
 
@@ -1057,222 +976,27 @@ OptionsDoc.propTypes = {
1057
976
  /* harmony default export */ __webpack_exports__["default"] = (OptionsDoc);
1058
977
 
1059
978
  /***/ }),
1060
- /* 52 */
1061
- /***/ (function(module, exports, __webpack_require__) {
1062
-
1063
- "use strict";
1064
-
1065
-
1066
- var _toConsumableArray = __webpack_require__(16);
1067
-
1068
- var _defineProperty = __webpack_require__(8);
1069
-
1070
- var __rest = this && this.__rest || function (s, e) {
1071
- var t = {};
1072
-
1073
- for (var p in s) {
1074
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1075
- }
1076
-
1077
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1078
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1079
- }
1080
- return t;
1081
- };
1082
-
1083
- Object.defineProperty(exports, "__esModule", {
1084
- value: true
1085
- });
1086
- exports.insertLayout = exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
1087
-
1088
- var lodash_1 = __webpack_require__(3);
1089
-
1090
- var schemaUtils_1 = __webpack_require__(53);
1091
-
1092
- var VizBehavior_1 = __webpack_require__(20);
1093
-
1094
- var dynamicOptionsDSLType = {
1095
- type: 'string',
1096
- pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
1097
- };
1098
- /**
1099
- * Helper function to extend an options schema with dynamic options DSL
1100
- * @param optionsSchema a visualization's options schema
1101
- * @returns an updated options schema that additionally allows strings starting with > for each option
1102
- */
1103
-
1104
- function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
1105
- var enhancedOptionsSchema = {};
1106
- Object.keys(optionsSchema).forEach(function (key) {
1107
- var _a = optionsSchema[key],
1108
- title = _a.title,
1109
- description = _a.description,
1110
- readOnly = _a.readOnly,
1111
- writeOnly = _a.writeOnly,
1112
- examples = _a.examples,
1113
- defaultValue = _a.default,
1114
- type = _a.type,
1115
- properties = _a.properties,
1116
- patternProperties = _a.patternProperties,
1117
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
1118
-
1119
- var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
1120
- title: title
1121
- }), description !== undefined && {
1122
- description: description
1123
- }), readOnly !== undefined && {
1124
- readOnly: readOnly
1125
- }), writeOnly !== undefined && {
1126
- writeOnly: writeOnly
1127
- }), examples !== undefined && {
1128
- examples: examples
1129
- }), defaultValue !== undefined && {
1130
- default: defaultValue
1131
- });
1132
-
1133
- if (type === 'object') {
1134
- enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
1135
- type: type
1136
- }), properties && {
1137
- properties: enhanceOptionsSchemaWithDynamicOptions(properties)
1138
- });
1139
-
1140
- if (patternProperties) {
1141
- var enhancedPatternProperties = {};
1142
- Object.keys(patternProperties).forEach(function (opt) {
1143
- enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
1144
- });
1145
- enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
1146
- }
1147
- } else {
1148
- enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
1149
- anyOf: [Object.assign(Object.assign({}, type !== undefined && {
1150
- type: type
1151
- }), remainingSchemaEntry), dynamicOptionsDSLType]
1152
- });
1153
- }
1154
- });
1155
- return enhancedOptionsSchema;
1156
- }
1157
-
1158
- exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
1159
- /**
1160
- * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
1161
- * @param vizConfig a Visualization Config
1162
- * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
1163
- */
1164
-
1165
- function enhanceConfig(vizConfig) {
1166
- var enhancedConfig = vizConfig;
1167
-
1168
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
1169
- enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
1170
- }
1171
-
1172
- return enhancedConfig;
1173
- }
1174
979
 
1175
- exports.enhanceConfig = enhanceConfig;
1176
-
1177
- function isDynamicOption(option) {
1178
- return option && typeof option === 'string' && option.trim().startsWith('>') || false;
1179
- }
1180
-
1181
- exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
1182
- // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
1183
-
1184
- /**
1185
- * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
1186
- * 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
1187
- * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
1188
- * 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
1189
- *
1190
- * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
1191
- */
1192
-
1193
- function hasCompatibleContexts(vizContext, presetContext) {
1194
- var presetContextKeys = Object.keys(presetContext);
1195
- return presetContextKeys.every(function (contextKey) {
1196
- return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
1197
- });
1198
- }
1199
- /**
1200
- * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
1201
- */
1202
-
1203
-
1204
- function hasCompatibleOptions(vizOptions, presetOptions) {
1205
- var presetOptionKeys = Object.keys(presetOptions);
1206
- return presetOptionKeys.every(function (optionKey) {
1207
- return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
1208
- });
1209
- }
1210
- /**
1211
- * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
1212
- * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
1213
- *
1214
- * @param {Object} vizContext - the current vizContext definition
1215
- * @param {Object} vizOptions - the current vizOptions definition
1216
- * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
1217
- */
1218
-
1219
-
1220
- function getInitialPreset(vizContext, vizOptions, presets) {
1221
- return presets.find(function (preset) {
1222
- var presetContext = lodash_1.get(preset, ['value', 'context'], {});
1223
- var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
1224
- var presetContextKeys = Object.keys(presetContext);
1225
- var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
1226
- // if not, then the preset is invalid in config.ts
1227
-
1228
- if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
1229
- return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
1230
- });
1231
- }
1232
-
1233
- exports.getInitialPreset = getInitialPreset;
1234
- /**
1235
- * generates number precision values for a Select editor
1236
- *
1237
- * @param {Number} numPrecisionValues - number of integer precision values to generate
1238
- * @returns {{ label: string; value; string }[]} array of { label, value } tuples
1239
- */
1240
-
1241
- function generatePrecisionValues(numPrecisionValues) {
1242
- return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
1243
- return {
1244
- label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
1245
- value: i
1246
- };
1247
- });
1248
- }
980
+ /***/ 52:
981
+ /***/ (function(module, exports) {
1249
982
 
1250
- exports.generatePrecisionValues = generatePrecisionValues;
1251
- /**
1252
- * insert layout in layout array, return a new layout array instead of updating the original
1253
- *
1254
- * @param {EditorLayoutConfig[][]} layout - editor layout
1255
- * @param {Number} index - the index to insert layout item(s)
1256
- * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
1257
- * @returns {EditorLayoutConfig[][]} new editor layout with insertion
1258
- */
983
+ module.exports = require("@splunk/visualizations-shared/configUtils");
1259
984
 
1260
- var insertLayout = function insertLayout(layout, index) {
1261
- for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1262
- layoutItems[_key - 2] = arguments[_key];
1263
- }
985
+ /***/ }),
1264
986
 
1265
- return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
1266
- };
987
+ /***/ 7:
988
+ /***/ (function(module, exports) {
1267
989
 
1268
- exports.insertLayout = insertLayout;
990
+ module.exports = require("@splunk/ui-utils/i18n");
1269
991
 
1270
992
  /***/ }),
1271
- /* 53 */
993
+
994
+ /***/ 8:
1272
995
  /***/ (function(module, exports) {
1273
996
 
1274
- module.exports = require("@splunk/visualizations-shared/schemaUtils");
997
+ module.exports = require("@babel/runtime/helpers/defineProperty");
1275
998
 
1276
999
  /***/ })
1277
- /******/ ]);
1000
+
1001
+ /******/ });
1278
1002
  //# sourceMappingURL=OptionsDoc.js.map