@splunk/visualizations 25.1.0 → 25.3.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 (184) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Background_Color_Red.png +0 -0
  2. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Basic.png +0 -0
  3. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_Simulated_Instance.png +0 -0
  4. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_for_Numeric_Field_Simulated_Instance.png +0 -0
  5. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Dark.png +0 -0
  6. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Light.png +0 -0
  7. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Background_color_cyan.png +0 -0
  8. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_after_default.png +0 -0
  9. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_before.png +0 -0
  10. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Background_Color_white_Under_Label_and_Unit_specified.png +0 -0
  11. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Major_Value_is_null.png +0 -0
  12. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_after_default.png +0 -0
  13. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_before.png +0 -0
  14. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
  15. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  16. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
  17. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  18. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  19. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  20. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Events_Editor.png +0 -0
  21. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  22. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
  23. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
  24. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  25. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  26. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
  27. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
  28. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  29. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  30. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
  31. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  32. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
  33. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
  34. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  35. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  36. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  37. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  38. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Background_Color_Light_Blue.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Basic_Events.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Event_Actions.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Actions.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary_Simulated_Instance.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields.png +0 -0
  45. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields_with_Highlight.png +0 -0
  46. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Show_Placeholder.png +0 -0
  47. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Value_Highlighting.png +0 -0
  48. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Height.png +0 -0
  49. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Percentage_50.png +0 -0
  50. package/.loki/reference/chrome_docker_Visualizations_Events_Events_With_Options.png +0 -0
  51. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_ES.png +0 -0
  52. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Background_Color_af575a.png +0 -0
  53. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Basic_Markdown.png +0 -0
  54. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Begin_with_Text_Instead_of_Header.png +0 -0
  55. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Color_purple.png +0 -0
  56. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Size_custom.png +0 -0
  57. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Size_extraLarge.png +0 -0
  58. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Markdown_with_number_as_DSL.png +0 -0
  59. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_after.png +0 -0
  60. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_before.png +0 -0
  61. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_After.png +0 -0
  62. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_Before.png +0 -0
  63. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_After.png +0 -0
  64. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_Before.png +0 -0
  65. package/Area.config.js +72 -22
  66. package/Area.config.js.map +1 -1
  67. package/Area.js +246 -185
  68. package/Area.js.map +1 -1
  69. package/Bar.config.js +17 -17
  70. package/Bar.config.js.map +1 -1
  71. package/Bar.js +191 -180
  72. package/Bar.js.map +1 -1
  73. package/Bubble.config.js +21 -14
  74. package/Bubble.config.js.map +1 -1
  75. package/Bubble.js +193 -175
  76. package/Bubble.js.map +1 -1
  77. package/ChoroplethSvg.config.js +6 -6
  78. package/ChoroplethSvg.config.js.map +1 -1
  79. package/ChoroplethSvg.js +180 -170
  80. package/ChoroplethSvg.js.map +1 -1
  81. package/Column.config.js +17 -17
  82. package/Column.config.js.map +1 -1
  83. package/Column.js +190 -180
  84. package/Column.js.map +1 -1
  85. package/Ellipse.config.js +3 -3
  86. package/Ellipse.config.js.map +1 -1
  87. package/Ellipse.js +144 -134
  88. package/Ellipse.js.map +1 -1
  89. package/Events.config.js +664 -0
  90. package/Events.config.js.map +1 -0
  91. package/Events.js +3114 -0
  92. package/Events.js.map +1 -0
  93. package/FillerGauge.config.js +20 -19
  94. package/FillerGauge.config.js.map +1 -1
  95. package/FillerGauge.js +183 -166
  96. package/FillerGauge.js.map +1 -1
  97. package/Image.config.js +5 -5
  98. package/Image.config.js.map +1 -1
  99. package/Image.js +128 -128
  100. package/Image.js.map +1 -1
  101. package/Line.config.js +73 -22
  102. package/Line.config.js.map +1 -1
  103. package/Line.js +253 -186
  104. package/Line.js.map +1 -1
  105. package/LinkGraph.config.js +15 -8
  106. package/LinkGraph.config.js.map +1 -1
  107. package/LinkGraph.js +25270 -434
  108. package/LinkGraph.js.map +1 -1
  109. package/Map.config.js +30 -29
  110. package/Map.config.js.map +1 -1
  111. package/Map.js +3064 -3125
  112. package/Map.js.map +1 -1
  113. package/Markdown.config.js +32 -10
  114. package/Markdown.config.js.map +1 -1
  115. package/Markdown.js +576 -529
  116. package/Markdown.js.map +1 -1
  117. package/MarkerGauge.config.js +16 -16
  118. package/MarkerGauge.config.js.map +1 -1
  119. package/MarkerGauge.js +1287 -1287
  120. package/MarkerGauge.js.map +1 -1
  121. package/ParallelCoordinates.config.js +14 -14
  122. package/ParallelCoordinates.config.js.map +1 -1
  123. package/ParallelCoordinates.js +532 -639
  124. package/ParallelCoordinates.js.map +1 -1
  125. package/Pie.config.js +16 -16
  126. package/Pie.config.js.map +1 -1
  127. package/Pie.js +1205 -1205
  128. package/Pie.js.map +1 -1
  129. package/Punchcard.config.js +14 -14
  130. package/Punchcard.config.js.map +1 -1
  131. package/Punchcard.js +2584 -2700
  132. package/Punchcard.js.map +1 -1
  133. package/Rectangle.config.js +7 -7
  134. package/Rectangle.config.js.map +1 -1
  135. package/Rectangle.js +726 -726
  136. package/Rectangle.js.map +1 -1
  137. package/Sankey.config.js +18 -18
  138. package/Sankey.config.js.map +1 -1
  139. package/Sankey.js +3132 -3253
  140. package/Sankey.js.map +1 -1
  141. package/Scatter.config.js +24 -16
  142. package/Scatter.config.js.map +1 -1
  143. package/Scatter.js +1402 -1395
  144. package/Scatter.js.map +1 -1
  145. package/SingleValue.config.js +11 -10
  146. package/SingleValue.config.js.map +1 -1
  147. package/SingleValue.js +2208 -2208
  148. package/SingleValue.js.map +1 -1
  149. package/SingleValueBasic.js +32 -32
  150. package/SingleValueBasic.js.map +1 -1
  151. package/SingleValueIcon.config.js +11 -10
  152. package/SingleValueIcon.config.js.map +1 -1
  153. package/SingleValueIcon.js +825 -966
  154. package/SingleValueIcon.js.map +1 -1
  155. package/SingleValueRadial.config.js +11 -10
  156. package/SingleValueRadial.config.js.map +1 -1
  157. package/SingleValueRadial.js +1897 -1897
  158. package/SingleValueRadial.js.map +1 -1
  159. package/Table.config.js +7 -7
  160. package/Table.config.js.map +1 -1
  161. package/Table.js +2158 -2155
  162. package/Table.js.map +1 -1
  163. package/common/EventsDoc.js +15 -8
  164. package/common/EventsDoc.js.map +1 -1
  165. package/common/GaugeMajorTicks.js +2 -2
  166. package/common/GaugeValueMarker.js +2 -2
  167. package/common/OptionsDoc.js +8 -8
  168. package/common/OptionsDoc.js.map +1 -1
  169. package/common/ThemesDoc.js +2 -2
  170. package/common/utils/configUtils.js +3 -3
  171. package/common/utils/configUtils.js.map +1 -1
  172. package/common/utils/dataUtils.js +136 -0
  173. package/common/utils/dataUtils.js.map +1 -0
  174. package/common/utils/hocUtils.js +2 -2
  175. package/common/utils/hocUtils.js.map +1 -1
  176. package/common/utils/mapUtils.js +11 -10
  177. package/common/utils/mapUtils.js.map +1 -1
  178. package/common/utils/singleValueUtils.js +3 -2
  179. package/common/utils/singleValueUtils.js.map +1 -1
  180. package/common/utils/testHelper.js +8 -8
  181. package/common/utils/testHelper.js.map +1 -1
  182. package/common/withDashboardViz.js +2 -2
  183. package/common/withDashboardViz.js.map +1 -1
  184. package/package.json +15 -13
package/MarkerGauge.js CHANGED
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 216);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 405);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -95,25 +95,32 @@ module.exports =
95
95
  /***/ 0:
96
96
  /***/ (function(module, exports) {
97
97
 
98
- module.exports = require("prop-types");
98
+ module.exports = require("react");
99
99
 
100
100
  /***/ }),
101
101
 
102
102
  /***/ 1:
103
103
  /***/ (function(module, exports) {
104
104
 
105
- module.exports = require("react");
105
+ module.exports = require("prop-types");
106
106
 
107
107
  /***/ }),
108
108
 
109
109
  /***/ 10:
110
110
  /***/ (function(module, exports) {
111
111
 
112
+ module.exports = require("@splunk/visualizations-shared/Message");
113
+
114
+ /***/ }),
115
+
116
+ /***/ 11:
117
+ /***/ (function(module, exports) {
118
+
112
119
  module.exports = require("@babel/runtime/helpers/classCallCheck");
113
120
 
114
121
  /***/ }),
115
122
 
116
- /***/ 102:
123
+ /***/ 110:
117
124
  /***/ (function(module, exports, __webpack_require__) {
118
125
 
119
126
  "use strict";
@@ -178,22 +185,22 @@ exports.default = gauge;
178
185
 
179
186
  /***/ }),
180
187
 
181
- /***/ 103:
188
+ /***/ 111:
182
189
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
183
190
 
184
191
  "use strict";
185
192
  __webpack_require__.r(__webpack_exports__);
186
193
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MajorTick", function() { return MajorTick; });
187
194
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionMajorTick", function() { return positionMajorTick; });
188
- /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47);
195
+ /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48);
189
196
  /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
190
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
197
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
191
198
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
192
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
199
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
193
200
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
194
201
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
195
202
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
196
- /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26);
203
+ /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30);
197
204
  /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__);
198
205
 
199
206
 
@@ -433,22 +440,22 @@ MajorTicks.defaultProps = {
433
440
 
434
441
  /***/ }),
435
442
 
436
- /***/ 104:
443
+ /***/ 112:
437
444
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
438
445
 
439
446
  "use strict";
440
447
  __webpack_require__.r(__webpack_exports__);
441
448
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionValueMarkerRect", function() { return positionValueMarkerRect; });
442
449
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionLabel", function() { return positionLabel; });
443
- /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47);
450
+ /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48);
444
451
  /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
445
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
452
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
446
453
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
447
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
454
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
448
455
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
449
456
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
450
457
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
451
- /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26);
458
+ /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30);
452
459
  /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__);
453
460
 
454
461
 
@@ -635,14 +642,14 @@ ValueMarker.defaultProps = {
635
642
 
636
643
  /***/ }),
637
644
 
638
- /***/ 11:
645
+ /***/ 12:
639
646
  /***/ (function(module, exports) {
640
647
 
641
648
  module.exports = require("@splunk/visualizations-shared/colorUtils");
642
649
 
643
650
  /***/ }),
644
651
 
645
- /***/ 12:
652
+ /***/ 13:
646
653
  /***/ (function(module, exports, __webpack_require__) {
647
654
 
648
655
  "use strict";
@@ -652,15 +659,15 @@ Object.defineProperty(exports, "__esModule", {
652
659
  value: true
653
660
  });
654
661
 
655
- var React = __webpack_require__(1);
662
+ var React = __webpack_require__(0);
656
663
 
657
664
  var styled_components_1 = __webpack_require__(4);
658
665
 
659
- var SizeAwareWrapper_1 = __webpack_require__(19);
666
+ var SizeAwareWrapper_1 = __webpack_require__(20);
660
667
 
661
- var style_1 = __webpack_require__(14);
668
+ var style_1 = __webpack_require__(15);
662
669
 
663
- var colorUtils_1 = __webpack_require__(11);
670
+ var colorUtils_1 = __webpack_require__(12);
664
671
 
665
672
  var Item = styled_components_1.default.div.attrs(function (_ref) {
666
673
  var width = _ref.width;
@@ -717,7 +724,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
717
724
 
718
725
  return React.createElement(FixSizeItem, {
719
726
  "data-test": "fix-size-item",
720
- "data-splunk-visualization-version": "25.1.0 - 812a9a4d8",
727
+ "data-splunk-visualization-version": "25.3.0 - dae70ec02",
721
728
  width: width,
722
729
  height: height,
723
730
  backgroundColor: backgroundColor
@@ -739,7 +746,7 @@ exports.default = withFixedSizeContainer;
739
746
 
740
747
  /***/ }),
741
748
 
742
- /***/ 13:
749
+ /***/ 14:
743
750
  /***/ (function(module, exports, __webpack_require__) {
744
751
 
745
752
  "use strict";
@@ -772,7 +779,7 @@ exports.extendStaticWrapperProps = extendStaticWrapperProps;
772
779
 
773
780
  /***/ }),
774
781
 
775
- /***/ 134:
782
+ /***/ 144:
776
783
  /***/ (function(module, exports, __webpack_require__) {
777
784
 
778
785
  "use strict";
@@ -798,15 +805,15 @@ exports.config = exports.computeVizProps = exports.PureMarkerGauge = void 0;
798
805
 
799
806
  var lodash_1 = __webpack_require__(3);
800
807
 
801
- var MarkerGauge_1 = __webpack_require__(217);
808
+ var MarkerGauge_1 = __webpack_require__(406);
802
809
 
803
- var config_1 = __webpack_require__(219);
810
+ var config_1 = __webpack_require__(408);
804
811
 
805
812
  exports.config = config_1.default;
806
813
 
807
- var withDashboardViz_1 = __webpack_require__(31);
814
+ var withDashboardViz_1 = __webpack_require__(32);
808
815
 
809
- var gaugeUtils_1 = __webpack_require__(80);
816
+ var gaugeUtils_1 = __webpack_require__(85);
810
817
 
811
818
  exports.PureMarkerGauge = MarkerGauge_1.default;
812
819
  var validOptions = Object.keys(config_1.default.optionsSchema);
@@ -835,29 +842,29 @@ exports.default = viz;
835
842
 
836
843
  /***/ }),
837
844
 
838
- /***/ 14:
845
+ /***/ 15:
839
846
  /***/ (function(module, exports) {
840
847
 
841
848
  module.exports = require("@splunk/visualizations-shared/style");
842
849
 
843
850
  /***/ }),
844
851
 
845
- /***/ 15:
852
+ /***/ 16:
846
853
  /***/ (function(module, exports) {
847
854
 
848
855
  module.exports = require("@splunk/visualizations-shared/schemaUtils");
849
856
 
850
857
  /***/ }),
851
858
 
852
- /***/ 16:
859
+ /***/ 17:
853
860
  /***/ (function(module, exports, __webpack_require__) {
854
861
 
855
862
  "use strict";
856
863
 
857
864
 
858
- var _toConsumableArray = __webpack_require__(7);
865
+ var _toConsumableArray = __webpack_require__(8);
859
866
 
860
- var _defineProperty = __webpack_require__(6);
867
+ var _defineProperty = __webpack_require__(7);
861
868
 
862
869
  var __rest = this && this.__rest || function (s, e) {
863
870
  var t = {};
@@ -879,9 +886,9 @@ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig
879
886
 
880
887
  var lodash_1 = __webpack_require__(3);
881
888
 
882
- var schemaUtils_1 = __webpack_require__(15);
889
+ var schemaUtils_1 = __webpack_require__(16);
883
890
 
884
- var VizBehavior_1 = __webpack_require__(5);
891
+ var VizBehavior_1 = __webpack_require__(6);
885
892
 
886
893
  var dynamicOptionsDSLType = {
887
894
  type: 'string',
@@ -957,7 +964,7 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
957
964
  */
958
965
 
959
966
  function enhanceConfig(vizConfig) {
960
- var enhancedConfig = vizConfig;
967
+ var enhancedConfig = Object.assign({}, vizConfig);
961
968
 
962
969
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
963
970
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
@@ -965,7 +972,7 @@ function enhanceConfig(vizConfig) {
965
972
 
966
973
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
967
974
  return Object.assign(Object.assign({}, config), {
968
- open: false
975
+ open: config.open || false
969
976
  });
970
977
  });
971
978
  return enhancedConfig;
@@ -980,7 +987,7 @@ exports.enhanceConfig = enhanceConfig;
980
987
  */
981
988
 
982
989
  function uncollapseEditorConfig(vizConfig) {
983
- var editorPanelUncollapsedConfig = vizConfig;
990
+ var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
984
991
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
985
992
  return Object.assign(Object.assign({}, config), {
986
993
  open: true
@@ -1086,24 +1093,24 @@ exports.insertLayout = insertLayout;
1086
1093
 
1087
1094
  /***/ }),
1088
1095
 
1089
- /***/ 18:
1096
+ /***/ 19:
1090
1097
  /***/ (function(module, exports) {
1091
1098
 
1092
1099
  module.exports = require("@babel/runtime/helpers/createClass");
1093
1100
 
1094
1101
  /***/ }),
1095
1102
 
1096
- /***/ 19:
1103
+ /***/ 2:
1097
1104
  /***/ (function(module, exports) {
1098
1105
 
1099
- module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
1106
+ module.exports = require("@splunk/ui-utils/i18n");
1100
1107
 
1101
1108
  /***/ }),
1102
1109
 
1103
- /***/ 2:
1110
+ /***/ 20:
1104
1111
  /***/ (function(module, exports) {
1105
1112
 
1106
- module.exports = require("@splunk/ui-utils/i18n");
1113
+ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
1107
1114
 
1108
1115
  /***/ }),
1109
1116
 
@@ -1114,949 +1121,763 @@ module.exports = require("@splunk/themes/pick");
1114
1121
 
1115
1122
  /***/ }),
1116
1123
 
1117
- /***/ 216:
1118
- /***/ (function(module, exports, __webpack_require__) {
1124
+ /***/ 23:
1125
+ /***/ (function(module, exports) {
1119
1126
 
1120
- "use strict";
1127
+ module.exports = require("@splunk/visualization-context/TimezoneContext");
1121
1128
 
1129
+ /***/ }),
1122
1130
 
1123
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1124
- if (k2 === undefined) k2 = k;
1125
- Object.defineProperty(o, k2, {
1126
- enumerable: true,
1127
- get: function get() {
1128
- return m[k];
1129
- }
1130
- });
1131
- } : function (o, m, k, k2) {
1132
- if (k2 === undefined) k2 = k;
1133
- o[k2] = m[k];
1134
- });
1131
+ /***/ 25:
1132
+ /***/ (function(module, exports) {
1133
+
1134
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
1135
+
1136
+ /***/ }),
1137
+
1138
+ /***/ 26:
1139
+ /***/ (function(module, exports) {
1140
+
1141
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
1142
+
1143
+ /***/ }),
1144
+
1145
+ /***/ 27:
1146
+ /***/ (function(module, exports, __webpack_require__) {
1147
+
1148
+ "use strict";
1135
1149
 
1136
- var __exportStar = this && this.__exportStar || function (m, exports) {
1137
- for (var p in m) {
1138
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1139
- }
1140
- };
1141
1150
 
1142
1151
  Object.defineProperty(exports, "__esModule", {
1143
1152
  value: true
1144
1153
  });
1145
- exports.default = void 0;
1154
+ exports.shouldShowIconPlaceholder = void 0;
1146
1155
 
1147
- __exportStar(__webpack_require__(134), exports);
1156
+ var React = __webpack_require__(0);
1148
1157
 
1149
- var MarkerGauge_1 = __webpack_require__(134);
1158
+ var T = __webpack_require__(1);
1150
1159
 
1151
- Object.defineProperty(exports, "default", {
1152
- enumerable: true,
1153
- get: function get() {
1154
- return MarkerGauge_1.default;
1155
- }
1156
- });
1160
+ var lodash_1 = __webpack_require__(3);
1157
1161
 
1158
- /***/ }),
1162
+ var i18n_1 = __webpack_require__(2);
1159
1163
 
1160
- /***/ 217:
1161
- /***/ (function(module, exports, __webpack_require__) {
1164
+ var Message_1 = __webpack_require__(10);
1162
1165
 
1163
- "use strict";
1166
+ var FixedSizeContainer_1 = __webpack_require__(13);
1167
+ /**
1168
+ * @method shouldShowIconPlaceholder
1169
+ * @param {object} dataSources
1170
+ * @param {boolean} loading
1171
+ * @returns {boolean}
1172
+ */
1164
1173
 
1165
1174
 
1166
- var __rest = this && this.__rest || function (s, e) {
1167
- var t = {};
1175
+ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
1176
+ var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1177
+ var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1178
+ var noData = data === undefined;
1179
+ var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1180
+ var noFields = fields === undefined;
1181
+ return loading || noData || noFields;
1182
+ };
1168
1183
 
1169
- for (var p in s) {
1170
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1171
- }
1184
+ exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
1185
+ var propTypes = {
1186
+ icon: T.func,
1187
+ width: T.oneOfType([T.string, T.number]),
1188
+ height: T.oneOfType([T.string, T.number]),
1189
+ // eslint-disable-next-line react/no-unused-prop-types
1190
+ backgroundColor: T.string,
1191
+ iconColor: T.string
1192
+ };
1193
+ /**
1194
+ * @method IconPlaceholder
1195
+ * @param {IconPlaceholderProps} props
1196
+ * @returns {React.ReactElement}
1197
+ */
1172
1198
 
1173
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1174
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1199
+ var IconPlaceholder = function IconPlaceholder(props) {
1200
+ var width = props.width,
1201
+ height = props.height,
1202
+ icon = props.icon,
1203
+ iconColor = props.iconColor;
1204
+
1205
+ if (icon) {
1206
+ return React.createElement(icon, {
1207
+ style: {
1208
+ left: '50%',
1209
+ top: '50%',
1210
+ color: iconColor,
1211
+ opacity: 0.15,
1212
+ position: 'absolute',
1213
+ transform: 'translate(-50%, -50%)'
1214
+ },
1215
+ width: '50%',
1216
+ height: '50%'
1217
+ });
1175
1218
  }
1176
- return t;
1219
+
1220
+ return React.createElement(Message_1.default, {
1221
+ width: width,
1222
+ height: height,
1223
+ level: "warning",
1224
+ message: i18n_1._('No DataSource Connected')
1225
+ });
1226
+ };
1227
+
1228
+ IconPlaceholder.propTypes = propTypes;
1229
+ IconPlaceholder.defaultProps = {
1230
+ width: '100%',
1231
+ height: 250
1177
1232
  };
1233
+ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1234
+
1235
+ /***/ }),
1236
+
1237
+ /***/ 28:
1238
+ /***/ (function(module, exports, __webpack_require__) {
1239
+
1240
+ "use strict";
1241
+
1242
+
1243
+ var _defineProperty = __webpack_require__(7);
1178
1244
 
1179
1245
  Object.defineProperty(exports, "__esModule", {
1180
1246
  value: true
1181
1247
  });
1248
+ exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1182
1249
 
1183
- var React = __webpack_require__(1);
1250
+ var T = __webpack_require__(1);
1184
1251
 
1185
- var react_1 = __webpack_require__(1);
1252
+ var lodash_1 = __webpack_require__(3);
1186
1253
 
1187
- var T = __webpack_require__(0);
1254
+ var DataSource_1 = __webpack_require__(39);
1188
1255
 
1189
- var styled_components_1 = __webpack_require__(4);
1256
+ exports.SortParamsPropTypes = T.shape({
1257
+ currentSortKey: T.string,
1258
+ currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1259
+ onSort: T.func
1260
+ });
1190
1261
 
1191
- var lodash_1 = __webpack_require__(3);
1262
+ var getSortingParams = function getSortingParams(_ref) {
1263
+ var requestParams = _ref.requestParams,
1264
+ onRequestParamsChange = _ref.onRequestParamsChange;
1265
+ var currentSortKey;
1266
+ var currentSortDir;
1267
+ var nextSortDirMap = {
1268
+ asc: 'desc',
1269
+ desc: 'asc',
1270
+ none: 'asc'
1271
+ };
1272
+ var onSort;
1192
1273
 
1193
- var i18n_1 = __webpack_require__(2);
1274
+ if (lodash_1.isFunction(onRequestParamsChange)) {
1275
+ if (requestParams && lodash_1.has(requestParams, 'sort')) {
1276
+ currentSortKey = Object.keys(requestParams.sort).shift();
1277
+ currentSortDir = requestParams.sort[currentSortKey];
1278
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1279
+
1280
+
1281
+ onSort = function onSort(e, _ref2) {
1282
+ var sortKey = _ref2.sortKey,
1283
+ sortDir = _ref2.sortDir;
1194
1284
 
1195
- var style_1 = __webpack_require__(14);
1285
+ if (typeof sortKey === 'string') {
1286
+ var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1287
+ onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1288
+ offset: 0,
1289
+ sort: _defineProperty({}, sortKey, nextSortDir)
1290
+ }));
1291
+ } else {
1292
+ onRequestParamsChange(requestParams);
1293
+ }
1294
+ };
1295
+ }
1196
1296
 
1197
- var SizeAwareWrapper_1 = __webpack_require__(19);
1297
+ return {
1298
+ currentSortKey: currentSortKey,
1299
+ currentSortDir: currentSortDir,
1300
+ onSort: onSort
1301
+ };
1302
+ };
1198
1303
 
1199
- var Message_1 = __webpack_require__(9);
1304
+ exports.getSortingParams = getSortingParams;
1200
1305
 
1201
- var id_1 = __webpack_require__(218);
1306
+ /***/ }),
1202
1307
 
1203
- var gaugeUtils_1 = __webpack_require__(80);
1308
+ /***/ 29:
1309
+ /***/ (function(module, exports, __webpack_require__) {
1204
1310
 
1205
- var GaugeMajorTicks_1 = __webpack_require__(103);
1311
+ "use strict";
1206
1312
 
1207
- var GaugeValueMarker_1 = __webpack_require__(104);
1208
1313
 
1209
- var MAX_VERTICAL_CONTAINER_WIDTH = 200;
1210
- var MIN_VERTICAL_CONTAINER_HEIGHT = 200;
1211
- var MIN_HORIZONTAL_CONTAINER_WIDTH = 200;
1212
- var MIN_HORIZONTAL_CONTAINER_HEIGHT = 100;
1213
- var Container = styled_components_1.default.div.withConfig({
1214
- displayName: "MarkerGauge__Container",
1215
- componentId: "sc-10z02va-0"
1216
- })(["overflow:hidden;", ";background-color:", ";"], function (props) {
1217
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
1218
- }, function (props) {
1219
- return props.backgroundColor;
1220
- });
1221
- var MarkerGaugeWrapper = styled_components_1.default.div.withConfig({
1222
- displayName: "MarkerGauge__MarkerGaugeWrapper",
1223
- componentId: "sc-10z02va-1"
1224
- })(["display:flex;justify-content:center;flex-direction:row;width:100%;height:100%;background-color:", ";"], function (props) {
1225
- return props.backgroundColor;
1226
- });
1227
- var MarkerGaugeContainer = styled_components_1.default.div.withConfig({
1228
- displayName: "MarkerGauge__MarkerGaugeContainer",
1229
- componentId: "sc-10z02va-2"
1230
- })(["overflow:hidden;position:relative;", ";"], function (props) {
1231
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
1314
+ Object.defineProperty(exports, "__esModule", {
1315
+ value: true
1232
1316
  });
1233
- var MarkerGaugeSVG = styled_components_1.default.svg.withConfig({
1234
- displayName: "MarkerGauge__MarkerGaugeSVG",
1235
- componentId: "sc-10z02va-3"
1236
- })(["", ";"], function (props) {
1237
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
1317
+ exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1318
+
1319
+ var T = __webpack_require__(1);
1320
+
1321
+ var lodash_1 = __webpack_require__(3);
1322
+
1323
+ exports.PaginatorParamsPropTypes = T.shape({
1324
+ isPaging: T.bool,
1325
+ current: T.number,
1326
+ totalPages: T.number,
1327
+ onChange: T.func
1238
1328
  });
1239
- var BackgroundBar = styled_components_1.default.rect.attrs({
1240
- 'data-test': 'background-bar-rect'
1241
- }).withConfig({
1242
- displayName: "MarkerGauge__BackgroundBar",
1243
- componentId: "sc-10z02va-4"
1244
- })(["fill:", ";"], function (props) {
1245
- return props.fillColor;
1329
+
1330
+ var getPaginationParams = function getPaginationParams(_ref) {
1331
+ var requestParams = _ref.requestParams,
1332
+ meta = _ref.meta,
1333
+ onRequestParamsChange = _ref.onRequestParamsChange;
1334
+ var totalCount = meta && meta.totalCount || 0;
1335
+ var offset = requestParams && requestParams.offset || 0;
1336
+ var count = requestParams && requestParams.count;
1337
+ var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1338
+ var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1339
+ var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
1340
+
1341
+ var onChangeHandler = function onChangeHandler(e, _ref2) {
1342
+ var page = _ref2.page,
1343
+ countArg = _ref2.count;
1344
+ var newParams = lodash_1.cloneDeep(requestParams);
1345
+
1346
+ if (typeof countArg === 'number') {
1347
+ newParams.count = countArg;
1348
+ newParams.offset = 0;
1349
+ }
1350
+
1351
+ var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1352
+
1353
+ if (typeof page === 'number' && page > 0) {
1354
+ newParams.count = pageCount;
1355
+ newParams.offset = (page - 1) * pageCount;
1356
+ }
1357
+
1358
+ onRequestParamsChange(newParams);
1359
+ };
1360
+
1361
+ return {
1362
+ isPaging: isPaging,
1363
+ current: current,
1364
+ totalPages: totalPages,
1365
+ onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
1366
+ };
1367
+ };
1368
+
1369
+ exports.getPaginationParams = getPaginationParams;
1370
+
1371
+ /***/ }),
1372
+
1373
+ /***/ 3:
1374
+ /***/ (function(module, exports) {
1375
+
1376
+ module.exports = require("lodash");
1377
+
1378
+ /***/ }),
1379
+
1380
+ /***/ 30:
1381
+ /***/ (function(module, exports) {
1382
+
1383
+ module.exports = require("@splunk/visualizations-shared/numberUtils");
1384
+
1385
+ /***/ }),
1386
+
1387
+ /***/ 31:
1388
+ /***/ (function(module, exports, __webpack_require__) {
1389
+
1390
+ "use strict";
1391
+
1392
+
1393
+ Object.defineProperty(exports, "__esModule", {
1394
+ value: true
1246
1395
  });
1247
- var MarkerBar = styled_components_1.default.rect.attrs({
1248
- 'data-test': 'marker-bar-rect'
1249
- }).withConfig({
1250
- displayName: "MarkerGauge__MarkerBar",
1251
- componentId: "sc-10z02va-5"
1252
- })([""]);
1396
+ exports.VizCategory = void 0;
1397
+ var VizCategory;
1253
1398
 
1254
- var MarkerGauge = function MarkerGauge(_a) {
1255
- var props = __rest(_a, []);
1399
+ (function (VizCategory) {
1400
+ VizCategory["SINGLE_VALUE"] = "Single Value";
1401
+ VizCategory["TRENDS"] = "Trends";
1402
+ VizCategory["COMPARISONS"] = "Comparisons";
1403
+ VizCategory["TABLE"] = "Table";
1404
+ VizCategory["GAUGE"] = "Gauge";
1405
+ VizCategory["DISTRIBUTIONS"] = "Distributions";
1406
+ VizCategory["CHOROPLETH"] = "Choropleth Maps";
1407
+ VizCategory["SHAPES"] = "Shapes";
1408
+ VizCategory["MISC"] = "misc";
1409
+ VizCategory["FLOW"] = "Flow";
1410
+ VizCategory["CORRELATION"] = "Correlation";
1411
+ VizCategory["SPATIAL"] = "Spatial";
1412
+ })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
1256
1413
 
1257
- var width = props.width,
1258
- height = props.height,
1259
- value = props.value,
1260
- orientation = props.orientation,
1261
- majorUnit = props.majorUnit,
1262
- showLabels = props.showLabels,
1263
- showValue = props.showValue,
1264
- usePercentageRange = props.usePercentageRange,
1265
- usePercentageValue = props.usePercentageValue,
1266
- backgroundColor = props.backgroundColor,
1267
- fillColor = props.fillColor,
1268
- ranges = props.ranges,
1269
- majorTickFillColor = props.majorTickFillColor,
1270
- majorTickStrokeColor = props.majorTickStrokeColor,
1271
- valueMarkerFillColor = props.valueMarkerFillColor,
1272
- valueMarkerLabelFillColor = props.valueMarkerLabelFillColor;
1273
- /**
1274
- * Standard error message render
1275
- */
1414
+ /***/ }),
1276
1415
 
1277
- var errorMessage = react_1.useCallback(function (containerWidth, containerHeight, err, errID) {
1278
- return React.createElement(Message_1.default, {
1279
- width: containerWidth,
1280
- height: containerHeight,
1281
- message: err,
1282
- level: "info",
1283
- id: errID
1284
- });
1285
- }, []);
1286
- var errorId = react_1.useMemo(function () {
1287
- return id_1.createDOMID();
1288
- }, []);
1289
- /**
1290
- * Pre-calculate linearGradientId, error, sortedRanges, gauge range and linear gradient
1291
- */
1416
+ /***/ 32:
1417
+ /***/ (function(module, exports, __webpack_require__) {
1292
1418
 
1293
- var error = react_1.useMemo(function () {
1294
- return gaugeUtils_1.validateRanges(ranges);
1295
- }, [ranges]);
1296
- var sortedRanges = react_1.useMemo(function () {
1297
- return gaugeUtils_1.getSortedRanges(ranges);
1298
- }, [ranges]);
1419
+ "use strict";
1299
1420
 
1300
- var _react_1$useMemo = react_1.useMemo(function () {
1301
- return gaugeUtils_1.getGaugeRange(sortedRanges);
1302
- }, [sortedRanges]),
1303
- min = _react_1$useMemo.min,
1304
- max = _react_1$useMemo.max;
1305
1421
 
1306
- var linearGradientId = react_1.useMemo(function () {
1307
- return id_1.createDOMID('marker');
1308
- }, []);
1309
- var linearGradient = react_1.useMemo(function () {
1310
- var stops = gaugeUtils_1.getGradientStops({
1311
- ranges: sortedRanges,
1312
- orientation: orientation
1313
- });
1422
+ Object.defineProperty(exports, "__esModule", {
1423
+ value: true
1424
+ });
1314
1425
 
1315
- var _gaugeUtils_1$getGrad = gaugeUtils_1.getGradientDimensions(orientation),
1316
- x1 = _gaugeUtils_1$getGrad.x1,
1317
- y1 = _gaugeUtils_1$getGrad.y1,
1318
- x2 = _gaugeUtils_1$getGrad.x2,
1319
- y2 = _gaugeUtils_1$getGrad.y2;
1426
+ var React = __webpack_require__(0);
1320
1427
 
1321
- var linearGradientStops = stops.map(function (stop) {
1322
- return React.createElement("stop", {
1323
- key: "".concat(stop.offset, "_").concat(stop.stopColor),
1324
- offset: stop.offset,
1325
- stopColor: stop.stopColor
1326
- });
1327
- });
1328
- return React.createElement("linearGradient", {
1329
- id: linearGradientId,
1330
- x1: x1,
1331
- y1: y1,
1332
- x2: x2,
1333
- y2: y2
1334
- }, linearGradientStops);
1335
- }, [sortedRanges, orientation, linearGradientId]);
1336
- /**
1337
- * Calculate marker gauge dimensions
1338
- */
1428
+ var lodash_1 = __webpack_require__(3);
1339
1429
 
1340
- var calculateMarkerGaugeDimensions = react_1.useCallback(function (containerWidth, containerHeight) {
1341
- var _gaugeUtils_1$getGaug = gaugeUtils_1.getGaugeDimensions({
1342
- containerWidth: containerWidth,
1343
- containerHeight: containerHeight,
1344
- orientation: orientation
1345
- }),
1346
- gaugeLength = _gaugeUtils_1$getGaug.gaugeLength,
1347
- gaugeStartX = _gaugeUtils_1$getGaug.gaugeStartX,
1348
- gaugeStartY = _gaugeUtils_1$getGaug.gaugeStartY,
1349
- gaugeWidth = _gaugeUtils_1$getGaug.gaugeWidth,
1350
- gaugeHeight = _gaugeUtils_1$getGaug.gaugeHeight;
1430
+ var getSettingsFromThemedProps_1 = __webpack_require__(33);
1351
1431
 
1352
- var _gaugeUtils_1$getMark = gaugeUtils_1.getMarkerBarDimensions({
1353
- gaugeLength: gaugeLength,
1354
- gaugeStartX: gaugeStartX,
1355
- gaugeStartY: gaugeStartY,
1356
- gaugeWidth: gaugeWidth,
1357
- gaugeHeight: gaugeHeight,
1358
- orientation: orientation
1359
- }),
1360
- markerBarLength = _gaugeUtils_1$getMark.markerBarLength,
1361
- markerBarX = _gaugeUtils_1$getMark.markerBarX,
1362
- markerBarY = _gaugeUtils_1$getMark.markerBarY,
1363
- markerBarWidth = _gaugeUtils_1$getMark.markerBarWidth,
1364
- markerBarHeight = _gaugeUtils_1$getMark.markerBarHeight;
1432
+ var Options_1 = __webpack_require__(34);
1365
1433
 
1366
- var _gaugeUtils_1$getMark2 = gaugeUtils_1.getMarkerGaugeValueMarkerPositions({
1367
- markerBarX: markerBarX,
1368
- markerBarY: markerBarY,
1369
- markerBarHeight: markerBarHeight,
1370
- markerBarLength: markerBarLength,
1371
- orientation: orientation,
1372
- value: value,
1373
- min: min,
1374
- max: max
1375
- }),
1376
- valueMarkerX = _gaugeUtils_1$getMark2.valueMarkerX,
1377
- valueMarkerY = _gaugeUtils_1$getMark2.valueMarkerY;
1434
+ var SanitizeProps_1 = __webpack_require__(35);
1378
1435
 
1379
- return {
1380
- markerBarX: markerBarX,
1381
- markerBarY: markerBarY,
1382
- markerBarWidth: markerBarWidth,
1383
- markerBarHeight: markerBarHeight,
1384
- valueMarkerX: valueMarkerX,
1385
- valueMarkerY: valueMarkerY,
1386
- gaugeStartX: gaugeStartX,
1387
- gaugeStartY: gaugeStartY,
1388
- gaugeWidth: gaugeWidth,
1389
- gaugeHeight: gaugeHeight
1390
- };
1391
- }, [orientation, value, min, max]);
1392
- var renderVisualization = react_1.useCallback(function (_ref) {
1393
- var containerWidth = _ref.width,
1394
- containerHeight = _ref.height;
1436
+ var TimezoneContext_1 = __webpack_require__(23);
1395
1437
 
1396
- // todo: need change the size when get design for smaller space
1397
- // 58 is the title & description header height in dashboard visualization
1398
- if ((containerWidth < MAX_VERTICAL_CONTAINER_WIDTH || containerHeight + 58 < MIN_VERTICAL_CONTAINER_HEIGHT) && orientation === 'vertical' || (containerWidth < MIN_HORIZONTAL_CONTAINER_WIDTH || containerHeight < MIN_HORIZONTAL_CONTAINER_HEIGHT) && orientation === 'horizontal') {
1399
- return errorMessage(containerWidth, containerHeight, i18n_1._('Too small to render content'), errorId);
1400
- }
1438
+ var moment_1 = __webpack_require__(36);
1401
1439
 
1402
- if (error) {
1403
- return errorMessage(containerWidth, containerHeight, error, errorId);
1404
- }
1440
+ var styled_components_1 = __webpack_require__(4);
1405
1441
 
1406
- var _calculateMarkerGauge = calculateMarkerGaugeDimensions(containerWidth, containerHeight),
1407
- markerBarX = _calculateMarkerGauge.markerBarX,
1408
- markerBarY = _calculateMarkerGauge.markerBarY,
1409
- markerBarWidth = _calculateMarkerGauge.markerBarWidth,
1410
- markerBarHeight = _calculateMarkerGauge.markerBarHeight,
1411
- valueMarkerX = _calculateMarkerGauge.valueMarkerX,
1412
- valueMarkerY = _calculateMarkerGauge.valueMarkerY,
1413
- gaugeStartX = _calculateMarkerGauge.gaugeStartX,
1414
- gaugeStartY = _calculateMarkerGauge.gaugeStartY,
1415
- gaugeWidth = _calculateMarkerGauge.gaugeWidth,
1416
- gaugeHeight = _calculateMarkerGauge.gaugeHeight;
1442
+ var hocUtils_1 = __webpack_require__(25);
1417
1443
 
1418
- return React.createElement(MarkerGaugeWrapper, {
1419
- backgroundColor: backgroundColor
1420
- }, React.createElement(MarkerGaugeContainer, {
1421
- width: containerWidth,
1422
- height: containerHeight
1423
- }, React.createElement(MarkerGaugeSVG, {
1424
- width: containerWidth,
1425
- height: containerHeight
1426
- }, linearGradient, React.createElement(BackgroundBar, {
1427
- x: gaugeStartX,
1428
- y: gaugeStartY,
1429
- width: gaugeWidth,
1430
- height: gaugeHeight,
1431
- fillColor: fillColor
1432
- }), React.createElement(GaugeMajorTicks_1.default, {
1433
- width: gaugeWidth,
1434
- height: gaugeHeight,
1435
- startX: gaugeStartX,
1436
- startY: gaugeStartY,
1437
- min: min,
1438
- max: max,
1439
- majorUnit: majorUnit,
1440
- orientation: orientation,
1441
- showLabels: showLabels,
1442
- usePercentageRange: usePercentageRange,
1443
- majorTickFillColor: majorTickFillColor,
1444
- majorTickStrokeColor: majorTickStrokeColor
1445
- }), React.createElement(MarkerBar, {
1446
- x: markerBarX,
1447
- y: markerBarY,
1448
- width: markerBarWidth,
1449
- height: markerBarHeight,
1450
- fill: "url(#".concat(linearGradientId, ")")
1451
- }), React.createElement(GaugeValueMarker_1.default, {
1452
- x: valueMarkerX,
1453
- y: valueMarkerY,
1454
- length: gaugeUtils_1.GAUGE_THICKNESS,
1455
- min: min,
1456
- max: max,
1457
- value: value,
1458
- orientation: orientation,
1459
- showValue: showValue,
1460
- usePercentageValue: usePercentageValue,
1461
- valueMarkerFillColor: valueMarkerFillColor,
1462
- valueMarkerLabelFillColor: valueMarkerLabelFillColor
1463
- }))));
1464
- }, [orientation, error, calculateMarkerGaugeDimensions, backgroundColor, linearGradient, fillColor, min, max, majorUnit, showLabels, usePercentageRange, majorTickFillColor, majorTickStrokeColor, linearGradientId, value, showValue, usePercentageValue, valueMarkerFillColor, valueMarkerLabelFillColor, errorMessage, errorId]);
1465
- return React.createElement(Container, {
1466
- width: width,
1467
- height: height,
1468
- backgroundColor: backgroundColor
1469
- }, React.createElement(SizeAwareWrapper_1.default, null, function (containerDimension) {
1470
- return renderVisualization(containerDimension);
1471
- }));
1472
- };
1444
+ var JSONSchemaUtils_1 = __webpack_require__(26);
1473
1445
 
1474
- MarkerGauge.propTypes = {
1475
- width: T.oneOfType([T.string, T.number]),
1476
- height: T.oneOfType([T.string, T.number]),
1477
- value: T.number,
1478
- // valueFieldName: T.string, // todo: need add it back when displaying name later
1479
- orientation: T.oneOf(['horizontal', 'vertical']),
1480
- majorUnit: T.oneOfType([T.string, T.number]),
1481
- showLabels: T.bool,
1482
- showValue: T.bool,
1483
- usePercentageRange: T.bool,
1484
- usePercentageValue: T.bool,
1485
- backgroundColor: T.string,
1486
- fillColor: T.string,
1487
- ranges: T.arrayOf(T.shape({
1488
- from: T.number.isRequired,
1489
- to: T.number.isRequired,
1490
- value: T.string.isRequired
1491
- })),
1492
- majorTickFillColor: T.string,
1493
- majorTickStrokeColor: T.string,
1494
- valueMarkerFillColor: T.string,
1495
- valueMarkerLabelFillColor: T.string
1496
- };
1497
- MarkerGauge.defaultProps = {
1498
- width: '100%',
1499
- height: 250,
1500
- orientation: 'vertical',
1501
- majorUnit: 'auto',
1502
- showLabels: true,
1503
- showValue: true,
1504
- usePercentageRange: false,
1505
- usePercentageValue: false,
1506
- backgroundColor: 'transparent',
1507
- value: 0,
1508
- fillColor: '#f2f4f5',
1509
- majorTickFillColor: '#3c444d',
1510
- majorTickStrokeColor: '#6b7785',
1511
- valueMarkerFillColor: '#3c444d',
1512
- valueMarkerLabelFillColor: '#f2f4f5',
1513
- ranges: [{
1514
- from: 0,
1515
- to: 50,
1516
- value: '#4BEBA8'
1517
- }, {
1518
- from: 50,
1519
- to: 90,
1520
- value: '#F4DF7A'
1521
- }, {
1522
- from: 90,
1523
- to: 100,
1524
- value: '#CB3B43'
1525
- }]
1526
- };
1527
- exports.default = MarkerGauge;
1446
+ var SplunkVisualization_1 = __webpack_require__(37);
1528
1447
 
1529
- /***/ }),
1448
+ var VizBehavior_1 = __webpack_require__(6);
1530
1449
 
1531
- /***/ 218:
1532
- /***/ (function(module, exports) {
1450
+ var getSorting_1 = __webpack_require__(28);
1533
1451
 
1534
- module.exports = require("@splunk/ui-utils/id");
1452
+ var getPagination_1 = __webpack_require__(29);
1535
1453
 
1536
- /***/ }),
1454
+ var useDeepMemo_1 = __webpack_require__(40);
1537
1455
 
1538
- /***/ 219:
1539
- /***/ (function(module, exports, __webpack_require__) {
1456
+ var MissingPropsMessage_1 = __webpack_require__(41);
1540
1457
 
1541
- "use strict";
1458
+ var withEditModeCover_1 = __webpack_require__(42);
1542
1459
 
1460
+ var withPlaceholder_1 = __webpack_require__(43);
1461
+ /**
1462
+ * hoc that wraps a pure react visualization in a Dashboard visualization
1463
+ * @param {DashboardVizOpts} opts
1464
+ * @returns {HOC}
1465
+ */
1543
1466
 
1544
- Object.defineProperty(exports, "__esModule", {
1545
- value: true
1546
- });
1547
1467
 
1548
- var i18n_1 = __webpack_require__(2);
1468
+ var withDashboardViz = function withDashboardViz(opts) {
1469
+ var ReactViz = opts.ReactViz,
1470
+ vizConfig = opts.vizConfig,
1471
+ _opts$computeVizProps = opts.computeVizProps,
1472
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1473
+ disableEditModeCover = opts.disableEditModeCover,
1474
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1549
1475
 
1550
- var GaugeMarker_1 = __webpack_require__(220);
1476
+ var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1477
+ var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1551
1478
 
1552
- var placeholders_1 = __webpack_require__(45);
1479
+ var DashboardViz = function DashboardViz(props) {
1480
+ var mode = props.mode,
1481
+ hasEventHandlers = props.hasEventHandlers,
1482
+ dataSources = props.dataSources,
1483
+ options = props.options,
1484
+ _props$context = props.context,
1485
+ context = _props$context === void 0 ? {} : _props$context,
1486
+ width = props.width,
1487
+ height = props.height,
1488
+ onComputedProps = props.onComputedProps,
1489
+ onEventTrigger = props.onEventTrigger,
1490
+ theme = props.theme,
1491
+ onRequestParamsChange = props.onRequestParamsChange;
1553
1492
 
1554
- var schemaUtils_1 = __webpack_require__(15);
1493
+ var _React$useContext = React.useContext(TimezoneContext_1.default),
1494
+ serializedTimezone = _React$useContext.serializedTimezone;
1555
1495
 
1556
- var variables_1 = __webpack_require__(8);
1496
+ if (serializedTimezone) {
1497
+ /*
1498
+ @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
1499
+ This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
1500
+ will use it.
1501
+ @TODO(pwied):
1502
+ - remove when we moved away from @splunk/moment
1503
+ - provide timezone context to dynamic option evaluation phase
1504
+ */
1505
+ if (!moment_1.default.getDefaultSplunkTimezone()) {
1506
+ moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1507
+ }
1508
+ }
1557
1509
 
1558
- var pick_1 = __webpack_require__(21);
1510
+ var themeFunc = function themeFunc(themeVar) {
1511
+ var _a, _b;
1559
1512
 
1560
- var Gauge_1 = __webpack_require__(102);
1513
+ return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1514
+ };
1561
1515
 
1562
- var VizBehavior_1 = __webpack_require__(5);
1516
+ var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1563
1517
 
1564
- var VizCategory_1 = __webpack_require__(30);
1518
+ var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1519
+ theme: theme
1520
+ }),
1521
+ currentThemeFamily = _getSettingsFromTheme.family,
1522
+ currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1523
+ currentThemeDensity = _getSettingsFromTheme.density;
1565
1524
 
1566
- var configUtils_1 = __webpack_require__(16);
1525
+ var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1567
1526
 
1568
- var BackgroundColor_1 = __webpack_require__(49);
1527
+ evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1528
+ try {
1529
+ return Options_1.Options.evaluate({
1530
+ context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1531
+ options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1532
+ }, dataSources, themeFunc);
1533
+ } catch (e) {
1534
+ // eslint-disable-next-line no-console
1535
+ console.error("unexpected error evaluating options: + ".concat(e.message));
1536
+ return {};
1537
+ }
1538
+ }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
1539
+ // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1569
1540
 
1570
- var dataContract = {
1571
- requiredDataSources: [{
1572
- name: 'primary',
1573
- description: 'DataSource that powers the visualization'
1574
- }],
1575
- optionalDataSources: [],
1576
- initialRequestParams: {
1577
- primary: {
1578
- offset: 0,
1579
- count: 10000
1580
- }
1581
- }
1582
- };
1583
- var size = {
1584
- initialWidth: 300,
1585
- initialHeight: 300
1586
- };
1587
- var defaultContext = {};
1588
- var optionsSchema = {
1589
- backgroundColor: {
1590
- description: 'Specify the color used for the background. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
1591
- type: 'string',
1592
- pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
1593
- default: '> themes.defaultBackgroundColor'
1594
- },
1595
- gaugeRanges: {
1596
- description: 'Specify the overall range of the gauge as a series of continuous, color-coded subranges. For example, [{"from": 0, "to": 20, "value": "#4BEBA8"}, {"from": 20, "to": 50, "value": "#F4DF7A"}].',
1597
- default: [{
1598
- from: 0,
1599
- to: 50,
1600
- value: '#118832'
1601
- }, {
1602
- from: 50,
1603
- to: 90,
1604
- value: '#CBA700'
1605
- }, {
1606
- from: 90,
1607
- to: 100,
1608
- value: '#D41F1F'
1609
- }],
1610
- type: 'array',
1611
- items: {
1612
- type: 'object',
1613
- properties: {
1614
- from: {
1615
- type: 'number',
1616
- description: 'Starting value for range.'
1617
- },
1618
- to: {
1619
- type: 'number',
1620
- description: 'Ending value for range.'
1621
- },
1622
- value: {
1623
- description: 'Color for sub range.',
1624
- type: 'string',
1625
- pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
1626
- }
1627
- },
1628
- required: ['from', 'to', 'value'],
1629
- additionalProperties: false
1630
- }
1631
- },
1632
- labelDisplay: {
1633
- description: 'Specify whether to display the labels as numbers, percentages, or off.',
1634
- default: 'number',
1635
- type: 'string',
1636
- pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off'])
1637
- },
1638
- majorTickInterval: {
1639
- description: 'Specify, in pixels, the spacing between major tick marks.',
1640
- default: 'auto',
1641
- type: ['string', 'number']
1642
- },
1643
- orientation: {
1644
- description: 'Specify the axis orientation of the gauge.',
1645
- default: 'vertical',
1646
- type: 'string',
1647
- pattern: schemaUtils_1.getPattern(['horizontal', 'vertical'])
1648
- },
1649
- value: {
1650
- description: 'Specify the dataSource applied to the value of the marker gauge.',
1651
- type: 'string',
1652
- default: '> primary | seriesByType("number") | lastPoint()'
1653
- },
1654
- valueDisplay: {
1655
- description: 'Specify whether to display the value as a number, percentage, or off.',
1656
- default: 'number',
1657
- type: 'string',
1658
- pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off'])
1659
- }
1660
- };
1661
- var themes = {
1662
- defaultFillColor: function defaultFillColor(props) {
1663
- return pick_1.default({
1664
- enterprise: variables_1.default.backgroundColorHover(props),
1665
- prisma: variables_1.default.neutral100(props)
1666
- })(props);
1667
- },
1668
- defaultBackgroundColor: function defaultBackgroundColor(props) {
1669
- return pick_1.default({
1670
- enterprise: {
1671
- dark: variables_1.default.black(props),
1672
- light: variables_1.default.backgroundColor(props)
1673
- },
1674
- prisma: variables_1.default.backgroundColorSidebar(props)
1675
- })(props);
1676
- },
1677
- majorTickFillColor: function majorTickFillColor(props) {
1678
- return pick_1.default({
1679
- enterprise: {
1680
- light: variables_1.default.gray30(props),
1681
- dark: variables_1.default.textGray(props) // was #D7DAE0
1541
+ React.useEffect(function () {
1542
+ onComputedProps(evaluatedOptions);
1543
+ }); // present warning message if any required props are missing
1682
1544
 
1683
- },
1684
- prisma: {
1685
- // TODO: missed colors :(
1686
- light: variables_1.default.neutral100(props),
1687
- dark: variables_1.default.contentColorMuted(props) // was #D7DAE0; contentColor
1545
+ var _vizConfig$requiredPr = vizConfig.requiredProps,
1546
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1547
+ supports = vizConfig.supports;
1548
+ var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
1688
1549
 
1689
- }
1690
- })(props);
1691
- },
1692
- majorTickStrokeColor: function majorTickStrokeColor(props) {
1693
- return pick_1.default({
1694
- enterprise: {
1695
- light: variables_1.default.textGray(props),
1696
- dark: variables_1.default.contentColorMuted(props)
1697
- },
1698
- prisma: variables_1.default.contentColorMuted(props)
1699
- })(props);
1700
- },
1701
- valueMarkerFillColor: function valueMarkerFillColor(props) {
1702
- return pick_1.default({
1703
- enterprise: variables_1.default.textColor(props),
1704
- prisma: {
1705
- dark: variables_1.default.white(props),
1706
- light: variables_1.default.black(props)
1707
- }
1708
- })(props);
1709
- },
1710
- valueMarkerLabelFillColor: function valueMarkerLabelFillColor(props) {
1711
- return pick_1.default({
1712
- enterprise: {
1713
- light: variables_1.default.gray96(props),
1714
- dark: variables_1.default.black(props)
1715
- },
1716
- prisma: variables_1.default.black(props)
1717
- })(props);
1718
- }
1719
- };
1720
- var editorConfig = [{
1721
- label: i18n_1._('Select Data Field'),
1722
- layout: [[{
1723
- label: i18n_1._('Data field'),
1724
- editor: 'editor.columnSelector',
1725
- option: 'value',
1726
- context: 'defaultContext',
1727
- editorProps: {
1728
- dataSourceKey: 'primary',
1729
- prepareValue: function prepareValue(definition) {
1730
- var value = definition.options.value;
1731
- return {
1732
- context: {},
1733
- options: {
1734
- value: "".concat(value, " | lastPoint()")
1550
+ if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
1551
+ return React.createElement(MissingPropsMessage_1.default, {
1552
+ "data-test": "missing-props-message",
1553
+ width: width,
1554
+ height: height,
1555
+ missingProps: missing,
1556
+ backgroundColor: bgColorFromTheme
1557
+ });
1558
+ } // events
1559
+
1560
+
1561
+ var eventCallbackProps = {};
1562
+
1563
+ if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1564
+ var supportedEvents = vizConfig.events;
1565
+ Object.keys(supportedEvents).forEach(function (eventName) {
1566
+ var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1567
+ eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1568
+ // then remove these lines
1569
+
1570
+ var payloadKeys = supportedEvents[eventName].payloadKeys;
1571
+ var payload = {};
1572
+
1573
+ if (Array.isArray(payloadKeys) && payloadKeys.length) {
1574
+ payloadKeys.forEach(function (p) {
1575
+ payload[p] = evaluatedOptions[p];
1576
+ });
1577
+ }
1578
+
1579
+ eventCallbackProps[eventCallbackPropName] = function (ev) {
1580
+ if (ev && ev.payload) {
1581
+ payload = ev.payload;
1735
1582
  }
1583
+
1584
+ return onEventTrigger({
1585
+ originalEvent: ev,
1586
+ payload: payload,
1587
+ type: eventName
1588
+ });
1736
1589
  };
1737
- }
1738
- }
1739
- }]]
1740
- }, Gauge_1.default, {
1741
- label: i18n_1._('Coloring'),
1742
- layout: [[{
1743
- label: i18n_1._('Gauge Ranges'),
1744
- option: 'gaugeRanges',
1745
- editor: 'editor.threshold',
1746
- editorProps: {
1747
- openRanges: false,
1748
- isTogglable: false // Can not disable thresholds
1590
+ });
1591
+ } // compute pure viz props which are not from options
1592
+
1593
+
1594
+ var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
1595
+ themeFunc: themeFunc
1596
+ }));
1597
+ /**
1598
+ * PAGE_AND_SORT behavior
1599
+ *
1600
+ * Some visualizations, like table, requires metadata about the datasource,
1601
+ * like total number of results, current count, offset, and sort, for rendering
1602
+ * paginator and sorting direction. In this approach, the visualization
1603
+ * allow users to set 'paginateDataSourceKey' to select which datasource
1604
+ * should the visualization extract the metadata from. It defaults to 'primary' datasource.
1605
+ * The visualization config should set the PAGE_AND_SORT behavior to receive
1606
+ * 'requestParams', 'meta' and onRequestParams callback as props.
1607
+ *
1608
+ * In future, we could automatically detect which all datasources are being used
1609
+ * and bind those magically to pagination/sorting behavior.
1610
+ */
1611
+
1612
+ var dataSourceMetadata = {};
1613
+ var OptionKey = 'paginateDataSourceKey';
1614
+ var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
1615
+
1616
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1617
+ var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1618
+ var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
1619
+
1620
+ var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1621
+ return onRequestParamsChange(paginateDataSourceKey, payload);
1622
+ };
1749
1623
 
1624
+ var sortParams = getSorting_1.getSortingParams({
1625
+ requestParams: requestParams,
1626
+ meta: meta,
1627
+ onRequestParamsChange: handleRequestParamsChange
1628
+ });
1629
+ var paginatorParams = getPagination_1.getPaginationParams({
1630
+ requestParams: requestParams,
1631
+ meta: meta,
1632
+ onRequestParamsChange: handleRequestParamsChange
1633
+ });
1634
+ dataSourceMetadata = {
1635
+ sortParams: sortParams,
1636
+ paginatorParams: paginatorParams
1637
+ };
1750
1638
  }
1751
- }], BackgroundColor_1.default({
1752
- themes: themes,
1753
- labelPosition: 'top'
1754
- })]
1755
- }];
1756
- /**
1757
- * visualization configuration
1758
- */
1759
1639
 
1760
- var config = {
1761
- /**
1762
- * unique viz key
1763
- */
1764
- key: 'splunk.markergauge',
1640
+ return React.createElement(SanitizedReactViz, Object.assign({
1641
+ mode: mode,
1642
+ width: width,
1643
+ height: height
1644
+ }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
1645
+ };
1765
1646
 
1766
- /**
1767
- * viz name
1768
- */
1769
- name: 'MarkerGauge',
1770
- category: VizCategory_1.VizCategory.GAUGE,
1647
+ DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1648
+ DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1649
+ // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1650
+ theme: {}
1651
+ }); // attach viz config
1771
1652
 
1772
- /**
1773
- * viz icon
1774
- */
1775
- icon: GaugeMarker_1.default,
1776
- placeholderIcon: placeholders_1.MarkerGauge,
1777
- dataContract: dataContract,
1778
- size: size,
1779
- defaultContext: defaultContext,
1780
- optionsSchema: optionsSchema,
1781
- editorConfig: editorConfig,
1782
- supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
1783
- themes: themes
1653
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1654
+
1655
+ return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
1784
1656
  };
1785
- exports.default = configUtils_1.enhanceConfig(config);
1657
+
1658
+ exports.default = withDashboardViz;
1786
1659
 
1787
1660
  /***/ }),
1788
1661
 
1789
- /***/ 22:
1662
+ /***/ 33:
1790
1663
  /***/ (function(module, exports) {
1791
1664
 
1792
- module.exports = require("@splunk/visualization-context/TimezoneContext");
1665
+ module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1793
1666
 
1794
1667
  /***/ }),
1795
1668
 
1796
- /***/ 220:
1669
+ /***/ 34:
1797
1670
  /***/ (function(module, exports) {
1798
1671
 
1799
- module.exports = require("@splunk/react-icons/GaugeMarker");
1672
+ module.exports = require("@splunk/visualization-encoding/Options");
1800
1673
 
1801
1674
  /***/ }),
1802
1675
 
1803
- /***/ 24:
1676
+ /***/ 35:
1804
1677
  /***/ (function(module, exports) {
1805
1678
 
1806
- module.exports = require("@splunk/visualizations-shared/hocUtils");
1679
+ module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1807
1680
 
1808
1681
  /***/ }),
1809
1682
 
1810
- /***/ 25:
1683
+ /***/ 36:
1811
1684
  /***/ (function(module, exports) {
1812
1685
 
1813
- module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
1686
+ module.exports = require("@splunk/moment");
1814
1687
 
1815
1688
  /***/ }),
1816
1689
 
1817
- /***/ 26:
1818
- /***/ (function(module, exports) {
1819
-
1820
- module.exports = require("@splunk/visualizations-shared/numberUtils");
1821
-
1822
- /***/ }),
1823
-
1824
- /***/ 27:
1690
+ /***/ 37:
1825
1691
  /***/ (function(module, exports, __webpack_require__) {
1826
1692
 
1827
1693
  "use strict";
1828
1694
 
1829
1695
 
1696
+ var _classCallCheck = __webpack_require__(11);
1697
+
1830
1698
  Object.defineProperty(exports, "__esModule", {
1831
1699
  value: true
1832
1700
  });
1833
- exports.shouldShowIconPlaceholder = void 0;
1834
-
1835
- var React = __webpack_require__(1);
1701
+ exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1702
+ /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1836
1703
 
1837
- var T = __webpack_require__(0);
1704
+ var T = __webpack_require__(1);
1838
1705
 
1839
1706
  var lodash_1 = __webpack_require__(3);
1840
1707
 
1841
- var i18n_1 = __webpack_require__(2);
1842
-
1843
- var Message_1 = __webpack_require__(9);
1844
-
1845
- var FixedSizeContainer_1 = __webpack_require__(12);
1846
- /**
1847
- * @method shouldShowIconPlaceholder
1848
- * @param {object} dataSources
1849
- * @param {boolean} loading
1850
- * @returns {boolean}
1851
- */
1708
+ var VizActionHandler_1 = __webpack_require__(38); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1852
1709
 
1853
1710
 
1854
- var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
1855
- var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1856
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1857
- var noData = data === undefined;
1858
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1859
- var noFields = fields === undefined;
1860
- return loading || noData || noFields;
1861
- };
1862
-
1863
- exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
1864
- var propTypes = {
1865
- icon: T.func,
1866
- width: T.oneOfType([T.string, T.number]),
1867
- height: T.oneOfType([T.string, T.number]),
1868
- // eslint-disable-next-line react/no-unused-prop-types
1869
- backgroundColor: T.string,
1870
- iconColor: T.string
1871
- };
1711
+ exports.INITIAL_WIDTH = 250;
1712
+ exports.INITIAL_HEIGHT = 250;
1872
1713
  /**
1873
- * @method IconPlaceholder
1874
- * @param {IconPlaceholderProps} props
1875
- * @returns {React.ReactElement}
1714
+ * A Splunk visualization
1876
1715
  */
1877
1716
 
1878
- var IconPlaceholder = function IconPlaceholder(props) {
1879
- var width = props.width,
1880
- height = props.height,
1881
- icon = props.icon,
1882
- iconColor = props.iconColor;
1883
-
1884
- if (icon) {
1885
- return React.createElement(icon, {
1886
- style: {
1887
- left: '50%',
1888
- top: '50%',
1889
- color: iconColor,
1890
- opacity: 0.15,
1891
- position: 'absolute',
1892
- transform: 'translate(-50%, -50%)'
1893
- },
1894
- width: '50%',
1895
- height: '50%'
1896
- });
1897
- }
1898
-
1899
- return React.createElement(Message_1.default, {
1900
- width: width,
1901
- height: height,
1902
- level: "warning",
1903
- message: i18n_1._('No DataSource Connected')
1904
- });
1905
- };
1906
-
1907
- IconPlaceholder.propTypes = propTypes;
1908
- IconPlaceholder.defaultProps = {
1909
- width: '100%',
1910
- height: 250
1717
+ var SplunkVisualization = function SplunkVisualization() {
1718
+ _classCallCheck(this, SplunkVisualization);
1911
1719
  };
1912
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1913
-
1914
- /***/ }),
1915
1720
 
1916
- /***/ 28:
1917
- /***/ (function(module, exports, __webpack_require__) {
1721
+ SplunkVisualization.propTypes = {
1722
+ /**
1723
+ * display mode
1724
+ */
1725
+ mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1918
1726
 
1919
- "use strict";
1727
+ /**
1728
+ * width in pixel or string, defaults to 100%
1729
+ */
1730
+ width: T.oneOfType([T.string, T.number]).isRequired,
1920
1731
 
1732
+ /**
1733
+ * height in pixel or string
1734
+ */
1735
+ height: T.oneOfType([T.string, T.number]).isRequired,
1921
1736
 
1922
- var _defineProperty = __webpack_require__(6);
1737
+ /**
1738
+ * visualization context used for dynamic option evaluation
1739
+ */
1740
+ context: T.object,
1923
1741
 
1924
- Object.defineProperty(exports, "__esModule", {
1925
- value: true
1926
- });
1927
- exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1742
+ /**
1743
+ * visualization formatting options
1744
+ */
1745
+ options: T.object,
1928
1746
 
1929
- var T = __webpack_require__(0);
1747
+ /**
1748
+ * A callback to update formatting options
1749
+ */
1750
+ onOptionsChange: T.func,
1930
1751
 
1931
- var lodash_1 = __webpack_require__(3);
1752
+ /**
1753
+ * datasource state which include data and request params, object key indicate the datasource type.
1754
+ */
1755
+ dataSources: T.objectOf(T.shape({
1756
+ /**
1757
+ * current request params
1758
+ */
1759
+ requestParams: T.object,
1932
1760
 
1933
- var DataSource_1 = __webpack_require__(38);
1761
+ /**
1762
+ * current dataset
1763
+ */
1764
+ data: T.shape({
1765
+ fields: T.array,
1766
+ columns: T.array
1767
+ }),
1934
1768
 
1935
- exports.SortParamsPropTypes = T.shape({
1936
- currentSortKey: T.string,
1937
- currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1938
- onSort: T.func
1939
- });
1769
+ /**
1770
+ * error
1771
+ */
1772
+ error: T.shape({
1773
+ level: T.string,
1774
+ message: T.string
1775
+ }),
1940
1776
 
1941
- var getSortingParams = function getSortingParams(_ref) {
1942
- var requestParams = _ref.requestParams,
1943
- onRequestParamsChange = _ref.onRequestParamsChange;
1944
- var currentSortKey;
1945
- var currentSortDir;
1946
- var nextSortDirMap = {
1947
- asc: 'desc',
1948
- desc: 'asc',
1949
- none: 'asc'
1950
- };
1951
- var onSort;
1777
+ /**
1778
+ * meta data that came with the dataset
1779
+ */
1780
+ meta: T.object
1781
+ })),
1952
1782
 
1953
- if (lodash_1.isFunction(onRequestParamsChange)) {
1954
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
1955
- currentSortKey = Object.keys(requestParams.sort).shift();
1956
- currentSortDir = requestParams.sort[currentSortKey];
1957
- } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1783
+ /**
1784
+ * A callback to trigger event
1785
+ */
1786
+ onEventTrigger: T.func,
1958
1787
 
1788
+ /**
1789
+ * Inform viz if there are handlers listening to events
1790
+ */
1791
+ hasEventHandlers: T.bool,
1959
1792
 
1960
- onSort = function onSort(e, _ref2) {
1961
- var sortKey = _ref2.sortKey,
1962
- sortDir = _ref2.sortDir;
1793
+ /**
1794
+ * A callback to communicate computed props to a consumer
1795
+ */
1796
+ onComputedProps: T.func,
1963
1797
 
1964
- if (typeof sortKey === 'string') {
1965
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1966
- onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1967
- offset: 0,
1968
- sort: _defineProperty({}, sortKey, nextSortDir)
1969
- }));
1970
- } else {
1971
- onRequestParamsChange(requestParams);
1972
- }
1973
- };
1974
- }
1798
+ /**
1799
+ * A callback to obtain visualization api
1800
+ */
1801
+ vizActionHandlerRef: T.func,
1802
+ loading: T.bool,
1803
+ theme: T.object,
1975
1804
 
1976
- return {
1977
- currentSortKey: currentSortKey,
1978
- currentSortDir: currentSortDir,
1979
- onSort: onSort
1980
- };
1805
+ /**
1806
+ * A callback to request new data with updated request params
1807
+ */
1808
+ onRequestParamsChange: T.func
1981
1809
  };
1810
+ /**
1811
+ *
1812
+ */
1982
1813
 
1983
- exports.getSortingParams = getSortingParams;
1814
+ SplunkVisualization.defaultProps = {
1815
+ // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1816
+ width: '100%',
1817
+ height: exports.INITIAL_HEIGHT,
1818
+ dataSources: {},
1819
+ onEventTrigger: function onEventTrigger() {
1820
+ return {};
1821
+ },
1822
+ mode: 'view',
1823
+ hasEventHandlers: false,
1824
+ options: {},
1825
+ context: {},
1826
+ onOptionsChange: function onOptionsChange() {
1827
+ return {};
1828
+ },
1829
+ vizActionHandlerRef: function vizActionHandlerRef() {
1830
+ return new VizActionHandler_1.DefaultVizActionHandler();
1831
+ },
1832
+ onComputedProps: function onComputedProps() {
1833
+ return {};
1834
+ },
1835
+ loading: false,
1836
+ onRequestParamsChange: lodash_1.noop
1837
+ };
1838
+ exports.default = SplunkVisualization;
1984
1839
 
1985
1840
  /***/ }),
1986
1841
 
1987
- /***/ 29:
1842
+ /***/ 38:
1988
1843
  /***/ (function(module, exports, __webpack_require__) {
1989
1844
 
1990
1845
  "use strict";
1991
1846
 
1992
1847
 
1848
+ var _classCallCheck = __webpack_require__(11);
1849
+
1850
+ var _createClass = __webpack_require__(19);
1851
+
1993
1852
  Object.defineProperty(exports, "__esModule", {
1994
1853
  value: true
1995
1854
  });
1996
- exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1855
+ exports.DefaultVizActionHandler = void 0;
1997
1856
 
1998
- var T = __webpack_require__(0);
1857
+ var DefaultVizActionHandler = /*#__PURE__*/function () {
1858
+ function DefaultVizActionHandler() {
1859
+ _classCallCheck(this, DefaultVizActionHandler);
1860
+ }
1999
1861
 
2000
- var lodash_1 = __webpack_require__(3);
1862
+ _createClass(DefaultVizActionHandler, [{
1863
+ key: "focus",
1864
+ value: function focus() {// noop
1865
+ }
1866
+ }, {
1867
+ key: "snapshot",
1868
+ value: function snapshot() {
1869
+ return null; // noop
1870
+ }
1871
+ }]);
2001
1872
 
2002
- exports.PaginatorParamsPropTypes = T.shape({
2003
- isPaging: T.bool,
2004
- current: T.number,
2005
- totalPages: T.number,
2006
- onChange: T.func
2007
- });
2008
-
2009
- var getPaginationParams = function getPaginationParams(_ref) {
2010
- var requestParams = _ref.requestParams,
2011
- meta = _ref.meta,
2012
- onRequestParamsChange = _ref.onRequestParamsChange;
2013
- var totalCount = meta && meta.totalCount || 0;
2014
- var offset = requestParams && requestParams.offset || 0;
2015
- var count = requestParams && requestParams.count;
2016
- var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
2017
- var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
2018
- var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
2019
-
2020
- var onChangeHandler = function onChangeHandler(e, _ref2) {
2021
- var page = _ref2.page,
2022
- countArg = _ref2.count;
2023
- var newParams = lodash_1.cloneDeep(requestParams);
2024
-
2025
- if (typeof countArg === 'number') {
2026
- newParams.count = countArg;
2027
- newParams.offset = 0;
2028
- }
2029
-
2030
- var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
2031
-
2032
- if (typeof page === 'number' && page > 0) {
2033
- newParams.count = pageCount;
2034
- newParams.offset = (page - 1) * pageCount;
2035
- }
2036
-
2037
- onRequestParamsChange(newParams);
2038
- };
2039
-
2040
- return {
2041
- isPaging: isPaging,
2042
- current: current,
2043
- totalPages: totalPages,
2044
- onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
2045
- };
2046
- };
2047
-
2048
- exports.getPaginationParams = getPaginationParams;
2049
-
2050
- /***/ }),
2051
-
2052
- /***/ 3:
2053
- /***/ (function(module, exports) {
1873
+ return DefaultVizActionHandler;
1874
+ }();
2054
1875
 
2055
- module.exports = require("lodash");
1876
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
2056
1877
 
2057
1878
  /***/ }),
2058
1879
 
2059
- /***/ 30:
1880
+ /***/ 39:
2060
1881
  /***/ (function(module, exports, __webpack_require__) {
2061
1882
 
2062
1883
  "use strict";
@@ -2065,27 +1886,19 @@ module.exports = require("lodash");
2065
1886
  Object.defineProperty(exports, "__esModule", {
2066
1887
  value: true
2067
1888
  });
2068
- exports.VizCategory = void 0;
2069
- var VizCategory;
1889
+ exports.validSortDirs = void 0;
1890
+ exports.validSortDirs = ['asc', 'desc', 'none'];
2070
1891
 
2071
- (function (VizCategory) {
2072
- VizCategory["SINGLE_VALUE"] = "Single Value";
2073
- VizCategory["TRENDS"] = "Trends";
2074
- VizCategory["COMPARISONS"] = "Comparisons";
2075
- VizCategory["TABLE"] = "Table";
2076
- VizCategory["GAUGE"] = "Gauge";
2077
- VizCategory["DISTRIBUTIONS"] = "Distributions";
2078
- VizCategory["CHOROPLETH"] = "Choropleth Maps";
2079
- VizCategory["SHAPES"] = "Shapes";
2080
- VizCategory["MISC"] = "misc";
2081
- VizCategory["FLOW"] = "Flow";
2082
- VizCategory["CORRELATION"] = "Correlation";
2083
- VizCategory["SPATIAL"] = "Spatial";
2084
- })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
1892
+ /***/ }),
1893
+
1894
+ /***/ 4:
1895
+ /***/ (function(module, exports) {
1896
+
1897
+ module.exports = require("styled-components");
2085
1898
 
2086
1899
  /***/ }),
2087
1900
 
2088
- /***/ 31:
1901
+ /***/ 40:
2089
1902
  /***/ (function(module, exports, __webpack_require__) {
2090
1903
 
2091
1904
  "use strict";
@@ -2094,529 +1907,723 @@ var VizCategory;
2094
1907
  Object.defineProperty(exports, "__esModule", {
2095
1908
  value: true
2096
1909
  });
1910
+ exports.useDeepMemo = void 0;
2097
1911
 
2098
- var React = __webpack_require__(1);
1912
+ var react_1 = __webpack_require__(0);
2099
1913
 
2100
1914
  var lodash_1 = __webpack_require__(3);
1915
+ /**
1916
+ * This hook evaluates and stores the result of a passed function and only
1917
+ * re-evaluates the function when passed dependencies change.
1918
+ *
1919
+ * It is different from the internal React useMemo in the following aspects:
1920
+ * - it only stores the last evaluated result
1921
+ * - it uses a deep equality check to determine if dependencies have changed
1922
+ *
1923
+ * Inspired by apollo-client's useDeepMemo
1924
+ *
1925
+ * @param fn the function to be executed and
1926
+ * @param dependencies an array of dependencies
1927
+ */
2101
1928
 
2102
- var getSettingsFromThemedProps_1 = __webpack_require__(32);
2103
1929
 
2104
- var Options_1 = __webpack_require__(33);
1930
+ var useDeepMemo = function useDeepMemo(fn, dependencies) {
1931
+ var ref = react_1.useRef();
2105
1932
 
2106
- var SanitizeProps_1 = __webpack_require__(34);
1933
+ if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1934
+ ref.current = {
1935
+ dependencies: dependencies,
1936
+ value: fn()
1937
+ };
1938
+ }
2107
1939
 
2108
- var TimezoneContext_1 = __webpack_require__(22);
1940
+ return ref.current.value;
1941
+ };
2109
1942
 
2110
- var moment_1 = __webpack_require__(35);
1943
+ exports.useDeepMemo = useDeepMemo;
2111
1944
 
2112
- var styled_components_1 = __webpack_require__(4);
1945
+ /***/ }),
2113
1946
 
2114
- var hocUtils_1 = __webpack_require__(24);
1947
+ /***/ 405:
1948
+ /***/ (function(module, exports, __webpack_require__) {
2115
1949
 
2116
- var JSONSchemaUtils_1 = __webpack_require__(25);
1950
+ "use strict";
2117
1951
 
2118
- var SplunkVisualization_1 = __webpack_require__(36);
2119
1952
 
2120
- var VizBehavior_1 = __webpack_require__(5);
1953
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1954
+ if (k2 === undefined) k2 = k;
1955
+ Object.defineProperty(o, k2, {
1956
+ enumerable: true,
1957
+ get: function get() {
1958
+ return m[k];
1959
+ }
1960
+ });
1961
+ } : function (o, m, k, k2) {
1962
+ if (k2 === undefined) k2 = k;
1963
+ o[k2] = m[k];
1964
+ });
2121
1965
 
2122
- var getSorting_1 = __webpack_require__(28);
1966
+ var __exportStar = this && this.__exportStar || function (m, exports) {
1967
+ for (var p in m) {
1968
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1969
+ }
1970
+ };
2123
1971
 
2124
- var getPagination_1 = __webpack_require__(29);
1972
+ Object.defineProperty(exports, "__esModule", {
1973
+ value: true
1974
+ });
1975
+ exports.default = void 0;
2125
1976
 
2126
- var useDeepMemo_1 = __webpack_require__(39);
1977
+ __exportStar(__webpack_require__(144), exports);
2127
1978
 
2128
- var MissingPropsMessage_1 = __webpack_require__(40);
1979
+ var MarkerGauge_1 = __webpack_require__(144);
2129
1980
 
2130
- var withEditModeCover_1 = __webpack_require__(41);
1981
+ Object.defineProperty(exports, "default", {
1982
+ enumerable: true,
1983
+ get: function get() {
1984
+ return MarkerGauge_1.default;
1985
+ }
1986
+ });
2131
1987
 
2132
- var withPlaceholder_1 = __webpack_require__(42);
2133
- /**
2134
- * hoc that wraps a pure react visualization in a Dashboard visualization
2135
- * @param {DashboardVizOpts} opts
2136
- * @returns {HOC}
2137
- */
1988
+ /***/ }),
2138
1989
 
1990
+ /***/ 406:
1991
+ /***/ (function(module, exports, __webpack_require__) {
2139
1992
 
2140
- var withDashboardViz = function withDashboardViz(opts) {
2141
- var ReactViz = opts.ReactViz,
2142
- vizConfig = opts.vizConfig,
2143
- _opts$computeVizProps = opts.computeVizProps,
2144
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
2145
- disableEditModeCover = opts.disableEditModeCover,
2146
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1993
+ "use strict";
2147
1994
 
2148
- var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
2149
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
2150
1995
 
2151
- var DashboardViz = function DashboardViz(props) {
2152
- var mode = props.mode,
2153
- hasEventHandlers = props.hasEventHandlers,
2154
- dataSources = props.dataSources,
2155
- options = props.options,
2156
- _props$context = props.context,
2157
- context = _props$context === void 0 ? {} : _props$context,
2158
- width = props.width,
2159
- height = props.height,
2160
- onComputedProps = props.onComputedProps,
2161
- onEventTrigger = props.onEventTrigger,
2162
- theme = props.theme,
2163
- onRequestParamsChange = props.onRequestParamsChange;
1996
+ var __rest = this && this.__rest || function (s, e) {
1997
+ var t = {};
2164
1998
 
2165
- var _React$useContext = React.useContext(TimezoneContext_1.default),
2166
- serializedTimezone = _React$useContext.serializedTimezone;
1999
+ for (var p in s) {
2000
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
2001
+ }
2167
2002
 
2168
- if (serializedTimezone) {
2169
- /*
2170
- @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
2171
- This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
2172
- will use it.
2173
- @TODO(pwied):
2174
- - remove when we moved away from @splunk/moment
2175
- - provide timezone context to dynamic option evaluation phase
2176
- */
2177
- if (!moment_1.default.getDefaultSplunkTimezone()) {
2178
- moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
2179
- }
2180
- }
2003
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2004
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
2005
+ }
2006
+ return t;
2007
+ };
2181
2008
 
2182
- var themeFunc = function themeFunc(themeVar) {
2183
- var _a, _b;
2009
+ Object.defineProperty(exports, "__esModule", {
2010
+ value: true
2011
+ });
2184
2012
 
2185
- return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
2186
- };
2013
+ var React = __webpack_require__(0);
2187
2014
 
2188
- var bgColorFromTheme = themeFunc('defaultBackgroundColor');
2015
+ var react_1 = __webpack_require__(0);
2189
2016
 
2190
- var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
2191
- theme: theme
2192
- }),
2193
- currentThemeFamily = _getSettingsFromTheme.family,
2194
- currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
2195
- currentThemeDensity = _getSettingsFromTheme.density;
2017
+ var T = __webpack_require__(1);
2196
2018
 
2197
- var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
2019
+ var styled_components_1 = __webpack_require__(4);
2198
2020
 
2199
- evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
2200
- try {
2201
- return Options_1.Options.evaluate({
2202
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
2203
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
2204
- }, dataSources, themeFunc);
2205
- } catch (e) {
2206
- // eslint-disable-next-line no-console
2207
- console.error("unexpected error evaluating options: + ".concat(e.message));
2208
- return {};
2209
- }
2210
- }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
2211
- // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
2021
+ var lodash_1 = __webpack_require__(3);
2212
2022
 
2213
- React.useEffect(function () {
2214
- onComputedProps(evaluatedOptions);
2215
- }); // present warning message if any required props are missing
2023
+ var i18n_1 = __webpack_require__(2);
2216
2024
 
2217
- var _vizConfig$requiredPr = vizConfig.requiredProps,
2218
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
2219
- supports = vizConfig.supports;
2220
- var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
2025
+ var style_1 = __webpack_require__(15);
2221
2026
 
2222
- if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
2223
- return React.createElement(MissingPropsMessage_1.default, {
2224
- "data-test": "missing-props-message",
2225
- width: width,
2226
- height: height,
2227
- missingProps: missing,
2228
- backgroundColor: bgColorFromTheme
2229
- });
2230
- } // events
2027
+ var SizeAwareWrapper_1 = __webpack_require__(20);
2231
2028
 
2029
+ var Message_1 = __webpack_require__(10);
2232
2030
 
2233
- var eventCallbackProps = {};
2031
+ var id_1 = __webpack_require__(407);
2234
2032
 
2235
- if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
2236
- var supportedEvents = vizConfig.events;
2237
- Object.keys(supportedEvents).forEach(function (eventName) {
2238
- var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
2239
- eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
2240
- // then remove these lines
2033
+ var gaugeUtils_1 = __webpack_require__(85);
2241
2034
 
2242
- var payloadKeys = supportedEvents[eventName].payloadKeys;
2243
- var payload = {};
2035
+ var GaugeMajorTicks_1 = __webpack_require__(111);
2244
2036
 
2245
- if (Array.isArray(payloadKeys) && payloadKeys.length) {
2246
- payloadKeys.forEach(function (p) {
2247
- payload[p] = evaluatedOptions[p];
2248
- });
2249
- }
2037
+ var GaugeValueMarker_1 = __webpack_require__(112);
2250
2038
 
2251
- eventCallbackProps[eventCallbackPropName] = function (ev) {
2252
- if (ev && ev.payload) {
2253
- payload = ev.payload;
2254
- }
2039
+ var MAX_VERTICAL_CONTAINER_WIDTH = 200;
2040
+ var MIN_VERTICAL_CONTAINER_HEIGHT = 200;
2041
+ var MIN_HORIZONTAL_CONTAINER_WIDTH = 200;
2042
+ var MIN_HORIZONTAL_CONTAINER_HEIGHT = 100;
2043
+ var Container = styled_components_1.default.div.withConfig({
2044
+ displayName: "MarkerGauge__Container",
2045
+ componentId: "sc-10z02va-0"
2046
+ })(["overflow:hidden;", ";background-color:", ";"], function (props) {
2047
+ return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
2048
+ }, function (props) {
2049
+ return props.backgroundColor;
2050
+ });
2051
+ var MarkerGaugeWrapper = styled_components_1.default.div.withConfig({
2052
+ displayName: "MarkerGauge__MarkerGaugeWrapper",
2053
+ componentId: "sc-10z02va-1"
2054
+ })(["display:flex;justify-content:center;flex-direction:row;width:100%;height:100%;background-color:", ";"], function (props) {
2055
+ return props.backgroundColor;
2056
+ });
2057
+ var MarkerGaugeContainer = styled_components_1.default.div.withConfig({
2058
+ displayName: "MarkerGauge__MarkerGaugeContainer",
2059
+ componentId: "sc-10z02va-2"
2060
+ })(["overflow:hidden;position:relative;", ";"], function (props) {
2061
+ return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
2062
+ });
2063
+ var MarkerGaugeSVG = styled_components_1.default.svg.withConfig({
2064
+ displayName: "MarkerGauge__MarkerGaugeSVG",
2065
+ componentId: "sc-10z02va-3"
2066
+ })(["", ";"], function (props) {
2067
+ return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
2068
+ });
2069
+ var BackgroundBar = styled_components_1.default.rect.attrs({
2070
+ 'data-test': 'background-bar-rect'
2071
+ }).withConfig({
2072
+ displayName: "MarkerGauge__BackgroundBar",
2073
+ componentId: "sc-10z02va-4"
2074
+ })(["fill:", ";"], function (props) {
2075
+ return props.fillColor;
2076
+ });
2077
+ var MarkerBar = styled_components_1.default.rect.attrs({
2078
+ 'data-test': 'marker-bar-rect'
2079
+ }).withConfig({
2080
+ displayName: "MarkerGauge__MarkerBar",
2081
+ componentId: "sc-10z02va-5"
2082
+ })([""]);
2255
2083
 
2256
- return onEventTrigger({
2257
- originalEvent: ev,
2258
- payload: payload,
2259
- type: eventName
2260
- });
2261
- };
2262
- });
2263
- } // compute pure viz props which are not from options
2084
+ var MarkerGauge = function MarkerGauge(_a) {
2085
+ var props = __rest(_a, []);
2264
2086
 
2087
+ var width = props.width,
2088
+ height = props.height,
2089
+ value = props.value,
2090
+ orientation = props.orientation,
2091
+ majorUnit = props.majorUnit,
2092
+ showLabels = props.showLabels,
2093
+ showValue = props.showValue,
2094
+ usePercentageRange = props.usePercentageRange,
2095
+ usePercentageValue = props.usePercentageValue,
2096
+ backgroundColor = props.backgroundColor,
2097
+ fillColor = props.fillColor,
2098
+ ranges = props.ranges,
2099
+ majorTickFillColor = props.majorTickFillColor,
2100
+ majorTickStrokeColor = props.majorTickStrokeColor,
2101
+ valueMarkerFillColor = props.valueMarkerFillColor,
2102
+ valueMarkerLabelFillColor = props.valueMarkerLabelFillColor;
2103
+ /**
2104
+ * Standard error message render
2105
+ */
2265
2106
 
2266
- var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
2267
- themeFunc: themeFunc
2268
- }));
2269
- /**
2270
- * PAGE_AND_SORT behavior
2271
- *
2272
- * Some visualizations, like table, requires metadata about the datasource,
2273
- * like total number of results, current count, offset, and sort, for rendering
2274
- * paginator and sorting direction. In this approach, the visualization
2275
- * allow users to set 'paginateDataSourceKey' to select which datasource
2276
- * should the visualization extract the metadata from. It defaults to 'primary' datasource.
2277
- * The visualization config should set the PAGE_AND_SORT behavior to receive
2278
- * 'requestParams', 'meta' and onRequestParams callback as props.
2279
- *
2280
- * In future, we could automatically detect which all datasources are being used
2281
- * and bind those magically to pagination/sorting behavior.
2282
- */
2107
+ var errorMessage = react_1.useCallback(function (containerWidth, containerHeight, err, errID) {
2108
+ return React.createElement(Message_1.default, {
2109
+ width: containerWidth,
2110
+ height: containerHeight,
2111
+ message: err,
2112
+ level: "info",
2113
+ id: errID
2114
+ });
2115
+ }, []);
2116
+ var errorId = react_1.useMemo(function () {
2117
+ return id_1.createDOMID();
2118
+ }, []);
2119
+ /**
2120
+ * Pre-calculate linearGradientId, error, sortedRanges, gauge range and linear gradient
2121
+ */
2283
2122
 
2284
- var dataSourceMetadata = {};
2285
- var OptionKey = 'paginateDataSourceKey';
2286
- var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
2123
+ var error = react_1.useMemo(function () {
2124
+ return gaugeUtils_1.validateRanges(ranges);
2125
+ }, [ranges]);
2126
+ var sortedRanges = react_1.useMemo(function () {
2127
+ return gaugeUtils_1.getSortedRanges(ranges);
2128
+ }, [ranges]);
2287
2129
 
2288
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
2289
- var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
2290
- var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
2130
+ var _react_1$useMemo = react_1.useMemo(function () {
2131
+ return gaugeUtils_1.getGaugeRange(sortedRanges);
2132
+ }, [sortedRanges]),
2133
+ min = _react_1$useMemo.min,
2134
+ max = _react_1$useMemo.max;
2291
2135
 
2292
- var handleRequestParamsChange = function handleRequestParamsChange(payload) {
2293
- return onRequestParamsChange(paginateDataSourceKey, payload);
2294
- };
2136
+ var linearGradientId = react_1.useMemo(function () {
2137
+ return id_1.createDOMID('marker');
2138
+ }, []);
2139
+ var linearGradient = react_1.useMemo(function () {
2140
+ var stops = gaugeUtils_1.getGradientStops({
2141
+ ranges: sortedRanges,
2142
+ orientation: orientation
2143
+ });
2295
2144
 
2296
- var sortParams = getSorting_1.getSortingParams({
2297
- requestParams: requestParams,
2298
- meta: meta,
2299
- onRequestParamsChange: handleRequestParamsChange
2300
- });
2301
- var paginatorParams = getPagination_1.getPaginationParams({
2302
- requestParams: requestParams,
2303
- meta: meta,
2304
- onRequestParamsChange: handleRequestParamsChange
2145
+ var _gaugeUtils_1$getGrad = gaugeUtils_1.getGradientDimensions(orientation),
2146
+ x1 = _gaugeUtils_1$getGrad.x1,
2147
+ y1 = _gaugeUtils_1$getGrad.y1,
2148
+ x2 = _gaugeUtils_1$getGrad.x2,
2149
+ y2 = _gaugeUtils_1$getGrad.y2;
2150
+
2151
+ var linearGradientStops = stops.map(function (stop) {
2152
+ return React.createElement("stop", {
2153
+ key: "".concat(stop.offset, "_").concat(stop.stopColor),
2154
+ offset: stop.offset,
2155
+ stopColor: stop.stopColor
2305
2156
  });
2306
- dataSourceMetadata = {
2307
- sortParams: sortParams,
2308
- paginatorParams: paginatorParams
2309
- };
2310
- }
2157
+ });
2158
+ return React.createElement("linearGradient", {
2159
+ id: linearGradientId,
2160
+ x1: x1,
2161
+ y1: y1,
2162
+ x2: x2,
2163
+ y2: y2
2164
+ }, linearGradientStops);
2165
+ }, [sortedRanges, orientation, linearGradientId]);
2166
+ /**
2167
+ * Calculate marker gauge dimensions
2168
+ */
2311
2169
 
2312
- return React.createElement(SanitizedReactViz, Object.assign({
2313
- mode: mode,
2314
- width: width,
2315
- height: height
2316
- }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
2317
- };
2170
+ var calculateMarkerGaugeDimensions = react_1.useCallback(function (containerWidth, containerHeight) {
2171
+ var _gaugeUtils_1$getGaug = gaugeUtils_1.getGaugeDimensions({
2172
+ containerWidth: containerWidth,
2173
+ containerHeight: containerHeight,
2174
+ orientation: orientation
2175
+ }),
2176
+ gaugeLength = _gaugeUtils_1$getGaug.gaugeLength,
2177
+ gaugeStartX = _gaugeUtils_1$getGaug.gaugeStartX,
2178
+ gaugeStartY = _gaugeUtils_1$getGaug.gaugeStartY,
2179
+ gaugeWidth = _gaugeUtils_1$getGaug.gaugeWidth,
2180
+ gaugeHeight = _gaugeUtils_1$getGaug.gaugeHeight;
2318
2181
 
2319
- DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
2320
- DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
2321
- // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
2322
- theme: {}
2323
- }); // attach viz config
2182
+ var _gaugeUtils_1$getMark = gaugeUtils_1.getMarkerBarDimensions({
2183
+ gaugeLength: gaugeLength,
2184
+ gaugeStartX: gaugeStartX,
2185
+ gaugeStartY: gaugeStartY,
2186
+ gaugeWidth: gaugeWidth,
2187
+ gaugeHeight: gaugeHeight,
2188
+ orientation: orientation
2189
+ }),
2190
+ markerBarLength = _gaugeUtils_1$getMark.markerBarLength,
2191
+ markerBarX = _gaugeUtils_1$getMark.markerBarX,
2192
+ markerBarY = _gaugeUtils_1$getMark.markerBarY,
2193
+ markerBarWidth = _gaugeUtils_1$getMark.markerBarWidth,
2194
+ markerBarHeight = _gaugeUtils_1$getMark.markerBarHeight;
2324
2195
 
2325
- DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
2196
+ var _gaugeUtils_1$getMark2 = gaugeUtils_1.getMarkerGaugeValueMarkerPositions({
2197
+ markerBarX: markerBarX,
2198
+ markerBarY: markerBarY,
2199
+ markerBarHeight: markerBarHeight,
2200
+ markerBarLength: markerBarLength,
2201
+ orientation: orientation,
2202
+ value: value,
2203
+ min: min,
2204
+ max: max
2205
+ }),
2206
+ valueMarkerX = _gaugeUtils_1$getMark2.valueMarkerX,
2207
+ valueMarkerY = _gaugeUtils_1$getMark2.valueMarkerY;
2326
2208
 
2327
- return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
2209
+ return {
2210
+ markerBarX: markerBarX,
2211
+ markerBarY: markerBarY,
2212
+ markerBarWidth: markerBarWidth,
2213
+ markerBarHeight: markerBarHeight,
2214
+ valueMarkerX: valueMarkerX,
2215
+ valueMarkerY: valueMarkerY,
2216
+ gaugeStartX: gaugeStartX,
2217
+ gaugeStartY: gaugeStartY,
2218
+ gaugeWidth: gaugeWidth,
2219
+ gaugeHeight: gaugeHeight
2220
+ };
2221
+ }, [orientation, value, min, max]);
2222
+ var renderVisualization = react_1.useCallback(function (_ref) {
2223
+ var containerWidth = _ref.width,
2224
+ containerHeight = _ref.height;
2225
+
2226
+ // todo: need change the size when get design for smaller space
2227
+ // 58 is the title & description header height in dashboard visualization
2228
+ if ((containerWidth < MAX_VERTICAL_CONTAINER_WIDTH || containerHeight + 58 < MIN_VERTICAL_CONTAINER_HEIGHT) && orientation === 'vertical' || (containerWidth < MIN_HORIZONTAL_CONTAINER_WIDTH || containerHeight < MIN_HORIZONTAL_CONTAINER_HEIGHT) && orientation === 'horizontal') {
2229
+ return errorMessage(containerWidth, containerHeight, i18n_1._('Too small to render content'), errorId);
2230
+ }
2231
+
2232
+ if (error) {
2233
+ return errorMessage(containerWidth, containerHeight, error, errorId);
2234
+ }
2235
+
2236
+ var _calculateMarkerGauge = calculateMarkerGaugeDimensions(containerWidth, containerHeight),
2237
+ markerBarX = _calculateMarkerGauge.markerBarX,
2238
+ markerBarY = _calculateMarkerGauge.markerBarY,
2239
+ markerBarWidth = _calculateMarkerGauge.markerBarWidth,
2240
+ markerBarHeight = _calculateMarkerGauge.markerBarHeight,
2241
+ valueMarkerX = _calculateMarkerGauge.valueMarkerX,
2242
+ valueMarkerY = _calculateMarkerGauge.valueMarkerY,
2243
+ gaugeStartX = _calculateMarkerGauge.gaugeStartX,
2244
+ gaugeStartY = _calculateMarkerGauge.gaugeStartY,
2245
+ gaugeWidth = _calculateMarkerGauge.gaugeWidth,
2246
+ gaugeHeight = _calculateMarkerGauge.gaugeHeight;
2247
+
2248
+ return React.createElement(MarkerGaugeWrapper, {
2249
+ backgroundColor: backgroundColor
2250
+ }, React.createElement(MarkerGaugeContainer, {
2251
+ width: containerWidth,
2252
+ height: containerHeight
2253
+ }, React.createElement(MarkerGaugeSVG, {
2254
+ width: containerWidth,
2255
+ height: containerHeight
2256
+ }, linearGradient, React.createElement(BackgroundBar, {
2257
+ x: gaugeStartX,
2258
+ y: gaugeStartY,
2259
+ width: gaugeWidth,
2260
+ height: gaugeHeight,
2261
+ fillColor: fillColor
2262
+ }), React.createElement(GaugeMajorTicks_1.default, {
2263
+ width: gaugeWidth,
2264
+ height: gaugeHeight,
2265
+ startX: gaugeStartX,
2266
+ startY: gaugeStartY,
2267
+ min: min,
2268
+ max: max,
2269
+ majorUnit: majorUnit,
2270
+ orientation: orientation,
2271
+ showLabels: showLabels,
2272
+ usePercentageRange: usePercentageRange,
2273
+ majorTickFillColor: majorTickFillColor,
2274
+ majorTickStrokeColor: majorTickStrokeColor
2275
+ }), React.createElement(MarkerBar, {
2276
+ x: markerBarX,
2277
+ y: markerBarY,
2278
+ width: markerBarWidth,
2279
+ height: markerBarHeight,
2280
+ fill: "url(#".concat(linearGradientId, ")")
2281
+ }), React.createElement(GaugeValueMarker_1.default, {
2282
+ x: valueMarkerX,
2283
+ y: valueMarkerY,
2284
+ length: gaugeUtils_1.GAUGE_THICKNESS,
2285
+ min: min,
2286
+ max: max,
2287
+ value: value,
2288
+ orientation: orientation,
2289
+ showValue: showValue,
2290
+ usePercentageValue: usePercentageValue,
2291
+ valueMarkerFillColor: valueMarkerFillColor,
2292
+ valueMarkerLabelFillColor: valueMarkerLabelFillColor
2293
+ }))));
2294
+ }, [orientation, error, calculateMarkerGaugeDimensions, backgroundColor, linearGradient, fillColor, min, max, majorUnit, showLabels, usePercentageRange, majorTickFillColor, majorTickStrokeColor, linearGradientId, value, showValue, usePercentageValue, valueMarkerFillColor, valueMarkerLabelFillColor, errorMessage, errorId]);
2295
+ return React.createElement(Container, {
2296
+ width: width,
2297
+ height: height,
2298
+ backgroundColor: backgroundColor
2299
+ }, React.createElement(SizeAwareWrapper_1.default, null, function (containerDimension) {
2300
+ return renderVisualization(containerDimension);
2301
+ }));
2328
2302
  };
2329
2303
 
2330
- exports.default = withDashboardViz;
2331
-
2332
- /***/ }),
2333
-
2334
- /***/ 32:
2335
- /***/ (function(module, exports) {
2336
-
2337
- module.exports = require("@splunk/themes/getSettingsFromThemedProps");
2338
-
2339
- /***/ }),
2340
-
2341
- /***/ 33:
2342
- /***/ (function(module, exports) {
2343
-
2344
- module.exports = require("@splunk/visualization-encoding/Options");
2345
-
2346
- /***/ }),
2347
-
2348
- /***/ 34:
2349
- /***/ (function(module, exports) {
2350
-
2351
- module.exports = require("@splunk/visualizations-shared/SanitizeProps");
2304
+ MarkerGauge.propTypes = {
2305
+ width: T.oneOfType([T.string, T.number]),
2306
+ height: T.oneOfType([T.string, T.number]),
2307
+ value: T.number,
2308
+ // valueFieldName: T.string, // todo: need add it back when displaying name later
2309
+ orientation: T.oneOf(['horizontal', 'vertical']),
2310
+ majorUnit: T.oneOfType([T.string, T.number]),
2311
+ showLabels: T.bool,
2312
+ showValue: T.bool,
2313
+ usePercentageRange: T.bool,
2314
+ usePercentageValue: T.bool,
2315
+ backgroundColor: T.string,
2316
+ fillColor: T.string,
2317
+ ranges: T.arrayOf(T.shape({
2318
+ from: T.number.isRequired,
2319
+ to: T.number.isRequired,
2320
+ value: T.string.isRequired
2321
+ })),
2322
+ majorTickFillColor: T.string,
2323
+ majorTickStrokeColor: T.string,
2324
+ valueMarkerFillColor: T.string,
2325
+ valueMarkerLabelFillColor: T.string
2326
+ };
2327
+ MarkerGauge.defaultProps = {
2328
+ width: '100%',
2329
+ height: 250,
2330
+ orientation: 'vertical',
2331
+ majorUnit: 'auto',
2332
+ showLabels: true,
2333
+ showValue: true,
2334
+ usePercentageRange: false,
2335
+ usePercentageValue: false,
2336
+ backgroundColor: 'transparent',
2337
+ value: 0,
2338
+ fillColor: '#f2f4f5',
2339
+ majorTickFillColor: '#3c444d',
2340
+ majorTickStrokeColor: '#6b7785',
2341
+ valueMarkerFillColor: '#3c444d',
2342
+ valueMarkerLabelFillColor: '#f2f4f5',
2343
+ ranges: [{
2344
+ from: 0,
2345
+ to: 50,
2346
+ value: '#4BEBA8'
2347
+ }, {
2348
+ from: 50,
2349
+ to: 90,
2350
+ value: '#F4DF7A'
2351
+ }, {
2352
+ from: 90,
2353
+ to: 100,
2354
+ value: '#CB3B43'
2355
+ }]
2356
+ };
2357
+ exports.default = MarkerGauge;
2352
2358
 
2353
2359
  /***/ }),
2354
2360
 
2355
- /***/ 35:
2361
+ /***/ 407:
2356
2362
  /***/ (function(module, exports) {
2357
2363
 
2358
- module.exports = require("@splunk/moment");
2364
+ module.exports = require("@splunk/ui-utils/id");
2359
2365
 
2360
2366
  /***/ }),
2361
2367
 
2362
- /***/ 36:
2368
+ /***/ 408:
2363
2369
  /***/ (function(module, exports, __webpack_require__) {
2364
2370
 
2365
2371
  "use strict";
2366
2372
 
2367
2373
 
2368
- var _classCallCheck = __webpack_require__(10);
2369
-
2370
2374
  Object.defineProperty(exports, "__esModule", {
2371
2375
  value: true
2372
2376
  });
2373
- exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
2374
- /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
2375
-
2376
- var T = __webpack_require__(0);
2377
-
2378
- var lodash_1 = __webpack_require__(3);
2379
-
2380
- var VizActionHandler_1 = __webpack_require__(37); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
2381
-
2382
-
2383
- exports.INITIAL_WIDTH = 250;
2384
- exports.INITIAL_HEIGHT = 250;
2385
- /**
2386
- * A Splunk visualization
2387
- */
2388
-
2389
- var SplunkVisualization = function SplunkVisualization() {
2390
- _classCallCheck(this, SplunkVisualization);
2391
- };
2392
-
2393
- SplunkVisualization.propTypes = {
2394
- /**
2395
- * display mode
2396
- */
2397
- mode: T.oneOf(['view', 'edit', 'export']).isRequired,
2398
-
2399
- /**
2400
- * width in pixel or string, defaults to 100%
2401
- */
2402
- width: T.oneOfType([T.string, T.number]).isRequired,
2403
-
2404
- /**
2405
- * height in pixel or string
2406
- */
2407
- height: T.oneOfType([T.string, T.number]).isRequired,
2408
2377
 
2409
- /**
2410
- * visualization context used for dynamic option evaluation
2411
- */
2412
- context: T.object,
2378
+ var i18n_1 = __webpack_require__(2);
2413
2379
 
2414
- /**
2415
- * visualization formatting options
2416
- */
2417
- options: T.object,
2380
+ var GaugeMarker_1 = __webpack_require__(409);
2418
2381
 
2419
- /**
2420
- * A callback to update formatting options
2421
- */
2422
- onOptionsChange: T.func,
2382
+ var placeholders_1 = __webpack_require__(44);
2423
2383
 
2424
- /**
2425
- * datasource state which include data and request params, object key indicate the datasource type.
2426
- */
2427
- dataSources: T.objectOf(T.shape({
2428
- /**
2429
- * current request params
2430
- */
2431
- requestParams: T.object,
2384
+ var schemaUtils_1 = __webpack_require__(16);
2432
2385
 
2433
- /**
2434
- * current dataset
2435
- */
2436
- data: T.shape({
2437
- fields: T.array,
2438
- columns: T.array
2439
- }),
2386
+ var variables_1 = __webpack_require__(9);
2440
2387
 
2441
- /**
2442
- * error
2443
- */
2444
- error: T.shape({
2445
- level: T.string,
2446
- message: T.string
2447
- }),
2388
+ var pick_1 = __webpack_require__(21);
2448
2389
 
2449
- /**
2450
- * meta data that came with the dataset
2451
- */
2452
- meta: T.object
2453
- })),
2390
+ var Gauge_1 = __webpack_require__(110);
2454
2391
 
2455
- /**
2456
- * A callback to trigger event
2457
- */
2458
- onEventTrigger: T.func,
2392
+ var VizBehavior_1 = __webpack_require__(6);
2459
2393
 
2460
- /**
2461
- * Inform viz if there are handlers listening to events
2462
- */
2463
- hasEventHandlers: T.bool,
2394
+ var VizCategory_1 = __webpack_require__(31);
2464
2395
 
2465
- /**
2466
- * A callback to communicate computed props to a consumer
2467
- */
2468
- onComputedProps: T.func,
2396
+ var configUtils_1 = __webpack_require__(17);
2469
2397
 
2470
- /**
2471
- * A callback to obtain visualization api
2472
- */
2473
- vizActionHandlerRef: T.func,
2474
- loading: T.bool,
2475
- theme: T.object,
2398
+ var BackgroundColor_1 = __webpack_require__(50);
2476
2399
 
2477
- /**
2478
- * A callback to request new data with updated request params
2479
- */
2480
- onRequestParamsChange: T.func
2400
+ var dataContract = {
2401
+ requiredDataSources: [{
2402
+ name: 'primary',
2403
+ description: 'DataSource that powers the visualization'
2404
+ }],
2405
+ optionalDataSources: [],
2406
+ initialRequestParams: {
2407
+ primary: {
2408
+ offset: 0,
2409
+ count: 10000
2410
+ }
2411
+ }
2481
2412
  };
2482
- /**
2483
- *
2484
- */
2485
-
2486
- SplunkVisualization.defaultProps = {
2487
- // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
2488
- width: '100%',
2489
- height: exports.INITIAL_HEIGHT,
2490
- dataSources: {},
2491
- onEventTrigger: function onEventTrigger() {
2492
- return {};
2413
+ var size = {
2414
+ initialWidth: 300,
2415
+ initialHeight: 300
2416
+ };
2417
+ var defaultContext = {};
2418
+ var optionsSchema = {
2419
+ backgroundColor: {
2420
+ description: 'Specify the color used for the background. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
2421
+ type: 'string',
2422
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
2423
+ default: '> themes.defaultBackgroundColor'
2493
2424
  },
2494
- mode: 'view',
2495
- hasEventHandlers: false,
2496
- options: {},
2497
- context: {},
2498
- onOptionsChange: function onOptionsChange() {
2499
- return {};
2425
+ gaugeRanges: {
2426
+ description: 'Specify the overall range of the gauge as a series of continuous, color-coded subranges. For example, [{"from": 0, "to": 20, "value": "#4BEBA8"}, {"from": 20, "to": 50, "value": "#F4DF7A"}].',
2427
+ default: [{
2428
+ from: 0,
2429
+ to: 50,
2430
+ value: '#118832'
2431
+ }, {
2432
+ from: 50,
2433
+ to: 90,
2434
+ value: '#CBA700'
2435
+ }, {
2436
+ from: 90,
2437
+ to: 100,
2438
+ value: '#D41F1F'
2439
+ }],
2440
+ type: 'array',
2441
+ items: {
2442
+ type: 'object',
2443
+ properties: {
2444
+ from: {
2445
+ type: 'number',
2446
+ description: 'Starting value for range.'
2447
+ },
2448
+ to: {
2449
+ type: 'number',
2450
+ description: 'Ending value for range.'
2451
+ },
2452
+ value: {
2453
+ description: 'Color for sub range.',
2454
+ type: 'string',
2455
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
2456
+ }
2457
+ },
2458
+ required: ['from', 'to', 'value'],
2459
+ additionalProperties: false
2460
+ }
2461
+ },
2462
+ labelDisplay: {
2463
+ description: 'Specify whether to display the labels as numbers, percentages, or off.',
2464
+ default: 'number',
2465
+ type: 'string',
2466
+ pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off'])
2500
2467
  },
2501
- vizActionHandlerRef: function vizActionHandlerRef() {
2502
- return new VizActionHandler_1.DefaultVizActionHandler();
2468
+ majorTickInterval: {
2469
+ description: 'Specify, in pixels, the spacing between major tick marks.',
2470
+ default: 'auto',
2471
+ type: ['string', 'number']
2503
2472
  },
2504
- onComputedProps: function onComputedProps() {
2505
- return {};
2473
+ orientation: {
2474
+ description: 'Specify the axis orientation of the gauge.',
2475
+ default: 'vertical',
2476
+ type: 'string',
2477
+ pattern: schemaUtils_1.getPattern(['horizontal', 'vertical'])
2506
2478
  },
2507
- loading: false,
2508
- onRequestParamsChange: lodash_1.noop
2479
+ value: {
2480
+ description: 'Specify the dataSource applied to the value of the marker gauge.',
2481
+ type: 'string',
2482
+ default: '> primary | seriesByType("number") | lastPoint()'
2483
+ },
2484
+ valueDisplay: {
2485
+ description: 'Specify whether to display the value as a number, percentage, or off.',
2486
+ default: 'number',
2487
+ type: 'string',
2488
+ pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off'])
2489
+ }
2509
2490
  };
2510
- exports.default = SplunkVisualization;
2511
-
2512
- /***/ }),
2513
-
2514
- /***/ 37:
2515
- /***/ (function(module, exports, __webpack_require__) {
2516
-
2517
- "use strict";
2518
-
2519
-
2520
- var _classCallCheck = __webpack_require__(10);
2521
-
2522
- var _createClass = __webpack_require__(18);
2491
+ var themes = {
2492
+ defaultFillColor: function defaultFillColor(props) {
2493
+ return pick_1.default({
2494
+ enterprise: variables_1.default.backgroundColorHover(props),
2495
+ prisma: variables_1.default.neutral100(props)
2496
+ })(props);
2497
+ },
2498
+ defaultBackgroundColor: function defaultBackgroundColor(props) {
2499
+ return pick_1.default({
2500
+ enterprise: {
2501
+ dark: variables_1.default.black(props),
2502
+ light: variables_1.default.backgroundColor(props)
2503
+ },
2504
+ prisma: variables_1.default.backgroundColorSidebar(props)
2505
+ })(props);
2506
+ },
2507
+ majorTickFillColor: function majorTickFillColor(props) {
2508
+ return pick_1.default({
2509
+ enterprise: {
2510
+ light: variables_1.default.gray30(props),
2511
+ dark: variables_1.default.textGray(props) // was #D7DAE0
2523
2512
 
2524
- Object.defineProperty(exports, "__esModule", {
2525
- value: true
2526
- });
2527
- exports.DefaultVizActionHandler = void 0;
2513
+ },
2514
+ prisma: {
2515
+ // TODO: missed colors :(
2516
+ light: variables_1.default.neutral100(props),
2517
+ dark: variables_1.default.contentColorMuted(props) // was #D7DAE0; contentColor
2528
2518
 
2529
- var DefaultVizActionHandler = /*#__PURE__*/function () {
2530
- function DefaultVizActionHandler() {
2531
- _classCallCheck(this, DefaultVizActionHandler);
2519
+ }
2520
+ })(props);
2521
+ },
2522
+ majorTickStrokeColor: function majorTickStrokeColor(props) {
2523
+ return pick_1.default({
2524
+ enterprise: {
2525
+ light: variables_1.default.textGray(props),
2526
+ dark: variables_1.default.contentColorMuted(props)
2527
+ },
2528
+ prisma: variables_1.default.contentColorMuted(props)
2529
+ })(props);
2530
+ },
2531
+ valueMarkerFillColor: function valueMarkerFillColor(props) {
2532
+ return pick_1.default({
2533
+ enterprise: variables_1.default.textColor(props),
2534
+ prisma: {
2535
+ dark: variables_1.default.white(props),
2536
+ light: variables_1.default.black(props)
2537
+ }
2538
+ })(props);
2539
+ },
2540
+ valueMarkerLabelFillColor: function valueMarkerLabelFillColor(props) {
2541
+ return pick_1.default({
2542
+ enterprise: {
2543
+ light: variables_1.default.gray96(props),
2544
+ dark: variables_1.default.black(props)
2545
+ },
2546
+ prisma: variables_1.default.black(props)
2547
+ })(props);
2532
2548
  }
2533
-
2534
- _createClass(DefaultVizActionHandler, [{
2535
- key: "focus",
2536
- value: function focus() {// noop
2537
- }
2538
- }, {
2539
- key: "snapshot",
2540
- value: function snapshot() {
2541
- return null; // noop
2549
+ };
2550
+ var editorConfig = [{
2551
+ label: i18n_1._('Select Data Field'),
2552
+ layout: [[{
2553
+ label: i18n_1._('Data field'),
2554
+ editor: 'editor.columnSelector',
2555
+ option: 'value',
2556
+ context: 'defaultContext',
2557
+ editorProps: {
2558
+ dataSourceKey: 'primary',
2559
+ prepareValue: function prepareValue(definition) {
2560
+ var value = definition.options.value;
2561
+ return {
2562
+ context: {},
2563
+ options: {
2564
+ value: "".concat(value, " | lastPoint()")
2565
+ }
2566
+ };
2567
+ }
2542
2568
  }
2543
- }]);
2544
-
2545
- return DefaultVizActionHandler;
2546
- }();
2547
-
2548
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
2549
-
2550
- /***/ }),
2551
-
2552
- /***/ 38:
2553
- /***/ (function(module, exports, __webpack_require__) {
2554
-
2555
- "use strict";
2556
-
2557
-
2558
- Object.defineProperty(exports, "__esModule", {
2559
- value: true
2560
- });
2561
- exports.validSortDirs = void 0;
2562
- exports.validSortDirs = ['asc', 'desc', 'none'];
2563
-
2564
- /***/ }),
2565
-
2566
- /***/ 39:
2567
- /***/ (function(module, exports, __webpack_require__) {
2568
-
2569
- "use strict";
2570
-
2571
-
2572
- Object.defineProperty(exports, "__esModule", {
2573
- value: true
2574
- });
2575
- exports.useDeepMemo = void 0;
2576
-
2577
- var react_1 = __webpack_require__(1);
2569
+ }]]
2570
+ }, Gauge_1.default, {
2571
+ label: i18n_1._('Coloring'),
2572
+ layout: [[{
2573
+ label: i18n_1._('Gauge Ranges'),
2574
+ option: 'gaugeRanges',
2575
+ editor: 'editor.threshold',
2576
+ editorProps: {
2577
+ openRanges: false,
2578
+ isTogglable: false // Can not disable thresholds
2578
2579
 
2579
- var lodash_1 = __webpack_require__(3);
2580
+ }
2581
+ }], BackgroundColor_1.default({
2582
+ themes: themes,
2583
+ labelPosition: 'top'
2584
+ })]
2585
+ }];
2580
2586
  /**
2581
- * This hook evaluates and stores the result of a passed function and only
2582
- * re-evaluates the function when passed dependencies change.
2583
- *
2584
- * It is different from the internal React useMemo in the following aspects:
2585
- * - it only stores the last evaluated result
2586
- * - it uses a deep equality check to determine if dependencies have changed
2587
- *
2588
- * Inspired by apollo-client's useDeepMemo
2589
- *
2590
- * @param fn the function to be executed and
2591
- * @param dependencies an array of dependencies
2587
+ * visualization configuration
2592
2588
  */
2593
2589
 
2590
+ var config = {
2591
+ /**
2592
+ * unique viz key
2593
+ */
2594
+ key: 'splunk.markergauge',
2594
2595
 
2595
- var useDeepMemo = function useDeepMemo(fn, dependencies) {
2596
- var ref = react_1.useRef();
2597
-
2598
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
2599
- ref.current = {
2600
- dependencies: dependencies,
2601
- value: fn()
2602
- };
2603
- }
2596
+ /**
2597
+ * viz name
2598
+ */
2599
+ name: 'MarkerGauge',
2600
+ category: VizCategory_1.VizCategory.GAUGE,
2604
2601
 
2605
- return ref.current.value;
2602
+ /**
2603
+ * viz icon
2604
+ */
2605
+ icon: GaugeMarker_1.default,
2606
+ placeholderIcon: placeholders_1.MarkerGauge,
2607
+ dataContract: dataContract,
2608
+ size: size,
2609
+ defaultContext: defaultContext,
2610
+ optionsSchema: optionsSchema,
2611
+ editorConfig: editorConfig,
2612
+ supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
2613
+ themes: themes
2606
2614
  };
2607
-
2608
- exports.useDeepMemo = useDeepMemo;
2615
+ exports.default = configUtils_1.enhanceConfig(config);
2609
2616
 
2610
2617
  /***/ }),
2611
2618
 
2612
- /***/ 4:
2619
+ /***/ 409:
2613
2620
  /***/ (function(module, exports) {
2614
2621
 
2615
- module.exports = require("styled-components");
2622
+ module.exports = require("@splunk/react-icons/GaugeMarker");
2616
2623
 
2617
2624
  /***/ }),
2618
2625
 
2619
- /***/ 40:
2626
+ /***/ 41:
2620
2627
  /***/ (function(module, exports, __webpack_require__) {
2621
2628
 
2622
2629
  "use strict";
@@ -2627,15 +2634,15 @@ Object.defineProperty(exports, "__esModule", {
2627
2634
  });
2628
2635
  exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
2629
2636
 
2630
- var React = __webpack_require__(1);
2637
+ var React = __webpack_require__(0);
2631
2638
 
2632
- var T = __webpack_require__(0);
2639
+ var T = __webpack_require__(1);
2633
2640
 
2634
2641
  var i18n_1 = __webpack_require__(2);
2635
2642
 
2636
- var Message_1 = __webpack_require__(9);
2643
+ var Message_1 = __webpack_require__(10);
2637
2644
 
2638
- var FixedSizeContainer_1 = __webpack_require__(12);
2645
+ var FixedSizeContainer_1 = __webpack_require__(13);
2639
2646
  /**
2640
2647
  * @method isMissing
2641
2648
  * @param {any} v
@@ -2697,7 +2704,7 @@ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
2697
2704
 
2698
2705
  /***/ }),
2699
2706
 
2700
- /***/ 41:
2707
+ /***/ 42:
2701
2708
  /***/ (function(module, exports, __webpack_require__) {
2702
2709
 
2703
2710
  "use strict";
@@ -2707,18 +2714,18 @@ Object.defineProperty(exports, "__esModule", {
2707
2714
  value: true
2708
2715
  });
2709
2716
 
2710
- var React = __webpack_require__(1);
2717
+ var React = __webpack_require__(0);
2711
2718
 
2712
2719
  var styled_components_1 = __webpack_require__(4);
2713
2720
 
2714
- var hocUtils_1 = __webpack_require__(13);
2721
+ var hocUtils_1 = __webpack_require__(14);
2715
2722
 
2716
2723
  var Cover = styled_components_1.default.div.withConfig({
2717
2724
  displayName: "withEditModeCover__Cover",
2718
2725
  componentId: "sc-1gsbnxb-0"
2719
2726
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
2720
2727
  var Blocker = styled_components_1.default.div.attrs({
2721
- 'data-splunk-visualization-version': "25.1.0 - 812a9a4d8"
2728
+ 'data-splunk-visualization-version': "25.3.0 - dae70ec02"
2722
2729
  }).withConfig({
2723
2730
  displayName: "withEditModeCover__Blocker",
2724
2731
  componentId: "sc-1gsbnxb-1"
@@ -2750,7 +2757,7 @@ exports.default = withEditModeCover;
2750
2757
 
2751
2758
  /***/ }),
2752
2759
 
2753
- /***/ 42:
2760
+ /***/ 43:
2754
2761
  /***/ (function(module, exports, __webpack_require__) {
2755
2762
 
2756
2763
  "use strict";
@@ -2760,17 +2767,17 @@ Object.defineProperty(exports, "__esModule", {
2760
2767
  value: true
2761
2768
  });
2762
2769
 
2763
- var React = __webpack_require__(1);
2770
+ var React = __webpack_require__(0);
2764
2771
 
2765
- var colorUtils_1 = __webpack_require__(11);
2772
+ var colorUtils_1 = __webpack_require__(12);
2766
2773
 
2767
- var variables_1 = __webpack_require__(8);
2774
+ var variables_1 = __webpack_require__(9);
2768
2775
 
2769
2776
  var IconPlaceholder_1 = __webpack_require__(27);
2770
2777
 
2771
- var VizBehavior_1 = __webpack_require__(5);
2778
+ var VizBehavior_1 = __webpack_require__(6);
2772
2779
 
2773
- var hocUtils_1 = __webpack_require__(13);
2780
+ var hocUtils_1 = __webpack_require__(14);
2774
2781
 
2775
2782
  var withPlaceholder = function withPlaceholder(Visualization) {
2776
2783
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
@@ -2815,28 +2822,28 @@ exports.default = withPlaceholder;
2815
2822
 
2816
2823
  /***/ }),
2817
2824
 
2818
- /***/ 43:
2825
+ /***/ 44:
2819
2826
  /***/ (function(module, exports) {
2820
2827
 
2821
- module.exports = require("@splunk/visualizations-shared/colorConstants");
2828
+ module.exports = require("@splunk/visualization-icons/placeholders");
2822
2829
 
2823
2830
  /***/ }),
2824
2831
 
2825
2832
  /***/ 45:
2826
2833
  /***/ (function(module, exports) {
2827
2834
 
2828
- module.exports = require("@splunk/visualization-icons/placeholders");
2835
+ module.exports = require("@splunk/visualizations-shared/colorConstants");
2829
2836
 
2830
2837
  /***/ }),
2831
2838
 
2832
- /***/ 47:
2839
+ /***/ 48:
2833
2840
  /***/ (function(module, exports) {
2834
2841
 
2835
2842
  module.exports = require("@babel/runtime/helpers/extends");
2836
2843
 
2837
2844
  /***/ }),
2838
2845
 
2839
- /***/ 49:
2846
+ /***/ 50:
2840
2847
  /***/ (function(module, exports, __webpack_require__) {
2841
2848
 
2842
2849
  "use strict";
@@ -2867,7 +2874,7 @@ exports.default = background;
2867
2874
 
2868
2875
  /***/ }),
2869
2876
 
2870
- /***/ 5:
2877
+ /***/ 6:
2871
2878
  /***/ (function(module, exports, __webpack_require__) {
2872
2879
 
2873
2880
  "use strict";
@@ -2905,34 +2912,27 @@ var VizBehavior;
2905
2912
 
2906
2913
  /***/ }),
2907
2914
 
2908
- /***/ 6:
2909
- /***/ (function(module, exports) {
2910
-
2911
- module.exports = require("@babel/runtime/helpers/defineProperty");
2912
-
2913
- /***/ }),
2914
-
2915
2915
  /***/ 7:
2916
2916
  /***/ (function(module, exports) {
2917
2917
 
2918
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
2918
+ module.exports = require("@babel/runtime/helpers/defineProperty");
2919
2919
 
2920
2920
  /***/ }),
2921
2921
 
2922
2922
  /***/ 8:
2923
2923
  /***/ (function(module, exports) {
2924
2924
 
2925
- module.exports = require("@splunk/themes/variables");
2925
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
2926
2926
 
2927
2927
  /***/ }),
2928
2928
 
2929
- /***/ 80:
2929
+ /***/ 85:
2930
2930
  /***/ (function(module, exports, __webpack_require__) {
2931
2931
 
2932
2932
  "use strict";
2933
2933
 
2934
2934
 
2935
- var _toConsumableArray = __webpack_require__(7);
2935
+ var _toConsumableArray = __webpack_require__(8);
2936
2936
 
2937
2937
  Object.defineProperty(exports, "__esModule", {
2938
2938
  value: true
@@ -2941,7 +2941,7 @@ exports.convertToGaugeProperties = exports.mapValueLabelDisplay = exports.mapToO
2941
2941
 
2942
2942
  var lodash_1 = __webpack_require__(3);
2943
2943
 
2944
- var colorConstants_1 = __webpack_require__(43);
2944
+ var colorConstants_1 = __webpack_require__(45);
2945
2945
 
2946
2946
  var i18n_1 = __webpack_require__(2);
2947
2947
 
@@ -3698,7 +3698,7 @@ exports.convertToGaugeProperties = convertToGaugeProperties;
3698
3698
  /***/ 9:
3699
3699
  /***/ (function(module, exports) {
3700
3700
 
3701
- module.exports = require("@splunk/visualizations-shared/Message");
3701
+ module.exports = require("@splunk/themes/variables");
3702
3702
 
3703
3703
  /***/ })
3704
3704