@splunk/visualizations 25.1.0 → 25.2.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 (172) 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_Width_Height.png +0 -0
  48. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Percentage_50.png +0 -0
  49. package/.loki/reference/chrome_docker_Visualizations_Events_Events_With_Options.png +0 -0
  50. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_ES.png +0 -0
  51. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_after.png +0 -0
  52. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_before.png +0 -0
  53. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_After.png +0 -0
  54. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_Before.png +0 -0
  55. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_After.png +0 -0
  56. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_Before.png +0 -0
  57. package/Area.config.js +14 -14
  58. package/Area.config.js.map +1 -1
  59. package/Area.js +171 -160
  60. package/Area.js.map +1 -1
  61. package/Bar.config.js +14 -14
  62. package/Bar.config.js.map +1 -1
  63. package/Bar.js +171 -160
  64. package/Bar.js.map +1 -1
  65. package/Bubble.config.js +18 -11
  66. package/Bubble.config.js.map +1 -1
  67. package/Bubble.js +173 -155
  68. package/Bubble.js.map +1 -1
  69. package/ChoroplethSvg.config.js +3 -3
  70. package/ChoroplethSvg.config.js.map +1 -1
  71. package/ChoroplethSvg.js +158 -148
  72. package/ChoroplethSvg.js.map +1 -1
  73. package/Column.config.js +14 -14
  74. package/Column.config.js.map +1 -1
  75. package/Column.js +170 -160
  76. package/Column.js.map +1 -1
  77. package/Ellipse.js +125 -115
  78. package/Ellipse.js.map +1 -1
  79. package/Events.config.js +668 -0
  80. package/Events.config.js.map +1 -0
  81. package/Events.js +3116 -0
  82. package/Events.js.map +1 -0
  83. package/FillerGauge.config.js +17 -16
  84. package/FillerGauge.config.js.map +1 -1
  85. package/FillerGauge.js +159 -142
  86. package/FillerGauge.js.map +1 -1
  87. package/Image.config.js +2 -2
  88. package/Image.config.js.map +1 -1
  89. package/Image.js +109 -109
  90. package/Image.js.map +1 -1
  91. package/Line.config.js +17 -16
  92. package/Line.config.js.map +1 -1
  93. package/Line.js +180 -163
  94. package/Line.js.map +1 -1
  95. package/LinkGraph.config.js +12 -5
  96. package/LinkGraph.config.js.map +1 -1
  97. package/LinkGraph.js +24318 -387
  98. package/LinkGraph.js.map +1 -1
  99. package/Map.config.js +27 -26
  100. package/Map.config.js.map +1 -1
  101. package/Map.js +3065 -3126
  102. package/Map.js.map +1 -1
  103. package/Markdown.config.js +6 -6
  104. package/Markdown.config.js.map +1 -1
  105. package/Markdown.js +332 -332
  106. package/Markdown.js.map +1 -1
  107. package/MarkerGauge.config.js +13 -13
  108. package/MarkerGauge.config.js.map +1 -1
  109. package/MarkerGauge.js +1147 -1147
  110. package/MarkerGauge.js.map +1 -1
  111. package/ParallelCoordinates.config.js +11 -11
  112. package/ParallelCoordinates.config.js.map +1 -1
  113. package/ParallelCoordinates.js +588 -695
  114. package/ParallelCoordinates.js.map +1 -1
  115. package/Pie.config.js +13 -13
  116. package/Pie.config.js.map +1 -1
  117. package/Pie.js +1164 -1164
  118. package/Pie.js.map +1 -1
  119. package/Punchcard.config.js +11 -11
  120. package/Punchcard.config.js.map +1 -1
  121. package/Punchcard.js +2628 -2744
  122. package/Punchcard.js.map +1 -1
  123. package/Rectangle.config.js +4 -4
  124. package/Rectangle.config.js.map +1 -1
  125. package/Rectangle.js +704 -704
  126. package/Rectangle.js.map +1 -1
  127. package/Sankey.config.js +15 -15
  128. package/Sankey.config.js.map +1 -1
  129. package/Sankey.js +3124 -3245
  130. package/Sankey.js.map +1 -1
  131. package/Scatter.config.js +21 -13
  132. package/Scatter.config.js.map +1 -1
  133. package/Scatter.js +1395 -1388
  134. package/Scatter.js.map +1 -1
  135. package/SingleValue.config.js +8 -7
  136. package/SingleValue.config.js.map +1 -1
  137. package/SingleValue.js +2136 -2136
  138. package/SingleValue.js.map +1 -1
  139. package/SingleValueBasic.js +28 -28
  140. package/SingleValueBasic.js.map +1 -1
  141. package/SingleValueIcon.config.js +8 -7
  142. package/SingleValueIcon.config.js.map +1 -1
  143. package/SingleValueIcon.js +1249 -1390
  144. package/SingleValueIcon.js.map +1 -1
  145. package/SingleValueRadial.config.js +8 -7
  146. package/SingleValueRadial.config.js.map +1 -1
  147. package/SingleValueRadial.js +1926 -1926
  148. package/SingleValueRadial.js.map +1 -1
  149. package/Table.config.js +4 -4
  150. package/Table.config.js.map +1 -1
  151. package/Table.js +2158 -2155
  152. package/Table.js.map +1 -1
  153. package/common/EventsDoc.js +15 -8
  154. package/common/EventsDoc.js.map +1 -1
  155. package/common/GaugeMajorTicks.js +2 -2
  156. package/common/GaugeValueMarker.js +2 -2
  157. package/common/OptionsDoc.js +9 -8
  158. package/common/OptionsDoc.js.map +1 -1
  159. package/common/ThemesDoc.js +2 -2
  160. package/common/utils/dataUtils.js +136 -0
  161. package/common/utils/dataUtils.js.map +1 -0
  162. package/common/utils/hocUtils.js +2 -2
  163. package/common/utils/hocUtils.js.map +1 -1
  164. package/common/utils/mapUtils.js +11 -10
  165. package/common/utils/mapUtils.js.map +1 -1
  166. package/common/utils/singleValueUtils.js +3 -2
  167. package/common/utils/singleValueUtils.js.map +1 -1
  168. package/common/utils/testHelper.js +8 -8
  169. package/common/utils/testHelper.js.map +1 -1
  170. package/common/withDashboardViz.js +2 -2
  171. package/common/withDashboardViz.js.map +1 -1
  172. package/package.json +14 -12
package/Scatter.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 = 254);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 437);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -109,18 +109,25 @@ module.exports = require("react");
109
109
  /***/ 10:
110
110
  /***/ (function(module, exports) {
111
111
 
112
- module.exports = require("@babel/runtime/helpers/classCallCheck");
112
+ module.exports = require("@splunk/visualizations-shared/Message");
113
113
 
114
114
  /***/ }),
115
115
 
116
116
  /***/ 11:
117
117
  /***/ (function(module, exports) {
118
118
 
119
- module.exports = require("@splunk/visualizations-shared/colorUtils");
119
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
120
120
 
121
121
  /***/ }),
122
122
 
123
123
  /***/ 12:
124
+ /***/ (function(module, exports) {
125
+
126
+ module.exports = require("@splunk/visualizations-shared/colorUtils");
127
+
128
+ /***/ }),
129
+
130
+ /***/ 13:
124
131
  /***/ (function(module, exports, __webpack_require__) {
125
132
 
126
133
  "use strict";
@@ -134,11 +141,11 @@ var React = __webpack_require__(1);
134
141
 
135
142
  var styled_components_1 = __webpack_require__(4);
136
143
 
137
- var SizeAwareWrapper_1 = __webpack_require__(19);
144
+ var SizeAwareWrapper_1 = __webpack_require__(20);
138
145
 
139
- var style_1 = __webpack_require__(14);
146
+ var style_1 = __webpack_require__(15);
140
147
 
141
- var colorUtils_1 = __webpack_require__(11);
148
+ var colorUtils_1 = __webpack_require__(12);
142
149
 
143
150
  var Item = styled_components_1.default.div.attrs(function (_ref) {
144
151
  var width = _ref.width;
@@ -195,7 +202,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
195
202
 
196
203
  return React.createElement(FixSizeItem, {
197
204
  "data-test": "fix-size-item",
198
- "data-splunk-visualization-version": "25.1.0 - 812a9a4d8",
205
+ "data-splunk-visualization-version": "25.2.0 - 4373c5a66",
199
206
  width: width,
200
207
  height: height,
201
208
  backgroundColor: backgroundColor
@@ -217,7 +224,7 @@ exports.default = withFixedSizeContainer;
217
224
 
218
225
  /***/ }),
219
226
 
220
- /***/ 13:
227
+ /***/ 14:
221
228
  /***/ (function(module, exports, __webpack_require__) {
222
229
 
223
230
  "use strict";
@@ -250,7 +257,7 @@ exports.extendStaticWrapperProps = extendStaticWrapperProps;
250
257
 
251
258
  /***/ }),
252
259
 
253
- /***/ 139:
260
+ /***/ 149:
254
261
  /***/ (function(module, exports, __webpack_require__) {
255
262
 
256
263
  "use strict";
@@ -278,21 +285,21 @@ var lodash_1 = __webpack_require__(3); // Charting imports i18n which needs to b
278
285
  // eslint-disable-next-line import/order
279
286
 
280
287
 
281
- var Charting_1 = __webpack_require__(55);
288
+ var Charting_1 = __webpack_require__(56);
282
289
 
283
- var charting_bundle_1 = __webpack_require__(51);
290
+ var charting_bundle_1 = __webpack_require__(53);
284
291
 
285
- var simpleXMLOptions_1 = __webpack_require__(61);
292
+ var simpleXMLOptions_1 = __webpack_require__(62);
286
293
 
287
- var config_1 = __webpack_require__(255);
294
+ var config_1 = __webpack_require__(438);
288
295
 
289
296
  exports.config = config_1.default;
290
297
 
291
- var withDashboardViz_1 = __webpack_require__(31);
298
+ var withDashboardViz_1 = __webpack_require__(32);
292
299
 
293
- var scatterUtils_1 = __webpack_require__(256);
300
+ var scatterUtils_1 = __webpack_require__(439);
294
301
 
295
- var chartingUtils_1 = __webpack_require__(50);
302
+ var chartingUtils_1 = __webpack_require__(52);
296
303
 
297
304
  var validOptions = Object.keys(config_1.default.optionsSchema);
298
305
 
@@ -368,29 +375,29 @@ exports.default = Column;
368
375
 
369
376
  /***/ }),
370
377
 
371
- /***/ 14:
378
+ /***/ 15:
372
379
  /***/ (function(module, exports) {
373
380
 
374
381
  module.exports = require("@splunk/visualizations-shared/style");
375
382
 
376
383
  /***/ }),
377
384
 
378
- /***/ 15:
385
+ /***/ 16:
379
386
  /***/ (function(module, exports) {
380
387
 
381
388
  module.exports = require("@splunk/visualizations-shared/schemaUtils");
382
389
 
383
390
  /***/ }),
384
391
 
385
- /***/ 16:
392
+ /***/ 17:
386
393
  /***/ (function(module, exports, __webpack_require__) {
387
394
 
388
395
  "use strict";
389
396
 
390
397
 
391
- var _toConsumableArray = __webpack_require__(7);
398
+ var _toConsumableArray = __webpack_require__(8);
392
399
 
393
- var _defineProperty = __webpack_require__(6);
400
+ var _defineProperty = __webpack_require__(7);
394
401
 
395
402
  var __rest = this && this.__rest || function (s, e) {
396
403
  var t = {};
@@ -412,9 +419,9 @@ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig
412
419
 
413
420
  var lodash_1 = __webpack_require__(3);
414
421
 
415
- var schemaUtils_1 = __webpack_require__(15);
422
+ var schemaUtils_1 = __webpack_require__(16);
416
423
 
417
- var VizBehavior_1 = __webpack_require__(5);
424
+ var VizBehavior_1 = __webpack_require__(6);
418
425
 
419
426
  var dynamicOptionsDSLType = {
420
427
  type: 'string',
@@ -619,24 +626,24 @@ exports.insertLayout = insertLayout;
619
626
 
620
627
  /***/ }),
621
628
 
622
- /***/ 18:
629
+ /***/ 19:
623
630
  /***/ (function(module, exports) {
624
631
 
625
632
  module.exports = require("@babel/runtime/helpers/createClass");
626
633
 
627
634
  /***/ }),
628
635
 
629
- /***/ 19:
636
+ /***/ 2:
630
637
  /***/ (function(module, exports) {
631
638
 
632
- module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
639
+ module.exports = require("@splunk/ui-utils/i18n");
633
640
 
634
641
  /***/ }),
635
642
 
636
- /***/ 2:
643
+ /***/ 20:
637
644
  /***/ (function(module, exports) {
638
645
 
639
- module.exports = require("@splunk/ui-utils/i18n");
646
+ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
640
647
 
641
648
  /***/ }),
642
649
 
@@ -647,603 +654,270 @@ module.exports = require("@splunk/themes/pick");
647
654
 
648
655
  /***/ }),
649
656
 
650
- /***/ 22:
657
+ /***/ 23:
651
658
  /***/ (function(module, exports) {
652
659
 
653
660
  module.exports = require("@splunk/visualization-context/TimezoneContext");
654
661
 
655
662
  /***/ }),
656
663
 
657
- /***/ 23:
664
+ /***/ 24:
658
665
  /***/ (function(module, exports) {
659
666
 
660
667
  module.exports = require("@splunk/visualizations-shared/propUtils");
661
668
 
662
669
  /***/ }),
663
670
 
664
- /***/ 24:
671
+ /***/ 25:
665
672
  /***/ (function(module, exports) {
666
673
 
667
674
  module.exports = require("@splunk/visualizations-shared/hocUtils");
668
675
 
669
676
  /***/ }),
670
677
 
671
- /***/ 25:
678
+ /***/ 26:
672
679
  /***/ (function(module, exports) {
673
680
 
674
681
  module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
675
682
 
676
683
  /***/ }),
677
684
 
678
- /***/ 254:
685
+ /***/ 27:
679
686
  /***/ (function(module, exports, __webpack_require__) {
680
687
 
681
688
  "use strict";
682
689
 
683
690
 
684
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
685
- if (k2 === undefined) k2 = k;
686
- Object.defineProperty(o, k2, {
687
- enumerable: true,
688
- get: function get() {
689
- return m[k];
690
- }
691
- });
692
- } : function (o, m, k, k2) {
693
- if (k2 === undefined) k2 = k;
694
- o[k2] = m[k];
691
+ Object.defineProperty(exports, "__esModule", {
692
+ value: true
695
693
  });
694
+ exports.shouldShowIconPlaceholder = void 0;
696
695
 
697
- var __exportStar = this && this.__exportStar || function (m, exports) {
698
- for (var p in m) {
699
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
696
+ var React = __webpack_require__(1);
697
+
698
+ var T = __webpack_require__(0);
699
+
700
+ var lodash_1 = __webpack_require__(3);
701
+
702
+ var i18n_1 = __webpack_require__(2);
703
+
704
+ var Message_1 = __webpack_require__(10);
705
+
706
+ var FixedSizeContainer_1 = __webpack_require__(13);
707
+ /**
708
+ * @method shouldShowIconPlaceholder
709
+ * @param {object} dataSources
710
+ * @param {boolean} loading
711
+ * @returns {boolean}
712
+ */
713
+
714
+
715
+ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
716
+ var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
717
+ var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
718
+ var noData = data === undefined;
719
+ var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
720
+ var noFields = fields === undefined;
721
+ return loading || noData || noFields;
722
+ };
723
+
724
+ exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
725
+ var propTypes = {
726
+ icon: T.func,
727
+ width: T.oneOfType([T.string, T.number]),
728
+ height: T.oneOfType([T.string, T.number]),
729
+ // eslint-disable-next-line react/no-unused-prop-types
730
+ backgroundColor: T.string,
731
+ iconColor: T.string
732
+ };
733
+ /**
734
+ * @method IconPlaceholder
735
+ * @param {IconPlaceholderProps} props
736
+ * @returns {React.ReactElement}
737
+ */
738
+
739
+ var IconPlaceholder = function IconPlaceholder(props) {
740
+ var width = props.width,
741
+ height = props.height,
742
+ icon = props.icon,
743
+ iconColor = props.iconColor;
744
+
745
+ if (icon) {
746
+ return React.createElement(icon, {
747
+ style: {
748
+ left: '50%',
749
+ top: '50%',
750
+ color: iconColor,
751
+ opacity: 0.15,
752
+ position: 'absolute',
753
+ transform: 'translate(-50%, -50%)'
754
+ },
755
+ width: '50%',
756
+ height: '50%'
757
+ });
700
758
  }
759
+
760
+ return React.createElement(Message_1.default, {
761
+ width: width,
762
+ height: height,
763
+ level: "warning",
764
+ message: i18n_1._('No DataSource Connected')
765
+ });
766
+ };
767
+
768
+ IconPlaceholder.propTypes = propTypes;
769
+ IconPlaceholder.defaultProps = {
770
+ width: '100%',
771
+ height: 250
701
772
  };
773
+ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
774
+
775
+ /***/ }),
776
+
777
+ /***/ 28:
778
+ /***/ (function(module, exports, __webpack_require__) {
779
+
780
+ "use strict";
781
+
782
+
783
+ var _defineProperty = __webpack_require__(7);
702
784
 
703
785
  Object.defineProperty(exports, "__esModule", {
704
786
  value: true
705
787
  });
706
- exports.default = void 0;
788
+ exports.getSortingParams = exports.SortParamsPropTypes = void 0;
789
+
790
+ var T = __webpack_require__(0);
707
791
 
708
- __exportStar(__webpack_require__(139), exports);
792
+ var lodash_1 = __webpack_require__(3);
709
793
 
710
- var Scatter_1 = __webpack_require__(139);
794
+ var DataSource_1 = __webpack_require__(39);
711
795
 
712
- Object.defineProperty(exports, "default", {
713
- enumerable: true,
714
- get: function get() {
715
- return Scatter_1.default;
716
- }
796
+ exports.SortParamsPropTypes = T.shape({
797
+ currentSortKey: T.string,
798
+ currentSortDir: T.oneOf(DataSource_1.validSortDirs),
799
+ onSort: T.func
717
800
  });
718
801
 
802
+ var getSortingParams = function getSortingParams(_ref) {
803
+ var requestParams = _ref.requestParams,
804
+ onRequestParamsChange = _ref.onRequestParamsChange;
805
+ var currentSortKey;
806
+ var currentSortDir;
807
+ var nextSortDirMap = {
808
+ asc: 'desc',
809
+ desc: 'asc',
810
+ none: 'asc'
811
+ };
812
+ var onSort;
813
+
814
+ if (lodash_1.isFunction(onRequestParamsChange)) {
815
+ if (requestParams && lodash_1.has(requestParams, 'sort')) {
816
+ currentSortKey = Object.keys(requestParams.sort).shift();
817
+ currentSortDir = requestParams.sort[currentSortKey];
818
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
819
+
820
+
821
+ onSort = function onSort(e, _ref2) {
822
+ var sortKey = _ref2.sortKey,
823
+ sortDir = _ref2.sortDir;
824
+
825
+ if (typeof sortKey === 'string') {
826
+ var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
827
+ onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
828
+ offset: 0,
829
+ sort: _defineProperty({}, sortKey, nextSortDir)
830
+ }));
831
+ } else {
832
+ onRequestParamsChange(requestParams);
833
+ }
834
+ };
835
+ }
836
+
837
+ return {
838
+ currentSortKey: currentSortKey,
839
+ currentSortDir: currentSortDir,
840
+ onSort: onSort
841
+ };
842
+ };
843
+
844
+ exports.getSortingParams = getSortingParams;
845
+
719
846
  /***/ }),
720
847
 
721
- /***/ 255:
848
+ /***/ 29:
722
849
  /***/ (function(module, exports, __webpack_require__) {
723
850
 
724
851
  "use strict";
725
852
 
726
853
 
727
- var _toConsumableArray = __webpack_require__(7);
728
-
729
854
  Object.defineProperty(exports, "__esModule", {
730
855
  value: true
731
856
  });
732
- exports.optionsSchema = void 0;
857
+ exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
733
858
 
734
- var visualization_icons_1 = __webpack_require__(46);
859
+ var T = __webpack_require__(0);
735
860
 
736
- var placeholders_1 = __webpack_require__(45);
861
+ var lodash_1 = __webpack_require__(3);
737
862
 
738
- var pick_1 = __webpack_require__(21);
863
+ exports.PaginatorParamsPropTypes = T.shape({
864
+ isPaging: T.bool,
865
+ current: T.number,
866
+ totalPages: T.number,
867
+ onChange: T.func
868
+ });
739
869
 
740
- var variables_1 = __webpack_require__(8);
870
+ var getPaginationParams = function getPaginationParams(_ref) {
871
+ var requestParams = _ref.requestParams,
872
+ meta = _ref.meta,
873
+ onRequestParamsChange = _ref.onRequestParamsChange;
874
+ var totalCount = meta && meta.totalCount || 0;
875
+ var offset = requestParams && requestParams.offset || 0;
876
+ var count = requestParams && requestParams.count;
877
+ var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
878
+ var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
879
+ var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
741
880
 
742
- var schemaUtils_1 = __webpack_require__(15);
881
+ var onChangeHandler = function onChangeHandler(e, _ref2) {
882
+ var page = _ref2.page,
883
+ countArg = _ref2.count;
884
+ var newParams = lodash_1.cloneDeep(requestParams);
743
885
 
744
- var visualization_color_palettes_1 = __webpack_require__(44);
886
+ if (typeof countArg === 'number') {
887
+ newParams.count = countArg;
888
+ newParams.offset = 0;
889
+ }
745
890
 
746
- var i18n_1 = __webpack_require__(2);
891
+ var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
747
892
 
748
- var VizBehavior_1 = __webpack_require__(5);
893
+ if (typeof page === 'number' && page > 0) {
894
+ newParams.count = pageCount;
895
+ newParams.offset = (page - 1) * pageCount;
896
+ }
749
897
 
750
- var VizCategory_1 = __webpack_require__(30);
898
+ onRequestParamsChange(newParams);
899
+ };
751
900
 
752
- var configUtils_1 = __webpack_require__(16);
901
+ return {
902
+ isPaging: isPaging,
903
+ current: current,
904
+ totalPages: totalPages,
905
+ onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
906
+ };
907
+ };
753
908
 
754
- var AxesChartDataConfig_1 = __webpack_require__(63);
909
+ exports.getPaginationParams = getPaginationParams;
755
910
 
756
- var AxesChartXGridAndLabels_1 = __webpack_require__(66);
911
+ /***/ }),
757
912
 
758
- var AxesChartColorAndStyle_1 = __webpack_require__(64);
913
+ /***/ 3:
914
+ /***/ (function(module, exports) {
759
915
 
760
- var AxesChartLegend_1 = __webpack_require__(65);
916
+ module.exports = require("lodash");
761
917
 
762
- var AxesChartYGridAndLabels_1 = __webpack_require__(67);
918
+ /***/ }),
763
919
 
764
- var dataContract = {
765
- requiredDataSources: [{
766
- name: 'primary',
767
- description: 'DataSource that powers the visualization'
768
- }],
769
- optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
770
- // {
771
- // name: 'annotation',
772
- // description: 'DataSource that populates event annotations',
773
- // },
774
- ],
775
- initialRequestParams: {
776
- primary: {
777
- offset: 0,
778
- count: 10000
779
- },
780
- annotation: {
781
- offset: 0,
782
- count: 10000
783
- }
784
- }
785
- };
786
- var size = {
787
- initialWidth: 300,
788
- initialHeight: 300
789
- };
790
- var defaultContext = {};
791
- exports.optionsSchema = {
792
- x: {
793
- default: '> primary | seriesByIndex(0)',
794
- description: 'Specify the dataSource applied to the x-axis.',
795
- type: 'array',
796
- items: {
797
- type: ['string', 'number']
798
- }
799
- },
800
- y: {
801
- default: '> primary | seriesByIndex(1)',
802
- description: 'Specify the dataSource applied to the y-axis.',
803
- type: 'array',
804
- items: {
805
- type: ['string', 'number']
806
- }
807
- },
808
- category: {
809
- description: 'Specify a sequence of dataSource events to be plotted on the chart.',
810
- type: 'array',
811
- items: {
812
- type: ['string', 'number']
813
- },
814
- default: '> primary | seriesByIndex(2)'
815
- },
816
- xField: {
817
- default: '> x | getField()',
818
- description: 'Specify the field that should be mapped to the x-axis.',
819
- type: 'string'
820
- },
821
- yField: {
822
- default: '> y | getField()',
823
- description: 'Specify the field that should be mapped to the y-axis.',
824
- type: 'string'
825
- },
826
- categoryField: {
827
- default: '> category | getField()',
828
- description: 'Specify the field that should be mapped to the series categories.',
829
- type: 'string'
830
- },
831
- backgroundColor: {
832
- default: '> themes.defaultBackgroundColor',
833
- 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".',
834
- pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
835
- type: 'string'
836
- },
837
- legendDisplay: {
838
- default: 'right',
839
- description: 'Specify the location of the legend on the panel.',
840
- pattern: schemaUtils_1.getPattern(['right', 'left', 'top', 'bottom', 'off']),
841
- type: 'string'
842
- },
843
- legendTruncation: {
844
- default: 'ellipsisEnd',
845
- description: 'Specify how to display legend labels when they overflow the layout boundaries by replacing overflow text with an ellipsis.',
846
- pattern: schemaUtils_1.getPattern(['ellipsisEnd', 'ellipsisMiddle', 'ellipsisStart', 'ellipsisOff']),
847
- type: 'string'
848
- },
849
- markerSize: {
850
- description: 'Specify, in pixels, the size of each scatter marker.',
851
- type: 'number',
852
- default: 4
853
- },
854
- resultLimit: {
855
- default: 50000,
856
- description: 'Specify the number of data points rendered in a chart.',
857
- type: 'number'
858
- },
859
- seriesColors: {
860
- default: visualization_color_palettes_1.VIZ_CATEGORICAL,
861
- description: 'Specify the colors used for a series. For example, ["#FF0000", "#0000FF", "#008000"].',
862
- type: 'array',
863
- items: {
864
- type: 'string'
865
- }
866
- },
867
- seriesColorsByField: {
868
- description: 'Specify the colors used for specific fields in a series. For example: {"count": "#008000", "percent": "#FFA500"}.',
869
- type: 'object'
870
- },
871
- showXAxisExtendedRange: {
872
- default: true,
873
- description: 'Specify whether the x-axis should be extended to snap to whole major tick marks.',
874
- type: 'boolean'
875
- },
876
- showYAxisExtendedRange: {
877
- default: true,
878
- description: 'Specify whether the y-axis should be extended to snap to whole major tick marks.',
879
- type: 'boolean'
880
- },
881
- showXAxisWithZero: {
882
- default: false,
883
- description: 'Specify whether the x-axis range includes zero.',
884
- type: 'boolean'
885
- },
886
- showYAxisWithZero: {
887
- default: false,
888
- description: 'Specify whether the y-axis range includes zero.',
889
- type: 'boolean'
890
- },
891
- showRoundedXAxisLabels: {
892
- default: false,
893
- description: 'Specify whether to round x-axis values to the nearest integer.',
894
- type: 'boolean'
895
- },
896
- // TODO: figure out if we want to change splunk-charting behavior for Bubble/Scatter, which hardcodes XMajorGridlines to false
897
- // showXMajorGridLines: {
898
- // default: false,
899
- // description: 'Specify whether major grid lines are visible on the x-axis.',
900
- // type: 'boolean',
901
- // },
902
- showYMajorGridLines: {
903
- default: true,
904
- description: 'Specify whether major grid lines are visible on the y-axis.',
905
- type: 'boolean'
906
- },
907
- showXMinorGridLines: {
908
- default: false,
909
- description: 'Specify whether minor grid lines are visible on the x-axis.',
910
- type: 'boolean'
911
- },
912
- showYMinorGridLines: {
913
- default: false,
914
- description: 'Specify whether minor grid lines are visible on the y-axis.',
915
- type: 'boolean'
916
- },
917
- xAxisLabelRotation: {
918
- default: 0,
919
- description: 'Specify the rotation of the x-axis labels in degrees.',
920
- type: 'number',
921
- enum: [-90, -45, 0, 45, 90]
922
- },
923
- xAxisAbbreviation: {
924
- default: 'off',
925
- description: 'Specify whether to abbreviate large x-axis values with the closest SI prefix.',
926
- enum: ['off', 'auto'],
927
- pattern: schemaUtils_1.getPattern(['auto', 'off']),
928
- type: 'string'
929
- },
930
- yAxisAbbreviation: {
931
- default: 'auto',
932
- description: 'Specify whether to abbreviate large y-axis values with the closest SI prefix.',
933
- enum: ['off', 'auto'],
934
- pattern: schemaUtils_1.getPattern(['auto', 'off']),
935
- type: 'string'
936
- },
937
- xAxisLabelVisibility: {
938
- default: 'auto',
939
- description: 'Specify whether to show or hide labels on the x-axis.',
940
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
941
- type: 'string'
942
- },
943
- yAxisLabelVisibility: {
944
- default: 'auto',
945
- description: 'Specify whether to show or hide labels on the y-axis.',
946
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
947
- type: 'string'
948
- },
949
- xAxisLineVisibility: {
950
- default: 'hide',
951
- description: 'Specify whether to show or hide the x-axis line.',
952
- enum: ['hide', 'show'],
953
- pattern: schemaUtils_1.getPattern(['show', 'hide']),
954
- type: 'string'
955
- },
956
- yAxisLineVisibility: {
957
- default: 'hide',
958
- description: 'Specify whether to show or hide the y-axis line.',
959
- enum: ['hide', 'show'],
960
- pattern: schemaUtils_1.getPattern(['show', 'hide']),
961
- type: 'string'
962
- },
963
- xAxisMajorTickInterval: {
964
- default: 'auto',
965
- description: 'Specify the spacing interval at which to place major tick marks along the numeric x-axis. By default, this value is automatically calculated based on the scale of the related axis.',
966
- type: ['string', 'number']
967
- },
968
- yAxisMajorTickInterval: {
969
- default: 'auto',
970
- description: 'Specify the spacing interval at which to place major tick marks along the numeric y-axis. By default, this value is automatically calculated based on the scale of the related axis.',
971
- type: ['string', 'number']
972
- },
973
- xAxisMajorTickSize: {
974
- default: 6,
975
- description: 'Specify the size, in pixels, of major tick marks on the x-axis.',
976
- type: 'number'
977
- },
978
- yAxisMajorTickSize: {
979
- default: 6,
980
- description: 'Specify the size, in pixels, of major tick marks on the y-axis.',
981
- type: 'number'
982
- },
983
- xAxisMinorTickSize: {
984
- default: 6,
985
- description: 'Specify the size, in pixels, of minor tick marks on the x-axis.',
986
- type: 'number'
987
- },
988
- yAxisMinorTickSize: {
989
- default: 6,
990
- description: 'Specify the size, in pixels, of minor tick marks on the y-axis.',
991
- type: 'number'
992
- },
993
- xAxisMajorTickVisibility: {
994
- default: 'auto',
995
- description: 'Specify whether to show or hide major tick marks on the x-axis.',
996
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
997
- type: 'string'
998
- },
999
- yAxisMajorTickVisibility: {
1000
- default: 'auto',
1001
- description: 'Specify whether to show or hide major tick marks on the y-axis.',
1002
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
1003
- type: 'string'
1004
- },
1005
- xAxisMinorTickVisibility: {
1006
- default: 'auto',
1007
- description: 'Specify whether to show or hide minor tick marks on the x-axis .',
1008
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
1009
- type: 'string'
1010
- },
1011
- yAxisMinorTickVisibility: {
1012
- default: 'auto',
1013
- description: 'Specify whether to show or hide minor tick marks on the y-axis.',
1014
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
1015
- type: 'string'
1016
- },
1017
- xAxisMax: {
1018
- default: 'auto',
1019
- description: 'Specify the maximum number for the range of the visible x-axis.',
1020
- type: ['string', 'number']
1021
- },
1022
- yAxisMax: {
1023
- default: 'auto',
1024
- description: 'Specify the maximum number for the range of the visible y-axis.',
1025
- type: ['string', 'number']
1026
- },
1027
- xAxisMin: {
1028
- default: 'auto',
1029
- description: 'Specify the minimum number for the range of the visible x-axis.',
1030
- type: ['string', 'number']
1031
- },
1032
- yAxisMin: {
1033
- default: 'auto',
1034
- description: 'Specify the minimum number for the range of the visible y-axis.',
1035
- type: ['string', 'number']
1036
- },
1037
- xAxisScale: {
1038
- default: 'linear',
1039
- description: 'Specify the type of scale that applies to a numerical x-axis.',
1040
- pattern: schemaUtils_1.getPattern(['linear', 'log']),
1041
- type: 'string'
1042
- },
1043
- yAxisScale: {
1044
- default: 'linear',
1045
- description: 'Specify the type of scale that applies to a numerical y-axis.',
1046
- pattern: schemaUtils_1.getPattern(['linear', 'log']),
1047
- type: 'string'
1048
- },
1049
- xAxisTitleText: {
1050
- description: 'Specify the title of the x-axis.',
1051
- type: 'string'
1052
- },
1053
- yAxisTitleText: {
1054
- description: 'Specify the title of the y-axis.',
1055
- type: 'string'
1056
- },
1057
- xAxisTitleVisibility: {
1058
- default: 'show',
1059
- description: 'Specify whether to show or hide the title of the x-axis.',
1060
- enum: ['hide', 'show'],
1061
- pattern: schemaUtils_1.getPattern(['show', 'hide']),
1062
- type: 'string'
1063
- },
1064
- yAxisTitleVisibility: {
1065
- default: 'show',
1066
- description: 'Specify whether to show or hide the title of the y-axis.',
1067
- enum: ['hide', 'show'],
1068
- pattern: schemaUtils_1.getPattern(['show', 'hide']),
1069
- type: 'string'
1070
- }
1071
- };
1072
- var themes = {
1073
- defaultBackgroundColor: function defaultBackgroundColor(props) {
1074
- return pick_1.default({
1075
- enterprise: {
1076
- dark: variables_1.default.black(props),
1077
- light: variables_1.default.backgroundColor(props)
1078
- },
1079
- prisma: variables_1.default.backgroundColorSidebar(props)
1080
- })(props);
1081
- }
1082
- };
1083
- var editorConfig = [AxesChartDataConfig_1.AxesChartDataConfigScatter, {
1084
- label: AxesChartColorAndStyle_1.default.label,
1085
- layout: [].concat(_toConsumableArray(AxesChartColorAndStyle_1.default.layout), [[{
1086
- label: i18n_1._('Marker size'),
1087
- option: 'markerSize',
1088
- editor: 'editor.slider',
1089
- editorProps: {
1090
- min: 0,
1091
- max: 20,
1092
- step: 1
1093
- }
1094
- }]])
1095
- }, AxesChartLegend_1.default, AxesChartXGridAndLabels_1.AxesChartXGridAndLabelsBubbleScatter, AxesChartYGridAndLabels_1.default];
1096
- /**
1097
- * visualization configuration
1098
- */
1099
-
1100
- var config = {
1101
- /**
1102
- * unique viz key
1103
- */
1104
- key: 'splunk.scatter',
1105
-
1106
- /**
1107
- * viz name
1108
- */
1109
- name: 'Scatter',
1110
- category: VizCategory_1.VizCategory.COMPARISONS,
1111
-
1112
- /**
1113
- * viz icon
1114
- */
1115
- icon: visualization_icons_1.Scatter,
1116
- placeholderIcon: placeholders_1.Scatter,
1117
- dataContract: dataContract,
1118
- size: size,
1119
- defaultContext: defaultContext,
1120
- optionsSchema: exports.optionsSchema,
1121
- editorConfig: editorConfig,
1122
- events: {
1123
- 'legend.click': {
1124
- description: 'triggered when user clicks on chart legend'
1125
- },
1126
- 'point.click': {
1127
- description: 'triggered when user clicks on a point in the scatter chart'
1128
- }
1129
- },
1130
- supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
1131
- themes: themes
1132
- };
1133
- exports.default = configUtils_1.enhanceConfig(config);
1134
-
1135
- /***/ }),
1136
-
1137
- /***/ 256:
1138
- /***/ (function(module, exports, __webpack_require__) {
1139
-
1140
- "use strict";
1141
-
1142
-
1143
- Object.defineProperty(exports, "__esModule", {
1144
- value: true
1145
- });
1146
- exports.convertToScatterSCProperties = exports.mapToOldKey = exports.convertToStringValues = exports.scatterOptionValuesSCMapping = void 0;
1147
-
1148
- var lodash_1 = __webpack_require__(3);
1149
-
1150
- var propUtils_1 = __webpack_require__(23);
1151
-
1152
- var chartingUtils_1 = __webpack_require__(50); // map for key names which are either new or not present in SimpleXML options mapping
1153
-
1154
-
1155
- var scatterOptionsSCMapping = {
1156
- xAxisLabelRotation: 'xAxisMajorLabelRotation',
1157
- xAxisLabelVisibility: 'xAxisMajorLabelVisibility',
1158
- yAxisLabelVisibility: 'yAxisMajorLabelVisibility',
1159
- showRoundedXAxisLabels: 'roundXAxisLabelsToInteger',
1160
- xAxisLineVisibility: 'xAxisVisibility',
1161
- yAxisLineVisibility: 'yAxisVisibility',
1162
- showYMajorGridLines: 'showMajorYGridLines',
1163
- showXMinorGridLines: 'showMinorXGridLines',
1164
- showYMinorGridLines: 'showMinorYGridLines',
1165
- xAxisMajorTickInterval: 'xAxisMajorUnit',
1166
- yAxisMajorTickInterval: 'yAxisMajorUnit',
1167
- showXAxisExtendedRange: 'xAxisExtendsAxisRange',
1168
- showYAxisExtendedRange: 'yAxisExtendsAxisRange',
1169
- showXAxisWithZero: 'xAxisIncludeZero',
1170
- showYAxisWithZero: 'yAxisIncludeZero',
1171
- legendTruncation: 'legendLabelOverflowMode',
1172
- legendDisplay: 'legendPlacement',
1173
- resultLimit: 'resultTruncationLimit',
1174
- seriesColorsByField: 'fieldColors',
1175
- bubbleSizeMax: 'bubbleMaxSize',
1176
- bubbleSizeMin: 'bubbleMinSize',
1177
- bubbleSizeMethod: 'bubbleSizeBy'
1178
- }; // key value mapping of what options (and their corresponding values) which we expose in config.ts to property values SC understands
1179
-
1180
- exports.scatterOptionValuesSCMapping = {
1181
- xAxisTitleVisibility: {
1182
- hide: 'collapsed'
1183
- },
1184
- yAxisTitleVisibility: {
1185
- hide: 'collapsed'
1186
- },
1187
- yAxisAbbreviation: {
1188
- off: 'none'
1189
- },
1190
- legendPlacement: {
1191
- off: 'none'
1192
- },
1193
- legendLabelOverflowMode: {
1194
- ellipsisOff: 'ellipsisNone'
1195
- }
1196
- };
1197
- /**
1198
- * Helper method to convert option which contains object literal values (e.g. arrays, objects)
1199
- * to strings as SC can only accept their stringified equivalents
1200
- * @method convertToStringValues
1201
- * @param {Object} options
1202
- * @returns {Object}
1203
- */
1204
-
1205
- var convertToStringValues = function convertToStringValues(options) {
1206
- var updatedOptions = propUtils_1.convertPropsToString({
1207
- vizProps: options,
1208
- propNames: ['seriesColors', 'fieldColors']
1209
- });
1210
- return Object.assign(Object.assign({}, options), updatedOptions);
1211
- };
1212
-
1213
- exports.convertToStringValues = convertToStringValues;
1214
- /**
1215
- * Helper method to update the option names which can be mapped to SimpleXML options or
1216
- * can be used directly with SC if don't have a 1-1 mapping in SimpleXML
1217
- * @method mapToOldKey
1218
- * @param {Object} options
1219
- * @returns {Object}
1220
- */
1221
-
1222
- var mapToOldKey = function mapToOldKey(options) {
1223
- return lodash_1.mapKeys(options, function (val, key) {
1224
- return scatterOptionsSCMapping[key] ? scatterOptionsSCMapping[key] : key;
1225
- });
1226
- };
1227
-
1228
- exports.mapToOldKey = mapToOldKey;
1229
- /**
1230
- * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts
1231
- * This is for options that has new key name and can not directly be mapped with SimpleXML or
1232
- * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)
1233
- * @method convertToScatterSCProperties
1234
- * @param {Object} originalOptions
1235
- * @returns {Object}
1236
- */
1237
-
1238
- var convertToScatterSCProperties = function convertToScatterSCProperties(originalOptions) {
1239
- return lodash_1.chain(exports.mapToOldKey(originalOptions)).thru(chartingUtils_1.mapToValues(exports.scatterOptionValuesSCMapping)).thru(exports.convertToStringValues).value();
1240
- };
1241
-
1242
- exports.convertToScatterSCProperties = convertToScatterSCProperties;
1243
-
1244
- /***/ }),
1245
-
1246
- /***/ 27:
920
+ /***/ 31:
1247
921
  /***/ (function(module, exports, __webpack_require__) {
1248
922
 
1249
923
  "use strict";
@@ -1251,928 +925,1224 @@ exports.convertToScatterSCProperties = convertToScatterSCProperties;
1251
925
 
1252
926
  Object.defineProperty(exports, "__esModule", {
1253
927
  value: true
1254
- });
1255
- exports.shouldShowIconPlaceholder = void 0;
1256
-
1257
- var React = __webpack_require__(1);
1258
-
1259
- var T = __webpack_require__(0);
1260
-
1261
- var lodash_1 = __webpack_require__(3);
1262
-
1263
- var i18n_1 = __webpack_require__(2);
1264
-
1265
- var Message_1 = __webpack_require__(9);
1266
-
1267
- var FixedSizeContainer_1 = __webpack_require__(12);
1268
- /**
1269
- * @method shouldShowIconPlaceholder
1270
- * @param {object} dataSources
1271
- * @param {boolean} loading
1272
- * @returns {boolean}
1273
- */
1274
-
1275
-
1276
- var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
1277
- var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1278
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1279
- var noData = data === undefined;
1280
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1281
- var noFields = fields === undefined;
1282
- return loading || noData || noFields;
1283
- };
1284
-
1285
- exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
1286
- var propTypes = {
1287
- icon: T.func,
1288
- width: T.oneOfType([T.string, T.number]),
1289
- height: T.oneOfType([T.string, T.number]),
1290
- // eslint-disable-next-line react/no-unused-prop-types
1291
- backgroundColor: T.string,
1292
- iconColor: T.string
1293
- };
1294
- /**
1295
- * @method IconPlaceholder
1296
- * @param {IconPlaceholderProps} props
1297
- * @returns {React.ReactElement}
1298
- */
1299
-
1300
- var IconPlaceholder = function IconPlaceholder(props) {
1301
- var width = props.width,
1302
- height = props.height,
1303
- icon = props.icon,
1304
- iconColor = props.iconColor;
1305
-
1306
- if (icon) {
1307
- return React.createElement(icon, {
1308
- style: {
1309
- left: '50%',
1310
- top: '50%',
1311
- color: iconColor,
1312
- opacity: 0.15,
1313
- position: 'absolute',
1314
- transform: 'translate(-50%, -50%)'
1315
- },
1316
- width: '50%',
1317
- height: '50%'
1318
- });
1319
- }
1320
-
1321
- return React.createElement(Message_1.default, {
1322
- width: width,
1323
- height: height,
1324
- level: "warning",
1325
- message: i18n_1._('No DataSource Connected')
1326
- });
1327
- };
928
+ });
929
+ exports.VizCategory = void 0;
930
+ var VizCategory;
1328
931
 
1329
- IconPlaceholder.propTypes = propTypes;
1330
- IconPlaceholder.defaultProps = {
1331
- width: '100%',
1332
- height: 250
1333
- };
1334
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
932
+ (function (VizCategory) {
933
+ VizCategory["SINGLE_VALUE"] = "Single Value";
934
+ VizCategory["TRENDS"] = "Trends";
935
+ VizCategory["COMPARISONS"] = "Comparisons";
936
+ VizCategory["TABLE"] = "Table";
937
+ VizCategory["GAUGE"] = "Gauge";
938
+ VizCategory["DISTRIBUTIONS"] = "Distributions";
939
+ VizCategory["CHOROPLETH"] = "Choropleth Maps";
940
+ VizCategory["SHAPES"] = "Shapes";
941
+ VizCategory["MISC"] = "misc";
942
+ VizCategory["FLOW"] = "Flow";
943
+ VizCategory["CORRELATION"] = "Correlation";
944
+ VizCategory["SPATIAL"] = "Spatial";
945
+ })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
1335
946
 
1336
947
  /***/ }),
1337
948
 
1338
- /***/ 28:
949
+ /***/ 32:
1339
950
  /***/ (function(module, exports, __webpack_require__) {
1340
951
 
1341
952
  "use strict";
1342
953
 
1343
954
 
1344
- var _defineProperty = __webpack_require__(6);
1345
-
1346
955
  Object.defineProperty(exports, "__esModule", {
1347
956
  value: true
1348
957
  });
1349
- exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1350
958
 
1351
- var T = __webpack_require__(0);
959
+ var React = __webpack_require__(1);
1352
960
 
1353
961
  var lodash_1 = __webpack_require__(3);
1354
962
 
1355
- var DataSource_1 = __webpack_require__(38);
963
+ var getSettingsFromThemedProps_1 = __webpack_require__(33);
1356
964
 
1357
- exports.SortParamsPropTypes = T.shape({
1358
- currentSortKey: T.string,
1359
- currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1360
- onSort: T.func
1361
- });
965
+ var Options_1 = __webpack_require__(34);
1362
966
 
1363
- var getSortingParams = function getSortingParams(_ref) {
1364
- var requestParams = _ref.requestParams,
1365
- onRequestParamsChange = _ref.onRequestParamsChange;
1366
- var currentSortKey;
1367
- var currentSortDir;
1368
- var nextSortDirMap = {
1369
- asc: 'desc',
1370
- desc: 'asc',
1371
- none: 'asc'
1372
- };
1373
- var onSort;
967
+ var SanitizeProps_1 = __webpack_require__(35);
1374
968
 
1375
- if (lodash_1.isFunction(onRequestParamsChange)) {
1376
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
1377
- currentSortKey = Object.keys(requestParams.sort).shift();
1378
- currentSortDir = requestParams.sort[currentSortKey];
1379
- } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
969
+ var TimezoneContext_1 = __webpack_require__(23);
1380
970
 
971
+ var moment_1 = __webpack_require__(36);
1381
972
 
1382
- onSort = function onSort(e, _ref2) {
1383
- var sortKey = _ref2.sortKey,
1384
- sortDir = _ref2.sortDir;
973
+ var styled_components_1 = __webpack_require__(4);
1385
974
 
1386
- if (typeof sortKey === 'string') {
1387
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1388
- onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1389
- offset: 0,
1390
- sort: _defineProperty({}, sortKey, nextSortDir)
1391
- }));
1392
- } else {
1393
- onRequestParamsChange(requestParams);
975
+ var hocUtils_1 = __webpack_require__(25);
976
+
977
+ var JSONSchemaUtils_1 = __webpack_require__(26);
978
+
979
+ var SplunkVisualization_1 = __webpack_require__(37);
980
+
981
+ var VizBehavior_1 = __webpack_require__(6);
982
+
983
+ var getSorting_1 = __webpack_require__(28);
984
+
985
+ var getPagination_1 = __webpack_require__(29);
986
+
987
+ var useDeepMemo_1 = __webpack_require__(40);
988
+
989
+ var MissingPropsMessage_1 = __webpack_require__(41);
990
+
991
+ var withEditModeCover_1 = __webpack_require__(42);
992
+
993
+ var withPlaceholder_1 = __webpack_require__(43);
994
+ /**
995
+ * hoc that wraps a pure react visualization in a Dashboard visualization
996
+ * @param {DashboardVizOpts} opts
997
+ * @returns {HOC}
998
+ */
999
+
1000
+
1001
+ var withDashboardViz = function withDashboardViz(opts) {
1002
+ var ReactViz = opts.ReactViz,
1003
+ vizConfig = opts.vizConfig,
1004
+ _opts$computeVizProps = opts.computeVizProps,
1005
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1006
+ disableEditModeCover = opts.disableEditModeCover,
1007
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1008
+
1009
+ var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1010
+ var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1011
+
1012
+ var DashboardViz = function DashboardViz(props) {
1013
+ var mode = props.mode,
1014
+ hasEventHandlers = props.hasEventHandlers,
1015
+ dataSources = props.dataSources,
1016
+ options = props.options,
1017
+ _props$context = props.context,
1018
+ context = _props$context === void 0 ? {} : _props$context,
1019
+ width = props.width,
1020
+ height = props.height,
1021
+ onComputedProps = props.onComputedProps,
1022
+ onEventTrigger = props.onEventTrigger,
1023
+ theme = props.theme,
1024
+ onRequestParamsChange = props.onRequestParamsChange;
1025
+
1026
+ var _React$useContext = React.useContext(TimezoneContext_1.default),
1027
+ serializedTimezone = _React$useContext.serializedTimezone;
1028
+
1029
+ if (serializedTimezone) {
1030
+ /*
1031
+ @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
1032
+ This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
1033
+ will use it.
1034
+ @TODO(pwied):
1035
+ - remove when we moved away from @splunk/moment
1036
+ - provide timezone context to dynamic option evaluation phase
1037
+ */
1038
+ if (!moment_1.default.getDefaultSplunkTimezone()) {
1039
+ moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1394
1040
  }
1041
+ }
1042
+
1043
+ var themeFunc = function themeFunc(themeVar) {
1044
+ var _a, _b;
1045
+
1046
+ return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1395
1047
  };
1396
- }
1397
1048
 
1398
- return {
1399
- currentSortKey: currentSortKey,
1400
- currentSortDir: currentSortDir,
1401
- onSort: onSort
1402
- };
1403
- };
1049
+ var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1404
1050
 
1405
- exports.getSortingParams = getSortingParams;
1051
+ var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1052
+ theme: theme
1053
+ }),
1054
+ currentThemeFamily = _getSettingsFromTheme.family,
1055
+ currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1056
+ currentThemeDensity = _getSettingsFromTheme.density;
1406
1057
 
1407
- /***/ }),
1058
+ var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1408
1059
 
1409
- /***/ 29:
1410
- /***/ (function(module, exports, __webpack_require__) {
1060
+ evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1061
+ try {
1062
+ return Options_1.Options.evaluate({
1063
+ context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1064
+ options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1065
+ }, dataSources, themeFunc);
1066
+ } catch (e) {
1067
+ // eslint-disable-next-line no-console
1068
+ console.error("unexpected error evaluating options: + ".concat(e.message));
1069
+ return {};
1070
+ }
1071
+ }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
1072
+ // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1411
1073
 
1412
- "use strict";
1074
+ React.useEffect(function () {
1075
+ onComputedProps(evaluatedOptions);
1076
+ }); // present warning message if any required props are missing
1413
1077
 
1078
+ var _vizConfig$requiredPr = vizConfig.requiredProps,
1079
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1080
+ supports = vizConfig.supports;
1081
+ var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
1414
1082
 
1415
- Object.defineProperty(exports, "__esModule", {
1416
- value: true
1417
- });
1418
- exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1083
+ if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
1084
+ return React.createElement(MissingPropsMessage_1.default, {
1085
+ "data-test": "missing-props-message",
1086
+ width: width,
1087
+ height: height,
1088
+ missingProps: missing,
1089
+ backgroundColor: bgColorFromTheme
1090
+ });
1091
+ } // events
1419
1092
 
1420
- var T = __webpack_require__(0);
1421
1093
 
1422
- var lodash_1 = __webpack_require__(3);
1094
+ var eventCallbackProps = {};
1423
1095
 
1424
- exports.PaginatorParamsPropTypes = T.shape({
1425
- isPaging: T.bool,
1426
- current: T.number,
1427
- totalPages: T.number,
1428
- onChange: T.func
1429
- });
1096
+ if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1097
+ var supportedEvents = vizConfig.events;
1098
+ Object.keys(supportedEvents).forEach(function (eventName) {
1099
+ var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1100
+ eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1101
+ // then remove these lines
1430
1102
 
1431
- var getPaginationParams = function getPaginationParams(_ref) {
1432
- var requestParams = _ref.requestParams,
1433
- meta = _ref.meta,
1434
- onRequestParamsChange = _ref.onRequestParamsChange;
1435
- var totalCount = meta && meta.totalCount || 0;
1436
- var offset = requestParams && requestParams.offset || 0;
1437
- var count = requestParams && requestParams.count;
1438
- var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1439
- var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1440
- var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
1103
+ var payloadKeys = supportedEvents[eventName].payloadKeys;
1104
+ var payload = {};
1441
1105
 
1442
- var onChangeHandler = function onChangeHandler(e, _ref2) {
1443
- var page = _ref2.page,
1444
- countArg = _ref2.count;
1445
- var newParams = lodash_1.cloneDeep(requestParams);
1106
+ if (Array.isArray(payloadKeys) && payloadKeys.length) {
1107
+ payloadKeys.forEach(function (p) {
1108
+ payload[p] = evaluatedOptions[p];
1109
+ });
1110
+ }
1446
1111
 
1447
- if (typeof countArg === 'number') {
1448
- newParams.count = countArg;
1449
- newParams.offset = 0;
1450
- }
1112
+ eventCallbackProps[eventCallbackPropName] = function (ev) {
1113
+ if (ev && ev.payload) {
1114
+ payload = ev.payload;
1115
+ }
1116
+
1117
+ return onEventTrigger({
1118
+ originalEvent: ev,
1119
+ payload: payload,
1120
+ type: eventName
1121
+ });
1122
+ };
1123
+ });
1124
+ } // compute pure viz props which are not from options
1125
+
1126
+
1127
+ var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
1128
+ themeFunc: themeFunc
1129
+ }));
1130
+ /**
1131
+ * PAGE_AND_SORT behavior
1132
+ *
1133
+ * Some visualizations, like table, requires metadata about the datasource,
1134
+ * like total number of results, current count, offset, and sort, for rendering
1135
+ * paginator and sorting direction. In this approach, the visualization
1136
+ * allow users to set 'paginateDataSourceKey' to select which datasource
1137
+ * should the visualization extract the metadata from. It defaults to 'primary' datasource.
1138
+ * The visualization config should set the PAGE_AND_SORT behavior to receive
1139
+ * 'requestParams', 'meta' and onRequestParams callback as props.
1140
+ *
1141
+ * In future, we could automatically detect which all datasources are being used
1142
+ * and bind those magically to pagination/sorting behavior.
1143
+ */
1144
+
1145
+ var dataSourceMetadata = {};
1146
+ var OptionKey = 'paginateDataSourceKey';
1147
+ var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
1148
+
1149
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1150
+ var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1151
+ var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
1451
1152
 
1452
- var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1153
+ var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1154
+ return onRequestParamsChange(paginateDataSourceKey, payload);
1155
+ };
1453
1156
 
1454
- if (typeof page === 'number' && page > 0) {
1455
- newParams.count = pageCount;
1456
- newParams.offset = (page - 1) * pageCount;
1157
+ var sortParams = getSorting_1.getSortingParams({
1158
+ requestParams: requestParams,
1159
+ meta: meta,
1160
+ onRequestParamsChange: handleRequestParamsChange
1161
+ });
1162
+ var paginatorParams = getPagination_1.getPaginationParams({
1163
+ requestParams: requestParams,
1164
+ meta: meta,
1165
+ onRequestParamsChange: handleRequestParamsChange
1166
+ });
1167
+ dataSourceMetadata = {
1168
+ sortParams: sortParams,
1169
+ paginatorParams: paginatorParams
1170
+ };
1457
1171
  }
1458
1172
 
1459
- onRequestParamsChange(newParams);
1173
+ return React.createElement(SanitizedReactViz, Object.assign({
1174
+ mode: mode,
1175
+ width: width,
1176
+ height: height
1177
+ }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
1460
1178
  };
1461
1179
 
1462
- return {
1463
- isPaging: isPaging,
1464
- current: current,
1465
- totalPages: totalPages,
1466
- onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
1467
- };
1180
+ DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1181
+ DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1182
+ // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1183
+ theme: {}
1184
+ }); // attach viz config
1185
+
1186
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1187
+
1188
+ return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
1468
1189
  };
1469
1190
 
1470
- exports.getPaginationParams = getPaginationParams;
1191
+ exports.default = withDashboardViz;
1471
1192
 
1472
1193
  /***/ }),
1473
1194
 
1474
- /***/ 3:
1195
+ /***/ 33:
1475
1196
  /***/ (function(module, exports) {
1476
1197
 
1477
- module.exports = require("lodash");
1198
+ module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1478
1199
 
1479
1200
  /***/ }),
1480
1201
 
1481
- /***/ 30:
1482
- /***/ (function(module, exports, __webpack_require__) {
1202
+ /***/ 34:
1203
+ /***/ (function(module, exports) {
1483
1204
 
1484
- "use strict";
1205
+ module.exports = require("@splunk/visualization-encoding/Options");
1485
1206
 
1207
+ /***/ }),
1486
1208
 
1487
- Object.defineProperty(exports, "__esModule", {
1488
- value: true
1489
- });
1490
- exports.VizCategory = void 0;
1491
- var VizCategory;
1209
+ /***/ 35:
1210
+ /***/ (function(module, exports) {
1492
1211
 
1493
- (function (VizCategory) {
1494
- VizCategory["SINGLE_VALUE"] = "Single Value";
1495
- VizCategory["TRENDS"] = "Trends";
1496
- VizCategory["COMPARISONS"] = "Comparisons";
1497
- VizCategory["TABLE"] = "Table";
1498
- VizCategory["GAUGE"] = "Gauge";
1499
- VizCategory["DISTRIBUTIONS"] = "Distributions";
1500
- VizCategory["CHOROPLETH"] = "Choropleth Maps";
1501
- VizCategory["SHAPES"] = "Shapes";
1502
- VizCategory["MISC"] = "misc";
1503
- VizCategory["FLOW"] = "Flow";
1504
- VizCategory["CORRELATION"] = "Correlation";
1505
- VizCategory["SPATIAL"] = "Spatial";
1506
- })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
1212
+ module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1507
1213
 
1508
1214
  /***/ }),
1509
1215
 
1510
- /***/ 31:
1216
+ /***/ 36:
1217
+ /***/ (function(module, exports) {
1218
+
1219
+ module.exports = require("@splunk/moment");
1220
+
1221
+ /***/ }),
1222
+
1223
+ /***/ 37:
1511
1224
  /***/ (function(module, exports, __webpack_require__) {
1512
1225
 
1513
1226
  "use strict";
1514
1227
 
1515
1228
 
1229
+ var _classCallCheck = __webpack_require__(11);
1230
+
1516
1231
  Object.defineProperty(exports, "__esModule", {
1517
1232
  value: true
1518
1233
  });
1234
+ exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1235
+ /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1519
1236
 
1520
- var React = __webpack_require__(1);
1237
+ var T = __webpack_require__(0);
1521
1238
 
1522
1239
  var lodash_1 = __webpack_require__(3);
1523
1240
 
1524
- var getSettingsFromThemedProps_1 = __webpack_require__(32);
1241
+ var VizActionHandler_1 = __webpack_require__(38); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1525
1242
 
1526
- var Options_1 = __webpack_require__(33);
1527
1243
 
1528
- var SanitizeProps_1 = __webpack_require__(34);
1244
+ exports.INITIAL_WIDTH = 250;
1245
+ exports.INITIAL_HEIGHT = 250;
1246
+ /**
1247
+ * A Splunk visualization
1248
+ */
1529
1249
 
1530
- var TimezoneContext_1 = __webpack_require__(22);
1250
+ var SplunkVisualization = function SplunkVisualization() {
1251
+ _classCallCheck(this, SplunkVisualization);
1252
+ };
1531
1253
 
1532
- var moment_1 = __webpack_require__(35);
1254
+ SplunkVisualization.propTypes = {
1255
+ /**
1256
+ * display mode
1257
+ */
1258
+ mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1533
1259
 
1534
- var styled_components_1 = __webpack_require__(4);
1260
+ /**
1261
+ * width in pixel or string, defaults to 100%
1262
+ */
1263
+ width: T.oneOfType([T.string, T.number]).isRequired,
1535
1264
 
1536
- var hocUtils_1 = __webpack_require__(24);
1265
+ /**
1266
+ * height in pixel or string
1267
+ */
1268
+ height: T.oneOfType([T.string, T.number]).isRequired,
1537
1269
 
1538
- var JSONSchemaUtils_1 = __webpack_require__(25);
1270
+ /**
1271
+ * visualization context used for dynamic option evaluation
1272
+ */
1273
+ context: T.object,
1539
1274
 
1540
- var SplunkVisualization_1 = __webpack_require__(36);
1275
+ /**
1276
+ * visualization formatting options
1277
+ */
1278
+ options: T.object,
1541
1279
 
1542
- var VizBehavior_1 = __webpack_require__(5);
1280
+ /**
1281
+ * A callback to update formatting options
1282
+ */
1283
+ onOptionsChange: T.func,
1543
1284
 
1544
- var getSorting_1 = __webpack_require__(28);
1285
+ /**
1286
+ * datasource state which include data and request params, object key indicate the datasource type.
1287
+ */
1288
+ dataSources: T.objectOf(T.shape({
1289
+ /**
1290
+ * current request params
1291
+ */
1292
+ requestParams: T.object,
1545
1293
 
1546
- var getPagination_1 = __webpack_require__(29);
1294
+ /**
1295
+ * current dataset
1296
+ */
1297
+ data: T.shape({
1298
+ fields: T.array,
1299
+ columns: T.array
1300
+ }),
1301
+
1302
+ /**
1303
+ * error
1304
+ */
1305
+ error: T.shape({
1306
+ level: T.string,
1307
+ message: T.string
1308
+ }),
1309
+
1310
+ /**
1311
+ * meta data that came with the dataset
1312
+ */
1313
+ meta: T.object
1314
+ })),
1315
+
1316
+ /**
1317
+ * A callback to trigger event
1318
+ */
1319
+ onEventTrigger: T.func,
1547
1320
 
1548
- var useDeepMemo_1 = __webpack_require__(39);
1321
+ /**
1322
+ * Inform viz if there are handlers listening to events
1323
+ */
1324
+ hasEventHandlers: T.bool,
1549
1325
 
1550
- var MissingPropsMessage_1 = __webpack_require__(40);
1326
+ /**
1327
+ * A callback to communicate computed props to a consumer
1328
+ */
1329
+ onComputedProps: T.func,
1551
1330
 
1552
- var withEditModeCover_1 = __webpack_require__(41);
1331
+ /**
1332
+ * A callback to obtain visualization api
1333
+ */
1334
+ vizActionHandlerRef: T.func,
1335
+ loading: T.bool,
1336
+ theme: T.object,
1553
1337
 
1554
- var withPlaceholder_1 = __webpack_require__(42);
1338
+ /**
1339
+ * A callback to request new data with updated request params
1340
+ */
1341
+ onRequestParamsChange: T.func
1342
+ };
1555
1343
  /**
1556
- * hoc that wraps a pure react visualization in a Dashboard visualization
1557
- * @param {DashboardVizOpts} opts
1558
- * @returns {HOC}
1344
+ *
1559
1345
  */
1560
1346
 
1347
+ SplunkVisualization.defaultProps = {
1348
+ // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1349
+ width: '100%',
1350
+ height: exports.INITIAL_HEIGHT,
1351
+ dataSources: {},
1352
+ onEventTrigger: function onEventTrigger() {
1353
+ return {};
1354
+ },
1355
+ mode: 'view',
1356
+ hasEventHandlers: false,
1357
+ options: {},
1358
+ context: {},
1359
+ onOptionsChange: function onOptionsChange() {
1360
+ return {};
1361
+ },
1362
+ vizActionHandlerRef: function vizActionHandlerRef() {
1363
+ return new VizActionHandler_1.DefaultVizActionHandler();
1364
+ },
1365
+ onComputedProps: function onComputedProps() {
1366
+ return {};
1367
+ },
1368
+ loading: false,
1369
+ onRequestParamsChange: lodash_1.noop
1370
+ };
1371
+ exports.default = SplunkVisualization;
1372
+
1373
+ /***/ }),
1561
1374
 
1562
- var withDashboardViz = function withDashboardViz(opts) {
1563
- var ReactViz = opts.ReactViz,
1564
- vizConfig = opts.vizConfig,
1565
- _opts$computeVizProps = opts.computeVizProps,
1566
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1567
- disableEditModeCover = opts.disableEditModeCover,
1568
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1375
+ /***/ 38:
1376
+ /***/ (function(module, exports, __webpack_require__) {
1569
1377
 
1570
- var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1571
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1378
+ "use strict";
1572
1379
 
1573
- var DashboardViz = function DashboardViz(props) {
1574
- var mode = props.mode,
1575
- hasEventHandlers = props.hasEventHandlers,
1576
- dataSources = props.dataSources,
1577
- options = props.options,
1578
- _props$context = props.context,
1579
- context = _props$context === void 0 ? {} : _props$context,
1580
- width = props.width,
1581
- height = props.height,
1582
- onComputedProps = props.onComputedProps,
1583
- onEventTrigger = props.onEventTrigger,
1584
- theme = props.theme,
1585
- onRequestParamsChange = props.onRequestParamsChange;
1586
1380
 
1587
- var _React$useContext = React.useContext(TimezoneContext_1.default),
1588
- serializedTimezone = _React$useContext.serializedTimezone;
1381
+ var _classCallCheck = __webpack_require__(11);
1589
1382
 
1590
- if (serializedTimezone) {
1591
- /*
1592
- @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
1593
- This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
1594
- will use it.
1595
- @TODO(pwied):
1596
- - remove when we moved away from @splunk/moment
1597
- - provide timezone context to dynamic option evaluation phase
1598
- */
1599
- if (!moment_1.default.getDefaultSplunkTimezone()) {
1600
- moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1601
- }
1383
+ var _createClass = __webpack_require__(19);
1384
+
1385
+ Object.defineProperty(exports, "__esModule", {
1386
+ value: true
1387
+ });
1388
+ exports.DefaultVizActionHandler = void 0;
1389
+
1390
+ var DefaultVizActionHandler = /*#__PURE__*/function () {
1391
+ function DefaultVizActionHandler() {
1392
+ _classCallCheck(this, DefaultVizActionHandler);
1393
+ }
1394
+
1395
+ _createClass(DefaultVizActionHandler, [{
1396
+ key: "focus",
1397
+ value: function focus() {// noop
1398
+ }
1399
+ }, {
1400
+ key: "snapshot",
1401
+ value: function snapshot() {
1402
+ return null; // noop
1602
1403
  }
1404
+ }]);
1603
1405
 
1604
- var themeFunc = function themeFunc(themeVar) {
1605
- var _a, _b;
1406
+ return DefaultVizActionHandler;
1407
+ }();
1606
1408
 
1607
- return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1608
- };
1409
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1609
1410
 
1610
- var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1411
+ /***/ }),
1611
1412
 
1612
- var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1613
- theme: theme
1614
- }),
1615
- currentThemeFamily = _getSettingsFromTheme.family,
1616
- currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1617
- currentThemeDensity = _getSettingsFromTheme.density;
1413
+ /***/ 39:
1414
+ /***/ (function(module, exports, __webpack_require__) {
1618
1415
 
1619
- var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1416
+ "use strict";
1620
1417
 
1621
- evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1622
- try {
1623
- return Options_1.Options.evaluate({
1624
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1625
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1626
- }, dataSources, themeFunc);
1627
- } catch (e) {
1628
- // eslint-disable-next-line no-console
1629
- console.error("unexpected error evaluating options: + ".concat(e.message));
1630
- return {};
1631
- }
1632
- }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
1633
- // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1634
1418
 
1635
- React.useEffect(function () {
1636
- onComputedProps(evaluatedOptions);
1637
- }); // present warning message if any required props are missing
1419
+ Object.defineProperty(exports, "__esModule", {
1420
+ value: true
1421
+ });
1422
+ exports.validSortDirs = void 0;
1423
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1638
1424
 
1639
- var _vizConfig$requiredPr = vizConfig.requiredProps,
1640
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1641
- supports = vizConfig.supports;
1642
- var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
1425
+ /***/ }),
1643
1426
 
1644
- if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
1645
- return React.createElement(MissingPropsMessage_1.default, {
1646
- "data-test": "missing-props-message",
1647
- width: width,
1648
- height: height,
1649
- missingProps: missing,
1650
- backgroundColor: bgColorFromTheme
1651
- });
1652
- } // events
1427
+ /***/ 4:
1428
+ /***/ (function(module, exports) {
1653
1429
 
1430
+ module.exports = require("styled-components");
1654
1431
 
1655
- var eventCallbackProps = {};
1432
+ /***/ }),
1656
1433
 
1657
- if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1658
- var supportedEvents = vizConfig.events;
1659
- Object.keys(supportedEvents).forEach(function (eventName) {
1660
- var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1661
- eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1662
- // then remove these lines
1434
+ /***/ 40:
1435
+ /***/ (function(module, exports, __webpack_require__) {
1663
1436
 
1664
- var payloadKeys = supportedEvents[eventName].payloadKeys;
1665
- var payload = {};
1437
+ "use strict";
1666
1438
 
1667
- if (Array.isArray(payloadKeys) && payloadKeys.length) {
1668
- payloadKeys.forEach(function (p) {
1669
- payload[p] = evaluatedOptions[p];
1670
- });
1671
- }
1672
1439
 
1673
- eventCallbackProps[eventCallbackPropName] = function (ev) {
1674
- if (ev && ev.payload) {
1675
- payload = ev.payload;
1676
- }
1440
+ Object.defineProperty(exports, "__esModule", {
1441
+ value: true
1442
+ });
1443
+ exports.useDeepMemo = void 0;
1677
1444
 
1678
- return onEventTrigger({
1679
- originalEvent: ev,
1680
- payload: payload,
1681
- type: eventName
1682
- });
1683
- };
1684
- });
1685
- } // compute pure viz props which are not from options
1445
+ var react_1 = __webpack_require__(1);
1686
1446
 
1447
+ var lodash_1 = __webpack_require__(3);
1448
+ /**
1449
+ * This hook evaluates and stores the result of a passed function and only
1450
+ * re-evaluates the function when passed dependencies change.
1451
+ *
1452
+ * It is different from the internal React useMemo in the following aspects:
1453
+ * - it only stores the last evaluated result
1454
+ * - it uses a deep equality check to determine if dependencies have changed
1455
+ *
1456
+ * Inspired by apollo-client's useDeepMemo
1457
+ *
1458
+ * @param fn the function to be executed and
1459
+ * @param dependencies an array of dependencies
1460
+ */
1687
1461
 
1688
- var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
1689
- themeFunc: themeFunc
1690
- }));
1691
- /**
1692
- * PAGE_AND_SORT behavior
1693
- *
1694
- * Some visualizations, like table, requires metadata about the datasource,
1695
- * like total number of results, current count, offset, and sort, for rendering
1696
- * paginator and sorting direction. In this approach, the visualization
1697
- * allow users to set 'paginateDataSourceKey' to select which datasource
1698
- * should the visualization extract the metadata from. It defaults to 'primary' datasource.
1699
- * The visualization config should set the PAGE_AND_SORT behavior to receive
1700
- * 'requestParams', 'meta' and onRequestParams callback as props.
1701
- *
1702
- * In future, we could automatically detect which all datasources are being used
1703
- * and bind those magically to pagination/sorting behavior.
1704
- */
1705
1462
 
1706
- var dataSourceMetadata = {};
1707
- var OptionKey = 'paginateDataSourceKey';
1708
- var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
1463
+ var useDeepMemo = function useDeepMemo(fn, dependencies) {
1464
+ var ref = react_1.useRef();
1709
1465
 
1710
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1711
- var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1712
- var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
1466
+ if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1467
+ ref.current = {
1468
+ dependencies: dependencies,
1469
+ value: fn()
1470
+ };
1471
+ }
1713
1472
 
1714
- var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1715
- return onRequestParamsChange(paginateDataSourceKey, payload);
1716
- };
1473
+ return ref.current.value;
1474
+ };
1717
1475
 
1718
- var sortParams = getSorting_1.getSortingParams({
1719
- requestParams: requestParams,
1720
- meta: meta,
1721
- onRequestParamsChange: handleRequestParamsChange
1722
- });
1723
- var paginatorParams = getPagination_1.getPaginationParams({
1724
- requestParams: requestParams,
1725
- meta: meta,
1726
- onRequestParamsChange: handleRequestParamsChange
1727
- });
1728
- dataSourceMetadata = {
1729
- sortParams: sortParams,
1730
- paginatorParams: paginatorParams
1731
- };
1732
- }
1476
+ exports.useDeepMemo = useDeepMemo;
1733
1477
 
1734
- return React.createElement(SanitizedReactViz, Object.assign({
1735
- mode: mode,
1736
- width: width,
1737
- height: height
1738
- }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
1739
- };
1478
+ /***/ }),
1740
1479
 
1741
- DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1742
- DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1743
- // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1744
- theme: {}
1745
- }); // attach viz config
1480
+ /***/ 41:
1481
+ /***/ (function(module, exports, __webpack_require__) {
1746
1482
 
1747
- DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1483
+ "use strict";
1748
1484
 
1749
- return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
1750
- };
1751
1485
 
1752
- exports.default = withDashboardViz;
1486
+ Object.defineProperty(exports, "__esModule", {
1487
+ value: true
1488
+ });
1489
+ exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1753
1490
 
1754
- /***/ }),
1491
+ var React = __webpack_require__(1);
1755
1492
 
1756
- /***/ 32:
1757
- /***/ (function(module, exports) {
1493
+ var T = __webpack_require__(0);
1758
1494
 
1759
- module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1495
+ var i18n_1 = __webpack_require__(2);
1760
1496
 
1761
- /***/ }),
1497
+ var Message_1 = __webpack_require__(10);
1762
1498
 
1763
- /***/ 33:
1764
- /***/ (function(module, exports) {
1499
+ var FixedSizeContainer_1 = __webpack_require__(13);
1500
+ /**
1501
+ * @method isMissing
1502
+ * @param {any} v
1503
+ * @returns {boolean} true if the input value === null or undefined
1504
+ */
1765
1505
 
1766
- module.exports = require("@splunk/visualization-encoding/Options");
1767
1506
 
1768
- /***/ }),
1507
+ var isMissing = function isMissing(v) {
1508
+ return v === null || v === undefined;
1509
+ };
1769
1510
 
1770
- /***/ 34:
1771
- /***/ (function(module, exports) {
1511
+ exports.isMissing = isMissing;
1512
+ /**
1513
+ * @method misskingKeys
1514
+ * @param {string[]} keys
1515
+ * @param {object} target
1516
+ * @returns {string[]} the keys of missing required props
1517
+ */
1772
1518
 
1773
- module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1519
+ var missingKeys = function missingKeys(keys, target) {
1520
+ return keys.filter(function (k) {
1521
+ return exports.isMissing(target[k]);
1522
+ });
1523
+ };
1774
1524
 
1775
- /***/ }),
1525
+ exports.missingKeys = missingKeys;
1526
+ var propTypes = {
1527
+ width: T.oneOfType([T.string, T.number]),
1528
+ height: T.oneOfType([T.string, T.number]),
1529
+ // eslint-disable-next-line react/no-unused-prop-types
1530
+ backgroundColor: T.string,
1531
+ missingProps: T.arrayOf(T.string)
1532
+ };
1533
+ /**
1534
+ * @method MissingPropsMessage
1535
+ * @param {MissingPropsProps} props
1536
+ * @returns {React.ReactElement}
1537
+ */
1776
1538
 
1777
- /***/ 35:
1778
- /***/ (function(module, exports) {
1539
+ var MissingPropsMessage = function MissingPropsMessage(props) {
1540
+ var width = props.width,
1541
+ height = props.height,
1542
+ missingProps = props.missingProps;
1543
+ return React.createElement(Message_1.default, {
1544
+ "data-test": "message",
1545
+ width: width,
1546
+ height: height,
1547
+ message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
1548
+ });
1549
+ };
1779
1550
 
1780
- module.exports = require("@splunk/moment");
1551
+ exports.MissingPropsMessage = MissingPropsMessage;
1552
+ exports.MissingPropsMessage.propTypes = propTypes;
1553
+ exports.MissingPropsMessage.defaultProps = {
1554
+ width: '100%',
1555
+ height: 250
1556
+ };
1557
+ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
1781
1558
 
1782
1559
  /***/ }),
1783
1560
 
1784
- /***/ 36:
1561
+ /***/ 42:
1785
1562
  /***/ (function(module, exports, __webpack_require__) {
1786
1563
 
1787
1564
  "use strict";
1788
1565
 
1789
1566
 
1790
- var _classCallCheck = __webpack_require__(10);
1791
-
1792
1567
  Object.defineProperty(exports, "__esModule", {
1793
1568
  value: true
1794
1569
  });
1795
- exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1796
- /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1797
-
1798
- var T = __webpack_require__(0);
1799
1570
 
1800
- var lodash_1 = __webpack_require__(3);
1571
+ var React = __webpack_require__(1);
1801
1572
 
1802
- var VizActionHandler_1 = __webpack_require__(37); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1573
+ var styled_components_1 = __webpack_require__(4);
1803
1574
 
1575
+ var hocUtils_1 = __webpack_require__(14);
1804
1576
 
1805
- exports.INITIAL_WIDTH = 250;
1806
- exports.INITIAL_HEIGHT = 250;
1577
+ var Cover = styled_components_1.default.div.withConfig({
1578
+ displayName: "withEditModeCover__Cover",
1579
+ componentId: "sc-1gsbnxb-0"
1580
+ })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1581
+ var Blocker = styled_components_1.default.div.attrs({
1582
+ 'data-splunk-visualization-version': "25.2.0 - 4373c5a66"
1583
+ }).withConfig({
1584
+ displayName: "withEditModeCover__Blocker",
1585
+ componentId: "sc-1gsbnxb-1"
1586
+ })(["position:relative;width:100%;height:100%;"]);
1807
1587
  /**
1808
- * A Splunk visualization
1588
+ * HOC that renders a cover layer in edit mode
1589
+ * @method withEditModeCover
1590
+ * @param {ExtendedDashViz} Visualization
1591
+ * @returns {ExtendedDashViz} Wrapper
1809
1592
  */
1810
1593
 
1811
- var SplunkVisualization = function SplunkVisualization() {
1812
- _classCallCheck(this, SplunkVisualization);
1594
+ var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1595
+ var Wrapper = function Wrapper(props) {
1596
+ var mode = props.mode;
1597
+ var showEditCover = mode === 'edit' && !disableEditModeCover;
1598
+ return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
1599
+ "data-test": "edit-mode-cover"
1600
+ }));
1601
+ };
1602
+
1603
+ hocUtils_1.extendStaticWrapperProps({
1604
+ Wrapper: Wrapper,
1605
+ Visualization: Visualization
1606
+ });
1607
+ return Wrapper;
1813
1608
  };
1814
1609
 
1815
- SplunkVisualization.propTypes = {
1816
- /**
1817
- * display mode
1818
- */
1819
- mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1610
+ exports.default = withEditModeCover;
1820
1611
 
1821
- /**
1822
- * width in pixel or string, defaults to 100%
1823
- */
1824
- width: T.oneOfType([T.string, T.number]).isRequired,
1612
+ /***/ }),
1825
1613
 
1826
- /**
1827
- * height in pixel or string
1828
- */
1829
- height: T.oneOfType([T.string, T.number]).isRequired,
1614
+ /***/ 43:
1615
+ /***/ (function(module, exports, __webpack_require__) {
1830
1616
 
1831
- /**
1832
- * visualization context used for dynamic option evaluation
1833
- */
1834
- context: T.object,
1617
+ "use strict";
1835
1618
 
1836
- /**
1837
- * visualization formatting options
1838
- */
1839
- options: T.object,
1840
1619
 
1841
- /**
1842
- * A callback to update formatting options
1843
- */
1844
- onOptionsChange: T.func,
1620
+ Object.defineProperty(exports, "__esModule", {
1621
+ value: true
1622
+ });
1845
1623
 
1846
- /**
1847
- * datasource state which include data and request params, object key indicate the datasource type.
1848
- */
1849
- dataSources: T.objectOf(T.shape({
1850
- /**
1851
- * current request params
1852
- */
1853
- requestParams: T.object,
1624
+ var React = __webpack_require__(1);
1854
1625
 
1855
- /**
1856
- * current dataset
1857
- */
1858
- data: T.shape({
1859
- fields: T.array,
1860
- columns: T.array
1861
- }),
1626
+ var colorUtils_1 = __webpack_require__(12);
1862
1627
 
1863
- /**
1864
- * error
1865
- */
1866
- error: T.shape({
1867
- level: T.string,
1868
- message: T.string
1869
- }),
1628
+ var variables_1 = __webpack_require__(9);
1870
1629
 
1871
- /**
1872
- * meta data that came with the dataset
1873
- */
1874
- meta: T.object
1875
- })),
1630
+ var IconPlaceholder_1 = __webpack_require__(27);
1876
1631
 
1877
- /**
1878
- * A callback to trigger event
1879
- */
1880
- onEventTrigger: T.func,
1632
+ var VizBehavior_1 = __webpack_require__(6);
1881
1633
 
1882
- /**
1883
- * Inform viz if there are handlers listening to events
1884
- */
1885
- hasEventHandlers: T.bool,
1634
+ var hocUtils_1 = __webpack_require__(14);
1886
1635
 
1887
- /**
1888
- * A callback to communicate computed props to a consumer
1889
- */
1890
- onComputedProps: T.func,
1636
+ var withPlaceholder = function withPlaceholder(Visualization) {
1637
+ var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
1638
+ var config = Visualization.config;
1639
+ var themes = config.themes;
1891
1640
 
1892
- /**
1893
- * A callback to obtain visualization api
1894
- */
1895
- vizActionHandlerRef: T.func,
1896
- loading: T.bool,
1897
- theme: T.object,
1641
+ var Wrapper = function Wrapper(props) {
1642
+ var _a, _b;
1898
1643
 
1899
- /**
1900
- * A callback to request new data with updated request params
1901
- */
1902
- onRequestParamsChange: T.func
1903
- };
1904
- /**
1905
- *
1906
- */
1644
+ var dataSources = props.dataSources,
1645
+ loading = props.loading,
1646
+ options = props.options,
1647
+ height = props.height,
1648
+ width = props.width;
1649
+ var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1650
+ var bgColorFromTheme = colorUtils_1.isColor(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
1651
+ var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1652
+ var iconColor = variables_1.default.contentColorActive(props);
1907
1653
 
1908
- SplunkVisualization.defaultProps = {
1909
- // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1910
- width: '100%',
1911
- height: exports.INITIAL_HEIGHT,
1912
- dataSources: {},
1913
- onEventTrigger: function onEventTrigger() {
1914
- return {};
1915
- },
1916
- mode: 'view',
1917
- hasEventHandlers: false,
1918
- options: {},
1919
- context: {},
1920
- onOptionsChange: function onOptionsChange() {
1921
- return {};
1922
- },
1923
- vizActionHandlerRef: function vizActionHandlerRef() {
1924
- return new VizActionHandler_1.DefaultVizActionHandler();
1925
- },
1926
- onComputedProps: function onComputedProps() {
1927
- return {};
1928
- },
1929
- loading: false,
1930
- onRequestParamsChange: lodash_1.noop
1654
+ if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1655
+ return React.createElement(IconPlaceholder_1.default, {
1656
+ "data-test": "icon-placeholder",
1657
+ icon: icon,
1658
+ width: width,
1659
+ height: height,
1660
+ backgroundColor: bgColorFromTheme,
1661
+ iconColor: iconColor
1662
+ });
1663
+ }
1664
+
1665
+ return React.createElement(Visualization, Object.assign({}, props));
1666
+ };
1667
+
1668
+ hocUtils_1.extendStaticWrapperProps({
1669
+ Wrapper: Wrapper,
1670
+ Visualization: Visualization
1671
+ });
1672
+ return Wrapper;
1931
1673
  };
1932
- exports.default = SplunkVisualization;
1674
+
1675
+ exports.default = withPlaceholder;
1933
1676
 
1934
1677
  /***/ }),
1935
1678
 
1936
- /***/ 37:
1679
+ /***/ 437:
1937
1680
  /***/ (function(module, exports, __webpack_require__) {
1938
1681
 
1939
1682
  "use strict";
1940
1683
 
1941
1684
 
1942
- var _classCallCheck = __webpack_require__(10);
1685
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1686
+ if (k2 === undefined) k2 = k;
1687
+ Object.defineProperty(o, k2, {
1688
+ enumerable: true,
1689
+ get: function get() {
1690
+ return m[k];
1691
+ }
1692
+ });
1693
+ } : function (o, m, k, k2) {
1694
+ if (k2 === undefined) k2 = k;
1695
+ o[k2] = m[k];
1696
+ });
1943
1697
 
1944
- var _createClass = __webpack_require__(18);
1698
+ var __exportStar = this && this.__exportStar || function (m, exports) {
1699
+ for (var p in m) {
1700
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1701
+ }
1702
+ };
1945
1703
 
1946
1704
  Object.defineProperty(exports, "__esModule", {
1947
1705
  value: true
1948
1706
  });
1949
- exports.DefaultVizActionHandler = void 0;
1950
-
1951
- var DefaultVizActionHandler = /*#__PURE__*/function () {
1952
- function DefaultVizActionHandler() {
1953
- _classCallCheck(this, DefaultVizActionHandler);
1954
- }
1955
-
1956
- _createClass(DefaultVizActionHandler, [{
1957
- key: "focus",
1958
- value: function focus() {// noop
1959
- }
1960
- }, {
1961
- key: "snapshot",
1962
- value: function snapshot() {
1963
- return null; // noop
1964
- }
1965
- }]);
1966
-
1967
- return DefaultVizActionHandler;
1968
- }();
1969
-
1970
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1971
-
1972
- /***/ }),
1973
-
1974
- /***/ 38:
1975
- /***/ (function(module, exports, __webpack_require__) {
1707
+ exports.default = void 0;
1976
1708
 
1977
- "use strict";
1709
+ __exportStar(__webpack_require__(149), exports);
1978
1710
 
1711
+ var Scatter_1 = __webpack_require__(149);
1979
1712
 
1980
- Object.defineProperty(exports, "__esModule", {
1981
- value: true
1713
+ Object.defineProperty(exports, "default", {
1714
+ enumerable: true,
1715
+ get: function get() {
1716
+ return Scatter_1.default;
1717
+ }
1982
1718
  });
1983
- exports.validSortDirs = void 0;
1984
- exports.validSortDirs = ['asc', 'desc', 'none'];
1985
1719
 
1986
1720
  /***/ }),
1987
1721
 
1988
- /***/ 39:
1722
+ /***/ 438:
1989
1723
  /***/ (function(module, exports, __webpack_require__) {
1990
1724
 
1991
1725
  "use strict";
1992
1726
 
1993
1727
 
1728
+ var _toConsumableArray = __webpack_require__(8);
1729
+
1994
1730
  Object.defineProperty(exports, "__esModule", {
1995
1731
  value: true
1996
1732
  });
1997
- exports.useDeepMemo = void 0;
1733
+ exports.optionsSchema = void 0;
1998
1734
 
1999
- var react_1 = __webpack_require__(1);
1735
+ var visualization_icons_1 = __webpack_require__(47);
2000
1736
 
2001
- var lodash_1 = __webpack_require__(3);
2002
- /**
2003
- * This hook evaluates and stores the result of a passed function and only
2004
- * re-evaluates the function when passed dependencies change.
2005
- *
2006
- * It is different from the internal React useMemo in the following aspects:
2007
- * - it only stores the last evaluated result
2008
- * - it uses a deep equality check to determine if dependencies have changed
2009
- *
2010
- * Inspired by apollo-client's useDeepMemo
2011
- *
2012
- * @param fn the function to be executed and
2013
- * @param dependencies an array of dependencies
2014
- */
1737
+ var placeholders_1 = __webpack_require__(44);
2015
1738
 
1739
+ var pick_1 = __webpack_require__(21);
2016
1740
 
2017
- var useDeepMemo = function useDeepMemo(fn, dependencies) {
2018
- var ref = react_1.useRef();
1741
+ var variables_1 = __webpack_require__(9);
2019
1742
 
2020
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
2021
- ref.current = {
2022
- dependencies: dependencies,
2023
- value: fn()
2024
- };
1743
+ var schemaUtils_1 = __webpack_require__(16);
1744
+
1745
+ var visualization_color_palettes_1 = __webpack_require__(46);
1746
+
1747
+ var i18n_1 = __webpack_require__(2);
1748
+
1749
+ var VizBehavior_1 = __webpack_require__(6);
1750
+
1751
+ var VizCategory_1 = __webpack_require__(31);
1752
+
1753
+ var configUtils_1 = __webpack_require__(17);
1754
+
1755
+ var AxesChartDataConfig_1 = __webpack_require__(64);
1756
+
1757
+ var AxesChartXGridAndLabels_1 = __webpack_require__(67);
1758
+
1759
+ var AxesChartColorAndStyle_1 = __webpack_require__(65);
1760
+
1761
+ var AxesChartLegend_1 = __webpack_require__(66);
1762
+
1763
+ var AxesChartYGridAndLabels_1 = __webpack_require__(68);
1764
+
1765
+ var dataContract = {
1766
+ requiredDataSources: [{
1767
+ name: 'primary',
1768
+ description: 'DataSource that powers the visualization'
1769
+ }],
1770
+ optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
1771
+ // {
1772
+ // name: 'annotation',
1773
+ // description: 'DataSource that populates event annotations',
1774
+ // },
1775
+ ],
1776
+ initialRequestParams: {
1777
+ primary: {
1778
+ offset: 0,
1779
+ count: 10000
1780
+ },
1781
+ annotation: {
1782
+ offset: 0,
1783
+ count: 10000
1784
+ }
1785
+ }
1786
+ };
1787
+ var size = {
1788
+ initialWidth: 300,
1789
+ initialHeight: 300
1790
+ };
1791
+ var defaultContext = {};
1792
+ exports.optionsSchema = {
1793
+ x: {
1794
+ default: '> primary | seriesByIndex(0)',
1795
+ description: 'Specify the dataSource applied to the x-axis.',
1796
+ type: 'array',
1797
+ items: {
1798
+ type: ['string', 'number']
1799
+ }
1800
+ },
1801
+ y: {
1802
+ default: '> primary | seriesByIndex(1)',
1803
+ description: 'Specify the dataSource applied to the y-axis.',
1804
+ type: 'array',
1805
+ items: {
1806
+ type: ['string', 'number']
1807
+ }
1808
+ },
1809
+ category: {
1810
+ description: 'Specify a sequence of dataSource events to be plotted on the chart.',
1811
+ type: 'array',
1812
+ items: {
1813
+ type: ['string', 'number']
1814
+ },
1815
+ default: '> primary | seriesByIndex(2)'
1816
+ },
1817
+ xField: {
1818
+ default: '> x | getField()',
1819
+ description: 'Specify the field that should be mapped to the x-axis.',
1820
+ type: 'string'
1821
+ },
1822
+ yField: {
1823
+ default: '> y | getField()',
1824
+ description: 'Specify the field that should be mapped to the y-axis.',
1825
+ type: 'string'
1826
+ },
1827
+ categoryField: {
1828
+ default: '> category | getField()',
1829
+ description: 'Specify the field that should be mapped to the series categories.',
1830
+ type: 'string'
1831
+ },
1832
+ backgroundColor: {
1833
+ default: '> themes.defaultBackgroundColor',
1834
+ 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".',
1835
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
1836
+ type: 'string'
1837
+ },
1838
+ legendDisplay: {
1839
+ default: 'right',
1840
+ description: 'Specify the location of the legend on the panel.',
1841
+ pattern: schemaUtils_1.getPattern(['right', 'left', 'top', 'bottom', 'off']),
1842
+ type: 'string'
1843
+ },
1844
+ legendTruncation: {
1845
+ default: 'ellipsisEnd',
1846
+ description: 'Specify how to display legend labels when they overflow the layout boundaries by replacing overflow text with an ellipsis.',
1847
+ pattern: schemaUtils_1.getPattern(['ellipsisEnd', 'ellipsisMiddle', 'ellipsisStart', 'ellipsisOff']),
1848
+ type: 'string'
1849
+ },
1850
+ markerSize: {
1851
+ description: 'Specify, in pixels, the size of each scatter marker.',
1852
+ type: 'number',
1853
+ default: 4
1854
+ },
1855
+ resultLimit: {
1856
+ default: 50000,
1857
+ description: 'Specify the number of data points rendered in a chart.',
1858
+ type: 'number'
1859
+ },
1860
+ seriesColors: {
1861
+ default: visualization_color_palettes_1.VIZ_CATEGORICAL,
1862
+ description: 'Specify the colors used for a series. For example, ["#FF0000", "#0000FF", "#008000"].',
1863
+ type: 'array',
1864
+ items: {
1865
+ type: 'string'
1866
+ }
1867
+ },
1868
+ seriesColorsByField: {
1869
+ description: 'Specify the colors to use for specific categories, or series names, derived from distinct values in the selected category field. For example, {"user1": "#008000", "user2": "#FFA500"}.',
1870
+ type: 'object'
1871
+ },
1872
+ showXAxisExtendedRange: {
1873
+ default: true,
1874
+ description: 'Specify whether the x-axis should be extended to snap to whole major tick marks.',
1875
+ type: 'boolean'
1876
+ },
1877
+ showYAxisExtendedRange: {
1878
+ default: true,
1879
+ description: 'Specify whether the y-axis should be extended to snap to whole major tick marks.',
1880
+ type: 'boolean'
1881
+ },
1882
+ showXAxisWithZero: {
1883
+ default: false,
1884
+ description: 'Specify whether the x-axis range includes zero.',
1885
+ type: 'boolean'
1886
+ },
1887
+ showYAxisWithZero: {
1888
+ default: false,
1889
+ description: 'Specify whether the y-axis range includes zero.',
1890
+ type: 'boolean'
1891
+ },
1892
+ showRoundedXAxisLabels: {
1893
+ default: false,
1894
+ description: 'Specify whether to round x-axis values to the nearest integer.',
1895
+ type: 'boolean'
1896
+ },
1897
+ // TODO: figure out if we want to change splunk-charting behavior for Bubble/Scatter, which hardcodes XMajorGridlines to false
1898
+ // showXMajorGridLines: {
1899
+ // default: false,
1900
+ // description: 'Specify whether major grid lines are visible on the x-axis.',
1901
+ // type: 'boolean',
1902
+ // },
1903
+ showYMajorGridLines: {
1904
+ default: true,
1905
+ description: 'Specify whether major grid lines are visible on the y-axis.',
1906
+ type: 'boolean'
1907
+ },
1908
+ showXMinorGridLines: {
1909
+ default: false,
1910
+ description: 'Specify whether minor grid lines are visible on the x-axis.',
1911
+ type: 'boolean'
1912
+ },
1913
+ showYMinorGridLines: {
1914
+ default: false,
1915
+ description: 'Specify whether minor grid lines are visible on the y-axis.',
1916
+ type: 'boolean'
1917
+ },
1918
+ xAxisLabelRotation: {
1919
+ default: 0,
1920
+ description: 'Specify the rotation of the x-axis labels in degrees.',
1921
+ type: 'number',
1922
+ enum: [-90, -45, 0, 45, 90]
1923
+ },
1924
+ xAxisAbbreviation: {
1925
+ default: 'off',
1926
+ description: 'Specify whether to abbreviate large x-axis values with the closest SI prefix.',
1927
+ enum: ['off', 'auto'],
1928
+ pattern: schemaUtils_1.getPattern(['auto', 'off']),
1929
+ type: 'string'
1930
+ },
1931
+ yAxisAbbreviation: {
1932
+ default: 'auto',
1933
+ description: 'Specify whether to abbreviate large y-axis values with the closest SI prefix.',
1934
+ enum: ['off', 'auto'],
1935
+ pattern: schemaUtils_1.getPattern(['auto', 'off']),
1936
+ type: 'string'
1937
+ },
1938
+ xAxisLabelVisibility: {
1939
+ default: 'auto',
1940
+ description: 'Specify whether to show or hide labels on the x-axis.',
1941
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
1942
+ type: 'string'
1943
+ },
1944
+ yAxisLabelVisibility: {
1945
+ default: 'auto',
1946
+ description: 'Specify whether to show or hide labels on the y-axis.',
1947
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
1948
+ type: 'string'
1949
+ },
1950
+ xAxisLineVisibility: {
1951
+ default: 'hide',
1952
+ description: 'Specify whether to show or hide the x-axis line.',
1953
+ enum: ['hide', 'show'],
1954
+ pattern: schemaUtils_1.getPattern(['show', 'hide']),
1955
+ type: 'string'
1956
+ },
1957
+ yAxisLineVisibility: {
1958
+ default: 'hide',
1959
+ description: 'Specify whether to show or hide the y-axis line.',
1960
+ enum: ['hide', 'show'],
1961
+ pattern: schemaUtils_1.getPattern(['show', 'hide']),
1962
+ type: 'string'
1963
+ },
1964
+ xAxisMajorTickInterval: {
1965
+ default: 'auto',
1966
+ description: 'Specify the spacing interval at which to place major tick marks along the numeric x-axis. By default, this value is automatically calculated based on the scale of the related axis.',
1967
+ type: ['string', 'number']
1968
+ },
1969
+ yAxisMajorTickInterval: {
1970
+ default: 'auto',
1971
+ description: 'Specify the spacing interval at which to place major tick marks along the numeric y-axis. By default, this value is automatically calculated based on the scale of the related axis.',
1972
+ type: ['string', 'number']
1973
+ },
1974
+ xAxisMajorTickSize: {
1975
+ default: 6,
1976
+ description: 'Specify the size, in pixels, of major tick marks on the x-axis.',
1977
+ type: 'number'
1978
+ },
1979
+ yAxisMajorTickSize: {
1980
+ default: 6,
1981
+ description: 'Specify the size, in pixels, of major tick marks on the y-axis.',
1982
+ type: 'number'
1983
+ },
1984
+ xAxisMinorTickSize: {
1985
+ default: 6,
1986
+ description: 'Specify the size, in pixels, of minor tick marks on the x-axis.',
1987
+ type: 'number'
1988
+ },
1989
+ yAxisMinorTickSize: {
1990
+ default: 6,
1991
+ description: 'Specify the size, in pixels, of minor tick marks on the y-axis.',
1992
+ type: 'number'
1993
+ },
1994
+ xAxisMajorTickVisibility: {
1995
+ default: 'auto',
1996
+ description: 'Specify whether to show or hide major tick marks on the x-axis.',
1997
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
1998
+ type: 'string'
1999
+ },
2000
+ yAxisMajorTickVisibility: {
2001
+ default: 'auto',
2002
+ description: 'Specify whether to show or hide major tick marks on the y-axis.',
2003
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
2004
+ type: 'string'
2005
+ },
2006
+ xAxisMinorTickVisibility: {
2007
+ default: 'auto',
2008
+ description: 'Specify whether to show or hide minor tick marks on the x-axis .',
2009
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
2010
+ type: 'string'
2011
+ },
2012
+ yAxisMinorTickVisibility: {
2013
+ default: 'auto',
2014
+ description: 'Specify whether to show or hide minor tick marks on the y-axis.',
2015
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
2016
+ type: 'string'
2017
+ },
2018
+ xAxisMax: {
2019
+ default: 'auto',
2020
+ description: 'Specify the maximum number for the range of the visible x-axis.',
2021
+ type: ['string', 'number']
2022
+ },
2023
+ yAxisMax: {
2024
+ default: 'auto',
2025
+ description: 'Specify the maximum number for the range of the visible y-axis.',
2026
+ type: ['string', 'number']
2027
+ },
2028
+ xAxisMin: {
2029
+ default: 'auto',
2030
+ description: 'Specify the minimum number for the range of the visible x-axis.',
2031
+ type: ['string', 'number']
2032
+ },
2033
+ yAxisMin: {
2034
+ default: 'auto',
2035
+ description: 'Specify the minimum number for the range of the visible y-axis.',
2036
+ type: ['string', 'number']
2037
+ },
2038
+ xAxisScale: {
2039
+ default: 'linear',
2040
+ description: 'Specify the type of scale that applies to a numerical x-axis.',
2041
+ pattern: schemaUtils_1.getPattern(['linear', 'log']),
2042
+ type: 'string'
2043
+ },
2044
+ yAxisScale: {
2045
+ default: 'linear',
2046
+ description: 'Specify the type of scale that applies to a numerical y-axis.',
2047
+ pattern: schemaUtils_1.getPattern(['linear', 'log']),
2048
+ type: 'string'
2049
+ },
2050
+ xAxisTitleText: {
2051
+ description: 'Specify the title of the x-axis.',
2052
+ type: 'string'
2053
+ },
2054
+ yAxisTitleText: {
2055
+ description: 'Specify the title of the y-axis.',
2056
+ type: 'string'
2057
+ },
2058
+ xAxisTitleVisibility: {
2059
+ default: 'show',
2060
+ description: 'Specify whether to show or hide the title of the x-axis.',
2061
+ enum: ['hide', 'show'],
2062
+ pattern: schemaUtils_1.getPattern(['show', 'hide']),
2063
+ type: 'string'
2064
+ },
2065
+ yAxisTitleVisibility: {
2066
+ default: 'show',
2067
+ description: 'Specify whether to show or hide the title of the y-axis.',
2068
+ enum: ['hide', 'show'],
2069
+ pattern: schemaUtils_1.getPattern(['show', 'hide']),
2070
+ type: 'string'
2025
2071
  }
2026
-
2027
- return ref.current.value;
2028
- };
2029
-
2030
- exports.useDeepMemo = useDeepMemo;
2031
-
2032
- /***/ }),
2033
-
2034
- /***/ 4:
2035
- /***/ (function(module, exports) {
2036
-
2037
- module.exports = require("styled-components");
2038
-
2039
- /***/ }),
2040
-
2041
- /***/ 40:
2042
- /***/ (function(module, exports, __webpack_require__) {
2043
-
2044
- "use strict";
2045
-
2046
-
2047
- Object.defineProperty(exports, "__esModule", {
2048
- value: true
2049
- });
2050
- exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
2051
-
2052
- var React = __webpack_require__(1);
2053
-
2054
- var T = __webpack_require__(0);
2055
-
2056
- var i18n_1 = __webpack_require__(2);
2057
-
2058
- var Message_1 = __webpack_require__(9);
2059
-
2060
- var FixedSizeContainer_1 = __webpack_require__(12);
2061
- /**
2062
- * @method isMissing
2063
- * @param {any} v
2064
- * @returns {boolean} true if the input value === null or undefined
2065
- */
2066
-
2067
-
2068
- var isMissing = function isMissing(v) {
2069
- return v === null || v === undefined;
2070
- };
2071
-
2072
- exports.isMissing = isMissing;
2073
- /**
2074
- * @method misskingKeys
2075
- * @param {string[]} keys
2076
- * @param {object} target
2077
- * @returns {string[]} the keys of missing required props
2078
- */
2079
-
2080
- var missingKeys = function missingKeys(keys, target) {
2081
- return keys.filter(function (k) {
2082
- return exports.isMissing(target[k]);
2083
- });
2084
- };
2085
-
2086
- exports.missingKeys = missingKeys;
2087
- var propTypes = {
2088
- width: T.oneOfType([T.string, T.number]),
2089
- height: T.oneOfType([T.string, T.number]),
2090
- // eslint-disable-next-line react/no-unused-prop-types
2091
- backgroundColor: T.string,
2092
- missingProps: T.arrayOf(T.string)
2093
- };
2094
- /**
2095
- * @method MissingPropsMessage
2096
- * @param {MissingPropsProps} props
2097
- * @returns {React.ReactElement}
2098
- */
2099
-
2100
- var MissingPropsMessage = function MissingPropsMessage(props) {
2101
- var width = props.width,
2102
- height = props.height,
2103
- missingProps = props.missingProps;
2104
- return React.createElement(Message_1.default, {
2105
- "data-test": "message",
2106
- width: width,
2107
- height: height,
2108
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
2109
- });
2110
2072
  };
2111
-
2112
- exports.MissingPropsMessage = MissingPropsMessage;
2113
- exports.MissingPropsMessage.propTypes = propTypes;
2114
- exports.MissingPropsMessage.defaultProps = {
2115
- width: '100%',
2116
- height: 250
2073
+ var themes = {
2074
+ defaultBackgroundColor: function defaultBackgroundColor(props) {
2075
+ return pick_1.default({
2076
+ enterprise: {
2077
+ dark: variables_1.default.black(props),
2078
+ light: variables_1.default.backgroundColor(props)
2079
+ },
2080
+ prisma: variables_1.default.backgroundColorSidebar(props)
2081
+ })(props);
2082
+ }
2117
2083
  };
2118
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
2119
-
2120
- /***/ }),
2121
-
2122
- /***/ 41:
2123
- /***/ (function(module, exports, __webpack_require__) {
2124
-
2125
- "use strict";
2126
-
2127
-
2128
- Object.defineProperty(exports, "__esModule", {
2129
- value: true
2130
- });
2131
-
2132
- var React = __webpack_require__(1);
2133
-
2134
- var styled_components_1 = __webpack_require__(4);
2135
-
2136
- var hocUtils_1 = __webpack_require__(13);
2137
-
2138
- var Cover = styled_components_1.default.div.withConfig({
2139
- displayName: "withEditModeCover__Cover",
2140
- componentId: "sc-1gsbnxb-0"
2141
- })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
2142
- var Blocker = styled_components_1.default.div.attrs({
2143
- 'data-splunk-visualization-version': "25.1.0 - 812a9a4d8"
2144
- }).withConfig({
2145
- displayName: "withEditModeCover__Blocker",
2146
- componentId: "sc-1gsbnxb-1"
2147
- })(["position:relative;width:100%;height:100%;"]);
2084
+ var editorConfig = [AxesChartDataConfig_1.AxesChartDataConfigScatter, {
2085
+ label: AxesChartColorAndStyle_1.default.label,
2086
+ layout: [].concat(_toConsumableArray(AxesChartColorAndStyle_1.default.layout.slice(0, 2)), [[{
2087
+ label: i18n_1._('Series colors by category name'),
2088
+ option: 'seriesColorsByField',
2089
+ editor: 'editor.seriesColorsByField',
2090
+ editorProps: {
2091
+ isCategorical: true
2092
+ }
2093
+ }], [{
2094
+ label: i18n_1._('Marker size'),
2095
+ option: 'markerSize',
2096
+ editor: 'editor.slider',
2097
+ editorProps: {
2098
+ min: 0,
2099
+ max: 20,
2100
+ step: 1
2101
+ }
2102
+ }]])
2103
+ }, AxesChartLegend_1.default, AxesChartXGridAndLabels_1.AxesChartXGridAndLabelsBubbleScatter, AxesChartYGridAndLabels_1.default];
2148
2104
  /**
2149
- * HOC that renders a cover layer in edit mode
2150
- * @method withEditModeCover
2151
- * @param {ExtendedDashViz} Visualization
2152
- * @returns {ExtendedDashViz} Wrapper
2105
+ * visualization configuration
2153
2106
  */
2154
2107
 
2155
- var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
2156
- var Wrapper = function Wrapper(props) {
2157
- var mode = props.mode;
2158
- var showEditCover = mode === 'edit' && !disableEditModeCover;
2159
- return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
2160
- "data-test": "edit-mode-cover"
2161
- }));
2162
- };
2108
+ var config = {
2109
+ /**
2110
+ * unique viz key
2111
+ */
2112
+ key: 'splunk.scatter',
2163
2113
 
2164
- hocUtils_1.extendStaticWrapperProps({
2165
- Wrapper: Wrapper,
2166
- Visualization: Visualization
2167
- });
2168
- return Wrapper;
2169
- };
2114
+ /**
2115
+ * viz name
2116
+ */
2117
+ name: 'Scatter',
2118
+ category: VizCategory_1.VizCategory.COMPARISONS,
2170
2119
 
2171
- exports.default = withEditModeCover;
2120
+ /**
2121
+ * viz icon
2122
+ */
2123
+ icon: visualization_icons_1.Scatter,
2124
+ placeholderIcon: placeholders_1.Scatter,
2125
+ dataContract: dataContract,
2126
+ size: size,
2127
+ defaultContext: defaultContext,
2128
+ optionsSchema: exports.optionsSchema,
2129
+ editorConfig: editorConfig,
2130
+ events: {
2131
+ 'legend.click': {
2132
+ description: 'triggered when user clicks on chart legend'
2133
+ },
2134
+ 'point.click': {
2135
+ description: 'triggered when user clicks on a point in the scatter chart'
2136
+ }
2137
+ },
2138
+ supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
2139
+ themes: themes
2140
+ };
2141
+ exports.default = configUtils_1.enhanceConfig(config);
2172
2142
 
2173
2143
  /***/ }),
2174
2144
 
2175
- /***/ 42:
2145
+ /***/ 439:
2176
2146
  /***/ (function(module, exports, __webpack_require__) {
2177
2147
 
2178
2148
  "use strict";
@@ -2181,84 +2151,128 @@ exports.default = withEditModeCover;
2181
2151
  Object.defineProperty(exports, "__esModule", {
2182
2152
  value: true
2183
2153
  });
2154
+ exports.convertToScatterSCProperties = exports.mapToOldKey = exports.convertToStringValues = exports.scatterOptionValuesSCMapping = void 0;
2184
2155
 
2185
- var React = __webpack_require__(1);
2186
-
2187
- var colorUtils_1 = __webpack_require__(11);
2156
+ var lodash_1 = __webpack_require__(3);
2188
2157
 
2189
- var variables_1 = __webpack_require__(8);
2158
+ var propUtils_1 = __webpack_require__(24);
2190
2159
 
2191
- var IconPlaceholder_1 = __webpack_require__(27);
2160
+ var chartingUtils_1 = __webpack_require__(52); // map for key names which are either new or not present in SimpleXML options mapping
2192
2161
 
2193
- var VizBehavior_1 = __webpack_require__(5);
2194
2162
 
2195
- var hocUtils_1 = __webpack_require__(13);
2163
+ var scatterOptionsSCMapping = {
2164
+ xAxisLabelRotation: 'xAxisMajorLabelRotation',
2165
+ xAxisLabelVisibility: 'xAxisMajorLabelVisibility',
2166
+ yAxisLabelVisibility: 'yAxisMajorLabelVisibility',
2167
+ showRoundedXAxisLabels: 'roundXAxisLabelsToInteger',
2168
+ xAxisLineVisibility: 'xAxisVisibility',
2169
+ yAxisLineVisibility: 'yAxisVisibility',
2170
+ showYMajorGridLines: 'showMajorYGridLines',
2171
+ showXMinorGridLines: 'showMinorXGridLines',
2172
+ showYMinorGridLines: 'showMinorYGridLines',
2173
+ xAxisMajorTickInterval: 'xAxisMajorUnit',
2174
+ yAxisMajorTickInterval: 'yAxisMajorUnit',
2175
+ showXAxisExtendedRange: 'xAxisExtendsAxisRange',
2176
+ showYAxisExtendedRange: 'yAxisExtendsAxisRange',
2177
+ showXAxisWithZero: 'xAxisIncludeZero',
2178
+ showYAxisWithZero: 'yAxisIncludeZero',
2179
+ legendTruncation: 'legendLabelOverflowMode',
2180
+ legendDisplay: 'legendPlacement',
2181
+ resultLimit: 'resultTruncationLimit',
2182
+ seriesColorsByField: 'fieldColors',
2183
+ bubbleSizeMax: 'bubbleMaxSize',
2184
+ bubbleSizeMin: 'bubbleMinSize',
2185
+ bubbleSizeMethod: 'bubbleSizeBy'
2186
+ }; // key value mapping of what options (and their corresponding values) which we expose in config.ts to property values SC understands
2196
2187
 
2197
- var withPlaceholder = function withPlaceholder(Visualization) {
2198
- var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
2199
- var config = Visualization.config;
2200
- var themes = config.themes;
2188
+ exports.scatterOptionValuesSCMapping = {
2189
+ xAxisTitleVisibility: {
2190
+ hide: 'collapsed'
2191
+ },
2192
+ yAxisTitleVisibility: {
2193
+ hide: 'collapsed'
2194
+ },
2195
+ yAxisAbbreviation: {
2196
+ off: 'none'
2197
+ },
2198
+ legendPlacement: {
2199
+ off: 'none'
2200
+ },
2201
+ legendLabelOverflowMode: {
2202
+ ellipsisOff: 'ellipsisNone'
2203
+ }
2204
+ };
2205
+ /**
2206
+ * Helper method to convert option which contains object literal values (e.g. arrays, objects)
2207
+ * to strings as SC can only accept their stringified equivalents
2208
+ * @method convertToStringValues
2209
+ * @param {Object} options
2210
+ * @returns {Object}
2211
+ */
2201
2212
 
2202
- var Wrapper = function Wrapper(props) {
2203
- var _a, _b;
2213
+ var convertToStringValues = function convertToStringValues(options) {
2214
+ var updatedOptions = propUtils_1.convertPropsToString({
2215
+ vizProps: options,
2216
+ propNames: ['seriesColors', 'fieldColors']
2217
+ });
2218
+ return Object.assign(Object.assign({}, options), updatedOptions);
2219
+ };
2204
2220
 
2205
- var dataSources = props.dataSources,
2206
- loading = props.loading,
2207
- options = props.options,
2208
- height = props.height,
2209
- width = props.width;
2210
- var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
2211
- var bgColorFromTheme = colorUtils_1.isColor(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
2212
- var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
2213
- var iconColor = variables_1.default.contentColorActive(props);
2221
+ exports.convertToStringValues = convertToStringValues;
2222
+ /**
2223
+ * Helper method to update the option names which can be mapped to SimpleXML options or
2224
+ * can be used directly with SC if don't have a 1-1 mapping in SimpleXML
2225
+ * @method mapToOldKey
2226
+ * @param {Object} options
2227
+ * @returns {Object}
2228
+ */
2214
2229
 
2215
- if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
2216
- return React.createElement(IconPlaceholder_1.default, {
2217
- "data-test": "icon-placeholder",
2218
- icon: icon,
2219
- width: width,
2220
- height: height,
2221
- backgroundColor: bgColorFromTheme,
2222
- iconColor: iconColor
2223
- });
2224
- }
2230
+ var mapToOldKey = function mapToOldKey(options) {
2231
+ return lodash_1.mapKeys(options, function (val, key) {
2232
+ return scatterOptionsSCMapping[key] ? scatterOptionsSCMapping[key] : key;
2233
+ });
2234
+ };
2225
2235
 
2226
- return React.createElement(Visualization, Object.assign({}, props));
2227
- };
2236
+ exports.mapToOldKey = mapToOldKey;
2237
+ /**
2238
+ * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts
2239
+ * This is for options that has new key name and can not directly be mapped with SimpleXML or
2240
+ * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)
2241
+ * @method convertToScatterSCProperties
2242
+ * @param {Object} originalOptions
2243
+ * @returns {Object}
2244
+ */
2228
2245
 
2229
- hocUtils_1.extendStaticWrapperProps({
2230
- Wrapper: Wrapper,
2231
- Visualization: Visualization
2232
- });
2233
- return Wrapper;
2246
+ var convertToScatterSCProperties = function convertToScatterSCProperties(originalOptions) {
2247
+ return lodash_1.chain(exports.mapToOldKey(originalOptions)).thru(chartingUtils_1.mapToValues(exports.scatterOptionValuesSCMapping)).thru(exports.convertToStringValues).value();
2234
2248
  };
2235
2249
 
2236
- exports.default = withPlaceholder;
2250
+ exports.convertToScatterSCProperties = convertToScatterSCProperties;
2237
2251
 
2238
2252
  /***/ }),
2239
2253
 
2240
2254
  /***/ 44:
2241
2255
  /***/ (function(module, exports) {
2242
2256
 
2243
- module.exports = require("@splunk/visualization-color-palettes");
2257
+ module.exports = require("@splunk/visualization-icons/placeholders");
2244
2258
 
2245
2259
  /***/ }),
2246
2260
 
2247
- /***/ 45:
2261
+ /***/ 46:
2248
2262
  /***/ (function(module, exports) {
2249
2263
 
2250
- module.exports = require("@splunk/visualization-icons/placeholders");
2264
+ module.exports = require("@splunk/visualization-color-palettes");
2251
2265
 
2252
2266
  /***/ }),
2253
2267
 
2254
- /***/ 46:
2268
+ /***/ 47:
2255
2269
  /***/ (function(module, exports) {
2256
2270
 
2257
2271
  module.exports = require("@splunk/visualization-icons");
2258
2272
 
2259
2273
  /***/ }),
2260
2274
 
2261
- /***/ 49:
2275
+ /***/ 50:
2262
2276
  /***/ (function(module, exports, __webpack_require__) {
2263
2277
 
2264
2278
  "use strict";
@@ -2289,51 +2303,13 @@ exports.default = background;
2289
2303
 
2290
2304
  /***/ }),
2291
2305
 
2292
- /***/ 5:
2293
- /***/ (function(module, exports, __webpack_require__) {
2294
-
2295
- "use strict";
2296
-
2297
-
2298
- Object.defineProperty(exports, "__esModule", {
2299
- value: true
2300
- });
2301
- exports.VizBehavior = void 0;
2302
- var VizBehavior;
2303
-
2304
- (function (VizBehavior) {
2305
- /**
2306
- * Dynamic Options Behavior.
2307
- * This allows visualization options to be powered by data
2308
- *
2309
- * **Example**
2310
- *
2311
- * sparklineValues: ">primary|seriesByIndex(0)"
2312
- * would configure sparklineValues with an array of data points
2313
- * coming from the first series in the primary datasource
2314
- *
2315
- */
2316
- VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
2317
- VizBehavior["EVENTS"] = "events";
2318
- /**
2319
- * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
2320
- * missing.
2321
- * @type {string}
2322
- */
2323
-
2324
- VizBehavior["PLACEHOLDER"] = "placeholder";
2325
- VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
2326
- })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
2327
-
2328
- /***/ }),
2329
-
2330
- /***/ 50:
2306
+ /***/ 52:
2331
2307
  /***/ (function(module, exports, __webpack_require__) {
2332
2308
 
2333
2309
  "use strict";
2334
2310
 
2335
2311
 
2336
- var _toConsumableArray = __webpack_require__(7);
2312
+ var _toConsumableArray = __webpack_require__(8);
2337
2313
 
2338
2314
  var __rest = this && this.__rest || function (s, e) {
2339
2315
  var t = {};
@@ -2549,14 +2525,14 @@ exports.constructFieldsAndColumns = constructFieldsAndColumns;
2549
2525
 
2550
2526
  /***/ }),
2551
2527
 
2552
- /***/ 51:
2528
+ /***/ 53:
2553
2529
  /***/ (function(module, exports) {
2554
2530
 
2555
2531
  module.exports = require("@splunk/charting-bundle");
2556
2532
 
2557
2533
  /***/ }),
2558
2534
 
2559
- /***/ 55:
2535
+ /***/ 56:
2560
2536
  /***/ (function(module, exports, __webpack_require__) {
2561
2537
 
2562
2538
  "use strict";
@@ -2572,7 +2548,7 @@ var lodash_1 = __webpack_require__(3);
2572
2548
 
2573
2549
  var i18n_1 = __webpack_require__(2);
2574
2550
 
2575
- var visualization_color_palettes_1 = __webpack_require__(44);
2551
+ var visualization_color_palettes_1 = __webpack_require__(46);
2576
2552
 
2577
2553
  var react_1 = __webpack_require__(1);
2578
2554
 
@@ -2580,26 +2556,26 @@ var React = __webpack_require__(1);
2580
2556
 
2581
2557
  var T = __webpack_require__(0);
2582
2558
 
2583
- var react_event_listener_1 = __webpack_require__(56);
2559
+ var react_event_listener_1 = __webpack_require__(57);
2584
2560
 
2585
- __webpack_require__(57); // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions
2561
+ __webpack_require__(58); // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions
2586
2562
 
2587
2563
 
2588
- var charting_bundle_1 = __webpack_require__(51);
2564
+ var charting_bundle_1 = __webpack_require__(53);
2589
2565
 
2590
- var TimezoneContext_1 = __webpack_require__(22);
2566
+ var TimezoneContext_1 = __webpack_require__(23);
2591
2567
 
2592
- var style_1 = __webpack_require__(14);
2568
+ var style_1 = __webpack_require__(15);
2593
2569
 
2594
2570
  var styled_components_1 = __webpack_require__(4);
2595
2571
 
2596
- var Message_1 = __webpack_require__(9);
2572
+ var Message_1 = __webpack_require__(10);
2597
2573
 
2598
- var useSplunkTheme_1 = __webpack_require__(58);
2574
+ var useSplunkTheme_1 = __webpack_require__(59);
2599
2575
 
2600
- var themeUtils_1 = __webpack_require__(59);
2576
+ var themeUtils_1 = __webpack_require__(60);
2601
2577
 
2602
- var ChartingApi_1 = __webpack_require__(60);
2578
+ var ChartingApi_1 = __webpack_require__(61);
2603
2579
 
2604
2580
  exports.NO_INPLACE_PROPS = ['chart', 'chart.orientation', 'layout.splitSeries', 'chart.style', 'legend.placement'];
2605
2581
 
@@ -2979,50 +2955,81 @@ exports.default = withEmptyChartMessage(Charting);
2979
2955
 
2980
2956
  /***/ }),
2981
2957
 
2982
- /***/ 56:
2958
+ /***/ 57:
2983
2959
  /***/ (function(module, exports) {
2984
2960
 
2985
2961
  module.exports = require("react-event-listener");
2986
2962
 
2987
2963
  /***/ }),
2988
2964
 
2989
- /***/ 57:
2965
+ /***/ 58:
2990
2966
  /***/ (function(module, exports) {
2991
2967
 
2992
2968
  module.exports = require("@splunk/visualizations-shared/i18n");
2993
2969
 
2994
2970
  /***/ }),
2995
2971
 
2996
- /***/ 58:
2972
+ /***/ 59:
2997
2973
  /***/ (function(module, exports) {
2998
2974
 
2999
2975
  module.exports = require("@splunk/themes/useSplunkTheme");
3000
2976
 
3001
2977
  /***/ }),
3002
2978
 
3003
- /***/ 59:
3004
- /***/ (function(module, exports) {
2979
+ /***/ 6:
2980
+ /***/ (function(module, exports, __webpack_require__) {
3005
2981
 
3006
- module.exports = require("@splunk/visualizations-shared/themeUtils");
2982
+ "use strict";
2983
+
2984
+
2985
+ Object.defineProperty(exports, "__esModule", {
2986
+ value: true
2987
+ });
2988
+ exports.VizBehavior = void 0;
2989
+ var VizBehavior;
2990
+
2991
+ (function (VizBehavior) {
2992
+ /**
2993
+ * Dynamic Options Behavior.
2994
+ * This allows visualization options to be powered by data
2995
+ *
2996
+ * **Example**
2997
+ *
2998
+ * sparklineValues: ">primary|seriesByIndex(0)"
2999
+ * would configure sparklineValues with an array of data points
3000
+ * coming from the first series in the primary datasource
3001
+ *
3002
+ */
3003
+ VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
3004
+ VizBehavior["EVENTS"] = "events";
3005
+ /**
3006
+ * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
3007
+ * missing.
3008
+ * @type {string}
3009
+ */
3010
+
3011
+ VizBehavior["PLACEHOLDER"] = "placeholder";
3012
+ VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
3013
+ })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
3007
3014
 
3008
3015
  /***/ }),
3009
3016
 
3010
- /***/ 6:
3017
+ /***/ 60:
3011
3018
  /***/ (function(module, exports) {
3012
3019
 
3013
- module.exports = require("@babel/runtime/helpers/defineProperty");
3020
+ module.exports = require("@splunk/visualizations-shared/themeUtils");
3014
3021
 
3015
3022
  /***/ }),
3016
3023
 
3017
- /***/ 60:
3024
+ /***/ 61:
3018
3025
  /***/ (function(module, exports, __webpack_require__) {
3019
3026
 
3020
3027
  "use strict";
3021
3028
 
3022
3029
 
3023
- var _classCallCheck = __webpack_require__(10);
3030
+ var _classCallCheck = __webpack_require__(11);
3024
3031
 
3025
- var _createClass = __webpack_require__(18);
3032
+ var _createClass = __webpack_require__(19);
3026
3033
 
3027
3034
  Object.defineProperty(exports, "__esModule", {
3028
3035
  value: true
@@ -3083,20 +3090,20 @@ exports.ChartingApiFunctional = ChartingApiFunctional;
3083
3090
 
3084
3091
  /***/ }),
3085
3092
 
3086
- /***/ 61:
3093
+ /***/ 62:
3087
3094
  /***/ (function(module, exports) {
3088
3095
 
3089
3096
  module.exports = require("@splunk/visualizations-shared/simpleXMLOptions");
3090
3097
 
3091
3098
  /***/ }),
3092
3099
 
3093
- /***/ 63:
3100
+ /***/ 64:
3094
3101
  /***/ (function(module, exports, __webpack_require__) {
3095
3102
 
3096
3103
  "use strict";
3097
3104
 
3098
3105
 
3099
- var _toConsumableArray = __webpack_require__(7);
3106
+ var _toConsumableArray = __webpack_require__(8);
3100
3107
 
3101
3108
  Object.defineProperty(exports, "__esModule", {
3102
3109
  value: true
@@ -3105,7 +3112,7 @@ exports.AxesChartDataConfigAreaColumnLine = exports.AxesChartDataConfigBubble =
3105
3112
 
3106
3113
  var i18n_1 = __webpack_require__(2);
3107
3114
 
3108
- var configUtils_1 = __webpack_require__(16);
3115
+ var configUtils_1 = __webpack_require__(17);
3109
3116
 
3110
3117
  var AxesChartDataConfig = {
3111
3118
  label: i18n_1._('Data configurations'),
@@ -3210,7 +3217,7 @@ exports.default = AxesChartDataConfig;
3210
3217
 
3211
3218
  /***/ }),
3212
3219
 
3213
- /***/ 64:
3220
+ /***/ 65:
3214
3221
  /***/ (function(module, exports, __webpack_require__) {
3215
3222
 
3216
3223
  "use strict";
@@ -3224,9 +3231,9 @@ var i18n_1 = __webpack_require__(2);
3224
3231
 
3225
3232
  var pick_1 = __webpack_require__(21);
3226
3233
 
3227
- var variables_1 = __webpack_require__(8);
3234
+ var variables_1 = __webpack_require__(9);
3228
3235
 
3229
- var BackgroundColor_1 = __webpack_require__(49);
3236
+ var BackgroundColor_1 = __webpack_require__(50);
3230
3237
 
3231
3238
  var themes = {
3232
3239
  defaultBackgroundColor: function defaultBackgroundColor(props) {
@@ -3257,7 +3264,7 @@ exports.default = AxesChartColorAndStyle;
3257
3264
 
3258
3265
  /***/ }),
3259
3266
 
3260
- /***/ 65:
3267
+ /***/ 66:
3261
3268
  /***/ (function(module, exports, __webpack_require__) {
3262
3269
 
3263
3270
  "use strict";
@@ -3322,13 +3329,13 @@ exports.default = AxesChartLegend;
3322
3329
 
3323
3330
  /***/ }),
3324
3331
 
3325
- /***/ 66:
3332
+ /***/ 67:
3326
3333
  /***/ (function(module, exports, __webpack_require__) {
3327
3334
 
3328
3335
  "use strict";
3329
3336
 
3330
3337
 
3331
- var _toConsumableArray = __webpack_require__(7);
3338
+ var _toConsumableArray = __webpack_require__(8);
3332
3339
 
3333
3340
  Object.defineProperty(exports, "__esModule", {
3334
3341
  value: true
@@ -3337,7 +3344,7 @@ exports.AxesChartXGridAndLabelsBubbleScatter = exports.AxesChartXGridAndLabelsCo
3337
3344
 
3338
3345
  var i18n_1 = __webpack_require__(2);
3339
3346
 
3340
- var configUtils_1 = __webpack_require__(16);
3347
+ var configUtils_1 = __webpack_require__(17);
3341
3348
 
3342
3349
  exports.AxesChartXGridAndLabelsCommon = {
3343
3350
  label: i18n_1._('X-axis grid and labels'),
@@ -3468,7 +3475,7 @@ exports.AxesChartXGridAndLabelsBubbleScatter = {
3468
3475
  }])), [[{
3469
3476
  label: i18n_1._('Label rotation'),
3470
3477
  option: 'xAxisLabelRotation',
3471
- editor: 'editor.radioBar',
3478
+ editor: 'editor.select',
3472
3479
  editorProps: {
3473
3480
  values: [{
3474
3481
  label: i18n_1._('-90'),
@@ -3611,7 +3618,7 @@ exports.default = AxesChartXGridAndLabels;
3611
3618
 
3612
3619
  /***/ }),
3613
3620
 
3614
- /***/ 67:
3621
+ /***/ 68:
3615
3622
  /***/ (function(module, exports, __webpack_require__) {
3616
3623
 
3617
3624
  "use strict";
@@ -3777,21 +3784,21 @@ exports.default = AxesChartYGridAndLabels;
3777
3784
  /***/ 7:
3778
3785
  /***/ (function(module, exports) {
3779
3786
 
3780
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
3787
+ module.exports = require("@babel/runtime/helpers/defineProperty");
3781
3788
 
3782
3789
  /***/ }),
3783
3790
 
3784
3791
  /***/ 8:
3785
3792
  /***/ (function(module, exports) {
3786
3793
 
3787
- module.exports = require("@splunk/themes/variables");
3794
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
3788
3795
 
3789
3796
  /***/ }),
3790
3797
 
3791
3798
  /***/ 9:
3792
3799
  /***/ (function(module, exports) {
3793
3800
 
3794
- module.exports = require("@splunk/visualizations-shared/Message");
3801
+ module.exports = require("@splunk/themes/variables");
3795
3802
 
3796
3803
  /***/ })
3797
3804