@splunk/visualizations 26.1.0 → 26.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/Area.config.js +1 -1
  2. package/Area.js +31 -25
  3. package/Area.js.map +1 -1
  4. package/Bar.config.js +1 -1
  5. package/Bar.js +33 -22
  6. package/Bar.js.map +1 -1
  7. package/Bubble.config.js +1 -1
  8. package/Bubble.js +33 -22
  9. package/Bubble.js.map +1 -1
  10. package/ChoroplethSvg.config.js +1 -1
  11. package/ChoroplethSvg.js +42 -31
  12. package/ChoroplethSvg.js.map +1 -1
  13. package/Column.config.js +1 -1
  14. package/Column.js +33 -22
  15. package/Column.js.map +1 -1
  16. package/Ellipse.config.js +1 -1
  17. package/Ellipse.js +22 -11
  18. package/Ellipse.js.map +1 -1
  19. package/Events.config.js +1 -1
  20. package/Events.js +45 -34
  21. package/Events.js.map +1 -1
  22. package/FillerGauge.config.js +1 -1
  23. package/FillerGauge.js +30 -19
  24. package/FillerGauge.js.map +1 -1
  25. package/Image.config.js +1 -1
  26. package/Image.js +23 -13
  27. package/Image.js.map +1 -1
  28. package/Line.config.js +1 -1
  29. package/Line.js +234 -257
  30. package/Line.js.map +1 -1
  31. package/LinkGraph.config.js +1 -1
  32. package/LinkGraph.js +24 -14
  33. package/LinkGraph.js.map +1 -1
  34. package/Map.config.js +3 -2
  35. package/Map.config.js.map +1 -1
  36. package/Map.js +31 -20
  37. package/Map.js.map +1 -1
  38. package/Markdown.config.js +1 -1
  39. package/Markdown.js +20 -10
  40. package/Markdown.js.map +1 -1
  41. package/MarkerGauge.config.js +1 -1
  42. package/MarkerGauge.js +20 -10
  43. package/MarkerGauge.js.map +1 -1
  44. package/ParallelCoordinates.config.js +1 -1
  45. package/ParallelCoordinates.js +20 -10
  46. package/ParallelCoordinates.js.map +1 -1
  47. package/Pie.config.js +1 -1
  48. package/Pie.js +29 -19
  49. package/Pie.js.map +1 -1
  50. package/Punchcard.config.js +1 -1
  51. package/Punchcard.js +23 -12
  52. package/Punchcard.js.map +1 -1
  53. package/Rectangle.config.js +1 -1
  54. package/Rectangle.js +20 -10
  55. package/Rectangle.js.map +1 -1
  56. package/Sankey.config.js +1 -1
  57. package/Sankey.js +20 -10
  58. package/Sankey.js.map +1 -1
  59. package/Scatter.config.js +1 -1
  60. package/Scatter.js +30 -20
  61. package/Scatter.js.map +1 -1
  62. package/SingleValue.config.js +1 -1
  63. package/SingleValue.js +19 -9
  64. package/SingleValue.js.map +1 -1
  65. package/SingleValueBasic.js +1 -1
  66. package/SingleValueIcon.config.js +1 -1
  67. package/SingleValueIcon.js +29 -19
  68. package/SingleValueIcon.js.map +1 -1
  69. package/SingleValueRadial.config.js +1 -1
  70. package/SingleValueRadial.js +21 -11
  71. package/SingleValueRadial.js.map +1 -1
  72. package/SparkLine.js +1 -1
  73. package/Table.config.js +1 -1
  74. package/Table.js +20 -10
  75. package/Table.js.map +1 -1
  76. package/common/Charting.js +45 -34
  77. package/common/Charting.js.map +1 -1
  78. package/common/ChartingApi.js +7 -7
  79. package/common/ChartingApi.js.map +1 -1
  80. package/common/DocExampleWithVizSandbox.js +530 -0
  81. package/common/DocExampleWithVizSandbox.js.map +1 -0
  82. package/common/EventsDoc.js +63 -82
  83. package/common/EventsDoc.js.map +1 -1
  84. package/common/GaugeMajorTicks.js +11 -11
  85. package/common/GaugeMajorTicks.js.map +1 -1
  86. package/common/GaugeValueMarker.js +11 -11
  87. package/common/GaugeValueMarker.js.map +1 -1
  88. package/common/OptionsDoc.js +22 -22
  89. package/common/OptionsDoc.js.map +1 -1
  90. package/common/OverviewDoc.js +498 -64
  91. package/common/OverviewDoc.js.map +1 -1
  92. package/common/SplunkVisualization.js +17 -17
  93. package/common/SplunkVisualization.js.map +1 -1
  94. package/common/SplunkVisualizationApi.js +7 -7
  95. package/common/SplunkVisualizationApi.js.map +1 -1
  96. package/common/ThemesDoc.js +30 -30
  97. package/common/ThemesDoc.js.map +1 -1
  98. package/common/chartingUtils.js +8 -8
  99. package/common/chartingUtils.js.map +1 -1
  100. package/common/docUtils.js +128 -6
  101. package/common/docUtils.js.map +1 -1
  102. package/common/gaugeUtils.js +12 -12
  103. package/common/gaugeUtils.js.map +1 -1
  104. package/common/shapeUtils.js +15 -15
  105. package/common/shapeUtils.js.map +1 -1
  106. package/common/utils/configUtils.js +1 -1
  107. package/common/utils/dataUtils.js +1 -1
  108. package/common/utils/hocUtils.js +1 -1
  109. package/common/utils/layoutUtils.js +1 -1
  110. package/common/utils/mapUtils.js +1 -1
  111. package/common/utils/singleValueUtils.js +1 -1
  112. package/common/utils/testHelper.js +1 -1
  113. package/common/utils/trellisUtils.js +1 -1
  114. package/common/utils/urlUtils.js +1 -1
  115. package/common/withDashboardViz.js +119 -101
  116. package/common/withDashboardViz.js.map +1 -1
  117. package/package.json +14 -20
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -87,159 +87,125 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 49);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 60);
91
91
  /******/ })
92
92
  /************************************************************************/
93
- /******/ ([
94
- /* 0 */
93
+ /******/ ({
94
+
95
+ /***/ 0:
95
96
  /***/ (function(module, exports) {
96
97
 
97
98
  module.exports = require("react");
98
99
 
99
100
  /***/ }),
100
- /* 1 */
101
+
102
+ /***/ 1:
101
103
  /***/ (function(module, exports) {
102
104
 
103
105
  module.exports = require("prop-types");
104
106
 
105
107
  /***/ }),
106
- /* 2 */
107
- /***/ (function(module, exports) {
108
108
 
109
- module.exports = require("styled-components");
110
-
111
- /***/ }),
112
- /* 3 */,
113
- /* 4 */
109
+ /***/ 10:
114
110
  /***/ (function(module, exports) {
115
111
 
116
- module.exports = require("@babel/runtime/helpers/classCallCheck");
112
+ module.exports = require("@babel/runtime/helpers/extends");
117
113
 
118
114
  /***/ }),
119
- /* 5 */
120
- /***/ (function(module, exports) {
121
-
122
- module.exports = require("@splunk/react-ui/Heading");
123
115
 
124
- /***/ }),
125
- /* 6 */
116
+ /***/ 15:
126
117
  /***/ (function(module, exports) {
127
118
 
128
- module.exports = require("@babel/runtime/helpers/createClass");
119
+ module.exports = require("@splunk/react-ui/Markdown");
129
120
 
130
121
  /***/ }),
131
- /* 7 */,
132
- /* 8 */
122
+
123
+ /***/ 2:
133
124
  /***/ (function(module, exports) {
134
125
 
135
- module.exports = require("@babel/runtime/helpers/defineProperty");
126
+ module.exports = require("styled-components");
136
127
 
137
128
  /***/ }),
138
- /* 9 */
129
+
130
+ /***/ 39:
139
131
  /***/ (function(module, exports) {
140
132
 
141
- module.exports = require("@babel/runtime/helpers/extends");
133
+ module.exports = require("@babel/runtime/helpers/inherits");
142
134
 
143
135
  /***/ }),
144
- /* 10 */,
145
- /* 11 */,
146
- /* 12 */,
147
- /* 13 */,
148
- /* 14 */,
149
- /* 15 */
136
+
137
+ /***/ 40:
150
138
  /***/ (function(module, exports) {
151
139
 
152
- module.exports = require("@splunk/react-ui/Markdown");
140
+ module.exports = require("@babel/runtime/helpers/getPrototypeOf");
153
141
 
154
142
  /***/ }),
155
- /* 16 */,
156
- /* 17 */,
157
- /* 18 */,
158
- /* 19 */,
159
- /* 20 */,
160
- /* 21 */,
161
- /* 22 */,
162
- /* 23 */,
163
- /* 24 */,
164
- /* 25 */,
165
- /* 26 */,
166
- /* 27 */,
167
- /* 28 */
143
+
144
+ /***/ 45:
168
145
  /***/ (function(module, exports) {
169
146
 
170
- module.exports = require("@babel/runtime/helpers/inherits");
147
+ module.exports = require("@babel/runtime/helpers/assertThisInitialized");
171
148
 
172
149
  /***/ }),
173
- /* 29 */
150
+
151
+ /***/ 46:
174
152
  /***/ (function(module, exports) {
175
153
 
176
- module.exports = require("@babel/runtime/helpers/getPrototypeOf");
154
+ module.exports = require("@babel/runtime/helpers/possibleConstructorReturn");
177
155
 
178
156
  /***/ }),
179
- /* 30 */,
180
- /* 31 */,
181
- /* 32 */,
182
- /* 33 */,
183
- /* 34 */
157
+
158
+ /***/ 47:
184
159
  /***/ (function(module, exports) {
185
160
 
186
- module.exports = require("@babel/runtime/helpers/assertThisInitialized");
161
+ module.exports = require("@splunk/react-ui/JSONTree");
187
162
 
188
163
  /***/ }),
189
- /* 35 */
164
+
165
+ /***/ 5:
190
166
  /***/ (function(module, exports) {
191
167
 
192
- module.exports = require("@babel/runtime/helpers/possibleConstructorReturn");
168
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
193
169
 
194
170
  /***/ }),
195
- /* 36 */
171
+
172
+ /***/ 6:
196
173
  /***/ (function(module, exports) {
197
174
 
198
- module.exports = require("@splunk/react-ui/JSONTree");
175
+ module.exports = require("@splunk/react-ui/Heading");
199
176
 
200
177
  /***/ }),
201
- /* 37 */,
202
- /* 38 */,
203
- /* 39 */,
204
- /* 40 */,
205
- /* 41 */,
206
- /* 42 */,
207
- /* 43 */,
208
- /* 44 */,
209
- /* 45 */,
210
- /* 46 */,
211
- /* 47 */,
212
- /* 48 */,
213
- /* 49 */
178
+
179
+ /***/ 60:
214
180
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
215
181
 
216
182
  "use strict";
217
183
  __webpack_require__.r(__webpack_exports__);
218
- /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
184
+ /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
219
185
  /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
220
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34);
186
+ /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45);
221
187
  /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
222
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
188
+ /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
223
189
  /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__);
224
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
190
+ /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
225
191
  /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);
226
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6);
192
+ /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
227
193
  /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);
228
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28);
194
+ /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(39);
229
195
  /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__);
230
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(35);
196
+ /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46);
231
197
  /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6__);
232
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(29);
198
+ /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(40);
233
199
  /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_7__);
234
200
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(0);
235
201
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__);
236
202
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1);
237
203
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_9__);
238
- /* harmony import */ var _splunk_react_ui_Heading__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5);
204
+ /* harmony import */ var _splunk_react_ui_Heading__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6);
239
205
  /* harmony import */ var _splunk_react_ui_Heading__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Heading__WEBPACK_IMPORTED_MODULE_10__);
240
206
  /* harmony import */ var _splunk_react_ui_Markdown__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(15);
241
207
  /* harmony import */ var _splunk_react_ui_Markdown__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Markdown__WEBPACK_IMPORTED_MODULE_11__);
242
- /* harmony import */ var _splunk_react_ui_JSONTree__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(36);
208
+ /* harmony import */ var _splunk_react_ui_JSONTree__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(47);
243
209
  /* harmony import */ var _splunk_react_ui_JSONTree__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_JSONTree__WEBPACK_IMPORTED_MODULE_12__);
244
210
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2);
245
211
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_13__);
@@ -501,6 +467,21 @@ EventsDoc.propTypes = {
501
467
  };
502
468
  /* harmony default export */ __webpack_exports__["default"] = (EventsDoc);
503
469
 
470
+ /***/ }),
471
+
472
+ /***/ 7:
473
+ /***/ (function(module, exports) {
474
+
475
+ module.exports = require("@babel/runtime/helpers/createClass");
476
+
477
+ /***/ }),
478
+
479
+ /***/ 9:
480
+ /***/ (function(module, exports) {
481
+
482
+ module.exports = require("@babel/runtime/helpers/defineProperty");
483
+
504
484
  /***/ })
505
- /******/ ]);
485
+
486
+ /******/ });
506
487
  //# sourceMappingURL=EventsDoc.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"styled-components\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@splunk/react-ui/Heading\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/extends\"","webpack:///external \"@splunk/react-ui/Markdown\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@babel/runtime/helpers/assertThisInitialized\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack:///external \"@splunk/react-ui/JSONTree\"","webpack:///./src/common/EventsDoc.jsx"],"names":["EventTester","styled","Event","EventName","EventItem","name","desc","marginLeft","T","string","EventsDesc","events","vizType","Object","description","VisExample","options","Visualization","dsState","onEventTrigger","height","width","PureComponent","number","EventExample","event","eventToDisplay","content","useMemo","JSON","object","EventsDoc","e","key","handleEvent","Component","any"],"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,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AAc,CAAdA;AACH;;AAED,MAAMC,OAAO,GAAGC,qDAAO,CAAC,YAAM;AAC1B,wBAAO;AAAU,SAAG,EAAEC,IAAI,CAAJA,UAAf,cAAeA,CAAf;AAA+C,UAAI,EAAnD;AAAqE,oBAAc;AAAnF,MAAP;AADmB,KAEpB,CAFH,cAEG,CAFoB,CAAvB;AAIA,sBACI,2DAAC,4CAAD,8BACI;AAAS,SAAK,EAAE;AAAhB,KADJ,eACI,CADJ,EADJ,OACI,CADJ;AAZJ;;AAoBAL,YAAY,CAAZA,YAAyB;AACrBC,OAAK,EAAEjB,iDAAC,CAACsB;AADY,CAAzBN;;IAIMO,S;;;;;AACF,qCAA4B;AAAA;;AAAA;;AACxB;;AADwB,4LAOd,aAAK;AACf,qBAAc;AACVC,SAAC,EAADA;AADU,OAAd;AARwB;;AAExB,kBAAa;AACTA,OAAC,EAAE;AADM,KAAb;AAFwB;AAK3B;;;;WAQD,kBAAS;AAAA;;AACL,0BACI,qFACI;AAAY,cAAM,EAAE,WAApB;AAAuC,eAAO,kBAAE,KAAF,+EAAE,aAAF,iGAAE,sBAAF,iEAAE,uBAAmCC;AAAnF,QADJ,eAEI,iJAAgB,KAAhB;AAA4B,sBAAc,EAAE,KAAKC;AAAjD,SAFJ,eAGI;AAAc,aAAK,EAAE,WAAWF;AAAhC,QAHJ,CADJ;AAOH;;;;EAtBmBG,+C;;AAyBxBJ,SAAS,CAATA,YAAsB;AAClBf,SAAO,EAAER,iDAAC,CADQ;AAElBG,QAAM,EAAEH,iDAAC,CAFS;AAGlBU,SAAO,EAAEV,iDAAC,CAHQ;AAIlBS,eAAa,EAAET,iDAAC,CAAC4B;AAJC,CAAtBL;AAOA,0E","file":"EventsDoc.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 = 49);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"styled-components\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@splunk/react-ui/Heading\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@splunk/react-ui/Markdown\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@babel/runtime/helpers/assertThisInitialized\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","module.exports = require(\"@splunk/react-ui/JSONTree\");","/* eslint-disable react/no-multi-comp */\n/* eslint-disable max-classes-per-file */\nimport React, { Component, PureComponent, useMemo } from 'react';\nimport T from 'prop-types';\nimport Heading from '@splunk/react-ui/Heading';\nimport Markdown from '@splunk/react-ui/Markdown';\nimport JSONTree from '@splunk/react-ui/JSONTree';\nimport styled from 'styled-components';\n\nconst EventTester = styled.div`\n margin-top: 50px;\n`;\n\nconst Event = styled.div`\n margin-top: 20px;\n`;\nconst EventName = styled.div`\n color: #5ca300;\n padding-bottom: 5px;\n`;\n\nconst EventItem = ({ name, desc }) => (\n <Event>\n <EventName>{name}</EventName>\n <Markdown style={{ marginLeft: 40 }} text={desc} />\n </Event>\n);\n\nEventItem.propTypes = {\n name: T.string,\n desc: T.string,\n};\n\nconst EventsDesc = ({ events, vizType }) => (\n <div>\n <Heading level={4}>\n {Object.keys(events).length !== 0 || vizType === 'splunk.events' ? 'Events' : 'No Events'}\n </Heading>\n {vizType === 'splunk.events' && (\n <Markdown text=\"Events are dynamically added via the `eventActions` and `fieldActions` options for the Events visualization.\" />\n )}\n {Object.keys(events).map(eventName => (\n <EventItem key={eventName} name={eventName} desc={events[eventName].description} />\n ))}\n </div>\n);\n\nEventsDesc.propTypes = {\n events: T.object.isRequired,\n vizType: T.string,\n};\n\nclass VisExample extends PureComponent {\n render() {\n const { options = {}, Visualization, dsState, onEventTrigger, height, width } = this.props;\n return (\n <EventTester>\n <Heading level={4}>Test Visualization</Heading>\n <Visualization\n options={options}\n dataSources={dsState}\n onEventTrigger={onEventTrigger}\n hasEventHandlers\n height={height}\n width={width}\n />\n </EventTester>\n );\n }\n}\n\nVisExample.propTypes = {\n options: T.object,\n Visualization: T.any,\n dsState: T.object,\n onEventTrigger: T.func,\n height: T.number,\n width: T.number,\n};\n\nconst EventExample = ({ event }) => {\n const eventToDisplay = {\n ...event,\n };\n if (eventToDisplay.originalEvent != null) {\n eventToDisplay.originalEvent = '...Original Event instance...';\n }\n\n const content = useMemo(() => {\n return <JSONTree key={JSON.stringify(eventToDisplay)} json={eventToDisplay} expandChildren />;\n }, [eventToDisplay]);\n\n return (\n <React.Fragment>\n <Heading level={4}>Event Monitor</Heading>\n {content}\n </React.Fragment>\n );\n};\n\nEventExample.propTypes = {\n event: T.object,\n};\n\nclass EventsDoc extends Component {\n constructor(props, context) {\n super(props, context);\n this.state = {\n e: null,\n };\n }\n\n handleEvent = e => {\n this.setState({\n e,\n });\n };\n\n render() {\n return (\n <div>\n <EventsDesc events={this.props.events} vizType={this.props?.Visualization?.config?.key} />\n <VisExample {...this.props} onEventTrigger={this.handleEvent} />\n <EventExample event={this.state.e} />\n </div>\n );\n }\n}\n\nEventsDoc.propTypes = {\n options: T.object,\n events: T.object,\n dsState: T.object,\n Visualization: T.any,\n};\n\nexport default EventsDoc;\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"@babel/runtime/helpers/extends\"","webpack:///external \"@splunk/react-ui/Markdown\"","webpack:///external \"styled-components\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@babel/runtime/helpers/assertThisInitialized\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\"","webpack:///external \"@splunk/react-ui/JSONTree\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@splunk/react-ui/Heading\"","webpack:///./src/common/EventsDoc.jsx","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@babel/runtime/helpers/defineProperty\""],"names":["EventTester","styled","Event","EventName","EventItem","name","desc","marginLeft","T","string","EventsDesc","events","vizType","Object","description","VisExample","options","Visualization","dsState","onEventTrigger","height","width","PureComponent","number","EventExample","event","eventToDisplay","content","useMemo","JSON","object","EventsDoc","e","key","handleEvent","Component","any"],"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,2D;;;;;;;ACAA,sD;;;;;;;ACAA,8C;;;;;;;ACAA,4D;;;;;;;ACAA,kE;;;;;;;ACAA,yE;;;;;;;ACAA,6E;;;;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FJ,cAEI,CAFmB,CAAvB;AAKA,sBACI,2DAAC,4CAAD,8BACI;AAAS,SAAK,EAAE;AAAhB,KADJ,eACI,CADJ,EADJ,OACI,CADJ;AAbJ;;AAqBAL,YAAY,CAAZA,YAAyB;AACrBC,OAAK,EAAEjB,iDAAC,CAACsB;AADY,CAAzBN;;IAIMO,S;;;;;AACF,qCAA4B;AAAA;;AAAA;;AACxB;;AADwB,4LAOd,aAAK;AACf,qBAAc;AACVC,SAAC,EAADA;AADU,OAAd;AARwB;;AAExB,kBAAa;AACTA,OAAC,EAAE;AADM,KAAb;AAFwB;AAK3B;;;;WAQD,kBAAS;AAAA;;AACL,0BACI,qFACI;AAAY,cAAM,EAAE,WAApB;AAAuC,eAAO,kBAAE,KAAF,+EAAE,aAAF,iGAAE,sBAAF,iEAAE,uBAAmCC;AAAnF,QADJ,eAEI,iJAAgB,KAAhB;AAA4B,sBAAc,EAAE,KAAKC;AAAjD,SAFJ,eAGI;AAAc,aAAK,EAAE,WAAWF;AAAhC,QAHJ,CADJ;AAOH;;;;EAtBmBG,+C;;AAyBxBJ,SAAS,CAATA,YAAsB;AAClBf,SAAO,EAAER,iDAAC,CADQ;AAElBG,QAAM,EAAEH,iDAAC,CAFS;AAGlBU,SAAO,EAAEV,iDAAC,CAHQ;AAIlBS,eAAa,EAAET,iDAAC,CAAC4B;AAJC,CAAtBL;AAOA,0E;;;;;;;ACzIA,+D;;;;;;;ACAA,kE","file":"EventsDoc.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 = 60);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@splunk/react-ui/Markdown\");","module.exports = require(\"styled-components\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@babel/runtime/helpers/assertThisInitialized\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");","module.exports = require(\"@splunk/react-ui/JSONTree\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@splunk/react-ui/Heading\");","/* eslint-disable react/no-multi-comp */\n/* eslint-disable max-classes-per-file */\nimport React, { Component, PureComponent, useMemo } from 'react';\nimport T from 'prop-types';\nimport Heading from '@splunk/react-ui/Heading';\nimport Markdown from '@splunk/react-ui/Markdown';\nimport JSONTree from '@splunk/react-ui/JSONTree';\nimport styled from 'styled-components';\n\nconst EventTester = styled.div`\n margin-top: 50px;\n`;\n\nconst Event = styled.div`\n margin-top: 20px;\n`;\nconst EventName = styled.div`\n color: #5ca300;\n padding-bottom: 5px;\n`;\n\nconst EventItem = ({ name, desc }) => (\n <Event>\n <EventName>{name}</EventName>\n <Markdown style={{ marginLeft: 40 }} text={desc} />\n </Event>\n);\n\nEventItem.propTypes = {\n name: T.string,\n desc: T.string,\n};\n\nconst EventsDesc = ({ events, vizType }) => (\n <div>\n <Heading level={4}>\n {Object.keys(events).length !== 0 || vizType === 'splunk.events' ? 'Events' : 'No Events'}\n </Heading>\n {vizType === 'splunk.events' && (\n <Markdown text=\"Events are dynamically added via the `eventActions` and `fieldActions` options for the Events visualization.\" />\n )}\n {Object.keys(events).map(eventName => (\n <EventItem key={eventName} name={eventName} desc={events[eventName].description} />\n ))}\n </div>\n);\n\nEventsDesc.propTypes = {\n events: T.object.isRequired,\n vizType: T.string,\n};\n\nclass VisExample extends PureComponent {\n render() {\n const { options = {}, Visualization, dsState, onEventTrigger, height, width } = this.props;\n return (\n <EventTester>\n <Heading level={4}>Test Visualization</Heading>\n <Visualization\n options={options}\n dataSources={dsState}\n onEventTrigger={onEventTrigger}\n hasEventHandlers\n height={height}\n width={width}\n />\n </EventTester>\n );\n }\n}\n\nVisExample.propTypes = {\n options: T.object,\n Visualization: T.any,\n dsState: T.object,\n onEventTrigger: T.func,\n height: T.number,\n width: T.number,\n};\n\nconst EventExample = ({ event }) => {\n const eventToDisplay = {\n ...event,\n };\n if (eventToDisplay.originalEvent != null) {\n eventToDisplay.originalEvent = '...Original Event instance...';\n }\n\n const content = useMemo(\n () => <JSONTree key={JSON.stringify(eventToDisplay)} json={eventToDisplay} expandChildren />,\n [eventToDisplay]\n );\n\n return (\n <React.Fragment>\n <Heading level={4}>Event Monitor</Heading>\n {content}\n </React.Fragment>\n );\n};\n\nEventExample.propTypes = {\n event: T.object,\n};\n\nclass EventsDoc extends Component {\n constructor(props, context) {\n super(props, context);\n this.state = {\n e: null,\n };\n }\n\n handleEvent = e => {\n this.setState({\n e,\n });\n };\n\n render() {\n return (\n <div>\n <EventsDesc events={this.props.events} vizType={this.props?.Visualization?.config?.key} />\n <VisExample {...this.props} onEventTrigger={this.handleEvent} />\n <EventExample event={this.state.e} />\n </div>\n );\n }\n}\n\nEventsDoc.propTypes = {\n options: T.object,\n events: T.object,\n dsState: T.object,\n Visualization: T.any,\n};\n\nexport default EventsDoc;\n","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");"],"sourceRoot":""}
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -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 = 50);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 61);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -106,6 +106,13 @@ module.exports = require("prop-types");
106
106
 
107
107
  /***/ }),
108
108
 
109
+ /***/ 10:
110
+ /***/ (function(module, exports) {
111
+
112
+ module.exports = require("@babel/runtime/helpers/extends");
113
+
114
+ /***/ }),
115
+
109
116
  /***/ 16:
110
117
  /***/ (function(module, exports) {
111
118
 
@@ -120,14 +127,14 @@ module.exports = require("styled-components");
120
127
 
121
128
  /***/ }),
122
129
 
123
- /***/ 50:
130
+ /***/ 61:
124
131
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
125
132
 
126
133
  "use strict";
127
134
  __webpack_require__.r(__webpack_exports__);
128
135
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MajorTick", function() { return MajorTick; });
129
136
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionMajorTick", function() { return positionMajorTick; });
130
- /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
137
+ /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
131
138
  /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
132
139
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
133
140
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
@@ -373,13 +380,6 @@ MajorTicks.defaultProps = {
373
380
  };
374
381
  /* harmony default export */ __webpack_exports__["default"] = (MajorTicks);
375
382
 
376
- /***/ }),
377
-
378
- /***/ 9:
379
- /***/ (function(module, exports) {
380
-
381
- module.exports = require("@babel/runtime/helpers/extends");
382
-
383
383
  /***/ })
384
384
 
385
385
  /******/ });
@@ -1 +1 @@
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/GaugeMajorTicks.jsx","webpack:///external \"@babel/runtime/helpers/extends\""],"names":["DEFAULT_NUM_OF_TICKS","TICK_LENGTH_DELTA","TICK_LABEL_PADDING_FACTOR","MajorTickLine","styled","props","MajorTickLabel","MajorTick","index","x1","y1","x2","y2","showLabels","label","labelX","labelY","majorTickStrokeColor","majorTickFillColor","formatNumber","useThousandSeparators","useTrendUnits","T","string","positionMajorTick","width","height","startX","startY","orientation","numOfTicks","i","y","x","MajorTicks","min","max","majorUnit","usePercentageRange","range","Number","majorTicks","parseInt","extraNumOfTicks","Math"],"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,oBAAoB,GAA1B;A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N;AAOI,gBAAU,EAPd;AAQI,WAAK,EAAEH,kBAAkB,YAR7B;AASI,YAAM,EATV;AAUI,YAAM,EAVV;AAWI,wBAAkB,EAXtB;AAYI,0BAAoB,EAAErB;AAZ1B,MADJwB;AAgBH;;AAED,sBAAO,sEAAP,UAAO,CAAP;AAtFJ;;AAyFAP,UAAU,CAAVA,YAAuB;AACnBT,OAAK,EAAEH,iDAAC,CADW;AAEnBI,QAAM,EAAEJ,iDAAC,CAFU;AAGnBK,QAAM,EAAEL,iDAAC,CAHU;AAInBM,QAAM,EAAEN,iDAAC,CAJU;AAKnBa,KAAG,EAAEb,iDAAC,CALa;AAMnBc,KAAG,EAAEd,iDAAC,CANa;AAOnBe,WAAS,EAAEf,iDAAC,CAADA,UAAY,CAACA,iDAAC,CAAF,QAAWA,iDAAC,CAPhB,MAOI,CAAZA,CAPQ;AAQnBO,aAAW,EAAEP,iDAAC,CARK;AASnBT,YAAU,EAAES,iDAAC,CATM;AAUnBgB,oBAAkB,EAAEhB,iDAAC,CAVF;AAWnBJ,oBAAkB,EAAEI,iDAAC,CAXF;AAYnBL,sBAAoB,EAAEK,iDAAC,CAACC;AAZL,CAAvBW;AAeAA,UAAU,CAAVA,eAA0B;AACtBC,KAAG,EADmB;AAEtBC,KAAG,EAFmB;AAGtBC,WAAS,EAHa;AAItBR,aAAW,EAJW;AAKtBhB,YAAU,EALY;AAMtByB,oBAAkB,EAAE;AANE,CAA1BJ;AASA,2E;;;;;;;ACpOA,2D","file":"GaugeMajorTicks.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 { isNumerial, formatNumber } from '@splunk/visualizations-shared/numberUtils';\n\nconst DEFAULT_NUM_OF_TICKS = 5;\nconst TICK_LENGTH_DELTA = 5;\nconst TICK_LABEL_PADDING_FACTOR = 3.2;\n\nconst MajorTickLine = styled.line`\n stroke: ${props => props.majorTickStrokeColor};\n stroke-width: 2px;\n stroke-dasharray: ${props => (props.index === 0 ? 0 : 3)};\n`;\n\nconst MajorTickLabel = styled.text`\n font-size: 12px;\n font-family: Splunk Platform Sans, sans-serif;\n line-height: 19px;\n fill: ${props => props.majorTickFillColor};\n text-anchor: middle;\n text-align: center;\n`;\n\nexport const MajorTick = ({\n index,\n x1,\n y1,\n x2,\n y2,\n showLabels,\n label,\n labelX,\n labelY,\n majorTickStrokeColor,\n majorTickFillColor,\n}) => (\n <g>\n <MajorTickLine\n index={index}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n majorTickStrokeColor={majorTickStrokeColor}\n />\n {showLabels && (\n <MajorTickLabel x={labelX} y={labelY} majorTickFillColor={majorTickFillColor}>\n {isNumerial(label)\n ? formatNumber(label, 0, {\n useThousandSeparators: true,\n useTrendUnits: true,\n })\n : label}\n </MajorTickLabel>\n )}\n </g>\n);\n\nMajorTick.propTypes = {\n index: T.number,\n x1: T.number,\n y1: T.number,\n x2: T.number,\n y2: T.number,\n showLabels: T.bool,\n label: T.oneOfType([T.string, T.number]),\n labelX: T.number,\n labelY: T.number,\n majorTickStrokeColor: T.string,\n majorTickFillColor: T.string,\n};\n\n/**\n * calculate position for each major tick\n * @method positionMajorTick\n * @param {Object} input\n * @param {Number} input.width\n * @param {Number} input.height\n * @param {Number} input.startX start x for rendering the first major tick\n * @param {Number} input.startY start y for rendering the first major tick\n * @param {String} input.orientation\n * @param {Number} input.numOfTicks how many ticks need to render\n * @param {Number} input.i index of major tick\n * @return {Object} MajorTick positions\n */\nexport const positionMajorTick = ({ width, height, startX, startY, orientation, numOfTicks, i }) => {\n let x1 = startX;\n let y1 = startY;\n let x2 = startX;\n let y2 = startY;\n let labelX = startX;\n let labelY;\n\n if (orientation === 'vertical') {\n const y = (height / numOfTicks) * (numOfTicks - i) + startY;\n x1 -= TICK_LENGTH_DELTA;\n y1 = y;\n x2 += width + TICK_LENGTH_DELTA;\n y2 = y;\n labelX += width + TICK_LENGTH_DELTA * TICK_LABEL_PADDING_FACTOR;\n labelY = y;\n } else {\n const x = (width / numOfTicks) * i + startX;\n x1 = x;\n y1 -= TICK_LENGTH_DELTA;\n x2 = x;\n y2 += height + TICK_LENGTH_DELTA;\n labelX = x;\n labelY = y2 + 16;\n }\n\n return { x1, y1, x2, y2, labelX, labelY };\n};\n\nconst MajorTicks = ({ ...props }) => {\n const {\n width,\n height,\n startX,\n startY,\n min,\n max,\n majorUnit,\n orientation,\n showLabels,\n usePercentageRange,\n majorTickFillColor,\n majorTickStrokeColor,\n } = props;\n\n const range = max - min;\n const numOfTicks =\n majorUnit === 'auto' || Number.isNaN(Number(majorUnit)) || majorUnit <= 0\n ? DEFAULT_NUM_OF_TICKS\n : range / majorUnit;\n const majorTicks = [];\n\n for (let i = 0; i <= numOfTicks; i += 1) {\n const { x1, y1, x2, y2, labelX, labelY } = positionMajorTick({\n width,\n height,\n startX,\n startY,\n orientation,\n numOfTicks,\n i,\n });\n const label = usePercentageRange\n ? `${parseInt((i / numOfTicks - min / range) * 100, 10)}%`\n : parseInt(min + (range / numOfTicks) * i, 10);\n\n majorTicks.push(\n <MajorTick\n key={i}\n index={i}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n showLabels={showLabels}\n label={label}\n labelX={labelX}\n labelY={labelY}\n majorTickFillColor={majorTickFillColor}\n majorTickStrokeColor={majorTickStrokeColor}\n />\n );\n }\n\n // if the gauge is not divided evenly, put the last tick at the end of the gauge\n if (!Number.isInteger(numOfTicks)) {\n const extraNumOfTicks = Math.ceil(numOfTicks);\n const { x1, y1, x2, y2, labelX, labelY } = positionMajorTick({\n width,\n height,\n startX,\n startY,\n orientation,\n numOfTicks: extraNumOfTicks,\n i: extraNumOfTicks,\n });\n\n majorTicks.push(\n <MajorTick\n key={extraNumOfTicks}\n id={extraNumOfTicks}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n showLabels={showLabels}\n label={usePercentageRange ? '100%' : max}\n labelX={labelX}\n labelY={labelY}\n majorTickFillColor={majorTickFillColor}\n majorTickStrokeColor={majorTickStrokeColor}\n />\n );\n }\n\n return <g>{majorTicks}</g>;\n};\n\nMajorTicks.propTypes = {\n width: T.number,\n height: T.number,\n startX: T.number,\n startY: T.number,\n min: T.number,\n max: T.number,\n majorUnit: T.oneOfType([T.string, T.number]),\n orientation: T.string,\n showLabels: T.bool,\n usePercentageRange: T.bool,\n majorTickFillColor: T.string,\n majorTickStrokeColor: T.string,\n};\n\nMajorTicks.defaultProps = {\n min: 0,\n max: 100,\n majorUnit: 'auto',\n orientation: 'horizontal',\n showLabels: true,\n usePercentageRange: false,\n};\n\nexport default MajorTicks;\n","module.exports = require(\"@babel/runtime/helpers/extends\");"],"sourceRoot":""}
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/GaugeMajorTicks.jsx"],"names":["DEFAULT_NUM_OF_TICKS","TICK_LENGTH_DELTA","TICK_LABEL_PADDING_FACTOR","MajorTickLine","styled","props","MajorTickLabel","MajorTick","index","x1","y1","x2","y2","showLabels","label","labelX","labelY","majorTickStrokeColor","majorTickFillColor","formatNumber","useThousandSeparators","useTrendUnits","T","string","positionMajorTick","width","height","startX","startY","orientation","numOfTicks","i","y","x","MajorTicks","min","max","majorUnit","usePercentageRange","range","Number","majorTicks","parseInt","extraNumOfTicks","Math"],"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,2D;;;;;;;ACAA,sE;;;;;;;ACAA,8C;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AAEA,IAAMA,oBAAoB,GAA1B;AACA,IAAMC,iBAAiB,GAAvB;AACA,IAAMC,yBAAyB,GAA/B;AAEA,IAAMC,aAAa,GAAGC,wDAAM,CAAT,IAAGA,CAAH,UAAGA,CAAH;AAAA;AAAA;AAAA,CAAGA,EAAH,uDAAGA,EACR,iBAAK;AAAA,SAAIC,KAAK,CAAT;AADA,CAAGD,EAGE,iBAAK;AAAA,SAAKC,KAAK,CAALA,kBAAL;AAH7B,CAAsBD,CAAtB;AAMA,IAAME,cAAc,GAAGF,wDAAM,CAAT,IAAGA,CAAH,UAAGA,CAAH;AAAA;AAAA;AAAA,CAAGA,EAAH,+HAAGA,EAIX,iBAAK;AAAA,SAAIC,KAAK,CAAT;AAJjB,CAAuB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OnBe,WAAS,EAAEf,iDAAC,CAADA,UAAY,CAACA,iDAAC,CAAF,QAAWA,iDAAC,CAPhB,MAOI,CAAZA,CAPQ;AAQnBO,aAAW,EAAEP,iDAAC,CARK;AASnBT,YAAU,EAAES,iDAAC,CATM;AAUnBgB,oBAAkB,EAAEhB,iDAAC,CAVF;AAWnBJ,oBAAkB,EAAEI,iDAAC,CAXF;AAYnBL,sBAAoB,EAAEK,iDAAC,CAACC;AAZL,CAAvBW;AAeAA,UAAU,CAAVA,eAA0B;AACtBC,KAAG,EADmB;AAEtBC,KAAG,EAFmB;AAGtBC,WAAS,EAHa;AAItBR,aAAW,EAJW;AAKtBhB,YAAU,EALY;AAMtByB,oBAAkB,EAAE;AANE,CAA1BJ;AASA,2E","file":"GaugeMajorTicks.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 = 61);\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 { isNumerial, formatNumber } from '@splunk/visualizations-shared/numberUtils';\n\nconst DEFAULT_NUM_OF_TICKS = 5;\nconst TICK_LENGTH_DELTA = 5;\nconst TICK_LABEL_PADDING_FACTOR = 3.2;\n\nconst MajorTickLine = styled.line`\n stroke: ${props => props.majorTickStrokeColor};\n stroke-width: 2px;\n stroke-dasharray: ${props => (props.index === 0 ? 0 : 3)};\n`;\n\nconst MajorTickLabel = styled.text`\n font-size: 12px;\n font-family: Splunk Platform Sans, sans-serif;\n line-height: 19px;\n fill: ${props => props.majorTickFillColor};\n text-anchor: middle;\n text-align: center;\n`;\n\nexport const MajorTick = ({\n index,\n x1,\n y1,\n x2,\n y2,\n showLabels,\n label,\n labelX,\n labelY,\n majorTickStrokeColor,\n majorTickFillColor,\n}) => (\n <g>\n <MajorTickLine\n index={index}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n majorTickStrokeColor={majorTickStrokeColor}\n />\n {showLabels && (\n <MajorTickLabel x={labelX} y={labelY} majorTickFillColor={majorTickFillColor}>\n {isNumerial(label)\n ? formatNumber(label, 0, {\n useThousandSeparators: true,\n useTrendUnits: true,\n })\n : label}\n </MajorTickLabel>\n )}\n </g>\n);\n\nMajorTick.propTypes = {\n index: T.number,\n x1: T.number,\n y1: T.number,\n x2: T.number,\n y2: T.number,\n showLabels: T.bool,\n label: T.oneOfType([T.string, T.number]),\n labelX: T.number,\n labelY: T.number,\n majorTickStrokeColor: T.string,\n majorTickFillColor: T.string,\n};\n\n/**\n * calculate position for each major tick\n * @method positionMajorTick\n * @param {Object} input\n * @param {Number} input.width\n * @param {Number} input.height\n * @param {Number} input.startX start x for rendering the first major tick\n * @param {Number} input.startY start y for rendering the first major tick\n * @param {String} input.orientation\n * @param {Number} input.numOfTicks how many ticks need to render\n * @param {Number} input.i index of major tick\n * @return {Object} MajorTick positions\n */\nexport const positionMajorTick = ({ width, height, startX, startY, orientation, numOfTicks, i }) => {\n let x1 = startX;\n let y1 = startY;\n let x2 = startX;\n let y2 = startY;\n let labelX = startX;\n let labelY;\n\n if (orientation === 'vertical') {\n const y = (height / numOfTicks) * (numOfTicks - i) + startY;\n x1 -= TICK_LENGTH_DELTA;\n y1 = y;\n x2 += width + TICK_LENGTH_DELTA;\n y2 = y;\n labelX += width + TICK_LENGTH_DELTA * TICK_LABEL_PADDING_FACTOR;\n labelY = y;\n } else {\n const x = (width / numOfTicks) * i + startX;\n x1 = x;\n y1 -= TICK_LENGTH_DELTA;\n x2 = x;\n y2 += height + TICK_LENGTH_DELTA;\n labelX = x;\n labelY = y2 + 16;\n }\n\n return { x1, y1, x2, y2, labelX, labelY };\n};\n\nconst MajorTicks = ({ ...props }) => {\n const {\n width,\n height,\n startX,\n startY,\n min,\n max,\n majorUnit,\n orientation,\n showLabels,\n usePercentageRange,\n majorTickFillColor,\n majorTickStrokeColor,\n } = props;\n\n const range = max - min;\n const numOfTicks =\n majorUnit === 'auto' || Number.isNaN(Number(majorUnit)) || majorUnit <= 0\n ? DEFAULT_NUM_OF_TICKS\n : range / majorUnit;\n const majorTicks = [];\n\n for (let i = 0; i <= numOfTicks; i += 1) {\n const { x1, y1, x2, y2, labelX, labelY } = positionMajorTick({\n width,\n height,\n startX,\n startY,\n orientation,\n numOfTicks,\n i,\n });\n const label = usePercentageRange\n ? `${parseInt((i / numOfTicks - min / range) * 100, 10)}%`\n : parseInt(min + (range / numOfTicks) * i, 10);\n\n majorTicks.push(\n <MajorTick\n key={i}\n index={i}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n showLabels={showLabels}\n label={label}\n labelX={labelX}\n labelY={labelY}\n majorTickFillColor={majorTickFillColor}\n majorTickStrokeColor={majorTickStrokeColor}\n />\n );\n }\n\n // if the gauge is not divided evenly, put the last tick at the end of the gauge\n if (!Number.isInteger(numOfTicks)) {\n const extraNumOfTicks = Math.ceil(numOfTicks);\n const { x1, y1, x2, y2, labelX, labelY } = positionMajorTick({\n width,\n height,\n startX,\n startY,\n orientation,\n numOfTicks: extraNumOfTicks,\n i: extraNumOfTicks,\n });\n\n majorTicks.push(\n <MajorTick\n key={extraNumOfTicks}\n id={extraNumOfTicks}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n showLabels={showLabels}\n label={usePercentageRange ? '100%' : max}\n labelX={labelX}\n labelY={labelY}\n majorTickFillColor={majorTickFillColor}\n majorTickStrokeColor={majorTickStrokeColor}\n />\n );\n }\n\n return <g>{majorTicks}</g>;\n};\n\nMajorTicks.propTypes = {\n width: T.number,\n height: T.number,\n startX: T.number,\n startY: T.number,\n min: T.number,\n max: T.number,\n majorUnit: T.oneOfType([T.string, T.number]),\n orientation: T.string,\n showLabels: T.bool,\n usePercentageRange: T.bool,\n majorTickFillColor: T.string,\n majorTickStrokeColor: T.string,\n};\n\nMajorTicks.defaultProps = {\n min: 0,\n max: 100,\n majorUnit: 'auto',\n orientation: 'horizontal',\n showLabels: true,\n usePercentageRange: false,\n};\n\nexport default MajorTicks;\n"],"sourceRoot":""}
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -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 = 51);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 62);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -106,6 +106,13 @@ module.exports = require("prop-types");
106
106
 
107
107
  /***/ }),
108
108
 
109
+ /***/ 10:
110
+ /***/ (function(module, exports) {
111
+
112
+ module.exports = require("@babel/runtime/helpers/extends");
113
+
114
+ /***/ }),
115
+
109
116
  /***/ 16:
110
117
  /***/ (function(module, exports) {
111
118
 
@@ -120,14 +127,14 @@ module.exports = require("styled-components");
120
127
 
121
128
  /***/ }),
122
129
 
123
- /***/ 51:
130
+ /***/ 62:
124
131
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
125
132
 
126
133
  "use strict";
127
134
  __webpack_require__.r(__webpack_exports__);
128
135
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionValueMarkerRect", function() { return positionValueMarkerRect; });
129
136
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionLabel", function() { return positionLabel; });
130
- /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
137
+ /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
131
138
  /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
132
139
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
133
140
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
@@ -330,13 +337,6 @@ ValueMarker.defaultProps = {
330
337
  };
331
338
  /* harmony default export */ __webpack_exports__["default"] = (ValueMarker);
332
339
 
333
- /***/ }),
334
-
335
- /***/ 9:
336
- /***/ (function(module, exports) {
337
-
338
- module.exports = require("@babel/runtime/helpers/extends");
339
-
340
340
  /***/ })
341
341
 
342
342
  /******/ });
@@ -1 +1 @@
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","alignCenter","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","bool"],"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,CAAH;AAAA;AAAA;AAAA,CAAGA,EAAH,+BAAGA,EAEZ,iBAAK;AAAA,SAAIC,KAAK,CAAT;AAFjB,CAAwBD,CAAxB;AAKA,IAAME,oBAAoB,GAAGF,wDAAM,CAAT,IAAGA,CAAH,UAAGA,CAAH;AAAA;AAAA;AAAA,CAAGA,EAAH,cAAGA,EACjB,iBAAK;AAAA,SAAIC,KAAK,CAAT;AADjB,CAA6BD,CAA7B;AAIA,IAAMG,gBAAgB,GAAGH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F;AAEnBC,iBAAa,EAAE;AAFI,GAAX,CARtB,CAXJ,CAPR,CADJ;AAzBJ;;AA+DAV,WAAW,CAAXA,YAAwB;AACpBnB,GAAC,EAAE8B,iDAAC,CADgB;AAEpB7B,GAAC,EAAE6B,iDAAC,CAFgB;AAGpBhB,QAAM,EAAEgB,iDAAC,CAHW;AAIpBV,KAAG,EAAEU,iDAAC,CAJc;AAKpBT,KAAG,EAAES,iDAAC,CALc;AAMpBR,OAAK,EAAEQ,iDAAC,CANY;AAOpB5B,aAAW,EAAE4B,iDAAC,CAPM;AAQpBP,WAAS,EAAEO,iDAAC,CARQ;AASpBN,oBAAkB,EAAEM,iDAAC,CATD;AAUpBL,sBAAoB,EAAEK,iDAAC,CAVH;AAWpBJ,2BAAyB,EAAEI,iDAAC,CAXR;AAYpB1B,aAAW,EAAE0B,iDAAC,CAACC;AAZK,CAAxBZ;AAeAA,WAAW,CAAXA,eAA2B;AACvBC,KAAG,EADoB;AAEvBC,KAAG,EAFoB;AAGvBnB,aAAW,EAHY;AAIvBqB,WAAS,EAJc;AAKvBC,oBAAkB,EALK;AAMvBpB,aAAW,EAAE;AANU,CAA3Be;AASA,4E;;;;;;;AC/MA,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 = 51);\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 = ({\n x,\n y,\n orientation,\n valueMarkerRectLength,\n alignCenter = false,\n}) => {\n let hLength = MARKER_THICKNESS;\n let vLength = valueMarkerRectLength;\n let markerStartX = alignCenter ? x - MARKER_THICKNESS / 2 : x - MARKER_THICKNESS;\n let 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 markerStartY = alignCenter ? y - MARKER_THICKNESS / 2 : y;\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, alignCenter = false }) => {\n // for horizontal view\n let labelRectX = alignCenter\n ? x - MARKER_LABEL_WIDTH / 2\n : x - MARKER_THICKNESS / 2 - MARKER_LABEL_WIDTH / 2;\n let labelRectY = y + length;\n if (orientation === 'vertical') {\n labelRectX = x + length;\n labelRectY = alignCenter\n ? y - MARKER_LABEL_HEIGHT / 2\n : 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 alignCenter,\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 alignCenter,\n });\n\n return (\n <g>\n <ValueMarkerRect\n data-test=\"value-marker-rect\"\n d={positionValueMarkerRect({ x, y, orientation, valueMarkerRectLength, alignCenter })}\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 alignCenter: T.bool,\n};\n\nValueMarker.defaultProps = {\n min: 0,\n max: 100,\n orientation: 'horizontal',\n showValue: true,\n usePercentageValue: false,\n alignCenter: false,\n};\n\nexport default ValueMarker;\n","module.exports = require(\"@babel/runtime/helpers/extends\");"],"sourceRoot":""}
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","alignCenter","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","bool"],"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,2D;;;;;;;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,eA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;AAEI,KAAC,EAFL;AAGI,KAAC,EAHL;AAII,SAAK,EAJT;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;AAzBJ;;AA+DAV,WAAW,CAAXA,YAAwB;AACpBnB,GAAC,EAAE8B,iDAAC,CADgB;AAEpB7B,GAAC,EAAE6B,iDAAC,CAFgB;AAGpBhB,QAAM,EAAEgB,iDAAC,CAHW;AAIpBV,KAAG,EAAEU,iDAAC,CAJc;AAKpBT,KAAG,EAAES,iDAAC,CALc;AAMpBR,OAAK,EAAEQ,iDAAC,CANY;AAOpB5B,aAAW,EAAE4B,iDAAC,CAPM;AAQpBP,WAAS,EAAEO,iDAAC,CARQ;AASpBN,oBAAkB,EAAEM,iDAAC,CATD;AAUpBL,sBAAoB,EAAEK,iDAAC,CAVH;AAWpBJ,2BAAyB,EAAEI,iDAAC,CAXR;AAYpB1B,aAAW,EAAE0B,iDAAC,CAACC;AAZK,CAAxBZ;AAeAA,WAAW,CAAXA,eAA2B;AACvBC,KAAG,EADoB;AAEvBC,KAAG,EAFoB;AAGvBnB,aAAW,EAHY;AAIvBqB,WAAS,EAJc;AAKvBC,oBAAkB,EALK;AAMvBpB,aAAW,EAAE;AANU,CAA3Be;AASA,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 = 62);\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 = ({\n x,\n y,\n orientation,\n valueMarkerRectLength,\n alignCenter = false,\n}) => {\n let hLength = MARKER_THICKNESS;\n let vLength = valueMarkerRectLength;\n let markerStartX = alignCenter ? x - MARKER_THICKNESS / 2 : x - MARKER_THICKNESS;\n let 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 markerStartY = alignCenter ? y - MARKER_THICKNESS / 2 : y;\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, alignCenter = false }) => {\n // for horizontal view\n let labelRectX = alignCenter\n ? x - MARKER_LABEL_WIDTH / 2\n : x - MARKER_THICKNESS / 2 - MARKER_LABEL_WIDTH / 2;\n let labelRectY = y + length;\n if (orientation === 'vertical') {\n labelRectX = x + length;\n labelRectY = alignCenter\n ? y - MARKER_LABEL_HEIGHT / 2\n : 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 alignCenter,\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 alignCenter,\n });\n\n return (\n <g>\n <ValueMarkerRect\n data-test=\"value-marker-rect\"\n d={positionValueMarkerRect({ x, y, orientation, valueMarkerRectLength, alignCenter })}\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 alignCenter: T.bool,\n};\n\nValueMarker.defaultProps = {\n min: 0,\n max: 100,\n orientation: 'horizontal',\n showValue: true,\n usePercentageValue: false,\n alignCenter: false,\n};\n\nexport default ValueMarker;\n"],"sourceRoot":""}