@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/Pie.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 = 230);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 413);
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
- /***/ 136:
260
+ /***/ 146:
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__(231);
294
+ var config_1 = __webpack_require__(414);
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 pieUtils_1 = __webpack_require__(233);
300
+ var pieUtils_1 = __webpack_require__(416);
294
301
 
295
- var chartingUtils_1 = __webpack_require__(50);
302
+ var chartingUtils_1 = __webpack_require__(52);
296
303
 
297
304
  var IconPlaceholder_1 = __webpack_require__(27);
298
305
 
@@ -380,29 +387,29 @@ exports.default = Pie;
380
387
 
381
388
  /***/ }),
382
389
 
383
- /***/ 14:
390
+ /***/ 15:
384
391
  /***/ (function(module, exports) {
385
392
 
386
393
  module.exports = require("@splunk/visualizations-shared/style");
387
394
 
388
395
  /***/ }),
389
396
 
390
- /***/ 15:
397
+ /***/ 16:
391
398
  /***/ (function(module, exports) {
392
399
 
393
400
  module.exports = require("@splunk/visualizations-shared/schemaUtils");
394
401
 
395
402
  /***/ }),
396
403
 
397
- /***/ 16:
404
+ /***/ 17:
398
405
  /***/ (function(module, exports, __webpack_require__) {
399
406
 
400
407
  "use strict";
401
408
 
402
409
 
403
- var _toConsumableArray = __webpack_require__(7);
410
+ var _toConsumableArray = __webpack_require__(8);
404
411
 
405
- var _defineProperty = __webpack_require__(6);
412
+ var _defineProperty = __webpack_require__(7);
406
413
 
407
414
  var __rest = this && this.__rest || function (s, e) {
408
415
  var t = {};
@@ -424,9 +431,9 @@ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig
424
431
 
425
432
  var lodash_1 = __webpack_require__(3);
426
433
 
427
- var schemaUtils_1 = __webpack_require__(15);
434
+ var schemaUtils_1 = __webpack_require__(16);
428
435
 
429
- var VizBehavior_1 = __webpack_require__(5);
436
+ var VizBehavior_1 = __webpack_require__(6);
430
437
 
431
438
  var dynamicOptionsDSLType = {
432
439
  type: 'string',
@@ -631,24 +638,24 @@ exports.insertLayout = insertLayout;
631
638
 
632
639
  /***/ }),
633
640
 
634
- /***/ 18:
641
+ /***/ 19:
635
642
  /***/ (function(module, exports) {
636
643
 
637
644
  module.exports = require("@babel/runtime/helpers/createClass");
638
645
 
639
646
  /***/ }),
640
647
 
641
- /***/ 19:
648
+ /***/ 2:
642
649
  /***/ (function(module, exports) {
643
650
 
644
- module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
651
+ module.exports = require("@splunk/ui-utils/i18n");
645
652
 
646
653
  /***/ }),
647
654
 
648
- /***/ 2:
655
+ /***/ 20:
649
656
  /***/ (function(module, exports) {
650
657
 
651
- module.exports = require("@splunk/ui-utils/i18n");
658
+ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
652
659
 
653
660
  /***/ }),
654
661
 
@@ -659,64 +666,198 @@ module.exports = require("@splunk/themes/pick");
659
666
 
660
667
  /***/ }),
661
668
 
662
- /***/ 22:
669
+ /***/ 23:
663
670
  /***/ (function(module, exports) {
664
671
 
665
672
  module.exports = require("@splunk/visualization-context/TimezoneContext");
666
673
 
667
674
  /***/ }),
668
675
 
669
- /***/ 23:
676
+ /***/ 24:
670
677
  /***/ (function(module, exports) {
671
678
 
672
679
  module.exports = require("@splunk/visualizations-shared/propUtils");
673
680
 
674
681
  /***/ }),
675
682
 
676
- /***/ 230:
683
+ /***/ 25:
684
+ /***/ (function(module, exports) {
685
+
686
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
687
+
688
+ /***/ }),
689
+
690
+ /***/ 26:
691
+ /***/ (function(module, exports) {
692
+
693
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
694
+
695
+ /***/ }),
696
+
697
+ /***/ 27:
677
698
  /***/ (function(module, exports, __webpack_require__) {
678
699
 
679
700
  "use strict";
680
701
 
681
702
 
682
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
683
- if (k2 === undefined) k2 = k;
684
- Object.defineProperty(o, k2, {
685
- enumerable: true,
686
- get: function get() {
687
- return m[k];
688
- }
689
- });
690
- } : function (o, m, k, k2) {
691
- if (k2 === undefined) k2 = k;
692
- o[k2] = m[k];
703
+ Object.defineProperty(exports, "__esModule", {
704
+ value: true
693
705
  });
706
+ exports.shouldShowIconPlaceholder = void 0;
694
707
 
695
- var __exportStar = this && this.__exportStar || function (m, exports) {
696
- for (var p in m) {
697
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
708
+ var React = __webpack_require__(1);
709
+
710
+ var T = __webpack_require__(0);
711
+
712
+ var lodash_1 = __webpack_require__(3);
713
+
714
+ var i18n_1 = __webpack_require__(2);
715
+
716
+ var Message_1 = __webpack_require__(10);
717
+
718
+ var FixedSizeContainer_1 = __webpack_require__(13);
719
+ /**
720
+ * @method shouldShowIconPlaceholder
721
+ * @param {object} dataSources
722
+ * @param {boolean} loading
723
+ * @returns {boolean}
724
+ */
725
+
726
+
727
+ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
728
+ var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
729
+ var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
730
+ var noData = data === undefined;
731
+ var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
732
+ var noFields = fields === undefined;
733
+ return loading || noData || noFields;
734
+ };
735
+
736
+ exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
737
+ var propTypes = {
738
+ icon: T.func,
739
+ width: T.oneOfType([T.string, T.number]),
740
+ height: T.oneOfType([T.string, T.number]),
741
+ // eslint-disable-next-line react/no-unused-prop-types
742
+ backgroundColor: T.string,
743
+ iconColor: T.string
744
+ };
745
+ /**
746
+ * @method IconPlaceholder
747
+ * @param {IconPlaceholderProps} props
748
+ * @returns {React.ReactElement}
749
+ */
750
+
751
+ var IconPlaceholder = function IconPlaceholder(props) {
752
+ var width = props.width,
753
+ height = props.height,
754
+ icon = props.icon,
755
+ iconColor = props.iconColor;
756
+
757
+ if (icon) {
758
+ return React.createElement(icon, {
759
+ style: {
760
+ left: '50%',
761
+ top: '50%',
762
+ color: iconColor,
763
+ opacity: 0.15,
764
+ position: 'absolute',
765
+ transform: 'translate(-50%, -50%)'
766
+ },
767
+ width: '50%',
768
+ height: '50%'
769
+ });
698
770
  }
771
+
772
+ return React.createElement(Message_1.default, {
773
+ width: width,
774
+ height: height,
775
+ level: "warning",
776
+ message: i18n_1._('No DataSource Connected')
777
+ });
778
+ };
779
+
780
+ IconPlaceholder.propTypes = propTypes;
781
+ IconPlaceholder.defaultProps = {
782
+ width: '100%',
783
+ height: 250
699
784
  };
785
+ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
786
+
787
+ /***/ }),
788
+
789
+ /***/ 28:
790
+ /***/ (function(module, exports, __webpack_require__) {
791
+
792
+ "use strict";
793
+
794
+
795
+ var _defineProperty = __webpack_require__(7);
700
796
 
701
797
  Object.defineProperty(exports, "__esModule", {
702
798
  value: true
703
799
  });
704
- exports.default = void 0;
800
+ exports.getSortingParams = exports.SortParamsPropTypes = void 0;
705
801
 
706
- __exportStar(__webpack_require__(136), exports);
802
+ var T = __webpack_require__(0);
707
803
 
708
- var Pie_1 = __webpack_require__(136);
804
+ var lodash_1 = __webpack_require__(3);
709
805
 
710
- Object.defineProperty(exports, "default", {
711
- enumerable: true,
712
- get: function get() {
713
- return Pie_1.default;
714
- }
806
+ var DataSource_1 = __webpack_require__(39);
807
+
808
+ exports.SortParamsPropTypes = T.shape({
809
+ currentSortKey: T.string,
810
+ currentSortDir: T.oneOf(DataSource_1.validSortDirs),
811
+ onSort: T.func
715
812
  });
716
813
 
814
+ var getSortingParams = function getSortingParams(_ref) {
815
+ var requestParams = _ref.requestParams,
816
+ onRequestParamsChange = _ref.onRequestParamsChange;
817
+ var currentSortKey;
818
+ var currentSortDir;
819
+ var nextSortDirMap = {
820
+ asc: 'desc',
821
+ desc: 'asc',
822
+ none: 'asc'
823
+ };
824
+ var onSort;
825
+
826
+ if (lodash_1.isFunction(onRequestParamsChange)) {
827
+ if (requestParams && lodash_1.has(requestParams, 'sort')) {
828
+ currentSortKey = Object.keys(requestParams.sort).shift();
829
+ currentSortDir = requestParams.sort[currentSortKey];
830
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
831
+
832
+
833
+ onSort = function onSort(e, _ref2) {
834
+ var sortKey = _ref2.sortKey,
835
+ sortDir = _ref2.sortDir;
836
+
837
+ if (typeof sortKey === 'string') {
838
+ var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
839
+ onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
840
+ offset: 0,
841
+ sort: _defineProperty({}, sortKey, nextSortDir)
842
+ }));
843
+ } else {
844
+ onRequestParamsChange(requestParams);
845
+ }
846
+ };
847
+ }
848
+
849
+ return {
850
+ currentSortKey: currentSortKey,
851
+ currentSortDir: currentSortDir,
852
+ onSort: onSort
853
+ };
854
+ };
855
+
856
+ exports.getSortingParams = getSortingParams;
857
+
717
858
  /***/ }),
718
859
 
719
- /***/ 231:
860
+ /***/ 29:
720
861
  /***/ (function(module, exports, __webpack_require__) {
721
862
 
722
863
  "use strict";
@@ -725,708 +866,563 @@ Object.defineProperty(exports, "default", {
725
866
  Object.defineProperty(exports, "__esModule", {
726
867
  value: true
727
868
  });
869
+ exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
728
870
 
729
- var ChartPie_1 = __webpack_require__(232);
871
+ var T = __webpack_require__(0);
730
872
 
731
- var placeholders_1 = __webpack_require__(45);
873
+ var lodash_1 = __webpack_require__(3);
732
874
 
733
- var i18n_1 = __webpack_require__(2);
875
+ exports.PaginatorParamsPropTypes = T.shape({
876
+ isPaging: T.bool,
877
+ current: T.number,
878
+ totalPages: T.number,
879
+ onChange: T.func
880
+ });
734
881
 
735
- var schemaUtils_1 = __webpack_require__(15);
882
+ var getPaginationParams = function getPaginationParams(_ref) {
883
+ var requestParams = _ref.requestParams,
884
+ meta = _ref.meta,
885
+ onRequestParamsChange = _ref.onRequestParamsChange;
886
+ var totalCount = meta && meta.totalCount || 0;
887
+ var offset = requestParams && requestParams.offset || 0;
888
+ var count = requestParams && requestParams.count;
889
+ var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
890
+ var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
891
+ var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
736
892
 
737
- var visualization_color_palettes_1 = __webpack_require__(44);
893
+ var onChangeHandler = function onChangeHandler(e, _ref2) {
894
+ var page = _ref2.page,
895
+ countArg = _ref2.count;
896
+ var newParams = lodash_1.cloneDeep(requestParams);
738
897
 
739
- var pick_1 = __webpack_require__(21);
898
+ if (typeof countArg === 'number') {
899
+ newParams.count = countArg;
900
+ newParams.offset = 0;
901
+ }
740
902
 
741
- var variables_1 = __webpack_require__(8);
903
+ var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
742
904
 
743
- var VizBehavior_1 = __webpack_require__(5);
905
+ if (typeof page === 'number' && page > 0) {
906
+ newParams.count = pageCount;
907
+ newParams.offset = (page - 1) * pageCount;
908
+ }
744
909
 
745
- var VizCategory_1 = __webpack_require__(30);
910
+ onRequestParamsChange(newParams);
911
+ };
746
912
 
747
- var configUtils_1 = __webpack_require__(16);
913
+ return {
914
+ isPaging: isPaging,
915
+ current: current,
916
+ totalPages: totalPages,
917
+ onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
918
+ };
919
+ };
748
920
 
749
- var BackgroundColor_1 = __webpack_require__(49);
750
-
751
- var dataContract = {
752
- requiredDataSources: [{
753
- name: 'primary',
754
- description: 'DataSource that powers the visualization'
755
- }],
756
- optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
757
- // {
758
- // name: 'annotation',
759
- // description: 'DataSource that populate event annotations',
760
- // },
761
- ],
762
- initialRequestParams: {
763
- primary: {
764
- offset: 0,
765
- count: 10000
766
- }
767
- }
768
- };
769
- var size = {
770
- initialWidth: 300,
771
- initialHeight: 300
772
- };
773
- var defaultContext = {};
774
- var optionsSchema = {
775
- backgroundColor: {
776
- default: '> themes.defaultBackgroundColor',
777
- description: 'Specify the color for the background. You may use a dataSource to apply the color. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
778
- pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
779
- type: 'string'
780
- },
781
- collapseLabel: {
782
- description: 'Specify the label for the consolidated slice.',
783
- type: 'string',
784
- default: 'other'
785
- },
786
- collapseThreshold: {
787
- description: 'Specify the size threshold as a number between 0 and 1 (inclusive), of the whole pie at which slices collapse into one consolidated slice.',
788
- type: 'number',
789
- default: 0.01
790
- },
791
- label: {
792
- description: 'List of string values to display the pie chart labels.',
793
- type: 'array',
794
- items: {
795
- type: 'string'
796
- },
797
- default: '> primary | seriesByIndex(0)'
798
- },
799
- labelField: {
800
- default: '> label | getField()',
801
- description: 'Specify the field that corresponds to the labels.',
802
- type: 'string'
803
- },
804
- labelDisplay: {
805
- description: 'Specify whether to display the labels and/or slice percentages.',
806
- type: 'string',
807
- pattern: schemaUtils_1.getPattern(['values', 'valuesAndPercentage', 'off']),
808
- default: 'values'
809
- },
810
- resultLimit: {
811
- default: 50000,
812
- description: 'Specify the number of data points rendered in a chart.',
813
- type: 'number'
814
- },
815
- seriesColors: {
816
- default: visualization_color_palettes_1.VIZ_CATEGORICAL,
817
- description: 'Specify the colors used for a series. For example, ["#FF0000", "#0000FF", "#008000"].',
818
- type: 'array',
819
- items: {
820
- type: 'string'
821
- }
822
- },
823
- seriesColorsByField: {
824
- description: 'Specify the colors used for specific pie slice labels. For example: {"April": "#008000", "May": "#FFA500"}.',
825
- type: 'object'
826
- },
827
- showDonutHole: {
828
- default: false,
829
- description: 'Specify whether the pie should be a donut.',
830
- type: 'boolean'
831
- },
832
- value: {
833
- description: 'List of numerical values to power the pie chart.',
834
- type: 'array',
835
- items: {
836
- type: 'number'
837
- },
838
- default: '> primary | seriesByIndex(1)'
839
- },
840
- valueField: {
841
- default: '> value | getField()',
842
- description: 'Specify the field that corresponds to the data powering values.',
843
- type: 'string'
844
- }
845
- };
846
- var themes = {
847
- defaultBackgroundColor: function defaultBackgroundColor(props) {
848
- return pick_1.default({
849
- enterprise: {
850
- dark: variables_1.default.black(props),
851
- light: variables_1.default.backgroundColor(props)
852
- },
853
- prisma: variables_1.default.backgroundColorSidebar(props)
854
- })(props);
855
- }
856
- };
857
- var editorConfig = [{
858
- label: i18n_1._('General'),
859
- layout: [BackgroundColor_1.default({
860
- themes: themes
861
- })]
862
- }, {
863
- label: i18n_1._('Appearance'),
864
- layout: [[{
865
- label: i18n_1._('Display type'),
866
- option: 'showDonutHole',
867
- editor: 'editor.radioBar',
868
- editorProps: {
869
- values: [{
870
- label: i18n_1._('Pie'),
871
- value: false
872
- }, {
873
- label: i18n_1._('Donut'),
874
- value: true
875
- }]
876
- }
877
- }]]
878
- }, {
879
- label: i18n_1._('Labels'),
880
- layout: [[{
881
- label: i18n_1._('Label display'),
882
- option: 'labelDisplay',
883
- editor: 'editor.radioBar',
884
- editorProps: {
885
- values: [{
886
- label: i18n_1._('Values'),
887
- value: 'values'
888
- }, {
889
- label: i18n_1._('Values & Percent'),
890
- value: 'valuesAndPercentage'
891
- }, {
892
- label: i18n_1._('Off'),
893
- value: 'off'
894
- }]
895
- }
896
- }]]
897
- }, {
898
- label: i18n_1._('Collapse to Summary'),
899
- layout: [[{
900
- label: i18n_1._('Collapse Threshold'),
901
- option: 'collapseThreshold',
902
- editor: 'editor.number',
903
- editorProps: {
904
- min: 0,
905
- max: 1,
906
- step: 0.01
907
- }
908
- }], [{
909
- label: i18n_1._('Collapsed Slice Label'),
910
- option: 'collapseLabel',
911
- editor: 'editor.text'
912
- }]]
913
- }];
914
- /**
915
- * visualization configuration
916
- */
917
-
918
- var config = {
919
- /**
920
- * unique viz key
921
- */
922
- key: 'splunk.pie',
923
-
924
- /**
925
- * viz name
926
- */
927
- name: 'Pie',
928
- category: VizCategory_1.VizCategory.COMPARISONS,
929
-
930
- /**
931
- * viz icon
932
- */
933
- icon: ChartPie_1.default,
934
- placeholderIcon: placeholders_1.Pie,
935
- dataContract: dataContract,
936
- size: size,
937
- defaultContext: defaultContext,
938
- optionsSchema: optionsSchema,
939
- editorConfig: editorConfig,
940
- events: {
941
- 'point.click': {
942
- description: 'triggered when user clicks on a point in the pie chart'
943
- }
944
- },
945
- supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER, VizBehavior_1.VizBehavior.EVENTS],
946
- themes: themes
947
- };
948
- exports.default = configUtils_1.enhanceConfig(config);
921
+ exports.getPaginationParams = getPaginationParams;
949
922
 
950
923
  /***/ }),
951
924
 
952
- /***/ 232:
925
+ /***/ 3:
953
926
  /***/ (function(module, exports) {
954
927
 
955
- module.exports = require("@splunk/react-icons/ChartPie");
928
+ module.exports = require("lodash");
956
929
 
957
930
  /***/ }),
958
931
 
959
- /***/ 233:
932
+ /***/ 31:
960
933
  /***/ (function(module, exports, __webpack_require__) {
961
934
 
962
935
  "use strict";
963
936
 
964
937
 
965
- var __rest = this && this.__rest || function (s, e) {
966
- var t = {};
938
+ Object.defineProperty(exports, "__esModule", {
939
+ value: true
940
+ });
941
+ exports.VizCategory = void 0;
942
+ var VizCategory;
967
943
 
968
- for (var p in s) {
969
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
970
- }
944
+ (function (VizCategory) {
945
+ VizCategory["SINGLE_VALUE"] = "Single Value";
946
+ VizCategory["TRENDS"] = "Trends";
947
+ VizCategory["COMPARISONS"] = "Comparisons";
948
+ VizCategory["TABLE"] = "Table";
949
+ VizCategory["GAUGE"] = "Gauge";
950
+ VizCategory["DISTRIBUTIONS"] = "Distributions";
951
+ VizCategory["CHOROPLETH"] = "Choropleth Maps";
952
+ VizCategory["SHAPES"] = "Shapes";
953
+ VizCategory["MISC"] = "misc";
954
+ VizCategory["FLOW"] = "Flow";
955
+ VizCategory["CORRELATION"] = "Correlation";
956
+ VizCategory["SPATIAL"] = "Spatial";
957
+ })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
958
+
959
+ /***/ }),
960
+
961
+ /***/ 32:
962
+ /***/ (function(module, exports, __webpack_require__) {
963
+
964
+ "use strict";
971
965
 
972
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
973
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
974
- }
975
- return t;
976
- };
977
966
 
978
967
  Object.defineProperty(exports, "__esModule", {
979
968
  value: true
980
969
  });
981
- exports.allInvalidDataValues = exports.invalidOptionField = exports.getPieOptionFieldIndex = exports.getPieMergedOptions = exports.convertToPieSCProperties = exports.mapToOldKey = exports.mapLabelDisplay = exports.convertToStringValues = void 0;
970
+
971
+ var React = __webpack_require__(1);
982
972
 
983
973
  var lodash_1 = __webpack_require__(3);
984
974
 
985
- var propUtils_1 = __webpack_require__(23);
975
+ var getSettingsFromThemedProps_1 = __webpack_require__(33);
986
976
 
987
- var dsl_1 = __webpack_require__(88);
977
+ var Options_1 = __webpack_require__(34);
988
978
 
989
- var hocUtils_1 = __webpack_require__(24);
979
+ var SanitizeProps_1 = __webpack_require__(35);
990
980
 
991
- var JSONSchemaUtils_1 = __webpack_require__(25); // CONVERT THIS TO PIE THEN ADD TO Pie.TSX
992
- // map for key names which are either new or not present in SimpleXML options mapping
981
+ var TimezoneContext_1 = __webpack_require__(23);
993
982
 
983
+ var moment_1 = __webpack_require__(36);
994
984
 
995
- var pieOptionsSCMapping = {
996
- resultLimit: 'resultTruncationLimit',
997
- seriesColorsByField: 'fieldColors',
998
- collapseThreshold: 'chart.sliceCollapsingThreshold',
999
- collapseLabel: 'chart.sliceCollapsingLabel'
1000
- };
1001
- /**
1002
- * Helper method to convert option which contains object literal values (e.g. arrays, objects)
1003
- * to strings as SC can only accept their stringified equivalents
1004
- * @method convertToStringValues
1005
- * @param {Object} options
1006
- * @returns {Object}
1007
- */
985
+ var styled_components_1 = __webpack_require__(4);
1008
986
 
1009
- var convertToStringValues = function convertToStringValues(options) {
1010
- var updatedOptions = propUtils_1.convertPropsToString({
1011
- vizProps: options,
1012
- propNames: ['seriesColors', 'fieldColors']
1013
- });
1014
- return Object.assign(Object.assign({}, options), updatedOptions);
1015
- };
987
+ var hocUtils_1 = __webpack_require__(25);
1016
988
 
1017
- exports.convertToStringValues = convertToStringValues;
1018
- /**
1019
- * Helper method to map labelDisplay options to jsCharting options
1020
- * @method mapLabelDisplay
1021
- * @param {Object} options
1022
- * @returns {Object}
1023
- */
989
+ var JSONSchemaUtils_1 = __webpack_require__(26);
1024
990
 
1025
- var mapLabelDisplay = function mapLabelDisplay(_a) {
1026
- var labelDisplay = _a.labelDisplay,
1027
- options = __rest(_a, ["labelDisplay"]);
991
+ var SplunkVisualization_1 = __webpack_require__(37);
1028
992
 
1029
- var convertedOptions = Object.assign(Object.assign({}, options), {
1030
- // default for labelDisplay option is 'values'
1031
- 'chart.showLabels': true,
1032
- 'chart.showPercent': false
1033
- });
993
+ var VizBehavior_1 = __webpack_require__(6);
1034
994
 
1035
- if (labelDisplay === 'valuesAndPercentage') {
1036
- convertedOptions['chart.showPercent'] = true;
1037
- } else if (labelDisplay === 'off') {
1038
- convertedOptions['chart.showLabels'] = false;
1039
- }
995
+ var getSorting_1 = __webpack_require__(28);
1040
996
 
1041
- return convertedOptions;
1042
- };
997
+ var getPagination_1 = __webpack_require__(29);
1043
998
 
1044
- exports.mapLabelDisplay = mapLabelDisplay;
1045
- /**
1046
- * Helper method to update the option names which can be mapped to SimpleXML options or
1047
- * can be used directly with SC if don't have a 1-1 mapping in SimpleXML
1048
- * @method mapToOldKey
1049
- * @param {Object} options
1050
- * @returns {Object}
1051
- */
999
+ var useDeepMemo_1 = __webpack_require__(40);
1052
1000
 
1053
- var mapToOldKey = function mapToOldKey(options) {
1054
- return lodash_1.mapKeys(options, function (val, key) {
1055
- return pieOptionsSCMapping[key] ? pieOptionsSCMapping[key] : key;
1056
- });
1057
- };
1001
+ var MissingPropsMessage_1 = __webpack_require__(41);
1058
1002
 
1059
- exports.mapToOldKey = mapToOldKey;
1003
+ var withEditModeCover_1 = __webpack_require__(42);
1004
+
1005
+ var withPlaceholder_1 = __webpack_require__(43);
1060
1006
  /**
1061
- * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts
1062
- * This is for options that has new key name and can not directly be mapped with SimpleXML or
1063
- * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)
1064
- * @method convertToPieSCProperties
1065
- * @param {Object} originalOptions
1066
- * @returns {Object}
1007
+ * hoc that wraps a pure react visualization in a Dashboard visualization
1008
+ * @param {DashboardVizOpts} opts
1009
+ * @returns {HOC}
1067
1010
  */
1068
1011
 
1069
- var convertToPieSCProperties = function convertToPieSCProperties(originalOptions) {
1070
- return lodash_1.chain(exports.mapToOldKey(originalOptions)).thru(exports.convertToStringValues).thru(exports.mapLabelDisplay).value();
1071
- };
1072
1012
 
1073
- exports.convertToPieSCProperties = convertToPieSCProperties;
1074
- /**
1075
- * Return all merged options (default + config) using vizConfig and options
1076
- * @param options
1077
- * @param vizConfig
1078
- * @returns
1079
- */
1013
+ var withDashboardViz = function withDashboardViz(opts) {
1014
+ var ReactViz = opts.ReactViz,
1015
+ vizConfig = opts.vizConfig,
1016
+ _opts$computeVizProps = opts.computeVizProps,
1017
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1018
+ disableEditModeCover = opts.disableEditModeCover,
1019
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1080
1020
 
1081
- var getPieMergedOptions = function getPieMergedOptions(options, vizConfig) {
1082
- return hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default'));
1083
- };
1021
+ var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1022
+ var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1084
1023
 
1085
- exports.getPieMergedOptions = getPieMergedOptions;
1086
- /**
1087
- * Returns option's field index. If not found returns -1
1088
- * @param optionName
1089
- * @param dataSources
1090
- * @param options
1091
- * @param vizConfig
1092
- * @returns
1093
- */
1024
+ var DashboardViz = function DashboardViz(props) {
1025
+ var mode = props.mode,
1026
+ hasEventHandlers = props.hasEventHandlers,
1027
+ dataSources = props.dataSources,
1028
+ options = props.options,
1029
+ _props$context = props.context,
1030
+ context = _props$context === void 0 ? {} : _props$context,
1031
+ width = props.width,
1032
+ height = props.height,
1033
+ onComputedProps = props.onComputedProps,
1034
+ onEventTrigger = props.onEventTrigger,
1035
+ theme = props.theme,
1036
+ onRequestParamsChange = props.onRequestParamsChange;
1037
+
1038
+ var _React$useContext = React.useContext(TimezoneContext_1.default),
1039
+ serializedTimezone = _React$useContext.serializedTimezone;
1040
+
1041
+ if (serializedTimezone) {
1042
+ /*
1043
+ @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
1044
+ This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
1045
+ will use it.
1046
+ @TODO(pwied):
1047
+ - remove when we moved away from @splunk/moment
1048
+ - provide timezone context to dynamic option evaluation phase
1049
+ */
1050
+ if (!moment_1.default.getDefaultSplunkTimezone()) {
1051
+ moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1052
+ }
1053
+ }
1094
1054
 
1095
- var getPieOptionFieldIndex = function getPieOptionFieldIndex(optionName, dataSources, options, vizConfig) {
1096
- var mergedOptions = exports.getPieMergedOptions(options, vizConfig); // find the field name configured for pie "value"
1055
+ var themeFunc = function themeFunc(themeVar) {
1056
+ var _a, _b;
1097
1057
 
1098
- var fieldName = dsl_1.getFieldsFromDSL(mergedOptions[optionName], dataSources)[0];
1099
- var fields = dataSources.primary.data.fields; // find the field index configured for pie "value"
1058
+ return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1059
+ };
1100
1060
 
1101
- var fieldIndex = fields.findIndex(function (field) {
1102
- return (typeof field === 'string' ? field : field.name.toString()) === fieldName;
1103
- });
1104
- return fieldIndex;
1105
- };
1061
+ var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1106
1062
 
1107
- exports.getPieOptionFieldIndex = getPieOptionFieldIndex;
1108
- /**
1109
- * Returns true if columns data has invalid data format for specified option (label or value)
1110
- * @param optionName
1111
- * @param dataSources
1112
- * @param options
1113
- * @param vizConfig
1114
- * @returns
1115
- */
1063
+ var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1064
+ theme: theme
1065
+ }),
1066
+ currentThemeFamily = _getSettingsFromTheme.family,
1067
+ currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1068
+ currentThemeDensity = _getSettingsFromTheme.density;
1116
1069
 
1117
- var invalidOptionField = function invalidOptionField(optionName, dataSources, options, vizConfig) {
1118
- var columns = dataSources.primary.data.columns;
1119
- var fieldIndex = exports.getPieOptionFieldIndex(optionName, dataSources, options, vizConfig);
1070
+ var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1120
1071
 
1121
- if (fieldIndex === -1 || !columns[fieldIndex] || !Array.isArray(columns[fieldIndex]) || Array.isArray(columns[fieldIndex]) && !columns[fieldIndex].length) {
1122
- return true;
1123
- }
1072
+ evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1073
+ try {
1074
+ return Options_1.Options.evaluate({
1075
+ context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1076
+ options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1077
+ }, dataSources, themeFunc);
1078
+ } catch (e) {
1079
+ // eslint-disable-next-line no-console
1080
+ console.error("unexpected error evaluating options: + ".concat(e.message));
1081
+ return {};
1082
+ }
1083
+ }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
1084
+ // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1124
1085
 
1125
- return false;
1126
- };
1086
+ React.useEffect(function () {
1087
+ onComputedProps(evaluatedOptions);
1088
+ }); // present warning message if any required props are missing
1127
1089
 
1128
- exports.invalidOptionField = invalidOptionField;
1129
- /**
1130
- * Helper function to evaluate if all data values are invalid (zero or negative)
1131
- */
1090
+ var _vizConfig$requiredPr = vizConfig.requiredProps,
1091
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1092
+ supports = vizConfig.supports;
1093
+ var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
1132
1094
 
1133
- var allInvalidDataValues = function allInvalidDataValues(dataSources, options, vizConfig) {
1134
- var columns = dataSources.primary.data.columns; // find the field index configured for pie "value"
1095
+ if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
1096
+ return React.createElement(MissingPropsMessage_1.default, {
1097
+ "data-test": "missing-props-message",
1098
+ width: width,
1099
+ height: height,
1100
+ missingProps: missing,
1101
+ backgroundColor: bgColorFromTheme
1102
+ });
1103
+ } // events
1135
1104
 
1136
- var valueFieldIndex = exports.getPieOptionFieldIndex('value', dataSources, options, vizConfig); // check if all values are invalid
1137
1105
 
1138
- if (Array.isArray(columns) && columns[valueFieldIndex] && Array.isArray(columns[valueFieldIndex])) {
1139
- return !columns[valueFieldIndex].some(function (value) {
1140
- return +value > 0;
1141
- });
1142
- }
1106
+ var eventCallbackProps = {};
1143
1107
 
1144
- return false;
1145
- };
1108
+ if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1109
+ var supportedEvents = vizConfig.events;
1110
+ Object.keys(supportedEvents).forEach(function (eventName) {
1111
+ var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1112
+ eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1113
+ // then remove these lines
1146
1114
 
1147
- exports.allInvalidDataValues = allInvalidDataValues;
1115
+ var payloadKeys = supportedEvents[eventName].payloadKeys;
1116
+ var payload = {};
1148
1117
 
1149
- /***/ }),
1118
+ if (Array.isArray(payloadKeys) && payloadKeys.length) {
1119
+ payloadKeys.forEach(function (p) {
1120
+ payload[p] = evaluatedOptions[p];
1121
+ });
1122
+ }
1150
1123
 
1151
- /***/ 24:
1152
- /***/ (function(module, exports) {
1124
+ eventCallbackProps[eventCallbackPropName] = function (ev) {
1125
+ if (ev && ev.payload) {
1126
+ payload = ev.payload;
1127
+ }
1153
1128
 
1154
- module.exports = require("@splunk/visualizations-shared/hocUtils");
1129
+ return onEventTrigger({
1130
+ originalEvent: ev,
1131
+ payload: payload,
1132
+ type: eventName
1133
+ });
1134
+ };
1135
+ });
1136
+ } // compute pure viz props which are not from options
1155
1137
 
1156
- /***/ }),
1157
1138
 
1158
- /***/ 25:
1159
- /***/ (function(module, exports) {
1139
+ var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
1140
+ themeFunc: themeFunc
1141
+ }));
1142
+ /**
1143
+ * PAGE_AND_SORT behavior
1144
+ *
1145
+ * Some visualizations, like table, requires metadata about the datasource,
1146
+ * like total number of results, current count, offset, and sort, for rendering
1147
+ * paginator and sorting direction. In this approach, the visualization
1148
+ * allow users to set 'paginateDataSourceKey' to select which datasource
1149
+ * should the visualization extract the metadata from. It defaults to 'primary' datasource.
1150
+ * The visualization config should set the PAGE_AND_SORT behavior to receive
1151
+ * 'requestParams', 'meta' and onRequestParams callback as props.
1152
+ *
1153
+ * In future, we could automatically detect which all datasources are being used
1154
+ * and bind those magically to pagination/sorting behavior.
1155
+ */
1160
1156
 
1161
- module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
1157
+ var dataSourceMetadata = {};
1158
+ var OptionKey = 'paginateDataSourceKey';
1159
+ var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
1162
1160
 
1163
- /***/ }),
1161
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1162
+ var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1163
+ var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
1164
1164
 
1165
- /***/ 27:
1166
- /***/ (function(module, exports, __webpack_require__) {
1165
+ var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1166
+ return onRequestParamsChange(paginateDataSourceKey, payload);
1167
+ };
1167
1168
 
1168
- "use strict";
1169
+ var sortParams = getSorting_1.getSortingParams({
1170
+ requestParams: requestParams,
1171
+ meta: meta,
1172
+ onRequestParamsChange: handleRequestParamsChange
1173
+ });
1174
+ var paginatorParams = getPagination_1.getPaginationParams({
1175
+ requestParams: requestParams,
1176
+ meta: meta,
1177
+ onRequestParamsChange: handleRequestParamsChange
1178
+ });
1179
+ dataSourceMetadata = {
1180
+ sortParams: sortParams,
1181
+ paginatorParams: paginatorParams
1182
+ };
1183
+ }
1169
1184
 
1185
+ return React.createElement(SanitizedReactViz, Object.assign({
1186
+ mode: mode,
1187
+ width: width,
1188
+ height: height
1189
+ }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
1190
+ };
1170
1191
 
1171
- Object.defineProperty(exports, "__esModule", {
1172
- value: true
1173
- });
1174
- exports.shouldShowIconPlaceholder = void 0;
1192
+ DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1193
+ DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1194
+ // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1195
+ theme: {}
1196
+ }); // attach viz config
1175
1197
 
1176
- var React = __webpack_require__(1);
1198
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1177
1199
 
1178
- var T = __webpack_require__(0);
1200
+ return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
1201
+ };
1179
1202
 
1180
- var lodash_1 = __webpack_require__(3);
1203
+ exports.default = withDashboardViz;
1181
1204
 
1182
- var i18n_1 = __webpack_require__(2);
1205
+ /***/ }),
1183
1206
 
1184
- var Message_1 = __webpack_require__(9);
1207
+ /***/ 33:
1208
+ /***/ (function(module, exports) {
1185
1209
 
1186
- var FixedSizeContainer_1 = __webpack_require__(12);
1187
- /**
1188
- * @method shouldShowIconPlaceholder
1189
- * @param {object} dataSources
1190
- * @param {boolean} loading
1191
- * @returns {boolean}
1192
- */
1210
+ module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1193
1211
 
1212
+ /***/ }),
1194
1213
 
1195
- var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
1196
- var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1197
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1198
- var noData = data === undefined;
1199
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1200
- var noFields = fields === undefined;
1201
- return loading || noData || noFields;
1202
- };
1214
+ /***/ 34:
1215
+ /***/ (function(module, exports) {
1203
1216
 
1204
- exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
1205
- var propTypes = {
1206
- icon: T.func,
1207
- width: T.oneOfType([T.string, T.number]),
1208
- height: T.oneOfType([T.string, T.number]),
1209
- // eslint-disable-next-line react/no-unused-prop-types
1210
- backgroundColor: T.string,
1211
- iconColor: T.string
1212
- };
1213
- /**
1214
- * @method IconPlaceholder
1215
- * @param {IconPlaceholderProps} props
1216
- * @returns {React.ReactElement}
1217
- */
1217
+ module.exports = require("@splunk/visualization-encoding/Options");
1218
1218
 
1219
- var IconPlaceholder = function IconPlaceholder(props) {
1220
- var width = props.width,
1221
- height = props.height,
1222
- icon = props.icon,
1223
- iconColor = props.iconColor;
1219
+ /***/ }),
1224
1220
 
1225
- if (icon) {
1226
- return React.createElement(icon, {
1227
- style: {
1228
- left: '50%',
1229
- top: '50%',
1230
- color: iconColor,
1231
- opacity: 0.15,
1232
- position: 'absolute',
1233
- transform: 'translate(-50%, -50%)'
1234
- },
1235
- width: '50%',
1236
- height: '50%'
1237
- });
1238
- }
1221
+ /***/ 35:
1222
+ /***/ (function(module, exports) {
1239
1223
 
1240
- return React.createElement(Message_1.default, {
1241
- width: width,
1242
- height: height,
1243
- level: "warning",
1244
- message: i18n_1._('No DataSource Connected')
1245
- });
1246
- };
1224
+ module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1225
+
1226
+ /***/ }),
1227
+
1228
+ /***/ 36:
1229
+ /***/ (function(module, exports) {
1247
1230
 
1248
- IconPlaceholder.propTypes = propTypes;
1249
- IconPlaceholder.defaultProps = {
1250
- width: '100%',
1251
- height: 250
1252
- };
1253
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1231
+ module.exports = require("@splunk/moment");
1254
1232
 
1255
1233
  /***/ }),
1256
1234
 
1257
- /***/ 28:
1235
+ /***/ 37:
1258
1236
  /***/ (function(module, exports, __webpack_require__) {
1259
1237
 
1260
1238
  "use strict";
1261
1239
 
1262
1240
 
1263
- var _defineProperty = __webpack_require__(6);
1241
+ var _classCallCheck = __webpack_require__(11);
1264
1242
 
1265
1243
  Object.defineProperty(exports, "__esModule", {
1266
1244
  value: true
1267
1245
  });
1268
- exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1246
+ exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1247
+ /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1269
1248
 
1270
1249
  var T = __webpack_require__(0);
1271
1250
 
1272
1251
  var lodash_1 = __webpack_require__(3);
1273
1252
 
1274
- var DataSource_1 = __webpack_require__(38);
1275
-
1276
- exports.SortParamsPropTypes = T.shape({
1277
- currentSortKey: T.string,
1278
- currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1279
- onSort: T.func
1280
- });
1281
-
1282
- var getSortingParams = function getSortingParams(_ref) {
1283
- var requestParams = _ref.requestParams,
1284
- onRequestParamsChange = _ref.onRequestParamsChange;
1285
- var currentSortKey;
1286
- var currentSortDir;
1287
- var nextSortDirMap = {
1288
- asc: 'desc',
1289
- desc: 'asc',
1290
- none: 'asc'
1291
- };
1292
- var onSort;
1293
-
1294
- if (lodash_1.isFunction(onRequestParamsChange)) {
1295
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
1296
- currentSortKey = Object.keys(requestParams.sort).shift();
1297
- currentSortDir = requestParams.sort[currentSortKey];
1298
- } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1299
-
1253
+ var VizActionHandler_1 = __webpack_require__(38); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1300
1254
 
1301
- onSort = function onSort(e, _ref2) {
1302
- var sortKey = _ref2.sortKey,
1303
- sortDir = _ref2.sortDir;
1304
1255
 
1305
- if (typeof sortKey === 'string') {
1306
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1307
- onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1308
- offset: 0,
1309
- sort: _defineProperty({}, sortKey, nextSortDir)
1310
- }));
1311
- } else {
1312
- onRequestParamsChange(requestParams);
1313
- }
1314
- };
1315
- }
1256
+ exports.INITIAL_WIDTH = 250;
1257
+ exports.INITIAL_HEIGHT = 250;
1258
+ /**
1259
+ * A Splunk visualization
1260
+ */
1316
1261
 
1317
- return {
1318
- currentSortKey: currentSortKey,
1319
- currentSortDir: currentSortDir,
1320
- onSort: onSort
1321
- };
1262
+ var SplunkVisualization = function SplunkVisualization() {
1263
+ _classCallCheck(this, SplunkVisualization);
1322
1264
  };
1323
1265
 
1324
- exports.getSortingParams = getSortingParams;
1325
-
1326
- /***/ }),
1266
+ SplunkVisualization.propTypes = {
1267
+ /**
1268
+ * display mode
1269
+ */
1270
+ mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1327
1271
 
1328
- /***/ 29:
1329
- /***/ (function(module, exports, __webpack_require__) {
1272
+ /**
1273
+ * width in pixel or string, defaults to 100%
1274
+ */
1275
+ width: T.oneOfType([T.string, T.number]).isRequired,
1330
1276
 
1331
- "use strict";
1277
+ /**
1278
+ * height in pixel or string
1279
+ */
1280
+ height: T.oneOfType([T.string, T.number]).isRequired,
1332
1281
 
1282
+ /**
1283
+ * visualization context used for dynamic option evaluation
1284
+ */
1285
+ context: T.object,
1333
1286
 
1334
- Object.defineProperty(exports, "__esModule", {
1335
- value: true
1336
- });
1337
- exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1287
+ /**
1288
+ * visualization formatting options
1289
+ */
1290
+ options: T.object,
1338
1291
 
1339
- var T = __webpack_require__(0);
1292
+ /**
1293
+ * A callback to update formatting options
1294
+ */
1295
+ onOptionsChange: T.func,
1340
1296
 
1341
- var lodash_1 = __webpack_require__(3);
1297
+ /**
1298
+ * datasource state which include data and request params, object key indicate the datasource type.
1299
+ */
1300
+ dataSources: T.objectOf(T.shape({
1301
+ /**
1302
+ * current request params
1303
+ */
1304
+ requestParams: T.object,
1342
1305
 
1343
- exports.PaginatorParamsPropTypes = T.shape({
1344
- isPaging: T.bool,
1345
- current: T.number,
1346
- totalPages: T.number,
1347
- onChange: T.func
1348
- });
1306
+ /**
1307
+ * current dataset
1308
+ */
1309
+ data: T.shape({
1310
+ fields: T.array,
1311
+ columns: T.array
1312
+ }),
1349
1313
 
1350
- var getPaginationParams = function getPaginationParams(_ref) {
1351
- var requestParams = _ref.requestParams,
1352
- meta = _ref.meta,
1353
- onRequestParamsChange = _ref.onRequestParamsChange;
1354
- var totalCount = meta && meta.totalCount || 0;
1355
- var offset = requestParams && requestParams.offset || 0;
1356
- var count = requestParams && requestParams.count;
1357
- var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1358
- var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1359
- var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
1314
+ /**
1315
+ * error
1316
+ */
1317
+ error: T.shape({
1318
+ level: T.string,
1319
+ message: T.string
1320
+ }),
1360
1321
 
1361
- var onChangeHandler = function onChangeHandler(e, _ref2) {
1362
- var page = _ref2.page,
1363
- countArg = _ref2.count;
1364
- var newParams = lodash_1.cloneDeep(requestParams);
1322
+ /**
1323
+ * meta data that came with the dataset
1324
+ */
1325
+ meta: T.object
1326
+ })),
1365
1327
 
1366
- if (typeof countArg === 'number') {
1367
- newParams.count = countArg;
1368
- newParams.offset = 0;
1369
- }
1328
+ /**
1329
+ * A callback to trigger event
1330
+ */
1331
+ onEventTrigger: T.func,
1370
1332
 
1371
- var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1333
+ /**
1334
+ * Inform viz if there are handlers listening to events
1335
+ */
1336
+ hasEventHandlers: T.bool,
1372
1337
 
1373
- if (typeof page === 'number' && page > 0) {
1374
- newParams.count = pageCount;
1375
- newParams.offset = (page - 1) * pageCount;
1376
- }
1338
+ /**
1339
+ * A callback to communicate computed props to a consumer
1340
+ */
1341
+ onComputedProps: T.func,
1377
1342
 
1378
- onRequestParamsChange(newParams);
1379
- };
1343
+ /**
1344
+ * A callback to obtain visualization api
1345
+ */
1346
+ vizActionHandlerRef: T.func,
1347
+ loading: T.bool,
1348
+ theme: T.object,
1380
1349
 
1381
- return {
1382
- isPaging: isPaging,
1383
- current: current,
1384
- totalPages: totalPages,
1385
- onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
1386
- };
1350
+ /**
1351
+ * A callback to request new data with updated request params
1352
+ */
1353
+ onRequestParamsChange: T.func
1387
1354
  };
1355
+ /**
1356
+ *
1357
+ */
1388
1358
 
1389
- exports.getPaginationParams = getPaginationParams;
1390
-
1391
- /***/ }),
1392
-
1393
- /***/ 3:
1394
- /***/ (function(module, exports) {
1395
-
1396
- module.exports = require("lodash");
1359
+ SplunkVisualization.defaultProps = {
1360
+ // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1361
+ width: '100%',
1362
+ height: exports.INITIAL_HEIGHT,
1363
+ dataSources: {},
1364
+ onEventTrigger: function onEventTrigger() {
1365
+ return {};
1366
+ },
1367
+ mode: 'view',
1368
+ hasEventHandlers: false,
1369
+ options: {},
1370
+ context: {},
1371
+ onOptionsChange: function onOptionsChange() {
1372
+ return {};
1373
+ },
1374
+ vizActionHandlerRef: function vizActionHandlerRef() {
1375
+ return new VizActionHandler_1.DefaultVizActionHandler();
1376
+ },
1377
+ onComputedProps: function onComputedProps() {
1378
+ return {};
1379
+ },
1380
+ loading: false,
1381
+ onRequestParamsChange: lodash_1.noop
1382
+ };
1383
+ exports.default = SplunkVisualization;
1397
1384
 
1398
1385
  /***/ }),
1399
1386
 
1400
- /***/ 30:
1387
+ /***/ 38:
1401
1388
  /***/ (function(module, exports, __webpack_require__) {
1402
1389
 
1403
1390
  "use strict";
1404
1391
 
1405
1392
 
1393
+ var _classCallCheck = __webpack_require__(11);
1394
+
1395
+ var _createClass = __webpack_require__(19);
1396
+
1406
1397
  Object.defineProperty(exports, "__esModule", {
1407
1398
  value: true
1408
1399
  });
1409
- exports.VizCategory = void 0;
1410
- var VizCategory;
1400
+ exports.DefaultVizActionHandler = void 0;
1411
1401
 
1412
- (function (VizCategory) {
1413
- VizCategory["SINGLE_VALUE"] = "Single Value";
1414
- VizCategory["TRENDS"] = "Trends";
1415
- VizCategory["COMPARISONS"] = "Comparisons";
1416
- VizCategory["TABLE"] = "Table";
1417
- VizCategory["GAUGE"] = "Gauge";
1418
- VizCategory["DISTRIBUTIONS"] = "Distributions";
1419
- VizCategory["CHOROPLETH"] = "Choropleth Maps";
1420
- VizCategory["SHAPES"] = "Shapes";
1421
- VizCategory["MISC"] = "misc";
1422
- VizCategory["FLOW"] = "Flow";
1423
- VizCategory["CORRELATION"] = "Correlation";
1424
- VizCategory["SPATIAL"] = "Spatial";
1425
- })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
1402
+ var DefaultVizActionHandler = /*#__PURE__*/function () {
1403
+ function DefaultVizActionHandler() {
1404
+ _classCallCheck(this, DefaultVizActionHandler);
1405
+ }
1406
+
1407
+ _createClass(DefaultVizActionHandler, [{
1408
+ key: "focus",
1409
+ value: function focus() {// noop
1410
+ }
1411
+ }, {
1412
+ key: "snapshot",
1413
+ value: function snapshot() {
1414
+ return null; // noop
1415
+ }
1416
+ }]);
1417
+
1418
+ return DefaultVizActionHandler;
1419
+ }();
1420
+
1421
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1426
1422
 
1427
1423
  /***/ }),
1428
1424
 
1429
- /***/ 31:
1425
+ /***/ 39:
1430
1426
  /***/ (function(module, exports, __webpack_require__) {
1431
1427
 
1432
1428
  "use strict";
@@ -1435,610 +1431,621 @@ var VizCategory;
1435
1431
  Object.defineProperty(exports, "__esModule", {
1436
1432
  value: true
1437
1433
  });
1434
+ exports.validSortDirs = void 0;
1435
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1438
1436
 
1439
- var React = __webpack_require__(1);
1440
-
1441
- var lodash_1 = __webpack_require__(3);
1442
-
1443
- var getSettingsFromThemedProps_1 = __webpack_require__(32);
1444
-
1445
- var Options_1 = __webpack_require__(33);
1446
-
1447
- var SanitizeProps_1 = __webpack_require__(34);
1448
-
1449
- var TimezoneContext_1 = __webpack_require__(22);
1450
-
1451
- var moment_1 = __webpack_require__(35);
1452
-
1453
- var styled_components_1 = __webpack_require__(4);
1454
-
1455
- var hocUtils_1 = __webpack_require__(24);
1437
+ /***/ }),
1456
1438
 
1457
- var JSONSchemaUtils_1 = __webpack_require__(25);
1439
+ /***/ 4:
1440
+ /***/ (function(module, exports) {
1458
1441
 
1459
- var SplunkVisualization_1 = __webpack_require__(36);
1442
+ module.exports = require("styled-components");
1460
1443
 
1461
- var VizBehavior_1 = __webpack_require__(5);
1444
+ /***/ }),
1462
1445
 
1463
- var getSorting_1 = __webpack_require__(28);
1446
+ /***/ 40:
1447
+ /***/ (function(module, exports, __webpack_require__) {
1464
1448
 
1465
- var getPagination_1 = __webpack_require__(29);
1449
+ "use strict";
1466
1450
 
1467
- var useDeepMemo_1 = __webpack_require__(39);
1468
1451
 
1469
- var MissingPropsMessage_1 = __webpack_require__(40);
1452
+ Object.defineProperty(exports, "__esModule", {
1453
+ value: true
1454
+ });
1455
+ exports.useDeepMemo = void 0;
1470
1456
 
1471
- var withEditModeCover_1 = __webpack_require__(41);
1457
+ var react_1 = __webpack_require__(1);
1472
1458
 
1473
- var withPlaceholder_1 = __webpack_require__(42);
1459
+ var lodash_1 = __webpack_require__(3);
1474
1460
  /**
1475
- * hoc that wraps a pure react visualization in a Dashboard visualization
1476
- * @param {DashboardVizOpts} opts
1477
- * @returns {HOC}
1461
+ * This hook evaluates and stores the result of a passed function and only
1462
+ * re-evaluates the function when passed dependencies change.
1463
+ *
1464
+ * It is different from the internal React useMemo in the following aspects:
1465
+ * - it only stores the last evaluated result
1466
+ * - it uses a deep equality check to determine if dependencies have changed
1467
+ *
1468
+ * Inspired by apollo-client's useDeepMemo
1469
+ *
1470
+ * @param fn the function to be executed and
1471
+ * @param dependencies an array of dependencies
1478
1472
  */
1479
1473
 
1480
1474
 
1481
- var withDashboardViz = function withDashboardViz(opts) {
1482
- var ReactViz = opts.ReactViz,
1483
- vizConfig = opts.vizConfig,
1484
- _opts$computeVizProps = opts.computeVizProps,
1485
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1486
- disableEditModeCover = opts.disableEditModeCover,
1487
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1488
-
1489
- var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1490
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1491
-
1492
- var DashboardViz = function DashboardViz(props) {
1493
- var mode = props.mode,
1494
- hasEventHandlers = props.hasEventHandlers,
1495
- dataSources = props.dataSources,
1496
- options = props.options,
1497
- _props$context = props.context,
1498
- context = _props$context === void 0 ? {} : _props$context,
1499
- width = props.width,
1500
- height = props.height,
1501
- onComputedProps = props.onComputedProps,
1502
- onEventTrigger = props.onEventTrigger,
1503
- theme = props.theme,
1504
- onRequestParamsChange = props.onRequestParamsChange;
1505
-
1506
- var _React$useContext = React.useContext(TimezoneContext_1.default),
1507
- serializedTimezone = _React$useContext.serializedTimezone;
1508
-
1509
- if (serializedTimezone) {
1510
- /*
1511
- @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
1512
- This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
1513
- will use it.
1514
- @TODO(pwied):
1515
- - remove when we moved away from @splunk/moment
1516
- - provide timezone context to dynamic option evaluation phase
1517
- */
1518
- if (!moment_1.default.getDefaultSplunkTimezone()) {
1519
- moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1520
- }
1521
- }
1522
-
1523
- var themeFunc = function themeFunc(themeVar) {
1524
- var _a, _b;
1475
+ var useDeepMemo = function useDeepMemo(fn, dependencies) {
1476
+ var ref = react_1.useRef();
1525
1477
 
1526
- return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1478
+ if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1479
+ ref.current = {
1480
+ dependencies: dependencies,
1481
+ value: fn()
1527
1482
  };
1483
+ }
1528
1484
 
1529
- var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1530
-
1531
- var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1532
- theme: theme
1533
- }),
1534
- currentThemeFamily = _getSettingsFromTheme.family,
1535
- currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1536
- currentThemeDensity = _getSettingsFromTheme.density;
1537
-
1538
- var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1539
-
1540
- evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1541
- try {
1542
- return Options_1.Options.evaluate({
1543
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1544
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1545
- }, dataSources, themeFunc);
1546
- } catch (e) {
1547
- // eslint-disable-next-line no-console
1548
- console.error("unexpected error evaluating options: + ".concat(e.message));
1549
- return {};
1550
- }
1551
- }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
1552
- // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1553
-
1554
- React.useEffect(function () {
1555
- onComputedProps(evaluatedOptions);
1556
- }); // present warning message if any required props are missing
1557
-
1558
- var _vizConfig$requiredPr = vizConfig.requiredProps,
1559
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1560
- supports = vizConfig.supports;
1561
- var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
1562
-
1563
- if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
1564
- return React.createElement(MissingPropsMessage_1.default, {
1565
- "data-test": "missing-props-message",
1566
- width: width,
1567
- height: height,
1568
- missingProps: missing,
1569
- backgroundColor: bgColorFromTheme
1570
- });
1571
- } // events
1485
+ return ref.current.value;
1486
+ };
1572
1487
 
1488
+ exports.useDeepMemo = useDeepMemo;
1573
1489
 
1574
- var eventCallbackProps = {};
1490
+ /***/ }),
1575
1491
 
1576
- if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1577
- var supportedEvents = vizConfig.events;
1578
- Object.keys(supportedEvents).forEach(function (eventName) {
1579
- var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1580
- eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1581
- // then remove these lines
1492
+ /***/ 41:
1493
+ /***/ (function(module, exports, __webpack_require__) {
1582
1494
 
1583
- var payloadKeys = supportedEvents[eventName].payloadKeys;
1584
- var payload = {};
1495
+ "use strict";
1585
1496
 
1586
- if (Array.isArray(payloadKeys) && payloadKeys.length) {
1587
- payloadKeys.forEach(function (p) {
1588
- payload[p] = evaluatedOptions[p];
1589
- });
1590
- }
1591
1497
 
1592
- eventCallbackProps[eventCallbackPropName] = function (ev) {
1593
- if (ev && ev.payload) {
1594
- payload = ev.payload;
1595
- }
1498
+ Object.defineProperty(exports, "__esModule", {
1499
+ value: true
1500
+ });
1501
+ exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1596
1502
 
1597
- return onEventTrigger({
1598
- originalEvent: ev,
1599
- payload: payload,
1600
- type: eventName
1601
- });
1602
- };
1603
- });
1604
- } // compute pure viz props which are not from options
1503
+ var React = __webpack_require__(1);
1605
1504
 
1505
+ var T = __webpack_require__(0);
1606
1506
 
1607
- var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
1608
- themeFunc: themeFunc
1609
- }));
1610
- /**
1611
- * PAGE_AND_SORT behavior
1612
- *
1613
- * Some visualizations, like table, requires metadata about the datasource,
1614
- * like total number of results, current count, offset, and sort, for rendering
1615
- * paginator and sorting direction. In this approach, the visualization
1616
- * allow users to set 'paginateDataSourceKey' to select which datasource
1617
- * should the visualization extract the metadata from. It defaults to 'primary' datasource.
1618
- * The visualization config should set the PAGE_AND_SORT behavior to receive
1619
- * 'requestParams', 'meta' and onRequestParams callback as props.
1620
- *
1621
- * In future, we could automatically detect which all datasources are being used
1622
- * and bind those magically to pagination/sorting behavior.
1623
- */
1507
+ var i18n_1 = __webpack_require__(2);
1624
1508
 
1625
- var dataSourceMetadata = {};
1626
- var OptionKey = 'paginateDataSourceKey';
1627
- var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
1509
+ var Message_1 = __webpack_require__(10);
1628
1510
 
1629
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1630
- var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1631
- var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
1511
+ var FixedSizeContainer_1 = __webpack_require__(13);
1512
+ /**
1513
+ * @method isMissing
1514
+ * @param {any} v
1515
+ * @returns {boolean} true if the input value === null or undefined
1516
+ */
1632
1517
 
1633
- var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1634
- return onRequestParamsChange(paginateDataSourceKey, payload);
1635
- };
1636
1518
 
1637
- var sortParams = getSorting_1.getSortingParams({
1638
- requestParams: requestParams,
1639
- meta: meta,
1640
- onRequestParamsChange: handleRequestParamsChange
1641
- });
1642
- var paginatorParams = getPagination_1.getPaginationParams({
1643
- requestParams: requestParams,
1644
- meta: meta,
1645
- onRequestParamsChange: handleRequestParamsChange
1646
- });
1647
- dataSourceMetadata = {
1648
- sortParams: sortParams,
1649
- paginatorParams: paginatorParams
1650
- };
1651
- }
1519
+ var isMissing = function isMissing(v) {
1520
+ return v === null || v === undefined;
1521
+ };
1652
1522
 
1653
- return React.createElement(SanitizedReactViz, Object.assign({
1654
- mode: mode,
1655
- width: width,
1656
- height: height
1657
- }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
1658
- };
1523
+ exports.isMissing = isMissing;
1524
+ /**
1525
+ * @method misskingKeys
1526
+ * @param {string[]} keys
1527
+ * @param {object} target
1528
+ * @returns {string[]} the keys of missing required props
1529
+ */
1659
1530
 
1660
- DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1661
- DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1662
- // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1663
- theme: {}
1664
- }); // attach viz config
1531
+ var missingKeys = function missingKeys(keys, target) {
1532
+ return keys.filter(function (k) {
1533
+ return exports.isMissing(target[k]);
1534
+ });
1535
+ };
1665
1536
 
1666
- DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1537
+ exports.missingKeys = missingKeys;
1538
+ var propTypes = {
1539
+ width: T.oneOfType([T.string, T.number]),
1540
+ height: T.oneOfType([T.string, T.number]),
1541
+ // eslint-disable-next-line react/no-unused-prop-types
1542
+ backgroundColor: T.string,
1543
+ missingProps: T.arrayOf(T.string)
1544
+ };
1545
+ /**
1546
+ * @method MissingPropsMessage
1547
+ * @param {MissingPropsProps} props
1548
+ * @returns {React.ReactElement}
1549
+ */
1667
1550
 
1668
- return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
1551
+ var MissingPropsMessage = function MissingPropsMessage(props) {
1552
+ var width = props.width,
1553
+ height = props.height,
1554
+ missingProps = props.missingProps;
1555
+ return React.createElement(Message_1.default, {
1556
+ "data-test": "message",
1557
+ width: width,
1558
+ height: height,
1559
+ message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
1560
+ });
1669
1561
  };
1670
1562
 
1671
- exports.default = withDashboardViz;
1563
+ exports.MissingPropsMessage = MissingPropsMessage;
1564
+ exports.MissingPropsMessage.propTypes = propTypes;
1565
+ exports.MissingPropsMessage.defaultProps = {
1566
+ width: '100%',
1567
+ height: 250
1568
+ };
1569
+ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
1672
1570
 
1673
1571
  /***/ }),
1674
1572
 
1675
- /***/ 32:
1676
- /***/ (function(module, exports) {
1677
-
1678
- module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1679
-
1680
- /***/ }),
1573
+ /***/ 413:
1574
+ /***/ (function(module, exports, __webpack_require__) {
1681
1575
 
1682
- /***/ 33:
1683
- /***/ (function(module, exports) {
1576
+ "use strict";
1684
1577
 
1685
- module.exports = require("@splunk/visualization-encoding/Options");
1686
1578
 
1687
- /***/ }),
1579
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1580
+ if (k2 === undefined) k2 = k;
1581
+ Object.defineProperty(o, k2, {
1582
+ enumerable: true,
1583
+ get: function get() {
1584
+ return m[k];
1585
+ }
1586
+ });
1587
+ } : function (o, m, k, k2) {
1588
+ if (k2 === undefined) k2 = k;
1589
+ o[k2] = m[k];
1590
+ });
1688
1591
 
1689
- /***/ 34:
1690
- /***/ (function(module, exports) {
1592
+ var __exportStar = this && this.__exportStar || function (m, exports) {
1593
+ for (var p in m) {
1594
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1595
+ }
1596
+ };
1691
1597
 
1692
- module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1598
+ Object.defineProperty(exports, "__esModule", {
1599
+ value: true
1600
+ });
1601
+ exports.default = void 0;
1693
1602
 
1694
- /***/ }),
1603
+ __exportStar(__webpack_require__(146), exports);
1695
1604
 
1696
- /***/ 35:
1697
- /***/ (function(module, exports) {
1605
+ var Pie_1 = __webpack_require__(146);
1698
1606
 
1699
- module.exports = require("@splunk/moment");
1607
+ Object.defineProperty(exports, "default", {
1608
+ enumerable: true,
1609
+ get: function get() {
1610
+ return Pie_1.default;
1611
+ }
1612
+ });
1700
1613
 
1701
1614
  /***/ }),
1702
1615
 
1703
- /***/ 36:
1616
+ /***/ 414:
1704
1617
  /***/ (function(module, exports, __webpack_require__) {
1705
1618
 
1706
1619
  "use strict";
1707
1620
 
1708
1621
 
1709
- var _classCallCheck = __webpack_require__(10);
1710
-
1711
1622
  Object.defineProperty(exports, "__esModule", {
1712
1623
  value: true
1713
1624
  });
1714
- exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1715
- /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1716
1625
 
1717
- var T = __webpack_require__(0);
1626
+ var ChartPie_1 = __webpack_require__(415);
1718
1627
 
1719
- var lodash_1 = __webpack_require__(3);
1628
+ var placeholders_1 = __webpack_require__(44);
1629
+
1630
+ var i18n_1 = __webpack_require__(2);
1720
1631
 
1721
- var VizActionHandler_1 = __webpack_require__(37); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1632
+ var schemaUtils_1 = __webpack_require__(16);
1722
1633
 
1634
+ var visualization_color_palettes_1 = __webpack_require__(46);
1723
1635
 
1724
- exports.INITIAL_WIDTH = 250;
1725
- exports.INITIAL_HEIGHT = 250;
1636
+ var pick_1 = __webpack_require__(21);
1637
+
1638
+ var variables_1 = __webpack_require__(9);
1639
+
1640
+ var VizBehavior_1 = __webpack_require__(6);
1641
+
1642
+ var VizCategory_1 = __webpack_require__(31);
1643
+
1644
+ var configUtils_1 = __webpack_require__(17);
1645
+
1646
+ var BackgroundColor_1 = __webpack_require__(50);
1647
+
1648
+ var dataContract = {
1649
+ requiredDataSources: [{
1650
+ name: 'primary',
1651
+ description: 'DataSource that powers the visualization'
1652
+ }],
1653
+ optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
1654
+ // {
1655
+ // name: 'annotation',
1656
+ // description: 'DataSource that populate event annotations',
1657
+ // },
1658
+ ],
1659
+ initialRequestParams: {
1660
+ primary: {
1661
+ offset: 0,
1662
+ count: 10000
1663
+ }
1664
+ }
1665
+ };
1666
+ var size = {
1667
+ initialWidth: 300,
1668
+ initialHeight: 300
1669
+ };
1670
+ var defaultContext = {};
1671
+ var optionsSchema = {
1672
+ backgroundColor: {
1673
+ default: '> themes.defaultBackgroundColor',
1674
+ description: 'Specify the color for the background. You may use a dataSource to apply the color. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
1675
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
1676
+ type: 'string'
1677
+ },
1678
+ collapseLabel: {
1679
+ description: 'Specify the label for the consolidated slice.',
1680
+ type: 'string',
1681
+ default: 'other'
1682
+ },
1683
+ collapseThreshold: {
1684
+ description: 'Specify the size threshold as a number between 0 and 1 (inclusive), of the whole pie at which slices collapse into one consolidated slice.',
1685
+ type: 'number',
1686
+ default: 0.01
1687
+ },
1688
+ label: {
1689
+ description: 'List of string values to display the pie chart labels.',
1690
+ type: 'array',
1691
+ items: {
1692
+ type: 'string'
1693
+ },
1694
+ default: '> primary | seriesByIndex(0)'
1695
+ },
1696
+ labelField: {
1697
+ default: '> label | getField()',
1698
+ description: 'Specify the field that corresponds to the labels.',
1699
+ type: 'string'
1700
+ },
1701
+ labelDisplay: {
1702
+ description: 'Specify whether to display the labels and/or slice percentages.',
1703
+ type: 'string',
1704
+ pattern: schemaUtils_1.getPattern(['values', 'valuesAndPercentage', 'off']),
1705
+ default: 'values'
1706
+ },
1707
+ resultLimit: {
1708
+ default: 50000,
1709
+ description: 'Specify the number of data points rendered in a chart.',
1710
+ type: 'number'
1711
+ },
1712
+ seriesColors: {
1713
+ default: visualization_color_palettes_1.VIZ_CATEGORICAL,
1714
+ description: 'Specify the colors used for a series. For example, ["#FF0000", "#0000FF", "#008000"].',
1715
+ type: 'array',
1716
+ items: {
1717
+ type: 'string'
1718
+ }
1719
+ },
1720
+ seriesColorsByField: {
1721
+ description: 'Specify the colors used for specific pie slice labels. For example: {"April": "#008000", "May": "#FFA500"}.',
1722
+ type: 'object'
1723
+ },
1724
+ showDonutHole: {
1725
+ default: false,
1726
+ description: 'Specify whether the pie should be a donut.',
1727
+ type: 'boolean'
1728
+ },
1729
+ value: {
1730
+ description: 'List of numerical values to power the pie chart.',
1731
+ type: 'array',
1732
+ items: {
1733
+ type: 'number'
1734
+ },
1735
+ default: '> primary | seriesByIndex(1)'
1736
+ },
1737
+ valueField: {
1738
+ default: '> value | getField()',
1739
+ description: 'Specify the field that corresponds to the data powering values.',
1740
+ type: 'string'
1741
+ }
1742
+ };
1743
+ var themes = {
1744
+ defaultBackgroundColor: function defaultBackgroundColor(props) {
1745
+ return pick_1.default({
1746
+ enterprise: {
1747
+ dark: variables_1.default.black(props),
1748
+ light: variables_1.default.backgroundColor(props)
1749
+ },
1750
+ prisma: variables_1.default.backgroundColorSidebar(props)
1751
+ })(props);
1752
+ }
1753
+ };
1754
+ var editorConfig = [{
1755
+ label: i18n_1._('General'),
1756
+ layout: [BackgroundColor_1.default({
1757
+ themes: themes
1758
+ })]
1759
+ }, {
1760
+ label: i18n_1._('Appearance'),
1761
+ layout: [[{
1762
+ label: i18n_1._('Display type'),
1763
+ option: 'showDonutHole',
1764
+ editor: 'editor.radioBar',
1765
+ editorProps: {
1766
+ values: [{
1767
+ label: i18n_1._('Pie'),
1768
+ value: false
1769
+ }, {
1770
+ label: i18n_1._('Donut'),
1771
+ value: true
1772
+ }]
1773
+ }
1774
+ }]]
1775
+ }, {
1776
+ label: i18n_1._('Labels'),
1777
+ layout: [[{
1778
+ label: i18n_1._('Label display'),
1779
+ option: 'labelDisplay',
1780
+ editor: 'editor.radioBar',
1781
+ editorProps: {
1782
+ values: [{
1783
+ label: i18n_1._('Values'),
1784
+ value: 'values'
1785
+ }, {
1786
+ label: i18n_1._('Values & Percent'),
1787
+ value: 'valuesAndPercentage'
1788
+ }, {
1789
+ label: i18n_1._('Off'),
1790
+ value: 'off'
1791
+ }]
1792
+ }
1793
+ }]]
1794
+ }, {
1795
+ label: i18n_1._('Collapse to Summary'),
1796
+ layout: [[{
1797
+ label: i18n_1._('Collapse Threshold'),
1798
+ option: 'collapseThreshold',
1799
+ editor: 'editor.number',
1800
+ editorProps: {
1801
+ min: 0,
1802
+ max: 1,
1803
+ step: 0.01
1804
+ }
1805
+ }], [{
1806
+ label: i18n_1._('Collapsed Slice Label'),
1807
+ option: 'collapseLabel',
1808
+ editor: 'editor.text'
1809
+ }]]
1810
+ }];
1726
1811
  /**
1727
- * A Splunk visualization
1812
+ * visualization configuration
1728
1813
  */
1729
1814
 
1730
- var SplunkVisualization = function SplunkVisualization() {
1731
- _classCallCheck(this, SplunkVisualization);
1732
- };
1733
-
1734
- SplunkVisualization.propTypes = {
1735
- /**
1736
- * display mode
1737
- */
1738
- mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1739
-
1740
- /**
1741
- * width in pixel or string, defaults to 100%
1742
- */
1743
- width: T.oneOfType([T.string, T.number]).isRequired,
1744
-
1745
- /**
1746
- * height in pixel or string
1747
- */
1748
- height: T.oneOfType([T.string, T.number]).isRequired,
1749
-
1750
- /**
1751
- * visualization context used for dynamic option evaluation
1752
- */
1753
- context: T.object,
1754
-
1755
- /**
1756
- * visualization formatting options
1757
- */
1758
- options: T.object,
1759
-
1760
- /**
1761
- * A callback to update formatting options
1762
- */
1763
- onOptionsChange: T.func,
1764
-
1765
- /**
1766
- * datasource state which include data and request params, object key indicate the datasource type.
1767
- */
1768
- dataSources: T.objectOf(T.shape({
1769
- /**
1770
- * current request params
1771
- */
1772
- requestParams: T.object,
1773
-
1774
- /**
1775
- * current dataset
1776
- */
1777
- data: T.shape({
1778
- fields: T.array,
1779
- columns: T.array
1780
- }),
1781
-
1782
- /**
1783
- * error
1784
- */
1785
- error: T.shape({
1786
- level: T.string,
1787
- message: T.string
1788
- }),
1789
-
1790
- /**
1791
- * meta data that came with the dataset
1792
- */
1793
- meta: T.object
1794
- })),
1795
-
1815
+ var config = {
1796
1816
  /**
1797
- * A callback to trigger event
1817
+ * unique viz key
1798
1818
  */
1799
- onEventTrigger: T.func,
1819
+ key: 'splunk.pie',
1800
1820
 
1801
1821
  /**
1802
- * Inform viz if there are handlers listening to events
1822
+ * viz name
1803
1823
  */
1804
- hasEventHandlers: T.bool,
1824
+ name: 'Pie',
1825
+ category: VizCategory_1.VizCategory.COMPARISONS,
1805
1826
 
1806
1827
  /**
1807
- * A callback to communicate computed props to a consumer
1828
+ * viz icon
1808
1829
  */
1809
- onComputedProps: T.func,
1830
+ icon: ChartPie_1.default,
1831
+ placeholderIcon: placeholders_1.Pie,
1832
+ dataContract: dataContract,
1833
+ size: size,
1834
+ defaultContext: defaultContext,
1835
+ optionsSchema: optionsSchema,
1836
+ editorConfig: editorConfig,
1837
+ events: {
1838
+ 'point.click': {
1839
+ description: 'triggered when user clicks on a point in the pie chart'
1840
+ }
1841
+ },
1842
+ supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER, VizBehavior_1.VizBehavior.EVENTS],
1843
+ themes: themes
1844
+ };
1845
+ exports.default = configUtils_1.enhanceConfig(config);
1810
1846
 
1811
- /**
1812
- * A callback to obtain visualization api
1813
- */
1814
- vizActionHandlerRef: T.func,
1815
- loading: T.bool,
1816
- theme: T.object,
1847
+ /***/ }),
1817
1848
 
1818
- /**
1819
- * A callback to request new data with updated request params
1820
- */
1821
- onRequestParamsChange: T.func
1822
- };
1823
- /**
1824
- *
1825
- */
1849
+ /***/ 415:
1850
+ /***/ (function(module, exports) {
1826
1851
 
1827
- SplunkVisualization.defaultProps = {
1828
- // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1829
- width: '100%',
1830
- height: exports.INITIAL_HEIGHT,
1831
- dataSources: {},
1832
- onEventTrigger: function onEventTrigger() {
1833
- return {};
1834
- },
1835
- mode: 'view',
1836
- hasEventHandlers: false,
1837
- options: {},
1838
- context: {},
1839
- onOptionsChange: function onOptionsChange() {
1840
- return {};
1841
- },
1842
- vizActionHandlerRef: function vizActionHandlerRef() {
1843
- return new VizActionHandler_1.DefaultVizActionHandler();
1844
- },
1845
- onComputedProps: function onComputedProps() {
1846
- return {};
1847
- },
1848
- loading: false,
1849
- onRequestParamsChange: lodash_1.noop
1850
- };
1851
- exports.default = SplunkVisualization;
1852
+ module.exports = require("@splunk/react-icons/ChartPie");
1852
1853
 
1853
1854
  /***/ }),
1854
1855
 
1855
- /***/ 37:
1856
+ /***/ 416:
1856
1857
  /***/ (function(module, exports, __webpack_require__) {
1857
1858
 
1858
1859
  "use strict";
1859
1860
 
1860
1861
 
1861
- var _classCallCheck = __webpack_require__(10);
1862
-
1863
- var _createClass = __webpack_require__(18);
1864
-
1865
- Object.defineProperty(exports, "__esModule", {
1866
- value: true
1867
- });
1868
- exports.DefaultVizActionHandler = void 0;
1862
+ var __rest = this && this.__rest || function (s, e) {
1863
+ var t = {};
1869
1864
 
1870
- var DefaultVizActionHandler = /*#__PURE__*/function () {
1871
- function DefaultVizActionHandler() {
1872
- _classCallCheck(this, DefaultVizActionHandler);
1865
+ for (var p in s) {
1866
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1873
1867
  }
1874
1868
 
1875
- _createClass(DefaultVizActionHandler, [{
1876
- key: "focus",
1877
- value: function focus() {// noop
1878
- }
1879
- }, {
1880
- key: "snapshot",
1881
- value: function snapshot() {
1882
- return null; // noop
1883
- }
1884
- }]);
1885
-
1886
- return DefaultVizActionHandler;
1887
- }();
1888
-
1889
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1890
-
1891
- /***/ }),
1892
-
1893
- /***/ 38:
1894
- /***/ (function(module, exports, __webpack_require__) {
1895
-
1896
- "use strict";
1897
-
1869
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1870
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1871
+ }
1872
+ return t;
1873
+ };
1898
1874
 
1899
1875
  Object.defineProperty(exports, "__esModule", {
1900
1876
  value: true
1901
1877
  });
1902
- exports.validSortDirs = void 0;
1903
- exports.validSortDirs = ['asc', 'desc', 'none'];
1878
+ exports.allInvalidDataValues = exports.invalidOptionField = exports.getPieOptionFieldIndex = exports.getPieMergedOptions = exports.convertToPieSCProperties = exports.mapToOldKey = exports.mapLabelDisplay = exports.convertToStringValues = void 0;
1904
1879
 
1905
- /***/ }),
1880
+ var lodash_1 = __webpack_require__(3);
1906
1881
 
1907
- /***/ 39:
1908
- /***/ (function(module, exports, __webpack_require__) {
1882
+ var propUtils_1 = __webpack_require__(24);
1909
1883
 
1910
- "use strict";
1884
+ var dsl_1 = __webpack_require__(92);
1911
1885
 
1886
+ var hocUtils_1 = __webpack_require__(25);
1912
1887
 
1913
- Object.defineProperty(exports, "__esModule", {
1914
- value: true
1915
- });
1916
- exports.useDeepMemo = void 0;
1888
+ var JSONSchemaUtils_1 = __webpack_require__(26); // CONVERT THIS TO PIE THEN ADD TO Pie.TSX
1889
+ // map for key names which are either new or not present in SimpleXML options mapping
1917
1890
 
1918
- var react_1 = __webpack_require__(1);
1919
1891
 
1920
- var lodash_1 = __webpack_require__(3);
1892
+ var pieOptionsSCMapping = {
1893
+ resultLimit: 'resultTruncationLimit',
1894
+ seriesColorsByField: 'fieldColors',
1895
+ collapseThreshold: 'chart.sliceCollapsingThreshold',
1896
+ collapseLabel: 'chart.sliceCollapsingLabel'
1897
+ };
1921
1898
  /**
1922
- * This hook evaluates and stores the result of a passed function and only
1923
- * re-evaluates the function when passed dependencies change.
1924
- *
1925
- * It is different from the internal React useMemo in the following aspects:
1926
- * - it only stores the last evaluated result
1927
- * - it uses a deep equality check to determine if dependencies have changed
1928
- *
1929
- * Inspired by apollo-client's useDeepMemo
1930
- *
1931
- * @param fn the function to be executed and
1932
- * @param dependencies an array of dependencies
1899
+ * Helper method to convert option which contains object literal values (e.g. arrays, objects)
1900
+ * to strings as SC can only accept their stringified equivalents
1901
+ * @method convertToStringValues
1902
+ * @param {Object} options
1903
+ * @returns {Object}
1904
+ */
1905
+
1906
+ var convertToStringValues = function convertToStringValues(options) {
1907
+ var updatedOptions = propUtils_1.convertPropsToString({
1908
+ vizProps: options,
1909
+ propNames: ['seriesColors', 'fieldColors']
1910
+ });
1911
+ return Object.assign(Object.assign({}, options), updatedOptions);
1912
+ };
1913
+
1914
+ exports.convertToStringValues = convertToStringValues;
1915
+ /**
1916
+ * Helper method to map labelDisplay options to jsCharting options
1917
+ * @method mapLabelDisplay
1918
+ * @param {Object} options
1919
+ * @returns {Object}
1933
1920
  */
1934
1921
 
1922
+ var mapLabelDisplay = function mapLabelDisplay(_a) {
1923
+ var labelDisplay = _a.labelDisplay,
1924
+ options = __rest(_a, ["labelDisplay"]);
1935
1925
 
1936
- var useDeepMemo = function useDeepMemo(fn, dependencies) {
1937
- var ref = react_1.useRef();
1926
+ var convertedOptions = Object.assign(Object.assign({}, options), {
1927
+ // default for labelDisplay option is 'values'
1928
+ 'chart.showLabels': true,
1929
+ 'chart.showPercent': false
1930
+ });
1938
1931
 
1939
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1940
- ref.current = {
1941
- dependencies: dependencies,
1942
- value: fn()
1943
- };
1932
+ if (labelDisplay === 'valuesAndPercentage') {
1933
+ convertedOptions['chart.showPercent'] = true;
1934
+ } else if (labelDisplay === 'off') {
1935
+ convertedOptions['chart.showLabels'] = false;
1944
1936
  }
1945
1937
 
1946
- return ref.current.value;
1938
+ return convertedOptions;
1947
1939
  };
1948
1940
 
1949
- exports.useDeepMemo = useDeepMemo;
1950
-
1951
- /***/ }),
1952
-
1953
- /***/ 4:
1954
- /***/ (function(module, exports) {
1955
-
1956
- module.exports = require("styled-components");
1941
+ exports.mapLabelDisplay = mapLabelDisplay;
1942
+ /**
1943
+ * Helper method to update the option names which can be mapped to SimpleXML options or
1944
+ * can be used directly with SC if don't have a 1-1 mapping in SimpleXML
1945
+ * @method mapToOldKey
1946
+ * @param {Object} options
1947
+ * @returns {Object}
1948
+ */
1957
1949
 
1958
- /***/ }),
1950
+ var mapToOldKey = function mapToOldKey(options) {
1951
+ return lodash_1.mapKeys(options, function (val, key) {
1952
+ return pieOptionsSCMapping[key] ? pieOptionsSCMapping[key] : key;
1953
+ });
1954
+ };
1959
1955
 
1960
- /***/ 40:
1961
- /***/ (function(module, exports, __webpack_require__) {
1956
+ exports.mapToOldKey = mapToOldKey;
1957
+ /**
1958
+ * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts
1959
+ * This is for options that has new key name and can not directly be mapped with SimpleXML or
1960
+ * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)
1961
+ * @method convertToPieSCProperties
1962
+ * @param {Object} originalOptions
1963
+ * @returns {Object}
1964
+ */
1962
1965
 
1963
- "use strict";
1966
+ var convertToPieSCProperties = function convertToPieSCProperties(originalOptions) {
1967
+ return lodash_1.chain(exports.mapToOldKey(originalOptions)).thru(exports.convertToStringValues).thru(exports.mapLabelDisplay).value();
1968
+ };
1964
1969
 
1970
+ exports.convertToPieSCProperties = convertToPieSCProperties;
1971
+ /**
1972
+ * Return all merged options (default + config) using vizConfig and options
1973
+ * @param options
1974
+ * @param vizConfig
1975
+ * @returns
1976
+ */
1965
1977
 
1966
- Object.defineProperty(exports, "__esModule", {
1967
- value: true
1968
- });
1969
- exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1978
+ var getPieMergedOptions = function getPieMergedOptions(options, vizConfig) {
1979
+ return hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default'));
1980
+ };
1970
1981
 
1971
- var React = __webpack_require__(1);
1982
+ exports.getPieMergedOptions = getPieMergedOptions;
1983
+ /**
1984
+ * Returns option's field index. If not found returns -1
1985
+ * @param optionName
1986
+ * @param dataSources
1987
+ * @param options
1988
+ * @param vizConfig
1989
+ * @returns
1990
+ */
1972
1991
 
1973
- var T = __webpack_require__(0);
1992
+ var getPieOptionFieldIndex = function getPieOptionFieldIndex(optionName, dataSources, options, vizConfig) {
1993
+ var mergedOptions = exports.getPieMergedOptions(options, vizConfig); // find the field name configured for pie "value"
1974
1994
 
1975
- var i18n_1 = __webpack_require__(2);
1995
+ var fieldName = dsl_1.getFieldsFromDSL(mergedOptions[optionName], dataSources)[0];
1996
+ var fields = dataSources.primary.data.fields; // find the field index configured for pie "value"
1976
1997
 
1977
- var Message_1 = __webpack_require__(9);
1998
+ var fieldIndex = fields.findIndex(function (field) {
1999
+ return (typeof field === 'string' ? field : field.name.toString()) === fieldName;
2000
+ });
2001
+ return fieldIndex;
2002
+ };
1978
2003
 
1979
- var FixedSizeContainer_1 = __webpack_require__(12);
2004
+ exports.getPieOptionFieldIndex = getPieOptionFieldIndex;
1980
2005
  /**
1981
- * @method isMissing
1982
- * @param {any} v
1983
- * @returns {boolean} true if the input value === null or undefined
2006
+ * Returns true if columns data has invalid data format for specified option (label or value)
2007
+ * @param optionName
2008
+ * @param dataSources
2009
+ * @param options
2010
+ * @param vizConfig
2011
+ * @returns
1984
2012
  */
1985
2013
 
2014
+ var invalidOptionField = function invalidOptionField(optionName, dataSources, options, vizConfig) {
2015
+ var columns = dataSources.primary.data.columns;
2016
+ var fieldIndex = exports.getPieOptionFieldIndex(optionName, dataSources, options, vizConfig);
2017
+
2018
+ if (fieldIndex === -1 || !columns[fieldIndex] || !Array.isArray(columns[fieldIndex]) || Array.isArray(columns[fieldIndex]) && !columns[fieldIndex].length) {
2019
+ return true;
2020
+ }
1986
2021
 
1987
- var isMissing = function isMissing(v) {
1988
- return v === null || v === undefined;
2022
+ return false;
1989
2023
  };
1990
2024
 
1991
- exports.isMissing = isMissing;
2025
+ exports.invalidOptionField = invalidOptionField;
1992
2026
  /**
1993
- * @method misskingKeys
1994
- * @param {string[]} keys
1995
- * @param {object} target
1996
- * @returns {string[]} the keys of missing required props
2027
+ * Helper function to evaluate if all data values are invalid (zero or negative)
1997
2028
  */
1998
2029
 
1999
- var missingKeys = function missingKeys(keys, target) {
2000
- return keys.filter(function (k) {
2001
- return exports.isMissing(target[k]);
2002
- });
2003
- };
2030
+ var allInvalidDataValues = function allInvalidDataValues(dataSources, options, vizConfig) {
2031
+ var columns = dataSources.primary.data.columns; // find the field index configured for pie "value"
2004
2032
 
2005
- exports.missingKeys = missingKeys;
2006
- var propTypes = {
2007
- width: T.oneOfType([T.string, T.number]),
2008
- height: T.oneOfType([T.string, T.number]),
2009
- // eslint-disable-next-line react/no-unused-prop-types
2010
- backgroundColor: T.string,
2011
- missingProps: T.arrayOf(T.string)
2012
- };
2013
- /**
2014
- * @method MissingPropsMessage
2015
- * @param {MissingPropsProps} props
2016
- * @returns {React.ReactElement}
2017
- */
2033
+ var valueFieldIndex = exports.getPieOptionFieldIndex('value', dataSources, options, vizConfig); // check if all values are invalid
2018
2034
 
2019
- var MissingPropsMessage = function MissingPropsMessage(props) {
2020
- var width = props.width,
2021
- height = props.height,
2022
- missingProps = props.missingProps;
2023
- return React.createElement(Message_1.default, {
2024
- "data-test": "message",
2025
- width: width,
2026
- height: height,
2027
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
2028
- });
2029
- };
2035
+ if (Array.isArray(columns) && columns[valueFieldIndex] && Array.isArray(columns[valueFieldIndex])) {
2036
+ return !columns[valueFieldIndex].some(function (value) {
2037
+ return +value > 0;
2038
+ });
2039
+ }
2030
2040
 
2031
- exports.MissingPropsMessage = MissingPropsMessage;
2032
- exports.MissingPropsMessage.propTypes = propTypes;
2033
- exports.MissingPropsMessage.defaultProps = {
2034
- width: '100%',
2035
- height: 250
2041
+ return false;
2036
2042
  };
2037
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
2043
+
2044
+ exports.allInvalidDataValues = allInvalidDataValues;
2038
2045
 
2039
2046
  /***/ }),
2040
2047
 
2041
- /***/ 41:
2048
+ /***/ 42:
2042
2049
  /***/ (function(module, exports, __webpack_require__) {
2043
2050
 
2044
2051
  "use strict";
@@ -2052,14 +2059,14 @@ var React = __webpack_require__(1);
2052
2059
 
2053
2060
  var styled_components_1 = __webpack_require__(4);
2054
2061
 
2055
- var hocUtils_1 = __webpack_require__(13);
2062
+ var hocUtils_1 = __webpack_require__(14);
2056
2063
 
2057
2064
  var Cover = styled_components_1.default.div.withConfig({
2058
2065
  displayName: "withEditModeCover__Cover",
2059
2066
  componentId: "sc-1gsbnxb-0"
2060
2067
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
2061
2068
  var Blocker = styled_components_1.default.div.attrs({
2062
- 'data-splunk-visualization-version': "25.1.0 - 812a9a4d8"
2069
+ 'data-splunk-visualization-version': "25.2.0 - 4373c5a66"
2063
2070
  }).withConfig({
2064
2071
  displayName: "withEditModeCover__Blocker",
2065
2072
  componentId: "sc-1gsbnxb-1"
@@ -2091,7 +2098,7 @@ exports.default = withEditModeCover;
2091
2098
 
2092
2099
  /***/ }),
2093
2100
 
2094
- /***/ 42:
2101
+ /***/ 43:
2095
2102
  /***/ (function(module, exports, __webpack_require__) {
2096
2103
 
2097
2104
  "use strict";
@@ -2103,15 +2110,15 @@ Object.defineProperty(exports, "__esModule", {
2103
2110
 
2104
2111
  var React = __webpack_require__(1);
2105
2112
 
2106
- var colorUtils_1 = __webpack_require__(11);
2113
+ var colorUtils_1 = __webpack_require__(12);
2107
2114
 
2108
- var variables_1 = __webpack_require__(8);
2115
+ var variables_1 = __webpack_require__(9);
2109
2116
 
2110
2117
  var IconPlaceholder_1 = __webpack_require__(27);
2111
2118
 
2112
- var VizBehavior_1 = __webpack_require__(5);
2119
+ var VizBehavior_1 = __webpack_require__(6);
2113
2120
 
2114
- var hocUtils_1 = __webpack_require__(13);
2121
+ var hocUtils_1 = __webpack_require__(14);
2115
2122
 
2116
2123
  var withPlaceholder = function withPlaceholder(Visualization) {
2117
2124
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
@@ -2159,18 +2166,18 @@ exports.default = withPlaceholder;
2159
2166
  /***/ 44:
2160
2167
  /***/ (function(module, exports) {
2161
2168
 
2162
- module.exports = require("@splunk/visualization-color-palettes");
2169
+ module.exports = require("@splunk/visualization-icons/placeholders");
2163
2170
 
2164
2171
  /***/ }),
2165
2172
 
2166
- /***/ 45:
2173
+ /***/ 46:
2167
2174
  /***/ (function(module, exports) {
2168
2175
 
2169
- module.exports = require("@splunk/visualization-icons/placeholders");
2176
+ module.exports = require("@splunk/visualization-color-palettes");
2170
2177
 
2171
2178
  /***/ }),
2172
2179
 
2173
- /***/ 49:
2180
+ /***/ 50:
2174
2181
  /***/ (function(module, exports, __webpack_require__) {
2175
2182
 
2176
2183
  "use strict";
@@ -2201,51 +2208,13 @@ exports.default = background;
2201
2208
 
2202
2209
  /***/ }),
2203
2210
 
2204
- /***/ 5:
2205
- /***/ (function(module, exports, __webpack_require__) {
2206
-
2207
- "use strict";
2208
-
2209
-
2210
- Object.defineProperty(exports, "__esModule", {
2211
- value: true
2212
- });
2213
- exports.VizBehavior = void 0;
2214
- var VizBehavior;
2215
-
2216
- (function (VizBehavior) {
2217
- /**
2218
- * Dynamic Options Behavior.
2219
- * This allows visualization options to be powered by data
2220
- *
2221
- * **Example**
2222
- *
2223
- * sparklineValues: ">primary|seriesByIndex(0)"
2224
- * would configure sparklineValues with an array of data points
2225
- * coming from the first series in the primary datasource
2226
- *
2227
- */
2228
- VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
2229
- VizBehavior["EVENTS"] = "events";
2230
- /**
2231
- * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
2232
- * missing.
2233
- * @type {string}
2234
- */
2235
-
2236
- VizBehavior["PLACEHOLDER"] = "placeholder";
2237
- VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
2238
- })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
2239
-
2240
- /***/ }),
2241
-
2242
- /***/ 50:
2211
+ /***/ 52:
2243
2212
  /***/ (function(module, exports, __webpack_require__) {
2244
2213
 
2245
2214
  "use strict";
2246
2215
 
2247
2216
 
2248
- var _toConsumableArray = __webpack_require__(7);
2217
+ var _toConsumableArray = __webpack_require__(8);
2249
2218
 
2250
2219
  var __rest = this && this.__rest || function (s, e) {
2251
2220
  var t = {};
@@ -2461,14 +2430,14 @@ exports.constructFieldsAndColumns = constructFieldsAndColumns;
2461
2430
 
2462
2431
  /***/ }),
2463
2432
 
2464
- /***/ 51:
2433
+ /***/ 53:
2465
2434
  /***/ (function(module, exports) {
2466
2435
 
2467
2436
  module.exports = require("@splunk/charting-bundle");
2468
2437
 
2469
2438
  /***/ }),
2470
2439
 
2471
- /***/ 55:
2440
+ /***/ 56:
2472
2441
  /***/ (function(module, exports, __webpack_require__) {
2473
2442
 
2474
2443
  "use strict";
@@ -2484,7 +2453,7 @@ var lodash_1 = __webpack_require__(3);
2484
2453
 
2485
2454
  var i18n_1 = __webpack_require__(2);
2486
2455
 
2487
- var visualization_color_palettes_1 = __webpack_require__(44);
2456
+ var visualization_color_palettes_1 = __webpack_require__(46);
2488
2457
 
2489
2458
  var react_1 = __webpack_require__(1);
2490
2459
 
@@ -2492,26 +2461,26 @@ var React = __webpack_require__(1);
2492
2461
 
2493
2462
  var T = __webpack_require__(0);
2494
2463
 
2495
- var react_event_listener_1 = __webpack_require__(56);
2464
+ var react_event_listener_1 = __webpack_require__(57);
2496
2465
 
2497
- __webpack_require__(57); // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions
2466
+ __webpack_require__(58); // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions
2498
2467
 
2499
2468
 
2500
- var charting_bundle_1 = __webpack_require__(51);
2469
+ var charting_bundle_1 = __webpack_require__(53);
2501
2470
 
2502
- var TimezoneContext_1 = __webpack_require__(22);
2471
+ var TimezoneContext_1 = __webpack_require__(23);
2503
2472
 
2504
- var style_1 = __webpack_require__(14);
2473
+ var style_1 = __webpack_require__(15);
2505
2474
 
2506
2475
  var styled_components_1 = __webpack_require__(4);
2507
2476
 
2508
- var Message_1 = __webpack_require__(9);
2477
+ var Message_1 = __webpack_require__(10);
2509
2478
 
2510
- var useSplunkTheme_1 = __webpack_require__(58);
2479
+ var useSplunkTheme_1 = __webpack_require__(59);
2511
2480
 
2512
- var themeUtils_1 = __webpack_require__(59);
2481
+ var themeUtils_1 = __webpack_require__(60);
2513
2482
 
2514
- var ChartingApi_1 = __webpack_require__(60);
2483
+ var ChartingApi_1 = __webpack_require__(61);
2515
2484
 
2516
2485
  exports.NO_INPLACE_PROPS = ['chart', 'chart.orientation', 'layout.splitSeries', 'chart.style', 'legend.placement'];
2517
2486
 
@@ -2891,50 +2860,81 @@ exports.default = withEmptyChartMessage(Charting);
2891
2860
 
2892
2861
  /***/ }),
2893
2862
 
2894
- /***/ 56:
2863
+ /***/ 57:
2895
2864
  /***/ (function(module, exports) {
2896
2865
 
2897
2866
  module.exports = require("react-event-listener");
2898
2867
 
2899
2868
  /***/ }),
2900
2869
 
2901
- /***/ 57:
2870
+ /***/ 58:
2902
2871
  /***/ (function(module, exports) {
2903
2872
 
2904
2873
  module.exports = require("@splunk/visualizations-shared/i18n");
2905
2874
 
2906
2875
  /***/ }),
2907
2876
 
2908
- /***/ 58:
2877
+ /***/ 59:
2909
2878
  /***/ (function(module, exports) {
2910
2879
 
2911
2880
  module.exports = require("@splunk/themes/useSplunkTheme");
2912
2881
 
2913
2882
  /***/ }),
2914
2883
 
2915
- /***/ 59:
2916
- /***/ (function(module, exports) {
2884
+ /***/ 6:
2885
+ /***/ (function(module, exports, __webpack_require__) {
2917
2886
 
2918
- module.exports = require("@splunk/visualizations-shared/themeUtils");
2887
+ "use strict";
2888
+
2889
+
2890
+ Object.defineProperty(exports, "__esModule", {
2891
+ value: true
2892
+ });
2893
+ exports.VizBehavior = void 0;
2894
+ var VizBehavior;
2895
+
2896
+ (function (VizBehavior) {
2897
+ /**
2898
+ * Dynamic Options Behavior.
2899
+ * This allows visualization options to be powered by data
2900
+ *
2901
+ * **Example**
2902
+ *
2903
+ * sparklineValues: ">primary|seriesByIndex(0)"
2904
+ * would configure sparklineValues with an array of data points
2905
+ * coming from the first series in the primary datasource
2906
+ *
2907
+ */
2908
+ VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
2909
+ VizBehavior["EVENTS"] = "events";
2910
+ /**
2911
+ * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
2912
+ * missing.
2913
+ * @type {string}
2914
+ */
2915
+
2916
+ VizBehavior["PLACEHOLDER"] = "placeholder";
2917
+ VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
2918
+ })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
2919
2919
 
2920
2920
  /***/ }),
2921
2921
 
2922
- /***/ 6:
2922
+ /***/ 60:
2923
2923
  /***/ (function(module, exports) {
2924
2924
 
2925
- module.exports = require("@babel/runtime/helpers/defineProperty");
2925
+ module.exports = require("@splunk/visualizations-shared/themeUtils");
2926
2926
 
2927
2927
  /***/ }),
2928
2928
 
2929
- /***/ 60:
2929
+ /***/ 61:
2930
2930
  /***/ (function(module, exports, __webpack_require__) {
2931
2931
 
2932
2932
  "use strict";
2933
2933
 
2934
2934
 
2935
- var _classCallCheck = __webpack_require__(10);
2935
+ var _classCallCheck = __webpack_require__(11);
2936
2936
 
2937
- var _createClass = __webpack_require__(18);
2937
+ var _createClass = __webpack_require__(19);
2938
2938
 
2939
2939
  Object.defineProperty(exports, "__esModule", {
2940
2940
  value: true
@@ -2995,7 +2995,7 @@ exports.ChartingApiFunctional = ChartingApiFunctional;
2995
2995
 
2996
2996
  /***/ }),
2997
2997
 
2998
- /***/ 61:
2998
+ /***/ 62:
2999
2999
  /***/ (function(module, exports) {
3000
3000
 
3001
3001
  module.exports = require("@splunk/visualizations-shared/simpleXMLOptions");
@@ -3005,28 +3005,28 @@ module.exports = require("@splunk/visualizations-shared/simpleXMLOptions");
3005
3005
  /***/ 7:
3006
3006
  /***/ (function(module, exports) {
3007
3007
 
3008
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
3008
+ module.exports = require("@babel/runtime/helpers/defineProperty");
3009
3009
 
3010
3010
  /***/ }),
3011
3011
 
3012
3012
  /***/ 8:
3013
3013
  /***/ (function(module, exports) {
3014
3014
 
3015
- module.exports = require("@splunk/themes/variables");
3015
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
3016
3016
 
3017
3017
  /***/ }),
3018
3018
 
3019
- /***/ 88:
3019
+ /***/ 9:
3020
3020
  /***/ (function(module, exports) {
3021
3021
 
3022
- module.exports = require("@splunk/visualization-encoding/utils/dsl");
3022
+ module.exports = require("@splunk/themes/variables");
3023
3023
 
3024
3024
  /***/ }),
3025
3025
 
3026
- /***/ 9:
3026
+ /***/ 92:
3027
3027
  /***/ (function(module, exports) {
3028
3028
 
3029
- module.exports = require("@splunk/visualizations-shared/Message");
3029
+ module.exports = require("@splunk/visualization-encoding/utils/dsl");
3030
3030
 
3031
3031
  /***/ })
3032
3032