@splunk/visualizations 25.0.1 → 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 (200) 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_PureMap_custom_base_layer_tile_server.png +0 -0
  8. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Background_color_cyan.png +0 -0
  9. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_after_default.png +0 -0
  10. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_before.png +0 -0
  11. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Background_Color_white_Under_Label_and_Unit_specified.png +0 -0
  12. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Major_Value_is_null.png +0 -0
  13. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_after_default.png +0 -0
  14. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_before.png +0 -0
  15. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
  16. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  17. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
  18. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  19. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  20. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  21. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Events_Editor.png +0 -0
  22. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  23. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
  24. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
  25. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  26. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  27. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
  28. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
  29. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  30. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  31. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
  32. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  33. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
  34. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
  35. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  36. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  37. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  38. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Background_Color_Light_Blue.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Basic_Events.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Event_Actions.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Actions.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary_Simulated_Instance.png +0 -0
  45. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields.png +0 -0
  46. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields_with_Highlight.png +0 -0
  47. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Show_Placeholder.png +0 -0
  48. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Height.png +0 -0
  49. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Percentage_50.png +0 -0
  50. package/.loki/reference/chrome_docker_Visualizations_Events_Events_With_Options.png +0 -0
  51. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_ES.png +0 -0
  52. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_after.png +0 -0
  53. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_before.png +0 -0
  54. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_After.png +0 -0
  55. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_Before.png +0 -0
  56. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_After.png +0 -0
  57. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_Before.png +0 -0
  58. package/Area.config.js +146 -157
  59. package/Area.config.js.map +1 -1
  60. package/Area.js +459 -545
  61. package/Area.js.map +1 -1
  62. package/Bar.config.js +148 -153
  63. package/Bar.config.js.map +1 -1
  64. package/Bar.js +468 -548
  65. package/Bar.js.map +1 -1
  66. package/Bubble.config.js +143 -123
  67. package/Bubble.config.js.map +1 -1
  68. package/Bubble.js +475 -530
  69. package/Bubble.js.map +1 -1
  70. package/ChoroplethSvg.config.js +87 -81
  71. package/ChoroplethSvg.config.js.map +1 -1
  72. package/ChoroplethSvg.js +352 -422
  73. package/ChoroplethSvg.js.map +1 -1
  74. package/Column.config.js +144 -151
  75. package/Column.config.js.map +1 -1
  76. package/Column.js +463 -546
  77. package/Column.js.map +1 -1
  78. package/Ellipse.config.js +86 -80
  79. package/Ellipse.config.js.map +1 -1
  80. package/Ellipse.js +319 -389
  81. package/Ellipse.js.map +1 -1
  82. package/Events.config.js +668 -0
  83. package/Events.config.js.map +1 -0
  84. package/Events.js +3116 -0
  85. package/Events.js.map +1 -0
  86. package/FillerGauge.config.js +94 -87
  87. package/FillerGauge.config.js.map +1 -1
  88. package/FillerGauge.js +352 -415
  89. package/FillerGauge.js.map +1 -1
  90. package/Image.config.js +74 -74
  91. package/Image.config.js.map +1 -1
  92. package/Image.js +713 -801
  93. package/Image.js.map +1 -1
  94. package/Line.config.js +145 -142
  95. package/Line.config.js.map +1 -1
  96. package/Line.js +471 -538
  97. package/Line.js.map +1 -1
  98. package/LinkGraph.config.js +120 -113
  99. package/LinkGraph.config.js.map +1 -1
  100. package/LinkGraph.js +24563 -717
  101. package/LinkGraph.js.map +1 -1
  102. package/Map.config.js +107 -100
  103. package/Map.config.js.map +1 -1
  104. package/Map.js +2358 -2465
  105. package/Map.js.map +1 -1
  106. package/Markdown.config.js +112 -112
  107. package/Markdown.config.js.map +1 -1
  108. package/Markdown.js +844 -918
  109. package/Markdown.js.map +1 -1
  110. package/MarkerGauge.config.js +185 -186
  111. package/MarkerGauge.config.js.map +1 -1
  112. package/MarkerGauge.js +1274 -1363
  113. package/MarkerGauge.js.map +1 -1
  114. package/ParallelCoordinates.config.js +137 -137
  115. package/ParallelCoordinates.config.js.map +1 -1
  116. package/ParallelCoordinates.js +732 -923
  117. package/ParallelCoordinates.js.map +1 -1
  118. package/Pie.config.js +132 -132
  119. package/Pie.config.js.map +1 -1
  120. package/Pie.js +1193 -1281
  121. package/Pie.js.map +1 -1
  122. package/Punchcard.config.js +138 -138
  123. package/Punchcard.config.js.map +1 -1
  124. package/Punchcard.js +2723 -2923
  125. package/Punchcard.js.map +1 -1
  126. package/Rectangle.config.js +267 -260
  127. package/Rectangle.config.js.map +1 -1
  128. package/Rectangle.js +1107 -1188
  129. package/Rectangle.js.map +1 -1
  130. package/Sankey.config.js +149 -142
  131. package/Sankey.config.js.map +1 -1
  132. package/Sankey.js +2613 -2808
  133. package/Sankey.js.map +1 -1
  134. package/Scatter.config.js +144 -123
  135. package/Scatter.config.js.map +1 -1
  136. package/Scatter.js +1820 -1889
  137. package/Scatter.js.map +1 -1
  138. package/SingleValue.config.js +121 -114
  139. package/SingleValue.config.js.map +1 -1
  140. package/SingleValue.js +2554 -2635
  141. package/SingleValue.js.map +1 -1
  142. package/SingleValueBasic.js +34 -34
  143. package/SingleValueBasic.js.map +1 -1
  144. package/SingleValueIcon.config.js +129 -120
  145. package/SingleValueIcon.config.js.map +1 -1
  146. package/SingleValueIcon.js +994 -1212
  147. package/SingleValueIcon.js.map +1 -1
  148. package/SingleValueRadial.config.js +216 -178
  149. package/SingleValueRadial.config.js.map +1 -1
  150. package/SingleValueRadial.js +2235 -2316
  151. package/SingleValueRadial.js.map +1 -1
  152. package/Table.config.js +150 -151
  153. package/Table.config.js.map +1 -1
  154. package/Table.js +2446 -2525
  155. package/Table.js.map +1 -1
  156. package/common/Charting.js +11 -11
  157. package/common/Charting.js.map +1 -1
  158. package/common/ChartingApi.js +2 -2
  159. package/common/ChartingApi.js.map +1 -1
  160. package/common/EventsDoc.js +25 -18
  161. package/common/EventsDoc.js.map +1 -1
  162. package/common/GaugeMajorTicks.js +10 -10
  163. package/common/GaugeMajorTicks.js.map +1 -1
  164. package/common/GaugeValueMarker.js +10 -10
  165. package/common/GaugeValueMarker.js.map +1 -1
  166. package/common/OptionsDoc.js +57 -357
  167. package/common/OptionsDoc.js.map +1 -1
  168. package/common/OverviewDoc.js +22 -22
  169. package/common/OverviewDoc.js.map +1 -1
  170. package/common/SplunkVisualization.js +4 -4
  171. package/common/SplunkVisualization.js.map +1 -1
  172. package/common/SplunkVisualizationApi.js +2 -2
  173. package/common/SplunkVisualizationApi.js.map +1 -1
  174. package/common/ThemesDoc.js +21 -21
  175. package/common/ThemesDoc.js.map +1 -1
  176. package/common/chartingUtils.js +4 -4
  177. package/common/chartingUtils.js.map +1 -1
  178. package/common/docUtils.js +4 -4
  179. package/common/docUtils.js.map +1 -1
  180. package/common/gaugeUtils.js +13 -13
  181. package/common/gaugeUtils.js.map +1 -1
  182. package/common/shapeUtils.js +8 -8
  183. package/common/shapeUtils.js.map +1 -1
  184. package/common/utils/configUtils.js +17 -18
  185. package/common/utils/configUtils.js.map +1 -1
  186. package/common/utils/{JSONSchemaUtils.js → dataUtils.js} +24 -25
  187. package/common/utils/dataUtils.js.map +1 -0
  188. package/common/utils/hocUtils.js +5 -85
  189. package/common/utils/hocUtils.js.map +1 -1
  190. package/common/utils/mapUtils.js +198 -0
  191. package/common/utils/mapUtils.js.map +1 -0
  192. package/common/utils/singleValueUtils.js +15 -12
  193. package/common/utils/singleValueUtils.js.map +1 -1
  194. package/common/utils/testHelper.js +8 -8
  195. package/common/utils/testHelper.js.map +1 -1
  196. package/common/withDashboardViz.js +120 -207
  197. package/common/withDashboardViz.js.map +1 -1
  198. package/package.json +16 -14
  199. package/.loki/reference/chrome_docker_PureVisualizations_SvgChoroplethDynamic_SVG_Of_Size_Greater_Than_2_MB_Render.png +0 -0
  200. package/common/utils/JSONSchemaUtils.js.map +0 -1
package/Scatter.js CHANGED
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 252);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 437);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -109,32 +109,155 @@ module.exports = require("react");
109
109
  /***/ 10:
110
110
  /***/ (function(module, exports) {
111
111
 
112
- module.exports = require("@splunk/themes/variables");
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/Message");
119
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
120
120
 
121
121
  /***/ }),
122
122
 
123
123
  /***/ 12:
124
124
  /***/ (function(module, exports) {
125
125
 
126
- module.exports = require("@babel/runtime/helpers/classCallCheck");
126
+ module.exports = require("@splunk/visualizations-shared/colorUtils");
127
127
 
128
128
  /***/ }),
129
129
 
130
130
  /***/ 13:
131
- /***/ (function(module, exports) {
131
+ /***/ (function(module, exports, __webpack_require__) {
132
132
 
133
- module.exports = require("@splunk/visualizations-shared/colorUtils");
133
+ "use strict";
134
+
135
+
136
+ Object.defineProperty(exports, "__esModule", {
137
+ value: true
138
+ });
139
+
140
+ var React = __webpack_require__(1);
141
+
142
+ var styled_components_1 = __webpack_require__(4);
143
+
144
+ var SizeAwareWrapper_1 = __webpack_require__(20);
145
+
146
+ var style_1 = __webpack_require__(15);
147
+
148
+ var colorUtils_1 = __webpack_require__(12);
149
+
150
+ var Item = styled_components_1.default.div.attrs(function (_ref) {
151
+ var width = _ref.width;
152
+ return {
153
+ style: {
154
+ width: style_1.toPx(width)
155
+ }
156
+ };
157
+ }).withConfig({
158
+ displayName: "FixedSizeContainer__Item",
159
+ componentId: "sc-1yhgpod-0"
160
+ })(["position:relative;background-color:", "};"], function (props) {
161
+ return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
162
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
163
+
164
+ var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
165
+ var width = _ref2.width,
166
+ height = _ref2.height;
167
+ return {
168
+ style: Object.assign(Object.assign({}, width && {
169
+ width: style_1.toPx(width)
170
+ }), height && {
171
+ height: style_1.toPx(height)
172
+ })
173
+ };
174
+ }).withConfig({
175
+ displayName: "FixedSizeContainer__FixSizeItem",
176
+ componentId: "sc-1yhgpod-1"
177
+ })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
178
+ return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
179
+ });
180
+ var ItemContent = styled_components_1.default.div.withConfig({
181
+ displayName: "FixedSizeContainer__ItemContent",
182
+ componentId: "sc-1yhgpod-2"
183
+ })(["position:relative;min-height:100px;width:100%;"]);
184
+ var FixSizeItemContent = styled_components_1.default.div.withConfig({
185
+ displayName: "FixedSizeContainer__FixSizeItemContent",
186
+ componentId: "sc-1yhgpod-3"
187
+ })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
188
+
189
+ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
190
+ var FixedSizeContainer = function FixedSizeContainer(props) {
191
+ var width = props.width,
192
+ height = props.height,
193
+ backgroundColor = props.backgroundColor;
194
+
195
+ if (!height) {
196
+ return React.createElement(Item, {
197
+ "data-test": "item",
198
+ width: width,
199
+ backgroundColor: backgroundColor
200
+ }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
201
+ }
202
+
203
+ return React.createElement(FixSizeItem, {
204
+ "data-test": "fix-size-item",
205
+ "data-splunk-visualization-version": "25.2.0 - 4373c5a66",
206
+ width: width,
207
+ height: height,
208
+ backgroundColor: backgroundColor
209
+ }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
210
+ var newWidth = _ref3.width,
211
+ newHeight = _ref3.height;
212
+ return React.createElement(Viz, Object.assign({}, props, {
213
+ width: newWidth,
214
+ height: newHeight
215
+ }));
216
+ })));
217
+ };
218
+
219
+ FixedSizeContainer.displayName = 'withFixedSizeContainer';
220
+ return FixedSizeContainer;
221
+ };
222
+
223
+ exports.default = withFixedSizeContainer;
224
+
225
+ /***/ }),
226
+
227
+ /***/ 14:
228
+ /***/ (function(module, exports, __webpack_require__) {
229
+
230
+ "use strict";
231
+
232
+
233
+ Object.defineProperty(exports, "__esModule", {
234
+ value: true
235
+ });
236
+ exports.extendStaticWrapperProps = void 0;
237
+ /**
238
+ * @method extendStaticWrapperProps
239
+ * @param {Object} props
240
+ * @param {DashboardVizType} props.Wrapper
241
+ * @param {DashboardVizType} props.Visualization
242
+ */
243
+
244
+ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
245
+ var Wrapper = _ref.Wrapper,
246
+ Visualization = _ref.Visualization;
247
+ var extendProperties = ['propTypes', 'defaultProps', 'config'];
248
+ extendProperties.forEach(function (prop) {
249
+ if (Visualization[prop]) {
250
+ // eslint-disable-next-line no-param-reassign
251
+ Wrapper[prop] = Visualization[prop];
252
+ }
253
+ });
254
+ };
255
+
256
+ exports.extendStaticWrapperProps = extendStaticWrapperProps;
134
257
 
135
258
  /***/ }),
136
259
 
137
- /***/ 138:
260
+ /***/ 149:
138
261
  /***/ (function(module, exports, __webpack_require__) {
139
262
 
140
263
  "use strict";
@@ -158,25 +281,25 @@ Object.defineProperty(exports, "__esModule", {
158
281
  });
159
282
  exports.config = exports.themes = exports.computeVizProps = void 0;
160
283
 
161
- var lodash_1 = __webpack_require__(2); // Charting imports i18n which needs to be run to instantiate window globals in the tests
284
+ var lodash_1 = __webpack_require__(3); // Charting imports i18n which needs to be run to instantiate window globals in the tests
162
285
  // eslint-disable-next-line import/order
163
286
 
164
287
 
165
- var Charting_1 = __webpack_require__(55);
288
+ var Charting_1 = __webpack_require__(56);
166
289
 
167
- var charting_bundle_1 = __webpack_require__(51);
290
+ var charting_bundle_1 = __webpack_require__(53);
168
291
 
169
- var simpleXMLOptions_1 = __webpack_require__(61);
292
+ var simpleXMLOptions_1 = __webpack_require__(62);
170
293
 
171
- var config_1 = __webpack_require__(253);
294
+ var config_1 = __webpack_require__(438);
172
295
 
173
296
  exports.config = config_1.default;
174
297
 
175
- var withDashboardViz_1 = __webpack_require__(30);
298
+ var withDashboardViz_1 = __webpack_require__(32);
176
299
 
177
- var scatterUtils_1 = __webpack_require__(254);
300
+ var scatterUtils_1 = __webpack_require__(439);
178
301
 
179
- var chartingUtils_1 = __webpack_require__(50);
302
+ var chartingUtils_1 = __webpack_require__(52);
180
303
 
181
304
  var validOptions = Object.keys(config_1.default.optionsSchema);
182
305
 
@@ -252,103 +375,6 @@ exports.default = Column;
252
375
 
253
376
  /***/ }),
254
377
 
255
- /***/ 14:
256
- /***/ (function(module, exports, __webpack_require__) {
257
-
258
- "use strict";
259
-
260
-
261
- Object.defineProperty(exports, "__esModule", {
262
- value: true
263
- });
264
-
265
- var React = __webpack_require__(1);
266
-
267
- var styled_components_1 = __webpack_require__(4);
268
-
269
- var SizeAwareWrapper_1 = __webpack_require__(18);
270
-
271
- var style_1 = __webpack_require__(15);
272
-
273
- var colorUtils_1 = __webpack_require__(13);
274
-
275
- var Item = styled_components_1.default.div.attrs(function (_ref) {
276
- var width = _ref.width;
277
- return {
278
- style: {
279
- width: style_1.toPx(width)
280
- }
281
- };
282
- }).withConfig({
283
- displayName: "FixedSizeContainer__Item",
284
- componentId: "sc-1yhgpod-0"
285
- })(["position:relative;background-color:", "};"], function (props) {
286
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
287
- }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
288
-
289
- var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
290
- var width = _ref2.width,
291
- height = _ref2.height;
292
- return {
293
- style: Object.assign(Object.assign({}, width && {
294
- width: style_1.toPx(width)
295
- }), height && {
296
- height: style_1.toPx(height)
297
- })
298
- };
299
- }).withConfig({
300
- displayName: "FixedSizeContainer__FixSizeItem",
301
- componentId: "sc-1yhgpod-1"
302
- })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
303
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
304
- });
305
- var ItemContent = styled_components_1.default.div.withConfig({
306
- displayName: "FixedSizeContainer__ItemContent",
307
- componentId: "sc-1yhgpod-2"
308
- })(["position:relative;min-height:100px;width:100%;"]);
309
- var FixSizeItemContent = styled_components_1.default.div.withConfig({
310
- displayName: "FixedSizeContainer__FixSizeItemContent",
311
- componentId: "sc-1yhgpod-3"
312
- })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
313
-
314
- var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
315
- var FixedSizeContainer = function FixedSizeContainer(props) {
316
- var width = props.width,
317
- height = props.height,
318
- backgroundColor = props.backgroundColor;
319
-
320
- if (!height) {
321
- return React.createElement(Item, {
322
- "data-test": "item",
323
- width: width,
324
- backgroundColor: backgroundColor
325
- }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
326
- }
327
-
328
- return React.createElement(FixSizeItem, {
329
- "data-test": "fix-size-item",
330
- "data-splunk-visualization-version": "25.0.1 - de10ad954",
331
- width: width,
332
- height: height,
333
- backgroundColor: backgroundColor
334
- }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
335
- var newWidth = _ref3.width,
336
- newHeight = _ref3.height;
337
- return React.createElement(Viz, Object.assign({}, props, {
338
- width: newWidth,
339
- height: newHeight
340
- }));
341
- })));
342
- };
343
-
344
- FixedSizeContainer.displayName = 'withFixedSizeContainer';
345
- return FixedSizeContainer;
346
- };
347
-
348
- exports.default = withFixedSizeContainer;
349
-
350
- /***/ }),
351
-
352
378
  /***/ 15:
353
379
  /***/ (function(module, exports) {
354
380
 
@@ -364,548 +390,563 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
364
390
  /***/ }),
365
391
 
366
392
  /***/ 17:
367
- /***/ (function(module, exports) {
393
+ /***/ (function(module, exports, __webpack_require__) {
368
394
 
369
- module.exports = require("@babel/runtime/helpers/createClass");
395
+ "use strict";
370
396
 
371
- /***/ }),
372
397
 
373
- /***/ 18:
374
- /***/ (function(module, exports) {
398
+ var _toConsumableArray = __webpack_require__(8);
375
399
 
376
- module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
400
+ var _defineProperty = __webpack_require__(7);
377
401
 
378
- /***/ }),
402
+ var __rest = this && this.__rest || function (s, e) {
403
+ var t = {};
379
404
 
380
- /***/ 2:
381
- /***/ (function(module, exports) {
405
+ for (var p in s) {
406
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
407
+ }
382
408
 
383
- module.exports = require("lodash");
409
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
410
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
411
+ }
412
+ return t;
413
+ };
384
414
 
385
- /***/ }),
415
+ Object.defineProperty(exports, "__esModule", {
416
+ value: true
417
+ });
418
+ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
386
419
 
387
- /***/ 20:
388
- /***/ (function(module, exports) {
420
+ var lodash_1 = __webpack_require__(3);
389
421
 
390
- module.exports = require("@splunk/themes/pick");
422
+ var schemaUtils_1 = __webpack_require__(16);
391
423
 
392
- /***/ }),
424
+ var VizBehavior_1 = __webpack_require__(6);
393
425
 
394
- /***/ 21:
395
- /***/ (function(module, exports) {
426
+ var dynamicOptionsDSLType = {
427
+ type: 'string',
428
+ pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
429
+ };
430
+ /**
431
+ * Helper function to extend an options schema with dynamic options DSL
432
+ * @param optionsSchema a visualization's options schema
433
+ * @returns an updated options schema that additionally allows strings starting with > for each option
434
+ */
396
435
 
397
- module.exports = require("@splunk/visualization-context/TimezoneContext");
436
+ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
437
+ var enhancedOptionsSchema = {};
438
+ Object.keys(optionsSchema).forEach(function (key) {
439
+ var _a = optionsSchema[key],
440
+ title = _a.title,
441
+ description = _a.description,
442
+ readOnly = _a.readOnly,
443
+ writeOnly = _a.writeOnly,
444
+ examples = _a.examples,
445
+ defaultValue = _a.default,
446
+ type = _a.type,
447
+ properties = _a.properties,
448
+ patternProperties = _a.patternProperties,
449
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
398
450
 
399
- /***/ }),
451
+ var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
452
+ title: title
453
+ }), description !== undefined && {
454
+ description: description
455
+ }), readOnly !== undefined && {
456
+ readOnly: readOnly
457
+ }), writeOnly !== undefined && {
458
+ writeOnly: writeOnly
459
+ }), examples !== undefined && {
460
+ examples: examples
461
+ }), defaultValue !== undefined && {
462
+ default: defaultValue
463
+ });
400
464
 
401
- /***/ 22:
402
- /***/ (function(module, exports) {
465
+ if (type === 'object') {
466
+ enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
467
+ type: type
468
+ }), properties && {
469
+ properties: enhanceOptionsSchemaWithDynamicOptions(properties)
470
+ });
403
471
 
404
- module.exports = require("@splunk/visualizations-shared/propUtils");
472
+ if (patternProperties) {
473
+ var enhancedPatternProperties = {};
474
+ Object.keys(patternProperties).forEach(function (opt) {
475
+ enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
476
+ });
477
+ enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
478
+ }
479
+ } else {
480
+ enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
481
+ anyOf: [Object.assign(Object.assign({}, type !== undefined && {
482
+ type: type
483
+ }), remainingSchemaEntry), dynamicOptionsDSLType]
484
+ });
485
+ }
486
+ });
487
+ return enhancedOptionsSchema;
488
+ }
405
489
 
406
- /***/ }),
490
+ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
491
+ /**
492
+ * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
493
+ * this function also collapse all editor panels
494
+ * @param vizConfig a Visualization Config
495
+ * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
496
+ * and containing `open: false` for all editor panels in editorConfig
497
+ */
407
498
 
408
- /***/ 24:
409
- /***/ (function(module, exports, __webpack_require__) {
499
+ function enhanceConfig(vizConfig) {
500
+ var enhancedConfig = vizConfig;
410
501
 
411
- "use strict";
502
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
503
+ enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
504
+ }
412
505
 
506
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
507
+ return Object.assign(Object.assign({}, config), {
508
+ open: false
509
+ });
510
+ });
511
+ return enhancedConfig;
512
+ }
413
513
 
414
- Object.defineProperty(exports, "__esModule", {
415
- value: true
416
- });
417
- exports.pickFieldFromJSONSchema = void 0;
514
+ exports.enhanceConfig = enhanceConfig;
515
+ /**
516
+ * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
517
+ * Created for editor unit tests
518
+ * @param vizConfig a Visualization Config
519
+ * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
520
+ */
418
521
 
419
- var lodash_1 = __webpack_require__(2);
522
+ function uncollapseEditorConfig(vizConfig) {
523
+ var editorPanelUncollapsedConfig = vizConfig;
524
+ editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
525
+ return Object.assign(Object.assign({}, config), {
526
+ open: true
527
+ });
528
+ });
529
+ return editorPanelUncollapsedConfig;
530
+ }
420
531
 
421
- var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
422
- var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
423
- return Object.keys(optionsSchema).reduce(function (accum, k) {
424
- if (lodash_1.has(optionsSchema[k], fieldName)) {
425
- accum[k] = optionsSchema[k][fieldName];
426
- } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
427
- var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
532
+ exports.uncollapseEditorConfig = uncollapseEditorConfig;
428
533
 
429
- if (!lodash_1.isEmpty(nestedSchema)) {
430
- accum[k] = nestedSchema;
431
- }
432
- }
534
+ function isDynamicOption(option) {
535
+ return option && typeof option === 'string' && option.trim().startsWith('>') || false;
536
+ }
433
537
 
434
- return accum;
435
- }, {});
436
- };
538
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
539
+ // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
437
540
 
438
- exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
541
+ /**
542
+ * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
543
+ * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
544
+ * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
545
+ * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
546
+ *
547
+ * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
548
+ */
439
549
 
440
- /***/ }),
550
+ function hasCompatibleContexts(vizContext, presetContext) {
551
+ var presetContextKeys = Object.keys(presetContext);
552
+ return presetContextKeys.every(function (contextKey) {
553
+ return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
554
+ });
555
+ }
556
+ /**
557
+ * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
558
+ */
441
559
 
442
- /***/ 25:
443
- /***/ (function(module, exports) {
444
560
 
445
- module.exports = require("@babel/runtime/helpers/typeof");
561
+ function hasCompatibleOptions(vizOptions, presetOptions) {
562
+ var presetOptionKeys = Object.keys(presetOptions);
563
+ return presetOptionKeys.every(function (optionKey) {
564
+ return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
565
+ });
566
+ }
567
+ /**
568
+ * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
569
+ * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
570
+ *
571
+ * @param {Object} vizContext - the current vizContext definition
572
+ * @param {Object} vizOptions - the current vizOptions definition
573
+ * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
574
+ */
446
575
 
447
- /***/ }),
448
576
 
449
- /***/ 252:
450
- /***/ (function(module, exports, __webpack_require__) {
577
+ function getInitialPreset(vizContext, vizOptions, presets) {
578
+ return presets.find(function (preset) {
579
+ var presetContext = lodash_1.get(preset, ['value', 'context'], {});
580
+ var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
581
+ var presetContextKeys = Object.keys(presetContext);
582
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
583
+ // if not, then the preset is invalid in config.ts
451
584
 
452
- "use strict";
585
+ if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
586
+ return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
587
+ });
588
+ }
453
589
 
590
+ exports.getInitialPreset = getInitialPreset;
591
+ /**
592
+ * generates number precision values for a Select editor
593
+ *
594
+ * @param {Number} numPrecisionValues - number of integer precision values to generate
595
+ * @returns {{ label: string; value; string }[]} array of { label, value } tuples
596
+ */
454
597
 
455
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
456
- if (k2 === undefined) k2 = k;
457
- Object.defineProperty(o, k2, {
458
- enumerable: true,
459
- get: function get() {
460
- return m[k];
461
- }
598
+ function generatePrecisionValues(numPrecisionValues) {
599
+ return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
600
+ return {
601
+ label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
602
+ value: i
603
+ };
462
604
  });
463
- } : function (o, m, k, k2) {
464
- if (k2 === undefined) k2 = k;
465
- o[k2] = m[k];
466
- });
605
+ }
467
606
 
468
- var __exportStar = this && this.__exportStar || function (m, exports) {
469
- for (var p in m) {
470
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
607
+ exports.generatePrecisionValues = generatePrecisionValues;
608
+ /**
609
+ * insert layout in layout array, return a new layout array instead of updating the original
610
+ *
611
+ * @param {EditorLayoutConfig[][]} layout - editor layout
612
+ * @param {Number} index - the index to insert layout item(s)
613
+ * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
614
+ * @returns {EditorLayoutConfig[][]} new editor layout with insertion
615
+ */
616
+
617
+ var insertLayout = function insertLayout(layout, index) {
618
+ for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
619
+ layoutItems[_key - 2] = arguments[_key];
471
620
  }
621
+
622
+ return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
472
623
  };
473
624
 
474
- Object.defineProperty(exports, "__esModule", {
475
- value: true
476
- });
477
- exports.default = void 0;
625
+ exports.insertLayout = insertLayout;
478
626
 
479
- __exportStar(__webpack_require__(138), exports);
627
+ /***/ }),
480
628
 
481
- var Scatter_1 = __webpack_require__(138);
629
+ /***/ 19:
630
+ /***/ (function(module, exports) {
482
631
 
483
- Object.defineProperty(exports, "default", {
484
- enumerable: true,
485
- get: function get() {
486
- return Scatter_1.default;
487
- }
488
- });
632
+ module.exports = require("@babel/runtime/helpers/createClass");
489
633
 
490
634
  /***/ }),
491
635
 
492
- /***/ 253:
493
- /***/ (function(module, exports, __webpack_require__) {
636
+ /***/ 2:
637
+ /***/ (function(module, exports) {
494
638
 
495
- "use strict";
639
+ module.exports = require("@splunk/ui-utils/i18n");
496
640
 
641
+ /***/ }),
497
642
 
498
- var _toConsumableArray = __webpack_require__(9);
643
+ /***/ 20:
644
+ /***/ (function(module, exports) {
499
645
 
500
- Object.defineProperty(exports, "__esModule", {
501
- value: true
502
- });
503
- exports.optionsSchema = void 0;
646
+ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
504
647
 
505
- var visualization_icons_1 = __webpack_require__(46);
648
+ /***/ }),
506
649
 
507
- var placeholders_1 = __webpack_require__(45);
650
+ /***/ 21:
651
+ /***/ (function(module, exports) {
508
652
 
509
- var pick_1 = __webpack_require__(20);
653
+ module.exports = require("@splunk/themes/pick");
510
654
 
511
- var variables_1 = __webpack_require__(10);
655
+ /***/ }),
512
656
 
513
- var schemaUtils_1 = __webpack_require__(16);
657
+ /***/ 23:
658
+ /***/ (function(module, exports) {
514
659
 
515
- var visualization_color_palettes_1 = __webpack_require__(44);
660
+ module.exports = require("@splunk/visualization-context/TimezoneContext");
516
661
 
517
- var i18n_1 = __webpack_require__(3);
662
+ /***/ }),
518
663
 
519
- var VizBehavior_1 = __webpack_require__(5);
664
+ /***/ 24:
665
+ /***/ (function(module, exports) {
520
666
 
521
- var VizCategory_1 = __webpack_require__(29);
667
+ module.exports = require("@splunk/visualizations-shared/propUtils");
522
668
 
523
- var configUtils_1 = __webpack_require__(6);
669
+ /***/ }),
524
670
 
525
- var AxesChartDataConfig_1 = __webpack_require__(63);
671
+ /***/ 25:
672
+ /***/ (function(module, exports) {
526
673
 
527
- var AxesChartXGridAndLabels_1 = __webpack_require__(66);
674
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
528
675
 
529
- var AxesChartColorAndStyle_1 = __webpack_require__(64);
676
+ /***/ }),
530
677
 
531
- var AxesChartLegend_1 = __webpack_require__(65);
678
+ /***/ 26:
679
+ /***/ (function(module, exports) {
532
680
 
533
- var AxesChartYGridAndLabels_1 = __webpack_require__(67);
681
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
534
682
 
535
- var dataContract = {
536
- requiredDataSources: [{
537
- name: 'primary',
538
- description: 'DataSource that powers the visualization'
539
- }],
540
- optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
541
- // {
542
- // name: 'annotation',
543
- // description: 'DataSource that populates event annotations',
544
- // },
545
- ],
546
- initialRequestParams: {
547
- primary: {
548
- offset: 0,
549
- count: 10000
550
- },
551
- annotation: {
552
- offset: 0,
553
- count: 10000
554
- }
683
+ /***/ }),
684
+
685
+ /***/ 27:
686
+ /***/ (function(module, exports, __webpack_require__) {
687
+
688
+ "use strict";
689
+
690
+
691
+ Object.defineProperty(exports, "__esModule", {
692
+ value: true
693
+ });
694
+ exports.shouldShowIconPlaceholder = void 0;
695
+
696
+ var React = __webpack_require__(1);
697
+
698
+ var T = __webpack_require__(0);
699
+
700
+ var lodash_1 = __webpack_require__(3);
701
+
702
+ var i18n_1 = __webpack_require__(2);
703
+
704
+ var Message_1 = __webpack_require__(10);
705
+
706
+ var FixedSizeContainer_1 = __webpack_require__(13);
707
+ /**
708
+ * @method shouldShowIconPlaceholder
709
+ * @param {object} dataSources
710
+ * @param {boolean} loading
711
+ * @returns {boolean}
712
+ */
713
+
714
+
715
+ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
716
+ var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
717
+ var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
718
+ var noData = data === undefined;
719
+ var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
720
+ var noFields = fields === undefined;
721
+ return loading || noData || noFields;
722
+ };
723
+
724
+ exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
725
+ var propTypes = {
726
+ icon: T.func,
727
+ width: T.oneOfType([T.string, T.number]),
728
+ height: T.oneOfType([T.string, T.number]),
729
+ // eslint-disable-next-line react/no-unused-prop-types
730
+ backgroundColor: T.string,
731
+ iconColor: T.string
732
+ };
733
+ /**
734
+ * @method IconPlaceholder
735
+ * @param {IconPlaceholderProps} props
736
+ * @returns {React.ReactElement}
737
+ */
738
+
739
+ var IconPlaceholder = function IconPlaceholder(props) {
740
+ var width = props.width,
741
+ height = props.height,
742
+ icon = props.icon,
743
+ iconColor = props.iconColor;
744
+
745
+ if (icon) {
746
+ return React.createElement(icon, {
747
+ style: {
748
+ left: '50%',
749
+ top: '50%',
750
+ color: iconColor,
751
+ opacity: 0.15,
752
+ position: 'absolute',
753
+ transform: 'translate(-50%, -50%)'
754
+ },
755
+ width: '50%',
756
+ height: '50%'
757
+ });
555
758
  }
759
+
760
+ return React.createElement(Message_1.default, {
761
+ width: width,
762
+ height: height,
763
+ level: "warning",
764
+ message: i18n_1._('No DataSource Connected')
765
+ });
556
766
  };
557
- var size = {
558
- initialWidth: 300,
559
- initialHeight: 300
767
+
768
+ IconPlaceholder.propTypes = propTypes;
769
+ IconPlaceholder.defaultProps = {
770
+ width: '100%',
771
+ height: 250
560
772
  };
561
- var defaultContext = {};
562
- exports.optionsSchema = {
563
- x: {
564
- default: '> primary | seriesByIndex(0)',
565
- description: 'Specify the dataSource applied to the x-axis.',
566
- type: 'array',
567
- items: {
568
- type: ['string', 'number']
773
+ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
774
+
775
+ /***/ }),
776
+
777
+ /***/ 28:
778
+ /***/ (function(module, exports, __webpack_require__) {
779
+
780
+ "use strict";
781
+
782
+
783
+ var _defineProperty = __webpack_require__(7);
784
+
785
+ Object.defineProperty(exports, "__esModule", {
786
+ value: true
787
+ });
788
+ exports.getSortingParams = exports.SortParamsPropTypes = void 0;
789
+
790
+ var T = __webpack_require__(0);
791
+
792
+ var lodash_1 = __webpack_require__(3);
793
+
794
+ var DataSource_1 = __webpack_require__(39);
795
+
796
+ exports.SortParamsPropTypes = T.shape({
797
+ currentSortKey: T.string,
798
+ currentSortDir: T.oneOf(DataSource_1.validSortDirs),
799
+ onSort: T.func
800
+ });
801
+
802
+ var getSortingParams = function getSortingParams(_ref) {
803
+ var requestParams = _ref.requestParams,
804
+ onRequestParamsChange = _ref.onRequestParamsChange;
805
+ var currentSortKey;
806
+ var currentSortDir;
807
+ var nextSortDirMap = {
808
+ asc: 'desc',
809
+ desc: 'asc',
810
+ none: 'asc'
811
+ };
812
+ var onSort;
813
+
814
+ if (lodash_1.isFunction(onRequestParamsChange)) {
815
+ if (requestParams && lodash_1.has(requestParams, 'sort')) {
816
+ currentSortKey = Object.keys(requestParams.sort).shift();
817
+ currentSortDir = requestParams.sort[currentSortKey];
818
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
819
+
820
+
821
+ onSort = function onSort(e, _ref2) {
822
+ var sortKey = _ref2.sortKey,
823
+ sortDir = _ref2.sortDir;
824
+
825
+ if (typeof sortKey === 'string') {
826
+ var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
827
+ onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
828
+ offset: 0,
829
+ sort: _defineProperty({}, sortKey, nextSortDir)
830
+ }));
831
+ } else {
832
+ onRequestParamsChange(requestParams);
833
+ }
834
+ };
835
+ }
836
+
837
+ return {
838
+ currentSortKey: currentSortKey,
839
+ currentSortDir: currentSortDir,
840
+ onSort: onSort
841
+ };
842
+ };
843
+
844
+ exports.getSortingParams = getSortingParams;
845
+
846
+ /***/ }),
847
+
848
+ /***/ 29:
849
+ /***/ (function(module, exports, __webpack_require__) {
850
+
851
+ "use strict";
852
+
853
+
854
+ Object.defineProperty(exports, "__esModule", {
855
+ value: true
856
+ });
857
+ exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
858
+
859
+ var T = __webpack_require__(0);
860
+
861
+ var lodash_1 = __webpack_require__(3);
862
+
863
+ exports.PaginatorParamsPropTypes = T.shape({
864
+ isPaging: T.bool,
865
+ current: T.number,
866
+ totalPages: T.number,
867
+ onChange: T.func
868
+ });
869
+
870
+ var getPaginationParams = function getPaginationParams(_ref) {
871
+ var requestParams = _ref.requestParams,
872
+ meta = _ref.meta,
873
+ onRequestParamsChange = _ref.onRequestParamsChange;
874
+ var totalCount = meta && meta.totalCount || 0;
875
+ var offset = requestParams && requestParams.offset || 0;
876
+ var count = requestParams && requestParams.count;
877
+ var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
878
+ var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
879
+ var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
880
+
881
+ var onChangeHandler = function onChangeHandler(e, _ref2) {
882
+ var page = _ref2.page,
883
+ countArg = _ref2.count;
884
+ var newParams = lodash_1.cloneDeep(requestParams);
885
+
886
+ if (typeof countArg === 'number') {
887
+ newParams.count = countArg;
888
+ newParams.offset = 0;
569
889
  }
570
- },
571
- y: {
572
- default: '> primary | seriesByIndex(1)',
573
- description: 'Specify the dataSource applied to the y-axis.',
574
- type: 'array',
575
- items: {
576
- type: ['string', 'number']
890
+
891
+ var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
892
+
893
+ if (typeof page === 'number' && page > 0) {
894
+ newParams.count = pageCount;
895
+ newParams.offset = (page - 1) * pageCount;
577
896
  }
578
- },
579
- category: {
580
- description: 'Specify a sequence of dataSource events to be plotted on the chart.',
581
- type: 'array',
582
- items: {
583
- type: ['string', 'number']
584
- },
585
- default: '> primary | seriesByIndex(2)'
586
- },
587
- xField: {
588
- default: '> x | getField()',
589
- description: 'Specify the field that should be mapped to the x-axis.',
590
- type: 'string'
591
- },
592
- yField: {
593
- default: '> y | getField()',
594
- description: 'Specify the field that should be mapped to the y-axis.',
595
- type: 'string'
596
- },
597
- categoryField: {
598
- default: '> category | getField()',
599
- description: 'Specify the field that should be mapped to the series categories.',
600
- type: 'string'
601
- },
602
- backgroundColor: {
603
- default: '> themes.defaultBackgroundColor',
604
- description: 'Specify the color used for the background. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
605
- pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN,
606
- type: 'string'
607
- },
608
- legendDisplay: {
609
- default: 'right',
610
- description: 'Specify the location of the legend on the panel.',
611
- pattern: schemaUtils_1.getPattern(['right', 'left', 'top', 'bottom', 'off']),
612
- type: 'string'
613
- },
614
- legendTruncation: {
615
- default: 'ellipsisEnd',
616
- description: 'Specify how to display legend labels when they overflow the layout boundaries by replacing overflow text with an ellipsis.',
617
- pattern: schemaUtils_1.getPattern(['ellipsisEnd', 'ellipsisMiddle', 'ellipsisStart', 'ellipsisOff']),
618
- type: 'string'
619
- },
620
- markerSize: {
621
- description: 'Specify, in pixels, the size of each scatter marker.',
622
- type: 'number',
623
- default: 4
624
- },
625
- resultLimit: {
626
- default: 50000,
627
- description: 'Specify the number of data points rendered in a chart.',
628
- type: 'number'
629
- },
630
- seriesColors: {
631
- default: visualization_color_palettes_1.VIZ_CATEGORICAL,
632
- description: 'Specify the colors used for a series. For example, ["#FF0000", "#0000FF", "#008000"].',
633
- type: 'array',
634
- items: {
635
- type: 'string'
636
- }
637
- },
638
- seriesColorsByField: {
639
- description: 'Specify the colors used for specific fields in a series. For example: {"count": "#008000", "percent": "#FFA500"}.',
640
- type: 'object'
641
- },
642
- showXAxisExtendedRange: {
643
- default: true,
644
- description: 'Specify whether the x-axis should be extended to snap to whole major tick marks.',
645
- type: 'boolean'
646
- },
647
- showYAxisExtendedRange: {
648
- default: true,
649
- description: 'Specify whether the y-axis should be extended to snap to whole major tick marks.',
650
- type: 'boolean'
651
- },
652
- showXAxisWithZero: {
653
- default: false,
654
- description: 'Specify whether the x-axis range includes zero.',
655
- type: 'boolean'
656
- },
657
- showYAxisWithZero: {
658
- default: false,
659
- description: 'Specify whether the y-axis range includes zero.',
660
- type: 'boolean'
661
- },
662
- showRoundedXAxisLabels: {
663
- default: false,
664
- description: 'Specify whether to round x-axis values to the nearest integer.',
665
- type: 'boolean'
666
- },
667
- // TODO: figure out if we want to change splunk-charting behavior for Bubble/Scatter, which hardcodes XMajorGridlines to false
668
- // showXMajorGridLines: {
669
- // default: false,
670
- // description: 'Specify whether major grid lines are visible on the x-axis.',
671
- // type: 'boolean',
672
- // },
673
- showYMajorGridLines: {
674
- default: true,
675
- description: 'Specify whether major grid lines are visible on the y-axis.',
676
- type: 'boolean'
677
- },
678
- showXMinorGridLines: {
679
- default: false,
680
- description: 'Specify whether minor grid lines are visible on the x-axis.',
681
- type: 'boolean'
682
- },
683
- showYMinorGridLines: {
684
- default: false,
685
- description: 'Specify whether minor grid lines are visible on the y-axis.',
686
- type: 'boolean'
687
- },
688
- xAxisLabelRotation: {
689
- default: 0,
690
- description: 'Specify the rotation of the x-axis labels in degrees.',
691
- type: 'number',
692
- enum: [-90, -45, 0, 45, 90]
693
- },
694
- xAxisAbbreviation: {
695
- default: 'off',
696
- description: 'Specify whether to abbreviate large x-axis values with the closest SI prefix.',
697
- enum: ['off', 'auto'],
698
- pattern: schemaUtils_1.getPattern(['auto', 'off']),
699
- type: 'string'
700
- },
701
- yAxisAbbreviation: {
702
- default: 'auto',
703
- description: 'Specify whether to abbreviate large y-axis values with the closest SI prefix.',
704
- enum: ['off', 'auto'],
705
- pattern: schemaUtils_1.getPattern(['auto', 'off']),
706
- type: 'string'
707
- },
708
- xAxisLabelVisibility: {
709
- default: 'auto',
710
- description: 'Specify whether to show or hide labels on the x-axis.',
711
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
712
- type: 'string'
713
- },
714
- yAxisLabelVisibility: {
715
- default: 'auto',
716
- description: 'Specify whether to show or hide labels on the y-axis.',
717
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
718
- type: 'string'
719
- },
720
- xAxisLineVisibility: {
721
- default: 'hide',
722
- description: 'Specify whether to show or hide the x-axis line.',
723
- enum: ['hide', 'show'],
724
- pattern: schemaUtils_1.getPattern(['show', 'hide']),
725
- type: 'string'
726
- },
727
- yAxisLineVisibility: {
728
- default: 'hide',
729
- description: 'Specify whether to show or hide the y-axis line.',
730
- enum: ['hide', 'show'],
731
- pattern: schemaUtils_1.getPattern(['show', 'hide']),
732
- type: 'string'
733
- },
734
- xAxisMajorTickInterval: {
735
- default: 'auto',
736
- description: 'Specify the spacing interval at which to place major tick marks along the numeric x-axis. By default, this value is automatically calculated based on the scale of the related axis.',
737
- type: ['string', 'number']
738
- },
739
- yAxisMajorTickInterval: {
740
- default: 'auto',
741
- description: 'Specify the spacing interval at which to place major tick marks along the numeric y-axis. By default, this value is automatically calculated based on the scale of the related axis.',
742
- type: ['string', 'number']
743
- },
744
- xAxisMajorTickSize: {
745
- default: 6,
746
- description: 'Specify the size, in pixels, of major tick marks on the x-axis.',
747
- type: 'number'
748
- },
749
- yAxisMajorTickSize: {
750
- default: 6,
751
- description: 'Specify the size, in pixels, of major tick marks on the y-axis.',
752
- type: 'number'
753
- },
754
- xAxisMinorTickSize: {
755
- default: 6,
756
- description: 'Specify the size, in pixels, of minor tick marks on the x-axis.',
757
- type: 'number'
758
- },
759
- yAxisMinorTickSize: {
760
- default: 6,
761
- description: 'Specify the size, in pixels, of minor tick marks on the y-axis.',
762
- type: 'number'
763
- },
764
- xAxisMajorTickVisibility: {
765
- default: 'auto',
766
- description: 'Specify whether to show or hide major tick marks on the x-axis.',
767
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
768
- type: 'string'
769
- },
770
- yAxisMajorTickVisibility: {
771
- default: 'auto',
772
- description: 'Specify whether to show or hide major tick marks on the y-axis.',
773
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
774
- type: 'string'
775
- },
776
- xAxisMinorTickVisibility: {
777
- default: 'auto',
778
- description: 'Specify whether to show or hide minor tick marks on the x-axis .',
779
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
780
- type: 'string'
781
- },
782
- yAxisMinorTickVisibility: {
783
- default: 'auto',
784
- description: 'Specify whether to show or hide minor tick marks on the y-axis.',
785
- pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
786
- type: 'string'
787
- },
788
- xAxisMax: {
789
- default: 'auto',
790
- description: 'Specify the maximum number for the range of the visible x-axis.',
791
- type: ['string', 'number']
792
- },
793
- yAxisMax: {
794
- default: 'auto',
795
- description: 'Specify the maximum number for the range of the visible y-axis.',
796
- type: ['string', 'number']
797
- },
798
- xAxisMin: {
799
- default: 'auto',
800
- description: 'Specify the minimum number for the range of the visible x-axis.',
801
- type: ['string', 'number']
802
- },
803
- yAxisMin: {
804
- default: 'auto',
805
- description: 'Specify the minimum number for the range of the visible y-axis.',
806
- type: ['string', 'number']
807
- },
808
- xAxisScale: {
809
- default: 'linear',
810
- description: 'Specify the type of scale that applies to a numerical x-axis.',
811
- pattern: schemaUtils_1.getPattern(['linear', 'log']),
812
- type: 'string'
813
- },
814
- yAxisScale: {
815
- default: 'linear',
816
- description: 'Specify the type of scale that applies to a numerical y-axis.',
817
- pattern: schemaUtils_1.getPattern(['linear', 'log']),
818
- type: 'string'
819
- },
820
- xAxisTitleText: {
821
- description: 'Specify the title of the x-axis.',
822
- type: 'string'
823
- },
824
- yAxisTitleText: {
825
- description: 'Specify the title of the y-axis.',
826
- type: 'string'
827
- },
828
- xAxisTitleVisibility: {
829
- default: 'show',
830
- description: 'Specify whether to show or hide the title of the x-axis.',
831
- enum: ['hide', 'show'],
832
- pattern: schemaUtils_1.getPattern(['show', 'hide']),
833
- type: 'string'
834
- },
835
- yAxisTitleVisibility: {
836
- default: 'show',
837
- description: 'Specify whether to show or hide the title of the y-axis.',
838
- enum: ['hide', 'show'],
839
- pattern: schemaUtils_1.getPattern(['show', 'hide']),
840
- type: 'string'
841
- }
842
- };
843
- var themes = {
844
- defaultBackgroundColor: function defaultBackgroundColor(props) {
845
- return pick_1.default({
846
- enterprise: {
847
- dark: variables_1.default.black(props),
848
- light: variables_1.default.backgroundColor(props)
849
- },
850
- prisma: variables_1.default.backgroundColorSidebar(props)
851
- })(props);
852
- }
897
+
898
+ onRequestParamsChange(newParams);
899
+ };
900
+
901
+ return {
902
+ isPaging: isPaging,
903
+ current: current,
904
+ totalPages: totalPages,
905
+ onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
906
+ };
853
907
  };
854
- var editorConfig = [AxesChartDataConfig_1.AxesChartDataConfigScatter, {
855
- label: AxesChartColorAndStyle_1.default.label,
856
- layout: [].concat(_toConsumableArray(AxesChartColorAndStyle_1.default.layout), [[{
857
- label: i18n_1._('Marker size'),
858
- option: 'markerSize',
859
- editor: 'editor.slider',
860
- editorProps: {
861
- min: 0,
862
- max: 20,
863
- step: 1
864
- }
865
- }]])
866
- }, AxesChartLegend_1.default, AxesChartXGridAndLabels_1.AxesChartXGridAndLabelsBubbleScatter, AxesChartYGridAndLabels_1.default];
867
- /**
868
- * visualization configuration
869
- */
870
908
 
871
- var config = {
872
- /**
873
- * unique viz key
874
- */
875
- key: 'splunk.scatter',
909
+ exports.getPaginationParams = getPaginationParams;
876
910
 
877
- /**
878
- * viz name
879
- */
880
- name: 'Scatter',
881
- category: VizCategory_1.VizCategory.COMPARISONS,
911
+ /***/ }),
882
912
 
883
- /**
884
- * viz icon
885
- */
886
- icon: visualization_icons_1.Scatter,
887
- placeholderIcon: placeholders_1.Scatter,
888
- dataContract: dataContract,
889
- size: size,
890
- defaultContext: defaultContext,
891
- optionsSchema: exports.optionsSchema,
892
- editorConfig: editorConfig,
893
- events: {
894
- 'legend.click': {
895
- description: 'triggered when user clicks on chart legend'
896
- },
897
- 'point.click': {
898
- description: 'triggered when user clicks on a point in the scatter chart'
899
- }
900
- },
901
- supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
902
- themes: themes
903
- };
904
- exports.default = configUtils_1.enhanceConfig(config);
913
+ /***/ 3:
914
+ /***/ (function(module, exports) {
915
+
916
+ module.exports = require("lodash");
917
+
918
+ /***/ }),
919
+
920
+ /***/ 31:
921
+ /***/ (function(module, exports, __webpack_require__) {
922
+
923
+ "use strict";
924
+
925
+
926
+ Object.defineProperty(exports, "__esModule", {
927
+ value: true
928
+ });
929
+ exports.VizCategory = void 0;
930
+ var VizCategory;
931
+
932
+ (function (VizCategory) {
933
+ VizCategory["SINGLE_VALUE"] = "Single Value";
934
+ VizCategory["TRENDS"] = "Trends";
935
+ VizCategory["COMPARISONS"] = "Comparisons";
936
+ VizCategory["TABLE"] = "Table";
937
+ VizCategory["GAUGE"] = "Gauge";
938
+ VizCategory["DISTRIBUTIONS"] = "Distributions";
939
+ VizCategory["CHOROPLETH"] = "Choropleth Maps";
940
+ VizCategory["SHAPES"] = "Shapes";
941
+ VizCategory["MISC"] = "misc";
942
+ VizCategory["FLOW"] = "Flow";
943
+ VizCategory["CORRELATION"] = "Correlation";
944
+ VizCategory["SPATIAL"] = "Spatial";
945
+ })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
905
946
 
906
947
  /***/ }),
907
948
 
908
- /***/ 254:
949
+ /***/ 32:
909
950
  /***/ (function(module, exports, __webpack_require__) {
910
951
 
911
952
  "use strict";
@@ -914,270 +955,529 @@ exports.default = configUtils_1.enhanceConfig(config);
914
955
  Object.defineProperty(exports, "__esModule", {
915
956
  value: true
916
957
  });
917
- exports.convertToScatterSCProperties = exports.mapToOldKey = exports.convertToStringValues = exports.scatterOptionValuesSCMapping = void 0;
918
958
 
919
- var lodash_1 = __webpack_require__(2);
959
+ var React = __webpack_require__(1);
920
960
 
921
- var propUtils_1 = __webpack_require__(22);
961
+ var lodash_1 = __webpack_require__(3);
922
962
 
923
- var chartingUtils_1 = __webpack_require__(50); // map for key names which are either new or not present in SimpleXML options mapping
963
+ var getSettingsFromThemedProps_1 = __webpack_require__(33);
924
964
 
965
+ var Options_1 = __webpack_require__(34);
925
966
 
926
- var scatterOptionsSCMapping = {
927
- xAxisLabelRotation: 'xAxisMajorLabelRotation',
928
- xAxisLabelVisibility: 'xAxisMajorLabelVisibility',
929
- yAxisLabelVisibility: 'yAxisMajorLabelVisibility',
930
- showRoundedXAxisLabels: 'roundXAxisLabelsToInteger',
931
- xAxisLineVisibility: 'xAxisVisibility',
932
- yAxisLineVisibility: 'yAxisVisibility',
933
- showYMajorGridLines: 'showMajorYGridLines',
934
- showXMinorGridLines: 'showMinorXGridLines',
935
- showYMinorGridLines: 'showMinorYGridLines',
936
- xAxisMajorTickInterval: 'xAxisMajorUnit',
937
- yAxisMajorTickInterval: 'yAxisMajorUnit',
938
- showXAxisExtendedRange: 'xAxisExtendsAxisRange',
939
- showYAxisExtendedRange: 'yAxisExtendsAxisRange',
940
- showXAxisWithZero: 'xAxisIncludeZero',
941
- showYAxisWithZero: 'yAxisIncludeZero',
942
- legendTruncation: 'legendLabelOverflowMode',
943
- legendDisplay: 'legendPlacement',
944
- resultLimit: 'resultTruncationLimit',
945
- seriesColorsByField: 'fieldColors',
946
- bubbleSizeMax: 'bubbleMaxSize',
947
- bubbleSizeMin: 'bubbleMinSize',
948
- bubbleSizeMethod: 'bubbleSizeBy'
949
- }; // key value mapping of what options (and their corresponding values) which we expose in config.ts to property values SC understands
967
+ var SanitizeProps_1 = __webpack_require__(35);
950
968
 
951
- exports.scatterOptionValuesSCMapping = {
952
- xAxisTitleVisibility: {
953
- hide: 'collapsed'
954
- },
955
- yAxisTitleVisibility: {
956
- hide: 'collapsed'
957
- },
958
- yAxisAbbreviation: {
959
- off: 'none'
960
- },
961
- legendPlacement: {
962
- off: 'none'
963
- },
964
- legendLabelOverflowMode: {
965
- ellipsisOff: 'ellipsisNone'
966
- }
967
- };
969
+ var TimezoneContext_1 = __webpack_require__(23);
970
+
971
+ var moment_1 = __webpack_require__(36);
972
+
973
+ var styled_components_1 = __webpack_require__(4);
974
+
975
+ var hocUtils_1 = __webpack_require__(25);
976
+
977
+ var JSONSchemaUtils_1 = __webpack_require__(26);
978
+
979
+ var SplunkVisualization_1 = __webpack_require__(37);
980
+
981
+ var VizBehavior_1 = __webpack_require__(6);
982
+
983
+ var getSorting_1 = __webpack_require__(28);
984
+
985
+ var getPagination_1 = __webpack_require__(29);
986
+
987
+ var useDeepMemo_1 = __webpack_require__(40);
988
+
989
+ var MissingPropsMessage_1 = __webpack_require__(41);
990
+
991
+ var withEditModeCover_1 = __webpack_require__(42);
992
+
993
+ var withPlaceholder_1 = __webpack_require__(43);
968
994
  /**
969
- * Helper method to convert option which contains object literal values (e.g. arrays, objects)
970
- * to strings as SC can only accept their stringified equivalents
971
- * @method convertToStringValues
972
- * @param {Object} options
973
- * @returns {Object}
995
+ * hoc that wraps a pure react visualization in a Dashboard visualization
996
+ * @param {DashboardVizOpts} opts
997
+ * @returns {HOC}
974
998
  */
975
999
 
976
- var convertToStringValues = function convertToStringValues(options) {
977
- var updatedOptions = propUtils_1.convertPropsToString({
978
- vizProps: options,
979
- propNames: ['seriesColors', 'fieldColors']
980
- });
981
- return Object.assign(Object.assign({}, options), updatedOptions);
982
- };
983
1000
 
984
- exports.convertToStringValues = convertToStringValues;
985
- /**
986
- * Helper method to update the option names which can be mapped to SimpleXML options or
987
- * can be used directly with SC if don't have a 1-1 mapping in SimpleXML
988
- * @method mapToOldKey
989
- * @param {Object} options
990
- * @returns {Object}
991
- */
1001
+ var withDashboardViz = function withDashboardViz(opts) {
1002
+ var ReactViz = opts.ReactViz,
1003
+ vizConfig = opts.vizConfig,
1004
+ _opts$computeVizProps = opts.computeVizProps,
1005
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1006
+ disableEditModeCover = opts.disableEditModeCover,
1007
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1008
+
1009
+ var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1010
+ var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1011
+
1012
+ var DashboardViz = function DashboardViz(props) {
1013
+ var mode = props.mode,
1014
+ hasEventHandlers = props.hasEventHandlers,
1015
+ dataSources = props.dataSources,
1016
+ options = props.options,
1017
+ _props$context = props.context,
1018
+ context = _props$context === void 0 ? {} : _props$context,
1019
+ width = props.width,
1020
+ height = props.height,
1021
+ onComputedProps = props.onComputedProps,
1022
+ onEventTrigger = props.onEventTrigger,
1023
+ theme = props.theme,
1024
+ onRequestParamsChange = props.onRequestParamsChange;
1025
+
1026
+ var _React$useContext = React.useContext(TimezoneContext_1.default),
1027
+ serializedTimezone = _React$useContext.serializedTimezone;
1028
+
1029
+ if (serializedTimezone) {
1030
+ /*
1031
+ @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
1032
+ This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
1033
+ will use it.
1034
+ @TODO(pwied):
1035
+ - remove when we moved away from @splunk/moment
1036
+ - provide timezone context to dynamic option evaluation phase
1037
+ */
1038
+ if (!moment_1.default.getDefaultSplunkTimezone()) {
1039
+ moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1040
+ }
1041
+ }
1042
+
1043
+ var themeFunc = function themeFunc(themeVar) {
1044
+ var _a, _b;
1045
+
1046
+ return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1047
+ };
1048
+
1049
+ var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1050
+
1051
+ var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1052
+ theme: theme
1053
+ }),
1054
+ currentThemeFamily = _getSettingsFromTheme.family,
1055
+ currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1056
+ currentThemeDensity = _getSettingsFromTheme.density;
1057
+
1058
+ var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1059
+
1060
+ evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1061
+ try {
1062
+ return Options_1.Options.evaluate({
1063
+ context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1064
+ options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1065
+ }, dataSources, themeFunc);
1066
+ } catch (e) {
1067
+ // eslint-disable-next-line no-console
1068
+ console.error("unexpected error evaluating options: + ".concat(e.message));
1069
+ return {};
1070
+ }
1071
+ }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
1072
+ // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1073
+
1074
+ React.useEffect(function () {
1075
+ onComputedProps(evaluatedOptions);
1076
+ }); // present warning message if any required props are missing
1077
+
1078
+ var _vizConfig$requiredPr = vizConfig.requiredProps,
1079
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1080
+ supports = vizConfig.supports;
1081
+ var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
1082
+
1083
+ if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
1084
+ return React.createElement(MissingPropsMessage_1.default, {
1085
+ "data-test": "missing-props-message",
1086
+ width: width,
1087
+ height: height,
1088
+ missingProps: missing,
1089
+ backgroundColor: bgColorFromTheme
1090
+ });
1091
+ } // events
1092
+
1093
+
1094
+ var eventCallbackProps = {};
1095
+
1096
+ if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1097
+ var supportedEvents = vizConfig.events;
1098
+ Object.keys(supportedEvents).forEach(function (eventName) {
1099
+ var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1100
+ eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1101
+ // then remove these lines
1102
+
1103
+ var payloadKeys = supportedEvents[eventName].payloadKeys;
1104
+ var payload = {};
1105
+
1106
+ if (Array.isArray(payloadKeys) && payloadKeys.length) {
1107
+ payloadKeys.forEach(function (p) {
1108
+ payload[p] = evaluatedOptions[p];
1109
+ });
1110
+ }
1111
+
1112
+ eventCallbackProps[eventCallbackPropName] = function (ev) {
1113
+ if (ev && ev.payload) {
1114
+ payload = ev.payload;
1115
+ }
1116
+
1117
+ return onEventTrigger({
1118
+ originalEvent: ev,
1119
+ payload: payload,
1120
+ type: eventName
1121
+ });
1122
+ };
1123
+ });
1124
+ } // compute pure viz props which are not from options
1125
+
1126
+
1127
+ var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
1128
+ themeFunc: themeFunc
1129
+ }));
1130
+ /**
1131
+ * PAGE_AND_SORT behavior
1132
+ *
1133
+ * Some visualizations, like table, requires metadata about the datasource,
1134
+ * like total number of results, current count, offset, and sort, for rendering
1135
+ * paginator and sorting direction. In this approach, the visualization
1136
+ * allow users to set 'paginateDataSourceKey' to select which datasource
1137
+ * should the visualization extract the metadata from. It defaults to 'primary' datasource.
1138
+ * The visualization config should set the PAGE_AND_SORT behavior to receive
1139
+ * 'requestParams', 'meta' and onRequestParams callback as props.
1140
+ *
1141
+ * In future, we could automatically detect which all datasources are being used
1142
+ * and bind those magically to pagination/sorting behavior.
1143
+ */
1144
+
1145
+ var dataSourceMetadata = {};
1146
+ var OptionKey = 'paginateDataSourceKey';
1147
+ var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
1148
+
1149
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1150
+ var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1151
+ var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
1152
+
1153
+ var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1154
+ return onRequestParamsChange(paginateDataSourceKey, payload);
1155
+ };
1156
+
1157
+ var sortParams = getSorting_1.getSortingParams({
1158
+ requestParams: requestParams,
1159
+ meta: meta,
1160
+ onRequestParamsChange: handleRequestParamsChange
1161
+ });
1162
+ var paginatorParams = getPagination_1.getPaginationParams({
1163
+ requestParams: requestParams,
1164
+ meta: meta,
1165
+ onRequestParamsChange: handleRequestParamsChange
1166
+ });
1167
+ dataSourceMetadata = {
1168
+ sortParams: sortParams,
1169
+ paginatorParams: paginatorParams
1170
+ };
1171
+ }
1172
+
1173
+ return React.createElement(SanitizedReactViz, Object.assign({
1174
+ mode: mode,
1175
+ width: width,
1176
+ height: height
1177
+ }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
1178
+ };
1179
+
1180
+ DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1181
+ DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1182
+ // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1183
+ theme: {}
1184
+ }); // attach viz config
1185
+
1186
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
992
1187
 
993
- var mapToOldKey = function mapToOldKey(options) {
994
- return lodash_1.mapKeys(options, function (val, key) {
995
- return scatterOptionsSCMapping[key] ? scatterOptionsSCMapping[key] : key;
996
- });
1188
+ return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
997
1189
  };
998
1190
 
999
- exports.mapToOldKey = mapToOldKey;
1000
- /**
1001
- * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts
1002
- * This is for options that has new key name and can not directly be mapped with SimpleXML or
1003
- * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)
1004
- * @method convertToScatterSCProperties
1005
- * @param {Object} originalOptions
1006
- * @returns {Object}
1007
- */
1191
+ exports.default = withDashboardViz;
1008
1192
 
1009
- var convertToScatterSCProperties = function convertToScatterSCProperties(originalOptions) {
1010
- return lodash_1.chain(exports.mapToOldKey(originalOptions)).thru(chartingUtils_1.mapToValues(exports.scatterOptionValuesSCMapping)).thru(exports.convertToStringValues).value();
1011
- };
1193
+ /***/ }),
1012
1194
 
1013
- exports.convertToScatterSCProperties = convertToScatterSCProperties;
1195
+ /***/ 33:
1196
+ /***/ (function(module, exports) {
1197
+
1198
+ module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1014
1199
 
1015
1200
  /***/ }),
1016
1201
 
1017
- /***/ 26:
1202
+ /***/ 34:
1203
+ /***/ (function(module, exports) {
1204
+
1205
+ module.exports = require("@splunk/visualization-encoding/Options");
1206
+
1207
+ /***/ }),
1208
+
1209
+ /***/ 35:
1210
+ /***/ (function(module, exports) {
1211
+
1212
+ module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1213
+
1214
+ /***/ }),
1215
+
1216
+ /***/ 36:
1217
+ /***/ (function(module, exports) {
1218
+
1219
+ module.exports = require("@splunk/moment");
1220
+
1221
+ /***/ }),
1222
+
1223
+ /***/ 37:
1018
1224
  /***/ (function(module, exports, __webpack_require__) {
1019
1225
 
1020
1226
  "use strict";
1021
1227
 
1022
1228
 
1229
+ var _classCallCheck = __webpack_require__(11);
1230
+
1023
1231
  Object.defineProperty(exports, "__esModule", {
1024
1232
  value: true
1025
1233
  });
1026
- exports.shouldShowIconPlaceholder = void 0;
1027
-
1028
- var React = __webpack_require__(1);
1234
+ exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1235
+ /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1029
1236
 
1030
1237
  var T = __webpack_require__(0);
1031
1238
 
1032
- var lodash_1 = __webpack_require__(2);
1239
+ var lodash_1 = __webpack_require__(3);
1033
1240
 
1034
- var i18n_1 = __webpack_require__(3);
1241
+ var VizActionHandler_1 = __webpack_require__(38); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1035
1242
 
1036
- var Message_1 = __webpack_require__(11);
1037
1243
 
1038
- var FixedSizeContainer_1 = __webpack_require__(14);
1244
+ exports.INITIAL_WIDTH = 250;
1245
+ exports.INITIAL_HEIGHT = 250;
1039
1246
  /**
1040
- * @method shouldShowIconPlaceholder
1041
- * @param {object} dataSources
1042
- * @param {boolean} loading
1043
- * @returns {boolean}
1247
+ * A Splunk visualization
1044
1248
  */
1045
1249
 
1046
-
1047
- var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
1048
- var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1049
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1050
- var noData = data === undefined;
1051
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1052
- var noFields = fields === undefined;
1053
- return loading || noData || noFields;
1250
+ var SplunkVisualization = function SplunkVisualization() {
1251
+ _classCallCheck(this, SplunkVisualization);
1054
1252
  };
1055
1253
 
1056
- exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
1057
- var propTypes = {
1058
- icon: T.func,
1059
- width: T.oneOfType([T.string, T.number]),
1060
- height: T.oneOfType([T.string, T.number]),
1061
- // eslint-disable-next-line react/no-unused-prop-types
1062
- backgroundColor: T.string,
1063
- iconColor: T.string
1254
+ SplunkVisualization.propTypes = {
1255
+ /**
1256
+ * display mode
1257
+ */
1258
+ mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1259
+
1260
+ /**
1261
+ * width in pixel or string, defaults to 100%
1262
+ */
1263
+ width: T.oneOfType([T.string, T.number]).isRequired,
1264
+
1265
+ /**
1266
+ * height in pixel or string
1267
+ */
1268
+ height: T.oneOfType([T.string, T.number]).isRequired,
1269
+
1270
+ /**
1271
+ * visualization context used for dynamic option evaluation
1272
+ */
1273
+ context: T.object,
1274
+
1275
+ /**
1276
+ * visualization formatting options
1277
+ */
1278
+ options: T.object,
1279
+
1280
+ /**
1281
+ * A callback to update formatting options
1282
+ */
1283
+ onOptionsChange: T.func,
1284
+
1285
+ /**
1286
+ * datasource state which include data and request params, object key indicate the datasource type.
1287
+ */
1288
+ dataSources: T.objectOf(T.shape({
1289
+ /**
1290
+ * current request params
1291
+ */
1292
+ requestParams: T.object,
1293
+
1294
+ /**
1295
+ * current dataset
1296
+ */
1297
+ data: T.shape({
1298
+ fields: T.array,
1299
+ columns: T.array
1300
+ }),
1301
+
1302
+ /**
1303
+ * error
1304
+ */
1305
+ error: T.shape({
1306
+ level: T.string,
1307
+ message: T.string
1308
+ }),
1309
+
1310
+ /**
1311
+ * meta data that came with the dataset
1312
+ */
1313
+ meta: T.object
1314
+ })),
1315
+
1316
+ /**
1317
+ * A callback to trigger event
1318
+ */
1319
+ onEventTrigger: T.func,
1320
+
1321
+ /**
1322
+ * Inform viz if there are handlers listening to events
1323
+ */
1324
+ hasEventHandlers: T.bool,
1325
+
1326
+ /**
1327
+ * A callback to communicate computed props to a consumer
1328
+ */
1329
+ onComputedProps: T.func,
1330
+
1331
+ /**
1332
+ * A callback to obtain visualization api
1333
+ */
1334
+ vizActionHandlerRef: T.func,
1335
+ loading: T.bool,
1336
+ theme: T.object,
1337
+
1338
+ /**
1339
+ * A callback to request new data with updated request params
1340
+ */
1341
+ onRequestParamsChange: T.func
1064
1342
  };
1065
1343
  /**
1066
- * @method IconPlaceholder
1067
- * @param {IconPlaceholderProps} props
1068
- * @returns {React.ReactElement}
1344
+ *
1069
1345
  */
1070
1346
 
1071
- var IconPlaceholder = function IconPlaceholder(props) {
1072
- var width = props.width,
1073
- height = props.height,
1074
- icon = props.icon,
1075
- iconColor = props.iconColor;
1347
+ SplunkVisualization.defaultProps = {
1348
+ // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1349
+ width: '100%',
1350
+ height: exports.INITIAL_HEIGHT,
1351
+ dataSources: {},
1352
+ onEventTrigger: function onEventTrigger() {
1353
+ return {};
1354
+ },
1355
+ mode: 'view',
1356
+ hasEventHandlers: false,
1357
+ options: {},
1358
+ context: {},
1359
+ onOptionsChange: function onOptionsChange() {
1360
+ return {};
1361
+ },
1362
+ vizActionHandlerRef: function vizActionHandlerRef() {
1363
+ return new VizActionHandler_1.DefaultVizActionHandler();
1364
+ },
1365
+ onComputedProps: function onComputedProps() {
1366
+ return {};
1367
+ },
1368
+ loading: false,
1369
+ onRequestParamsChange: lodash_1.noop
1370
+ };
1371
+ exports.default = SplunkVisualization;
1076
1372
 
1077
- if (icon) {
1078
- return React.createElement(icon, {
1079
- style: {
1080
- left: '50%',
1081
- top: '50%',
1082
- color: iconColor,
1083
- opacity: 0.15,
1084
- position: 'absolute',
1085
- transform: 'translate(-50%, -50%)'
1086
- },
1087
- width: '50%',
1088
- height: '50%'
1089
- });
1373
+ /***/ }),
1374
+
1375
+ /***/ 38:
1376
+ /***/ (function(module, exports, __webpack_require__) {
1377
+
1378
+ "use strict";
1379
+
1380
+
1381
+ var _classCallCheck = __webpack_require__(11);
1382
+
1383
+ var _createClass = __webpack_require__(19);
1384
+
1385
+ Object.defineProperty(exports, "__esModule", {
1386
+ value: true
1387
+ });
1388
+ exports.DefaultVizActionHandler = void 0;
1389
+
1390
+ var DefaultVizActionHandler = /*#__PURE__*/function () {
1391
+ function DefaultVizActionHandler() {
1392
+ _classCallCheck(this, DefaultVizActionHandler);
1090
1393
  }
1091
1394
 
1092
- return React.createElement(Message_1.default, {
1093
- width: width,
1094
- height: height,
1095
- level: "warning",
1096
- message: i18n_1._('No DataSource Connected')
1097
- });
1098
- };
1395
+ _createClass(DefaultVizActionHandler, [{
1396
+ key: "focus",
1397
+ value: function focus() {// noop
1398
+ }
1399
+ }, {
1400
+ key: "snapshot",
1401
+ value: function snapshot() {
1402
+ return null; // noop
1403
+ }
1404
+ }]);
1099
1405
 
1100
- IconPlaceholder.propTypes = propTypes;
1101
- IconPlaceholder.defaultProps = {
1102
- width: '100%',
1103
- height: 250
1104
- };
1105
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1406
+ return DefaultVizActionHandler;
1407
+ }();
1408
+
1409
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1106
1410
 
1107
1411
  /***/ }),
1108
1412
 
1109
- /***/ 27:
1413
+ /***/ 39:
1110
1414
  /***/ (function(module, exports, __webpack_require__) {
1111
1415
 
1112
1416
  "use strict";
1113
1417
 
1114
1418
 
1115
- var _defineProperty = __webpack_require__(7);
1116
-
1117
1419
  Object.defineProperty(exports, "__esModule", {
1118
1420
  value: true
1119
1421
  });
1120
- exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1422
+ exports.validSortDirs = void 0;
1423
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1121
1424
 
1122
- var T = __webpack_require__(0);
1425
+ /***/ }),
1426
+
1427
+ /***/ 4:
1428
+ /***/ (function(module, exports) {
1123
1429
 
1124
- var lodash_1 = __webpack_require__(2);
1430
+ module.exports = require("styled-components");
1125
1431
 
1126
- var DataSource_1 = __webpack_require__(37);
1432
+ /***/ }),
1127
1433
 
1128
- exports.SortParamsPropTypes = T.shape({
1129
- currentSortKey: T.string,
1130
- currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1131
- onSort: T.func
1434
+ /***/ 40:
1435
+ /***/ (function(module, exports, __webpack_require__) {
1436
+
1437
+ "use strict";
1438
+
1439
+
1440
+ Object.defineProperty(exports, "__esModule", {
1441
+ value: true
1132
1442
  });
1443
+ exports.useDeepMemo = void 0;
1133
1444
 
1134
- var getSortingParams = function getSortingParams(_ref) {
1135
- var requestParams = _ref.requestParams,
1136
- onRequestParamsChange = _ref.onRequestParamsChange;
1137
- var currentSortKey;
1138
- var currentSortDir;
1139
- var nextSortDirMap = {
1140
- asc: 'desc',
1141
- desc: 'asc',
1142
- none: 'asc'
1143
- };
1144
- var onSort;
1445
+ var react_1 = __webpack_require__(1);
1145
1446
 
1146
- if (lodash_1.isFunction(onRequestParamsChange)) {
1147
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
1148
- currentSortKey = Object.keys(requestParams.sort).shift();
1149
- currentSortDir = requestParams.sort[currentSortKey];
1150
- } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1447
+ var lodash_1 = __webpack_require__(3);
1448
+ /**
1449
+ * This hook evaluates and stores the result of a passed function and only
1450
+ * re-evaluates the function when passed dependencies change.
1451
+ *
1452
+ * It is different from the internal React useMemo in the following aspects:
1453
+ * - it only stores the last evaluated result
1454
+ * - it uses a deep equality check to determine if dependencies have changed
1455
+ *
1456
+ * Inspired by apollo-client's useDeepMemo
1457
+ *
1458
+ * @param fn the function to be executed and
1459
+ * @param dependencies an array of dependencies
1460
+ */
1151
1461
 
1152
1462
 
1153
- onSort = function onSort(e, _ref2) {
1154
- var sortKey = _ref2.sortKey,
1155
- sortDir = _ref2.sortDir;
1463
+ var useDeepMemo = function useDeepMemo(fn, dependencies) {
1464
+ var ref = react_1.useRef();
1156
1465
 
1157
- if (typeof sortKey === 'string') {
1158
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1159
- onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1160
- offset: 0,
1161
- sort: _defineProperty({}, sortKey, nextSortDir)
1162
- }));
1163
- } else {
1164
- onRequestParamsChange(requestParams);
1165
- }
1466
+ if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1467
+ ref.current = {
1468
+ dependencies: dependencies,
1469
+ value: fn()
1166
1470
  };
1167
1471
  }
1168
1472
 
1169
- return {
1170
- currentSortKey: currentSortKey,
1171
- currentSortDir: currentSortDir,
1172
- onSort: onSort
1173
- };
1473
+ return ref.current.value;
1174
1474
  };
1175
1475
 
1176
- exports.getSortingParams = getSortingParams;
1476
+ exports.useDeepMemo = useDeepMemo;
1177
1477
 
1178
1478
  /***/ }),
1179
1479
 
1180
- /***/ 28:
1480
+ /***/ 41:
1181
1481
  /***/ (function(module, exports, __webpack_require__) {
1182
1482
 
1183
1483
  "use strict";
@@ -1186,63 +1486,79 @@ exports.getSortingParams = getSortingParams;
1186
1486
  Object.defineProperty(exports, "__esModule", {
1187
1487
  value: true
1188
1488
  });
1189
- exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1489
+ exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1490
+
1491
+ var React = __webpack_require__(1);
1190
1492
 
1191
1493
  var T = __webpack_require__(0);
1192
1494
 
1193
- var lodash_1 = __webpack_require__(2);
1495
+ var i18n_1 = __webpack_require__(2);
1194
1496
 
1195
- exports.PaginatorParamsPropTypes = T.shape({
1196
- isPaging: T.bool,
1197
- current: T.number,
1198
- totalPages: T.number,
1199
- onChange: T.func
1200
- });
1497
+ var Message_1 = __webpack_require__(10);
1201
1498
 
1202
- var getPaginationParams = function getPaginationParams(_ref) {
1203
- var requestParams = _ref.requestParams,
1204
- meta = _ref.meta,
1205
- onRequestParamsChange = _ref.onRequestParamsChange;
1206
- var totalCount = meta && meta.totalCount || 0;
1207
- var offset = requestParams && requestParams.offset || 0;
1208
- var count = requestParams && requestParams.count;
1209
- var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1210
- var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1211
- var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
1499
+ var FixedSizeContainer_1 = __webpack_require__(13);
1500
+ /**
1501
+ * @method isMissing
1502
+ * @param {any} v
1503
+ * @returns {boolean} true if the input value === null or undefined
1504
+ */
1212
1505
 
1213
- var onChangeHandler = function onChangeHandler(e, _ref2) {
1214
- var page = _ref2.page,
1215
- countArg = _ref2.count;
1216
- var newParams = lodash_1.cloneDeep(requestParams);
1217
1506
 
1218
- if (typeof countArg === 'number') {
1219
- newParams.count = countArg;
1220
- newParams.offset = 0;
1221
- }
1507
+ var isMissing = function isMissing(v) {
1508
+ return v === null || v === undefined;
1509
+ };
1222
1510
 
1223
- var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1511
+ exports.isMissing = isMissing;
1512
+ /**
1513
+ * @method misskingKeys
1514
+ * @param {string[]} keys
1515
+ * @param {object} target
1516
+ * @returns {string[]} the keys of missing required props
1517
+ */
1224
1518
 
1225
- if (typeof page === 'number' && page > 0) {
1226
- newParams.count = pageCount;
1227
- newParams.offset = (page - 1) * pageCount;
1228
- }
1519
+ var missingKeys = function missingKeys(keys, target) {
1520
+ return keys.filter(function (k) {
1521
+ return exports.isMissing(target[k]);
1522
+ });
1523
+ };
1229
1524
 
1230
- onRequestParamsChange(newParams);
1231
- };
1525
+ exports.missingKeys = missingKeys;
1526
+ var propTypes = {
1527
+ width: T.oneOfType([T.string, T.number]),
1528
+ height: T.oneOfType([T.string, T.number]),
1529
+ // eslint-disable-next-line react/no-unused-prop-types
1530
+ backgroundColor: T.string,
1531
+ missingProps: T.arrayOf(T.string)
1532
+ };
1533
+ /**
1534
+ * @method MissingPropsMessage
1535
+ * @param {MissingPropsProps} props
1536
+ * @returns {React.ReactElement}
1537
+ */
1232
1538
 
1233
- return {
1234
- isPaging: isPaging,
1235
- current: current,
1236
- totalPages: totalPages,
1237
- onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
1238
- };
1539
+ var MissingPropsMessage = function MissingPropsMessage(props) {
1540
+ var width = props.width,
1541
+ height = props.height,
1542
+ missingProps = props.missingProps;
1543
+ return React.createElement(Message_1.default, {
1544
+ "data-test": "message",
1545
+ width: width,
1546
+ height: height,
1547
+ message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
1548
+ });
1239
1549
  };
1240
1550
 
1241
- exports.getPaginationParams = getPaginationParams;
1551
+ exports.MissingPropsMessage = MissingPropsMessage;
1552
+ exports.MissingPropsMessage.propTypes = propTypes;
1553
+ exports.MissingPropsMessage.defaultProps = {
1554
+ width: '100%',
1555
+ height: 250
1556
+ };
1557
+ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
1242
1558
 
1243
1559
  /***/ }),
1244
1560
 
1245
- /***/ 29:
1561
+ /***/ 42:
1246
1562
  /***/ (function(module, exports, __webpack_require__) {
1247
1563
 
1248
1564
  "use strict";
@@ -1251,34 +1567,51 @@ exports.getPaginationParams = getPaginationParams;
1251
1567
  Object.defineProperty(exports, "__esModule", {
1252
1568
  value: true
1253
1569
  });
1254
- exports.VizCategory = void 0;
1255
- var VizCategory;
1256
1570
 
1257
- (function (VizCategory) {
1258
- VizCategory["SINGLE_VALUE"] = "Single Value";
1259
- VizCategory["TRENDS"] = "Trends";
1260
- VizCategory["COMPARISONS"] = "Comparisons";
1261
- VizCategory["TABLE"] = "Table";
1262
- VizCategory["GAUGE"] = "Gauge";
1263
- VizCategory["DISTRIBUTIONS"] = "Distributions";
1264
- VizCategory["CHOROPLETH"] = "Choropleth Maps";
1265
- VizCategory["SHAPES"] = "Shapes";
1266
- VizCategory["MISC"] = "misc";
1267
- VizCategory["FLOW"] = "Flow";
1268
- VizCategory["CORRELATION"] = "Correlation";
1269
- VizCategory["SPATIAL"] = "Spatial";
1270
- })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
1571
+ var React = __webpack_require__(1);
1271
1572
 
1272
- /***/ }),
1573
+ var styled_components_1 = __webpack_require__(4);
1273
1574
 
1274
- /***/ 3:
1275
- /***/ (function(module, exports) {
1575
+ var hocUtils_1 = __webpack_require__(14);
1576
+
1577
+ var Cover = styled_components_1.default.div.withConfig({
1578
+ displayName: "withEditModeCover__Cover",
1579
+ componentId: "sc-1gsbnxb-0"
1580
+ })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1581
+ var Blocker = styled_components_1.default.div.attrs({
1582
+ 'data-splunk-visualization-version': "25.2.0 - 4373c5a66"
1583
+ }).withConfig({
1584
+ displayName: "withEditModeCover__Blocker",
1585
+ componentId: "sc-1gsbnxb-1"
1586
+ })(["position:relative;width:100%;height:100%;"]);
1587
+ /**
1588
+ * HOC that renders a cover layer in edit mode
1589
+ * @method withEditModeCover
1590
+ * @param {ExtendedDashViz} Visualization
1591
+ * @returns {ExtendedDashViz} Wrapper
1592
+ */
1593
+
1594
+ var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1595
+ var Wrapper = function Wrapper(props) {
1596
+ var mode = props.mode;
1597
+ var showEditCover = mode === 'edit' && !disableEditModeCover;
1598
+ return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
1599
+ "data-test": "edit-mode-cover"
1600
+ }));
1601
+ };
1602
+
1603
+ hocUtils_1.extendStaticWrapperProps({
1604
+ Wrapper: Wrapper,
1605
+ Visualization: Visualization
1606
+ });
1607
+ return Wrapper;
1608
+ };
1276
1609
 
1277
- module.exports = require("@splunk/ui-utils/i18n");
1610
+ exports.default = withEditModeCover;
1278
1611
 
1279
1612
  /***/ }),
1280
1613
 
1281
- /***/ 30:
1614
+ /***/ 43:
1282
1615
  /***/ (function(module, exports, __webpack_require__) {
1283
1616
 
1284
1617
  "use strict";
@@ -1290,667 +1623,526 @@ Object.defineProperty(exports, "__esModule", {
1290
1623
 
1291
1624
  var React = __webpack_require__(1);
1292
1625
 
1293
- var lodash_1 = __webpack_require__(2);
1294
-
1295
- var getSettingsFromThemedProps_1 = __webpack_require__(31);
1296
-
1297
- var Options_1 = __webpack_require__(32);
1298
-
1299
- var SanitizeProps_1 = __webpack_require__(33);
1300
-
1301
- var TimezoneContext_1 = __webpack_require__(21);
1302
-
1303
- var moment_1 = __webpack_require__(34);
1304
-
1305
- var styled_components_1 = __webpack_require__(4);
1306
-
1307
- var SplunkVisualization_1 = __webpack_require__(35);
1308
-
1309
- var VizBehavior_1 = __webpack_require__(5);
1626
+ var colorUtils_1 = __webpack_require__(12);
1310
1627
 
1311
- var getSorting_1 = __webpack_require__(27);
1628
+ var variables_1 = __webpack_require__(9);
1312
1629
 
1313
- var getPagination_1 = __webpack_require__(28);
1630
+ var IconPlaceholder_1 = __webpack_require__(27);
1314
1631
 
1315
- var useDeepMemo_1 = __webpack_require__(38);
1632
+ var VizBehavior_1 = __webpack_require__(6);
1316
1633
 
1317
- var JSONSchemaUtils_1 = __webpack_require__(24);
1634
+ var hocUtils_1 = __webpack_require__(14);
1318
1635
 
1319
- var MissingPropsMessage_1 = __webpack_require__(39);
1320
-
1321
- var withEditModeCover_1 = __webpack_require__(40);
1322
-
1323
- var withPlaceholder_1 = __webpack_require__(42);
1324
-
1325
- var hocUtils_1 = __webpack_require__(8);
1326
- /**
1327
- * hoc that wraps a pure react visualization in a Dashboard visualization
1328
- * @param {DashboardVizOpts} opts
1329
- * @returns {HOC}
1330
- */
1331
-
1332
-
1333
- var withDashboardViz = function withDashboardViz(opts) {
1334
- var ReactViz = opts.ReactViz,
1335
- vizConfig = opts.vizConfig,
1336
- _opts$computeVizProps = opts.computeVizProps,
1337
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1338
- disableEditModeCover = opts.disableEditModeCover,
1339
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1636
+ var withPlaceholder = function withPlaceholder(Visualization) {
1637
+ var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
1638
+ var config = Visualization.config;
1639
+ var themes = config.themes;
1340
1640
 
1341
- var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1342
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1641
+ var Wrapper = function Wrapper(props) {
1642
+ var _a, _b;
1343
1643
 
1344
- var DashboardViz = function DashboardViz(props) {
1345
- var mode = props.mode,
1346
- hasEventHandlers = props.hasEventHandlers,
1347
- dataSources = props.dataSources,
1644
+ var dataSources = props.dataSources,
1645
+ loading = props.loading,
1348
1646
  options = props.options,
1349
- _props$context = props.context,
1350
- context = _props$context === void 0 ? {} : _props$context,
1351
- width = props.width,
1352
1647
  height = props.height,
1353
- onComputedProps = props.onComputedProps,
1354
- onEventTrigger = props.onEventTrigger,
1355
- theme = props.theme,
1356
- onRequestParamsChange = props.onRequestParamsChange;
1357
-
1358
- var _React$useContext = React.useContext(TimezoneContext_1.default),
1359
- serializedTimezone = _React$useContext.serializedTimezone;
1360
-
1361
- if (serializedTimezone) {
1362
- /*
1363
- @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
1364
- This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
1365
- will use it.
1366
- @TODO(pwied):
1367
- - remove when we moved away from @splunk/moment
1368
- - provide timezone context to dynamic option evaluation phase
1369
- */
1370
- if (!moment_1.default.getDefaultSplunkTimezone()) {
1371
- moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1372
- }
1373
- }
1374
-
1375
- var themeFunc = function themeFunc(themeVar) {
1376
- var _a, _b;
1377
-
1378
- return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1379
- };
1380
-
1381
- var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1382
-
1383
- var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1384
- theme: theme
1385
- }),
1386
- currentThemeFamily = _getSettingsFromTheme.family,
1387
- currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1388
- currentThemeDensity = _getSettingsFromTheme.density;
1389
-
1390
- var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1391
-
1392
- evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1393
- try {
1394
- return Options_1.Options.evaluate({
1395
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1396
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1397
- }, dataSources, themeFunc);
1398
- } catch (e) {
1399
- // eslint-disable-next-line no-console
1400
- console.error("unexpected error evaluating options: + ".concat(e.message));
1401
- return {};
1402
- }
1403
- }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
1404
- // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1405
-
1406
- React.useEffect(function () {
1407
- onComputedProps(evaluatedOptions);
1408
- }); // present warning message if any required props are missing
1409
-
1410
- var _vizConfig$requiredPr = vizConfig.requiredProps,
1411
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1412
- supports = vizConfig.supports;
1413
- var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
1648
+ width = props.width;
1649
+ var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1650
+ var bgColorFromTheme = colorUtils_1.isColor(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
1651
+ var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1652
+ var iconColor = variables_1.default.contentColorActive(props);
1414
1653
 
1415
- if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
1416
- return React.createElement(MissingPropsMessage_1.default, {
1417
- "data-test": "missing-props-message",
1654
+ if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1655
+ return React.createElement(IconPlaceholder_1.default, {
1656
+ "data-test": "icon-placeholder",
1657
+ icon: icon,
1418
1658
  width: width,
1419
1659
  height: height,
1420
- missingProps: missing,
1421
- backgroundColor: bgColorFromTheme
1422
- });
1423
- } // events
1424
-
1425
-
1426
- var eventCallbackProps = {};
1427
-
1428
- if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1429
- var supportedEvents = vizConfig.events;
1430
- Object.keys(supportedEvents).forEach(function (eventName) {
1431
- var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1432
- eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1433
- // then remove these lines
1434
-
1435
- var payloadKeys = supportedEvents[eventName].payloadKeys;
1436
- var payload = {};
1437
-
1438
- if (Array.isArray(payloadKeys) && payloadKeys.length) {
1439
- payloadKeys.forEach(function (p) {
1440
- payload[p] = evaluatedOptions[p];
1441
- });
1442
- }
1443
-
1444
- eventCallbackProps[eventCallbackPropName] = function (ev) {
1445
- if (ev && ev.payload) {
1446
- payload = ev.payload;
1447
- }
1448
-
1449
- return onEventTrigger({
1450
- originalEvent: ev,
1451
- payload: payload,
1452
- type: eventName
1453
- });
1454
- };
1455
- });
1456
- } // compute pure viz props which are not from options
1457
-
1458
-
1459
- var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
1460
- themeFunc: themeFunc
1461
- }));
1462
- /**
1463
- * PAGE_AND_SORT behavior
1464
- *
1465
- * Some visualizations, like table, requires metadata about the datasource,
1466
- * like total number of results, current count, offset, and sort, for rendering
1467
- * paginator and sorting direction. In this approach, the visualization
1468
- * allow users to set 'paginateDataSourceKey' to select which datasource
1469
- * should the visualization extract the metadata from. It defaults to 'primary' datasource.
1470
- * The visualization config should set the PAGE_AND_SORT behavior to receive
1471
- * 'requestParams', 'meta' and onRequestParams callback as props.
1472
- *
1473
- * In future, we could automatically detect which all datasources are being used
1474
- * and bind those magically to pagination/sorting behavior.
1475
- */
1476
-
1477
- var dataSourceMetadata = {};
1478
- var OptionKey = 'paginateDataSourceKey';
1479
- var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
1480
-
1481
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1482
- var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1483
- var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
1484
-
1485
- var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1486
- return onRequestParamsChange(paginateDataSourceKey, payload);
1487
- };
1488
-
1489
- var sortParams = getSorting_1.getSortingParams({
1490
- requestParams: requestParams,
1491
- meta: meta,
1492
- onRequestParamsChange: handleRequestParamsChange
1493
- });
1494
- var paginatorParams = getPagination_1.getPaginationParams({
1495
- requestParams: requestParams,
1496
- meta: meta,
1497
- onRequestParamsChange: handleRequestParamsChange
1660
+ backgroundColor: bgColorFromTheme,
1661
+ iconColor: iconColor
1498
1662
  });
1499
- dataSourceMetadata = {
1500
- sortParams: sortParams,
1501
- paginatorParams: paginatorParams
1502
- };
1503
1663
  }
1504
1664
 
1505
- return React.createElement(SanitizedReactViz, Object.assign({
1506
- mode: mode,
1507
- width: width,
1508
- height: height
1509
- }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
1665
+ return React.createElement(Visualization, Object.assign({}, props));
1510
1666
  };
1511
1667
 
1512
- DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1513
- DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1514
- // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1515
- theme: {}
1516
- }); // attach viz config
1517
-
1518
- DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1519
-
1520
- return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
1668
+ hocUtils_1.extendStaticWrapperProps({
1669
+ Wrapper: Wrapper,
1670
+ Visualization: Visualization
1671
+ });
1672
+ return Wrapper;
1521
1673
  };
1522
1674
 
1523
- exports.default = withDashboardViz;
1524
-
1525
- /***/ }),
1526
-
1527
- /***/ 31:
1528
- /***/ (function(module, exports) {
1529
-
1530
- module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1675
+ exports.default = withPlaceholder;
1531
1676
 
1532
1677
  /***/ }),
1533
1678
 
1534
- /***/ 32:
1535
- /***/ (function(module, exports) {
1679
+ /***/ 437:
1680
+ /***/ (function(module, exports, __webpack_require__) {
1536
1681
 
1537
- module.exports = require("@splunk/visualization-encoding/Options");
1682
+ "use strict";
1538
1683
 
1539
- /***/ }),
1540
1684
 
1541
- /***/ 33:
1542
- /***/ (function(module, exports) {
1685
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1686
+ if (k2 === undefined) k2 = k;
1687
+ Object.defineProperty(o, k2, {
1688
+ enumerable: true,
1689
+ get: function get() {
1690
+ return m[k];
1691
+ }
1692
+ });
1693
+ } : function (o, m, k, k2) {
1694
+ if (k2 === undefined) k2 = k;
1695
+ o[k2] = m[k];
1696
+ });
1543
1697
 
1544
- module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1698
+ var __exportStar = this && this.__exportStar || function (m, exports) {
1699
+ for (var p in m) {
1700
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1701
+ }
1702
+ };
1545
1703
 
1546
- /***/ }),
1704
+ Object.defineProperty(exports, "__esModule", {
1705
+ value: true
1706
+ });
1707
+ exports.default = void 0;
1547
1708
 
1548
- /***/ 34:
1549
- /***/ (function(module, exports) {
1709
+ __exportStar(__webpack_require__(149), exports);
1550
1710
 
1551
- module.exports = require("@splunk/moment");
1711
+ var Scatter_1 = __webpack_require__(149);
1712
+
1713
+ Object.defineProperty(exports, "default", {
1714
+ enumerable: true,
1715
+ get: function get() {
1716
+ return Scatter_1.default;
1717
+ }
1718
+ });
1552
1719
 
1553
1720
  /***/ }),
1554
1721
 
1555
- /***/ 35:
1722
+ /***/ 438:
1556
1723
  /***/ (function(module, exports, __webpack_require__) {
1557
1724
 
1558
1725
  "use strict";
1559
1726
 
1560
1727
 
1561
- var _classCallCheck = __webpack_require__(12);
1728
+ var _toConsumableArray = __webpack_require__(8);
1562
1729
 
1563
1730
  Object.defineProperty(exports, "__esModule", {
1564
1731
  value: true
1565
1732
  });
1566
- exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1567
- /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1568
-
1569
- var T = __webpack_require__(0);
1570
-
1571
- var lodash_1 = __webpack_require__(2);
1572
-
1573
- var VizActionHandler_1 = __webpack_require__(36); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1574
-
1575
-
1576
- exports.INITIAL_WIDTH = 250;
1577
- exports.INITIAL_HEIGHT = 250;
1578
- /**
1579
- * A Splunk visualization
1580
- */
1733
+ exports.optionsSchema = void 0;
1581
1734
 
1582
- var SplunkVisualization = function SplunkVisualization() {
1583
- _classCallCheck(this, SplunkVisualization);
1584
- };
1735
+ var visualization_icons_1 = __webpack_require__(47);
1585
1736
 
1586
- SplunkVisualization.propTypes = {
1587
- /**
1588
- * display mode
1589
- */
1590
- mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1737
+ var placeholders_1 = __webpack_require__(44);
1591
1738
 
1592
- /**
1593
- * width in pixel or string, defaults to 100%
1594
- */
1595
- width: T.oneOfType([T.string, T.number]).isRequired,
1739
+ var pick_1 = __webpack_require__(21);
1596
1740
 
1597
- /**
1598
- * height in pixel or string
1599
- */
1600
- height: T.oneOfType([T.string, T.number]).isRequired,
1741
+ var variables_1 = __webpack_require__(9);
1601
1742
 
1602
- /**
1603
- * visualization context used for dynamic option evaluation
1604
- */
1605
- context: T.object,
1743
+ var schemaUtils_1 = __webpack_require__(16);
1606
1744
 
1607
- /**
1608
- * visualization formatting options
1609
- */
1610
- options: T.object,
1745
+ var visualization_color_palettes_1 = __webpack_require__(46);
1611
1746
 
1612
- /**
1613
- * A callback to update formatting options
1614
- */
1615
- onOptionsChange: T.func,
1747
+ var i18n_1 = __webpack_require__(2);
1616
1748
 
1617
- /**
1618
- * datasource state which include data and request params, object key indicate the datasource type.
1619
- */
1620
- dataSources: T.objectOf(T.shape({
1621
- /**
1622
- * current request params
1623
- */
1624
- requestParams: T.object,
1749
+ var VizBehavior_1 = __webpack_require__(6);
1625
1750
 
1626
- /**
1627
- * current dataset
1628
- */
1629
- data: T.shape({
1630
- fields: T.array,
1631
- columns: T.array
1632
- }),
1751
+ var VizCategory_1 = __webpack_require__(31);
1633
1752
 
1634
- /**
1635
- * error
1636
- */
1637
- error: T.shape({
1638
- level: T.string,
1639
- message: T.string
1640
- }),
1753
+ var configUtils_1 = __webpack_require__(17);
1641
1754
 
1642
- /**
1643
- * meta data that came with the dataset
1644
- */
1645
- meta: T.object
1646
- })),
1755
+ var AxesChartDataConfig_1 = __webpack_require__(64);
1647
1756
 
1648
- /**
1649
- * A callback to trigger event
1650
- */
1651
- onEventTrigger: T.func,
1757
+ var AxesChartXGridAndLabels_1 = __webpack_require__(67);
1652
1758
 
1653
- /**
1654
- * Inform viz if there are handlers listening to events
1655
- */
1656
- hasEventHandlers: T.bool,
1759
+ var AxesChartColorAndStyle_1 = __webpack_require__(65);
1657
1760
 
1658
- /**
1659
- * A callback to communicate computed props to a consumer
1660
- */
1661
- onComputedProps: T.func,
1761
+ var AxesChartLegend_1 = __webpack_require__(66);
1662
1762
 
1663
- /**
1664
- * A callback to obtain visualization api
1665
- */
1666
- vizActionHandlerRef: T.func,
1667
- loading: T.bool,
1668
- theme: T.object,
1763
+ var AxesChartYGridAndLabels_1 = __webpack_require__(68);
1669
1764
 
1670
- /**
1671
- * A callback to request new data with updated request params
1672
- */
1673
- onRequestParamsChange: T.func
1765
+ var dataContract = {
1766
+ requiredDataSources: [{
1767
+ name: 'primary',
1768
+ description: 'DataSource that powers the visualization'
1769
+ }],
1770
+ optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
1771
+ // {
1772
+ // name: 'annotation',
1773
+ // description: 'DataSource that populates event annotations',
1774
+ // },
1775
+ ],
1776
+ initialRequestParams: {
1777
+ primary: {
1778
+ offset: 0,
1779
+ count: 10000
1780
+ },
1781
+ annotation: {
1782
+ offset: 0,
1783
+ count: 10000
1784
+ }
1785
+ }
1674
1786
  };
1675
- /**
1676
- *
1677
- */
1678
-
1679
- SplunkVisualization.defaultProps = {
1680
- // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1681
- width: '100%',
1682
- height: exports.INITIAL_HEIGHT,
1683
- dataSources: {},
1684
- onEventTrigger: function onEventTrigger() {
1685
- return {};
1787
+ var size = {
1788
+ initialWidth: 300,
1789
+ initialHeight: 300
1790
+ };
1791
+ var defaultContext = {};
1792
+ exports.optionsSchema = {
1793
+ x: {
1794
+ default: '> primary | seriesByIndex(0)',
1795
+ description: 'Specify the dataSource applied to the x-axis.',
1796
+ type: 'array',
1797
+ items: {
1798
+ type: ['string', 'number']
1799
+ }
1800
+ },
1801
+ y: {
1802
+ default: '> primary | seriesByIndex(1)',
1803
+ description: 'Specify the dataSource applied to the y-axis.',
1804
+ type: 'array',
1805
+ items: {
1806
+ type: ['string', 'number']
1807
+ }
1808
+ },
1809
+ category: {
1810
+ description: 'Specify a sequence of dataSource events to be plotted on the chart.',
1811
+ type: 'array',
1812
+ items: {
1813
+ type: ['string', 'number']
1814
+ },
1815
+ default: '> primary | seriesByIndex(2)'
1816
+ },
1817
+ xField: {
1818
+ default: '> x | getField()',
1819
+ description: 'Specify the field that should be mapped to the x-axis.',
1820
+ type: 'string'
1821
+ },
1822
+ yField: {
1823
+ default: '> y | getField()',
1824
+ description: 'Specify the field that should be mapped to the y-axis.',
1825
+ type: 'string'
1826
+ },
1827
+ categoryField: {
1828
+ default: '> category | getField()',
1829
+ description: 'Specify the field that should be mapped to the series categories.',
1830
+ type: 'string'
1831
+ },
1832
+ backgroundColor: {
1833
+ default: '> themes.defaultBackgroundColor',
1834
+ description: 'Specify the color used for the background. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
1835
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
1836
+ type: 'string'
1837
+ },
1838
+ legendDisplay: {
1839
+ default: 'right',
1840
+ description: 'Specify the location of the legend on the panel.',
1841
+ pattern: schemaUtils_1.getPattern(['right', 'left', 'top', 'bottom', 'off']),
1842
+ type: 'string'
1843
+ },
1844
+ legendTruncation: {
1845
+ default: 'ellipsisEnd',
1846
+ description: 'Specify how to display legend labels when they overflow the layout boundaries by replacing overflow text with an ellipsis.',
1847
+ pattern: schemaUtils_1.getPattern(['ellipsisEnd', 'ellipsisMiddle', 'ellipsisStart', 'ellipsisOff']),
1848
+ type: 'string'
1849
+ },
1850
+ markerSize: {
1851
+ description: 'Specify, in pixels, the size of each scatter marker.',
1852
+ type: 'number',
1853
+ default: 4
1854
+ },
1855
+ resultLimit: {
1856
+ default: 50000,
1857
+ description: 'Specify the number of data points rendered in a chart.',
1858
+ type: 'number'
1859
+ },
1860
+ seriesColors: {
1861
+ default: visualization_color_palettes_1.VIZ_CATEGORICAL,
1862
+ description: 'Specify the colors used for a series. For example, ["#FF0000", "#0000FF", "#008000"].',
1863
+ type: 'array',
1864
+ items: {
1865
+ type: 'string'
1866
+ }
1867
+ },
1868
+ seriesColorsByField: {
1869
+ description: 'Specify the colors to use for specific categories, or series names, derived from distinct values in the selected category field. For example, {"user1": "#008000", "user2": "#FFA500"}.',
1870
+ type: 'object'
1871
+ },
1872
+ showXAxisExtendedRange: {
1873
+ default: true,
1874
+ description: 'Specify whether the x-axis should be extended to snap to whole major tick marks.',
1875
+ type: 'boolean'
1876
+ },
1877
+ showYAxisExtendedRange: {
1878
+ default: true,
1879
+ description: 'Specify whether the y-axis should be extended to snap to whole major tick marks.',
1880
+ type: 'boolean'
1881
+ },
1882
+ showXAxisWithZero: {
1883
+ default: false,
1884
+ description: 'Specify whether the x-axis range includes zero.',
1885
+ type: 'boolean'
1886
+ },
1887
+ showYAxisWithZero: {
1888
+ default: false,
1889
+ description: 'Specify whether the y-axis range includes zero.',
1890
+ type: 'boolean'
1891
+ },
1892
+ showRoundedXAxisLabels: {
1893
+ default: false,
1894
+ description: 'Specify whether to round x-axis values to the nearest integer.',
1895
+ type: 'boolean'
1896
+ },
1897
+ // TODO: figure out if we want to change splunk-charting behavior for Bubble/Scatter, which hardcodes XMajorGridlines to false
1898
+ // showXMajorGridLines: {
1899
+ // default: false,
1900
+ // description: 'Specify whether major grid lines are visible on the x-axis.',
1901
+ // type: 'boolean',
1902
+ // },
1903
+ showYMajorGridLines: {
1904
+ default: true,
1905
+ description: 'Specify whether major grid lines are visible on the y-axis.',
1906
+ type: 'boolean'
1686
1907
  },
1687
- mode: 'view',
1688
- hasEventHandlers: false,
1689
- options: {},
1690
- context: {},
1691
- onOptionsChange: function onOptionsChange() {
1692
- return {};
1908
+ showXMinorGridLines: {
1909
+ default: false,
1910
+ description: 'Specify whether minor grid lines are visible on the x-axis.',
1911
+ type: 'boolean'
1693
1912
  },
1694
- vizActionHandlerRef: function vizActionHandlerRef() {
1695
- return new VizActionHandler_1.DefaultVizActionHandler();
1913
+ showYMinorGridLines: {
1914
+ default: false,
1915
+ description: 'Specify whether minor grid lines are visible on the y-axis.',
1916
+ type: 'boolean'
1696
1917
  },
1697
- onComputedProps: function onComputedProps() {
1698
- return {};
1918
+ xAxisLabelRotation: {
1919
+ default: 0,
1920
+ description: 'Specify the rotation of the x-axis labels in degrees.',
1921
+ type: 'number',
1922
+ enum: [-90, -45, 0, 45, 90]
1699
1923
  },
1700
- loading: false,
1701
- onRequestParamsChange: lodash_1.noop
1702
- };
1703
- exports.default = SplunkVisualization;
1704
-
1705
- /***/ }),
1706
-
1707
- /***/ 36:
1708
- /***/ (function(module, exports, __webpack_require__) {
1709
-
1710
- "use strict";
1711
-
1712
-
1713
- var _classCallCheck = __webpack_require__(12);
1714
-
1715
- var _createClass = __webpack_require__(17);
1716
-
1717
- Object.defineProperty(exports, "__esModule", {
1718
- value: true
1719
- });
1720
- exports.DefaultVizActionHandler = void 0;
1721
-
1722
- var DefaultVizActionHandler = /*#__PURE__*/function () {
1723
- function DefaultVizActionHandler() {
1724
- _classCallCheck(this, DefaultVizActionHandler);
1725
- }
1726
-
1727
- _createClass(DefaultVizActionHandler, [{
1728
- key: "focus",
1729
- value: function focus() {// noop
1730
- }
1731
- }, {
1732
- key: "snapshot",
1733
- value: function snapshot() {
1734
- return null; // noop
1735
- }
1736
- }]);
1737
-
1738
- return DefaultVizActionHandler;
1739
- }();
1740
-
1741
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1742
-
1743
- /***/ }),
1744
-
1745
- /***/ 37:
1746
- /***/ (function(module, exports, __webpack_require__) {
1747
-
1748
- "use strict";
1749
-
1750
-
1751
- Object.defineProperty(exports, "__esModule", {
1752
- value: true
1753
- });
1754
- exports.validSortDirs = void 0;
1755
- exports.validSortDirs = ['asc', 'desc', 'none'];
1756
-
1757
- /***/ }),
1758
-
1759
- /***/ 38:
1760
- /***/ (function(module, exports, __webpack_require__) {
1761
-
1762
- "use strict";
1763
-
1764
-
1765
- Object.defineProperty(exports, "__esModule", {
1766
- value: true
1767
- });
1768
- exports.useDeepMemo = void 0;
1769
-
1770
- var react_1 = __webpack_require__(1);
1771
-
1772
- var lodash_1 = __webpack_require__(2);
1773
- /**
1774
- * This hook evaluates and stores the result of a passed function and only
1775
- * re-evaluates the function when passed dependencies change.
1776
- *
1777
- * It is different from the internal React useMemo in the following aspects:
1778
- * - it only stores the last evaluated result
1779
- * - it uses a deep equality check to determine if dependencies have changed
1780
- *
1781
- * Inspired by apollo-client's useDeepMemo
1782
- *
1783
- * @param fn the function to be executed and
1784
- * @param dependencies an array of dependencies
1785
- */
1786
-
1787
-
1788
- var useDeepMemo = function useDeepMemo(fn, dependencies) {
1789
- var ref = react_1.useRef();
1790
-
1791
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1792
- ref.current = {
1793
- dependencies: dependencies,
1794
- value: fn()
1795
- };
1924
+ xAxisAbbreviation: {
1925
+ default: 'off',
1926
+ description: 'Specify whether to abbreviate large x-axis values with the closest SI prefix.',
1927
+ enum: ['off', 'auto'],
1928
+ pattern: schemaUtils_1.getPattern(['auto', 'off']),
1929
+ type: 'string'
1930
+ },
1931
+ yAxisAbbreviation: {
1932
+ default: 'auto',
1933
+ description: 'Specify whether to abbreviate large y-axis values with the closest SI prefix.',
1934
+ enum: ['off', 'auto'],
1935
+ pattern: schemaUtils_1.getPattern(['auto', 'off']),
1936
+ type: 'string'
1937
+ },
1938
+ xAxisLabelVisibility: {
1939
+ default: 'auto',
1940
+ description: 'Specify whether to show or hide labels on the x-axis.',
1941
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
1942
+ type: 'string'
1943
+ },
1944
+ yAxisLabelVisibility: {
1945
+ default: 'auto',
1946
+ description: 'Specify whether to show or hide labels on the y-axis.',
1947
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
1948
+ type: 'string'
1949
+ },
1950
+ xAxisLineVisibility: {
1951
+ default: 'hide',
1952
+ description: 'Specify whether to show or hide the x-axis line.',
1953
+ enum: ['hide', 'show'],
1954
+ pattern: schemaUtils_1.getPattern(['show', 'hide']),
1955
+ type: 'string'
1956
+ },
1957
+ yAxisLineVisibility: {
1958
+ default: 'hide',
1959
+ description: 'Specify whether to show or hide the y-axis line.',
1960
+ enum: ['hide', 'show'],
1961
+ pattern: schemaUtils_1.getPattern(['show', 'hide']),
1962
+ type: 'string'
1963
+ },
1964
+ xAxisMajorTickInterval: {
1965
+ default: 'auto',
1966
+ description: 'Specify the spacing interval at which to place major tick marks along the numeric x-axis. By default, this value is automatically calculated based on the scale of the related axis.',
1967
+ type: ['string', 'number']
1968
+ },
1969
+ yAxisMajorTickInterval: {
1970
+ default: 'auto',
1971
+ description: 'Specify the spacing interval at which to place major tick marks along the numeric y-axis. By default, this value is automatically calculated based on the scale of the related axis.',
1972
+ type: ['string', 'number']
1973
+ },
1974
+ xAxisMajorTickSize: {
1975
+ default: 6,
1976
+ description: 'Specify the size, in pixels, of major tick marks on the x-axis.',
1977
+ type: 'number'
1978
+ },
1979
+ yAxisMajorTickSize: {
1980
+ default: 6,
1981
+ description: 'Specify the size, in pixels, of major tick marks on the y-axis.',
1982
+ type: 'number'
1983
+ },
1984
+ xAxisMinorTickSize: {
1985
+ default: 6,
1986
+ description: 'Specify the size, in pixels, of minor tick marks on the x-axis.',
1987
+ type: 'number'
1988
+ },
1989
+ yAxisMinorTickSize: {
1990
+ default: 6,
1991
+ description: 'Specify the size, in pixels, of minor tick marks on the y-axis.',
1992
+ type: 'number'
1993
+ },
1994
+ xAxisMajorTickVisibility: {
1995
+ default: 'auto',
1996
+ description: 'Specify whether to show or hide major tick marks on the x-axis.',
1997
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
1998
+ type: 'string'
1999
+ },
2000
+ yAxisMajorTickVisibility: {
2001
+ default: 'auto',
2002
+ description: 'Specify whether to show or hide major tick marks on the y-axis.',
2003
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
2004
+ type: 'string'
2005
+ },
2006
+ xAxisMinorTickVisibility: {
2007
+ default: 'auto',
2008
+ description: 'Specify whether to show or hide minor tick marks on the x-axis .',
2009
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
2010
+ type: 'string'
2011
+ },
2012
+ yAxisMinorTickVisibility: {
2013
+ default: 'auto',
2014
+ description: 'Specify whether to show or hide minor tick marks on the y-axis.',
2015
+ pattern: schemaUtils_1.getPattern(['auto', 'show', 'hide']),
2016
+ type: 'string'
2017
+ },
2018
+ xAxisMax: {
2019
+ default: 'auto',
2020
+ description: 'Specify the maximum number for the range of the visible x-axis.',
2021
+ type: ['string', 'number']
2022
+ },
2023
+ yAxisMax: {
2024
+ default: 'auto',
2025
+ description: 'Specify the maximum number for the range of the visible y-axis.',
2026
+ type: ['string', 'number']
2027
+ },
2028
+ xAxisMin: {
2029
+ default: 'auto',
2030
+ description: 'Specify the minimum number for the range of the visible x-axis.',
2031
+ type: ['string', 'number']
2032
+ },
2033
+ yAxisMin: {
2034
+ default: 'auto',
2035
+ description: 'Specify the minimum number for the range of the visible y-axis.',
2036
+ type: ['string', 'number']
2037
+ },
2038
+ xAxisScale: {
2039
+ default: 'linear',
2040
+ description: 'Specify the type of scale that applies to a numerical x-axis.',
2041
+ pattern: schemaUtils_1.getPattern(['linear', 'log']),
2042
+ type: 'string'
2043
+ },
2044
+ yAxisScale: {
2045
+ default: 'linear',
2046
+ description: 'Specify the type of scale that applies to a numerical y-axis.',
2047
+ pattern: schemaUtils_1.getPattern(['linear', 'log']),
2048
+ type: 'string'
2049
+ },
2050
+ xAxisTitleText: {
2051
+ description: 'Specify the title of the x-axis.',
2052
+ type: 'string'
2053
+ },
2054
+ yAxisTitleText: {
2055
+ description: 'Specify the title of the y-axis.',
2056
+ type: 'string'
2057
+ },
2058
+ xAxisTitleVisibility: {
2059
+ default: 'show',
2060
+ description: 'Specify whether to show or hide the title of the x-axis.',
2061
+ enum: ['hide', 'show'],
2062
+ pattern: schemaUtils_1.getPattern(['show', 'hide']),
2063
+ type: 'string'
2064
+ },
2065
+ yAxisTitleVisibility: {
2066
+ default: 'show',
2067
+ description: 'Specify whether to show or hide the title of the y-axis.',
2068
+ enum: ['hide', 'show'],
2069
+ pattern: schemaUtils_1.getPattern(['show', 'hide']),
2070
+ type: 'string'
1796
2071
  }
1797
-
1798
- return ref.current.value;
1799
- };
1800
-
1801
- exports.useDeepMemo = useDeepMemo;
1802
-
1803
- /***/ }),
1804
-
1805
- /***/ 39:
1806
- /***/ (function(module, exports, __webpack_require__) {
1807
-
1808
- "use strict";
1809
-
1810
-
1811
- Object.defineProperty(exports, "__esModule", {
1812
- value: true
1813
- });
1814
- exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1815
-
1816
- var React = __webpack_require__(1);
1817
-
1818
- var T = __webpack_require__(0);
1819
-
1820
- var i18n_1 = __webpack_require__(3);
1821
-
1822
- var Message_1 = __webpack_require__(11);
1823
-
1824
- var FixedSizeContainer_1 = __webpack_require__(14);
1825
- /**
1826
- * @method isMissing
1827
- * @param {any} v
1828
- * @returns {boolean} true if the input value === null or undefined
1829
- */
1830
-
1831
-
1832
- var isMissing = function isMissing(v) {
1833
- return v === null || v === undefined;
1834
- };
1835
-
1836
- exports.isMissing = isMissing;
1837
- /**
1838
- * @method misskingKeys
1839
- * @param {string[]} keys
1840
- * @param {object} target
1841
- * @returns {string[]} the keys of missing required props
1842
- */
1843
-
1844
- var missingKeys = function missingKeys(keys, target) {
1845
- return keys.filter(function (k) {
1846
- return exports.isMissing(target[k]);
1847
- });
1848
2072
  };
1849
-
1850
- exports.missingKeys = missingKeys;
1851
- var propTypes = {
1852
- width: T.oneOfType([T.string, T.number]),
1853
- height: T.oneOfType([T.string, T.number]),
1854
- // eslint-disable-next-line react/no-unused-prop-types
1855
- backgroundColor: T.string,
1856
- missingProps: T.arrayOf(T.string)
2073
+ var themes = {
2074
+ defaultBackgroundColor: function defaultBackgroundColor(props) {
2075
+ return pick_1.default({
2076
+ enterprise: {
2077
+ dark: variables_1.default.black(props),
2078
+ light: variables_1.default.backgroundColor(props)
2079
+ },
2080
+ prisma: variables_1.default.backgroundColorSidebar(props)
2081
+ })(props);
2082
+ }
1857
2083
  };
2084
+ var editorConfig = [AxesChartDataConfig_1.AxesChartDataConfigScatter, {
2085
+ label: AxesChartColorAndStyle_1.default.label,
2086
+ layout: [].concat(_toConsumableArray(AxesChartColorAndStyle_1.default.layout.slice(0, 2)), [[{
2087
+ label: i18n_1._('Series colors by category name'),
2088
+ option: 'seriesColorsByField',
2089
+ editor: 'editor.seriesColorsByField',
2090
+ editorProps: {
2091
+ isCategorical: true
2092
+ }
2093
+ }], [{
2094
+ label: i18n_1._('Marker size'),
2095
+ option: 'markerSize',
2096
+ editor: 'editor.slider',
2097
+ editorProps: {
2098
+ min: 0,
2099
+ max: 20,
2100
+ step: 1
2101
+ }
2102
+ }]])
2103
+ }, AxesChartLegend_1.default, AxesChartXGridAndLabels_1.AxesChartXGridAndLabelsBubbleScatter, AxesChartYGridAndLabels_1.default];
1858
2104
  /**
1859
- * @method MissingPropsMessage
1860
- * @param {MissingPropsProps} props
1861
- * @returns {React.ReactElement}
2105
+ * visualization configuration
1862
2106
  */
1863
2107
 
1864
- var MissingPropsMessage = function MissingPropsMessage(props) {
1865
- var width = props.width,
1866
- height = props.height,
1867
- missingProps = props.missingProps;
1868
- return React.createElement(Message_1.default, {
1869
- "data-test": "message",
1870
- width: width,
1871
- height: height,
1872
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
1873
- });
1874
- };
1875
-
1876
- exports.MissingPropsMessage = MissingPropsMessage;
1877
- exports.MissingPropsMessage.propTypes = propTypes;
1878
- exports.MissingPropsMessage.defaultProps = {
1879
- width: '100%',
1880
- height: 250
1881
- };
1882
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
1883
-
1884
- /***/ }),
1885
-
1886
- /***/ 4:
1887
- /***/ (function(module, exports) {
1888
-
1889
- module.exports = require("styled-components");
1890
-
1891
- /***/ }),
1892
-
1893
- /***/ 40:
1894
- /***/ (function(module, exports, __webpack_require__) {
1895
-
1896
- "use strict";
1897
-
1898
-
1899
- Object.defineProperty(exports, "__esModule", {
1900
- value: true
1901
- });
1902
-
1903
- var React = __webpack_require__(1);
1904
-
1905
- var styled_components_1 = __webpack_require__(4);
1906
-
1907
- var hocUtils_1 = __webpack_require__(8);
1908
-
1909
- var Cover = styled_components_1.default.div.withConfig({
1910
- displayName: "withEditModeCover__Cover",
1911
- componentId: "sc-1gsbnxb-0"
1912
- })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1913
- var Blocker = styled_components_1.default.div.attrs({
1914
- 'data-splunk-visualization-version': "25.0.1 - de10ad954"
1915
- }).withConfig({
1916
- displayName: "withEditModeCover__Blocker",
1917
- componentId: "sc-1gsbnxb-1"
1918
- })(["position:relative;width:100%;height:100%;"]);
1919
- /**
1920
- * HOC that renders a cover layer in edit mode
1921
- * @method withEditModeCover
1922
- * @param {ExtendedDashViz} Visualization
1923
- * @returns {ExtendedDashViz} Wrapper
1924
- */
2108
+ var config = {
2109
+ /**
2110
+ * unique viz key
2111
+ */
2112
+ key: 'splunk.scatter',
1925
2113
 
1926
- var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1927
- var Wrapper = function Wrapper(props) {
1928
- var mode = props.mode;
1929
- var showEditCover = mode === 'edit' && !disableEditModeCover;
1930
- return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
1931
- "data-test": "edit-mode-cover"
1932
- }));
1933
- };
2114
+ /**
2115
+ * viz name
2116
+ */
2117
+ name: 'Scatter',
2118
+ category: VizCategory_1.VizCategory.COMPARISONS,
1934
2119
 
1935
- hocUtils_1.extendStaticWrapperProps({
1936
- Wrapper: Wrapper,
1937
- Visualization: Visualization
1938
- });
1939
- return Wrapper;
2120
+ /**
2121
+ * viz icon
2122
+ */
2123
+ icon: visualization_icons_1.Scatter,
2124
+ placeholderIcon: placeholders_1.Scatter,
2125
+ dataContract: dataContract,
2126
+ size: size,
2127
+ defaultContext: defaultContext,
2128
+ optionsSchema: exports.optionsSchema,
2129
+ editorConfig: editorConfig,
2130
+ events: {
2131
+ 'legend.click': {
2132
+ description: 'triggered when user clicks on chart legend'
2133
+ },
2134
+ 'point.click': {
2135
+ description: 'triggered when user clicks on a point in the scatter chart'
2136
+ }
2137
+ },
2138
+ supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
2139
+ themes: themes
1940
2140
  };
1941
-
1942
- exports.default = withEditModeCover;
1943
-
1944
- /***/ }),
1945
-
1946
- /***/ 41:
1947
- /***/ (function(module, exports) {
1948
-
1949
- module.exports = require("@splunk/visualizations-shared/mapUtils");
2141
+ exports.default = configUtils_1.enhanceConfig(config);
1950
2142
 
1951
2143
  /***/ }),
1952
2144
 
1953
- /***/ 42:
2145
+ /***/ 439:
1954
2146
  /***/ (function(module, exports, __webpack_require__) {
1955
2147
 
1956
2148
  "use strict";
@@ -1959,84 +2151,128 @@ module.exports = require("@splunk/visualizations-shared/mapUtils");
1959
2151
  Object.defineProperty(exports, "__esModule", {
1960
2152
  value: true
1961
2153
  });
2154
+ exports.convertToScatterSCProperties = exports.mapToOldKey = exports.convertToStringValues = exports.scatterOptionValuesSCMapping = void 0;
1962
2155
 
1963
- var React = __webpack_require__(1);
1964
-
1965
- var colorUtils_1 = __webpack_require__(13);
2156
+ var lodash_1 = __webpack_require__(3);
1966
2157
 
1967
- var variables_1 = __webpack_require__(10);
2158
+ var propUtils_1 = __webpack_require__(24);
1968
2159
 
1969
- var IconPlaceholder_1 = __webpack_require__(26);
2160
+ var chartingUtils_1 = __webpack_require__(52); // map for key names which are either new or not present in SimpleXML options mapping
1970
2161
 
1971
- var VizBehavior_1 = __webpack_require__(5);
1972
2162
 
1973
- var hocUtils_1 = __webpack_require__(8);
2163
+ var scatterOptionsSCMapping = {
2164
+ xAxisLabelRotation: 'xAxisMajorLabelRotation',
2165
+ xAxisLabelVisibility: 'xAxisMajorLabelVisibility',
2166
+ yAxisLabelVisibility: 'yAxisMajorLabelVisibility',
2167
+ showRoundedXAxisLabels: 'roundXAxisLabelsToInteger',
2168
+ xAxisLineVisibility: 'xAxisVisibility',
2169
+ yAxisLineVisibility: 'yAxisVisibility',
2170
+ showYMajorGridLines: 'showMajorYGridLines',
2171
+ showXMinorGridLines: 'showMinorXGridLines',
2172
+ showYMinorGridLines: 'showMinorYGridLines',
2173
+ xAxisMajorTickInterval: 'xAxisMajorUnit',
2174
+ yAxisMajorTickInterval: 'yAxisMajorUnit',
2175
+ showXAxisExtendedRange: 'xAxisExtendsAxisRange',
2176
+ showYAxisExtendedRange: 'yAxisExtendsAxisRange',
2177
+ showXAxisWithZero: 'xAxisIncludeZero',
2178
+ showYAxisWithZero: 'yAxisIncludeZero',
2179
+ legendTruncation: 'legendLabelOverflowMode',
2180
+ legendDisplay: 'legendPlacement',
2181
+ resultLimit: 'resultTruncationLimit',
2182
+ seriesColorsByField: 'fieldColors',
2183
+ bubbleSizeMax: 'bubbleMaxSize',
2184
+ bubbleSizeMin: 'bubbleMinSize',
2185
+ bubbleSizeMethod: 'bubbleSizeBy'
2186
+ }; // key value mapping of what options (and their corresponding values) which we expose in config.ts to property values SC understands
1974
2187
 
1975
- var withPlaceholder = function withPlaceholder(Visualization) {
1976
- var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
1977
- var config = Visualization.config;
1978
- var themes = config.themes;
2188
+ exports.scatterOptionValuesSCMapping = {
2189
+ xAxisTitleVisibility: {
2190
+ hide: 'collapsed'
2191
+ },
2192
+ yAxisTitleVisibility: {
2193
+ hide: 'collapsed'
2194
+ },
2195
+ yAxisAbbreviation: {
2196
+ off: 'none'
2197
+ },
2198
+ legendPlacement: {
2199
+ off: 'none'
2200
+ },
2201
+ legendLabelOverflowMode: {
2202
+ ellipsisOff: 'ellipsisNone'
2203
+ }
2204
+ };
2205
+ /**
2206
+ * Helper method to convert option which contains object literal values (e.g. arrays, objects)
2207
+ * to strings as SC can only accept their stringified equivalents
2208
+ * @method convertToStringValues
2209
+ * @param {Object} options
2210
+ * @returns {Object}
2211
+ */
1979
2212
 
1980
- var Wrapper = function Wrapper(props) {
1981
- var _a, _b;
2213
+ var convertToStringValues = function convertToStringValues(options) {
2214
+ var updatedOptions = propUtils_1.convertPropsToString({
2215
+ vizProps: options,
2216
+ propNames: ['seriesColors', 'fieldColors']
2217
+ });
2218
+ return Object.assign(Object.assign({}, options), updatedOptions);
2219
+ };
1982
2220
 
1983
- var dataSources = props.dataSources,
1984
- loading = props.loading,
1985
- options = props.options,
1986
- height = props.height,
1987
- width = props.width;
1988
- var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1989
- var bgColorFromTheme = colorUtils_1.isColor(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
1990
- var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1991
- var iconColor = variables_1.default.contentColorActive(props);
2221
+ exports.convertToStringValues = convertToStringValues;
2222
+ /**
2223
+ * Helper method to update the option names which can be mapped to SimpleXML options or
2224
+ * can be used directly with SC if don't have a 1-1 mapping in SimpleXML
2225
+ * @method mapToOldKey
2226
+ * @param {Object} options
2227
+ * @returns {Object}
2228
+ */
1992
2229
 
1993
- if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1994
- return React.createElement(IconPlaceholder_1.default, {
1995
- "data-test": "icon-placeholder",
1996
- icon: icon,
1997
- width: width,
1998
- height: height,
1999
- backgroundColor: bgColorFromTheme,
2000
- iconColor: iconColor
2001
- });
2002
- }
2230
+ var mapToOldKey = function mapToOldKey(options) {
2231
+ return lodash_1.mapKeys(options, function (val, key) {
2232
+ return scatterOptionsSCMapping[key] ? scatterOptionsSCMapping[key] : key;
2233
+ });
2234
+ };
2003
2235
 
2004
- return React.createElement(Visualization, Object.assign({}, props));
2005
- };
2236
+ exports.mapToOldKey = mapToOldKey;
2237
+ /**
2238
+ * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts
2239
+ * This is for options that has new key name and can not directly be mapped with SimpleXML or
2240
+ * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)
2241
+ * @method convertToScatterSCProperties
2242
+ * @param {Object} originalOptions
2243
+ * @returns {Object}
2244
+ */
2006
2245
 
2007
- hocUtils_1.extendStaticWrapperProps({
2008
- Wrapper: Wrapper,
2009
- Visualization: Visualization
2010
- });
2011
- return Wrapper;
2246
+ var convertToScatterSCProperties = function convertToScatterSCProperties(originalOptions) {
2247
+ return lodash_1.chain(exports.mapToOldKey(originalOptions)).thru(chartingUtils_1.mapToValues(exports.scatterOptionValuesSCMapping)).thru(exports.convertToStringValues).value();
2012
2248
  };
2013
2249
 
2014
- exports.default = withPlaceholder;
2250
+ exports.convertToScatterSCProperties = convertToScatterSCProperties;
2015
2251
 
2016
2252
  /***/ }),
2017
2253
 
2018
2254
  /***/ 44:
2019
2255
  /***/ (function(module, exports) {
2020
2256
 
2021
- module.exports = require("@splunk/visualization-color-palettes");
2257
+ module.exports = require("@splunk/visualization-icons/placeholders");
2022
2258
 
2023
2259
  /***/ }),
2024
2260
 
2025
- /***/ 45:
2261
+ /***/ 46:
2026
2262
  /***/ (function(module, exports) {
2027
2263
 
2028
- module.exports = require("@splunk/visualization-icons/placeholders");
2264
+ module.exports = require("@splunk/visualization-color-palettes");
2029
2265
 
2030
2266
  /***/ }),
2031
2267
 
2032
- /***/ 46:
2268
+ /***/ 47:
2033
2269
  /***/ (function(module, exports) {
2034
2270
 
2035
2271
  module.exports = require("@splunk/visualization-icons");
2036
2272
 
2037
2273
  /***/ }),
2038
2274
 
2039
- /***/ 49:
2275
+ /***/ 50:
2040
2276
  /***/ (function(module, exports, __webpack_require__) {
2041
2277
 
2042
2278
  "use strict";
@@ -2046,7 +2282,7 @@ Object.defineProperty(exports, "__esModule", {
2046
2282
  value: true
2047
2283
  });
2048
2284
 
2049
- var i18n_1 = __webpack_require__(3);
2285
+ var i18n_1 = __webpack_require__(2);
2050
2286
 
2051
2287
  var background = function background(_ref) {
2052
2288
  var label = _ref.label,
@@ -2067,51 +2303,13 @@ exports.default = background;
2067
2303
 
2068
2304
  /***/ }),
2069
2305
 
2070
- /***/ 5:
2071
- /***/ (function(module, exports, __webpack_require__) {
2072
-
2073
- "use strict";
2074
-
2075
-
2076
- Object.defineProperty(exports, "__esModule", {
2077
- value: true
2078
- });
2079
- exports.VizBehavior = void 0;
2080
- var VizBehavior;
2081
-
2082
- (function (VizBehavior) {
2083
- /**
2084
- * Dynamic Options Behavior.
2085
- * This allows visualization options to be powered by data
2086
- *
2087
- * **Example**
2088
- *
2089
- * sparklineValues: ">primary|seriesByIndex(0)"
2090
- * would configure sparklineValues with an array of data points
2091
- * coming from the first series in the primary datasource
2092
- *
2093
- */
2094
- VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
2095
- VizBehavior["EVENTS"] = "events";
2096
- /**
2097
- * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
2098
- * missing.
2099
- * @type {string}
2100
- */
2101
-
2102
- VizBehavior["PLACEHOLDER"] = "placeholder";
2103
- VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
2104
- })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
2105
-
2106
- /***/ }),
2107
-
2108
- /***/ 50:
2306
+ /***/ 52:
2109
2307
  /***/ (function(module, exports, __webpack_require__) {
2110
2308
 
2111
2309
  "use strict";
2112
2310
 
2113
2311
 
2114
- var _toConsumableArray = __webpack_require__(9);
2312
+ var _toConsumableArray = __webpack_require__(8);
2115
2313
 
2116
2314
  var __rest = this && this.__rest || function (s, e) {
2117
2315
  var t = {};
@@ -2131,7 +2329,7 @@ Object.defineProperty(exports, "__esModule", {
2131
2329
  });
2132
2330
  exports.constructFieldsAndColumns = exports.toArrayForSeries = exports.isMultiSeriesData = exports.convertOverlayFields = exports.convertY2AxisOptions = exports.mapToValues = exports.truncateData = exports.getAnnotations = void 0;
2133
2331
 
2134
- var lodash_1 = __webpack_require__(2);
2332
+ var lodash_1 = __webpack_require__(3);
2135
2333
  /**
2136
2334
  * Get formatted annotations
2137
2335
  * @method getAnnotations
@@ -2327,14 +2525,14 @@ exports.constructFieldsAndColumns = constructFieldsAndColumns;
2327
2525
 
2328
2526
  /***/ }),
2329
2527
 
2330
- /***/ 51:
2528
+ /***/ 53:
2331
2529
  /***/ (function(module, exports) {
2332
2530
 
2333
2531
  module.exports = require("@splunk/charting-bundle");
2334
2532
 
2335
2533
  /***/ }),
2336
2534
 
2337
- /***/ 55:
2535
+ /***/ 56:
2338
2536
  /***/ (function(module, exports, __webpack_require__) {
2339
2537
 
2340
2538
  "use strict";
@@ -2346,11 +2544,11 @@ Object.defineProperty(exports, "__esModule", {
2346
2544
  exports.updateRowPayload = exports.canUpdateInPlace = exports.changedOptions = exports.NO_INPLACE_PROPS = void 0;
2347
2545
  /* eslint-disable react/no-unused-prop-types */
2348
2546
 
2349
- var lodash_1 = __webpack_require__(2);
2547
+ var lodash_1 = __webpack_require__(3);
2350
2548
 
2351
- var i18n_1 = __webpack_require__(3);
2549
+ var i18n_1 = __webpack_require__(2);
2352
2550
 
2353
- var visualization_color_palettes_1 = __webpack_require__(44);
2551
+ var visualization_color_palettes_1 = __webpack_require__(46);
2354
2552
 
2355
2553
  var react_1 = __webpack_require__(1);
2356
2554
 
@@ -2358,26 +2556,26 @@ var React = __webpack_require__(1);
2358
2556
 
2359
2557
  var T = __webpack_require__(0);
2360
2558
 
2361
- var react_event_listener_1 = __webpack_require__(56);
2559
+ var react_event_listener_1 = __webpack_require__(57);
2362
2560
 
2363
- __webpack_require__(57); // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions
2561
+ __webpack_require__(58); // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions
2364
2562
 
2365
2563
 
2366
- var charting_bundle_1 = __webpack_require__(51);
2564
+ var charting_bundle_1 = __webpack_require__(53);
2367
2565
 
2368
- var TimezoneContext_1 = __webpack_require__(21);
2566
+ var TimezoneContext_1 = __webpack_require__(23);
2369
2567
 
2370
2568
  var style_1 = __webpack_require__(15);
2371
2569
 
2372
2570
  var styled_components_1 = __webpack_require__(4);
2373
2571
 
2374
- var Message_1 = __webpack_require__(11);
2572
+ var Message_1 = __webpack_require__(10);
2375
2573
 
2376
- var useSplunkTheme_1 = __webpack_require__(58);
2574
+ var useSplunkTheme_1 = __webpack_require__(59);
2377
2575
 
2378
- var themeUtils_1 = __webpack_require__(59);
2576
+ var themeUtils_1 = __webpack_require__(60);
2379
2577
 
2380
- var ChartingApi_1 = __webpack_require__(60);
2578
+ var ChartingApi_1 = __webpack_require__(61);
2381
2579
 
2382
2580
  exports.NO_INPLACE_PROPS = ['chart', 'chart.orientation', 'layout.splitSeries', 'chart.style', 'legend.placement'];
2383
2581
 
@@ -2753,284 +2951,85 @@ var withEmptyChartMessage = function withEmptyChartMessage(Chart) {
2753
2951
  }; // export default Charting;
2754
2952
 
2755
2953
 
2756
- exports.default = withEmptyChartMessage(Charting);
2757
-
2758
- /***/ }),
2759
-
2760
- /***/ 56:
2761
- /***/ (function(module, exports) {
2762
-
2763
- module.exports = require("react-event-listener");
2764
-
2765
- /***/ }),
2766
-
2767
- /***/ 57:
2768
- /***/ (function(module, exports) {
2769
-
2770
- module.exports = require("@splunk/visualizations-shared/i18n");
2771
-
2772
- /***/ }),
2773
-
2774
- /***/ 58:
2775
- /***/ (function(module, exports) {
2776
-
2777
- module.exports = require("@splunk/themes/useSplunkTheme");
2778
-
2779
- /***/ }),
2780
-
2781
- /***/ 59:
2782
- /***/ (function(module, exports) {
2783
-
2784
- module.exports = require("@splunk/visualizations-shared/themeUtils");
2785
-
2786
- /***/ }),
2787
-
2788
- /***/ 6:
2789
- /***/ (function(module, exports, __webpack_require__) {
2790
-
2791
- "use strict";
2792
-
2793
-
2794
- var _toConsumableArray = __webpack_require__(9);
2795
-
2796
- var _defineProperty = __webpack_require__(7);
2797
-
2798
- var __rest = this && this.__rest || function (s, e) {
2799
- var t = {};
2800
-
2801
- for (var p in s) {
2802
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
2803
- }
2804
-
2805
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2806
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
2807
- }
2808
- return t;
2809
- };
2810
-
2811
- Object.defineProperty(exports, "__esModule", {
2812
- value: true
2813
- });
2814
- exports.insertLayout = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
2815
-
2816
- var lodash_1 = __webpack_require__(2);
2817
-
2818
- var schemaUtils_1 = __webpack_require__(16);
2819
-
2820
- var VizBehavior_1 = __webpack_require__(5);
2821
-
2822
- var dynamicOptionsDSLType = {
2823
- type: 'string',
2824
- pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
2825
- };
2826
- /**
2827
- * Helper function to extend an options schema with dynamic options DSL
2828
- * @param optionsSchema a visualization's options schema
2829
- * @returns an updated options schema that additionally allows strings starting with > for each option
2830
- */
2831
-
2832
- function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
2833
- var enhancedOptionsSchema = {};
2834
- Object.keys(optionsSchema).forEach(function (key) {
2835
- var _a = optionsSchema[key],
2836
- title = _a.title,
2837
- description = _a.description,
2838
- readOnly = _a.readOnly,
2839
- writeOnly = _a.writeOnly,
2840
- examples = _a.examples,
2841
- defaultValue = _a.default,
2842
- type = _a.type,
2843
- properties = _a.properties,
2844
- patternProperties = _a.patternProperties,
2845
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
2846
-
2847
- var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
2848
- title: title
2849
- }), description !== undefined && {
2850
- description: description
2851
- }), readOnly !== undefined && {
2852
- readOnly: readOnly
2853
- }), writeOnly !== undefined && {
2854
- writeOnly: writeOnly
2855
- }), examples !== undefined && {
2856
- examples: examples
2857
- }), defaultValue !== undefined && {
2858
- default: defaultValue
2859
- });
2860
-
2861
- if (type === 'object') {
2862
- enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
2863
- type: type
2864
- }), properties && {
2865
- properties: enhanceOptionsSchemaWithDynamicOptions(properties)
2866
- });
2867
-
2868
- if (patternProperties) {
2869
- var enhancedPatternProperties = {};
2870
- Object.keys(patternProperties).forEach(function (opt) {
2871
- enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
2872
- });
2873
- enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
2874
- }
2875
- } else {
2876
- enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
2877
- anyOf: [Object.assign(Object.assign({}, type !== undefined && {
2878
- type: type
2879
- }), remainingSchemaEntry), dynamicOptionsDSLType]
2880
- });
2881
- }
2882
- });
2883
- return enhancedOptionsSchema;
2884
- }
2885
-
2886
- exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
2887
- /**
2888
- * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
2889
- * this function also collapse all editor panels
2890
- * @param vizConfig a Visualization Config
2891
- * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
2892
- * and containing `open: false` for all editor panels in editorConfig
2893
- */
2894
-
2895
- function enhanceConfig(vizConfig) {
2896
- var enhancedConfig = vizConfig;
2897
-
2898
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
2899
- enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
2900
- }
2954
+ exports.default = withEmptyChartMessage(Charting);
2901
2955
 
2902
- enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
2903
- return Object.assign(Object.assign({}, config), {
2904
- open: false
2905
- });
2906
- });
2907
- return enhancedConfig;
2908
- }
2956
+ /***/ }),
2909
2957
 
2910
- exports.enhanceConfig = enhanceConfig;
2911
- /**
2912
- * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
2913
- * Created for editor unit tests
2914
- * @param vizConfig a Visualization Config
2915
- * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
2916
- */
2958
+ /***/ 57:
2959
+ /***/ (function(module, exports) {
2917
2960
 
2918
- function uncollapseEditorConfig(vizConfig) {
2919
- var editorPanelUncollapsedConfig = vizConfig;
2920
- editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
2921
- return Object.assign(Object.assign({}, config), {
2922
- open: true
2923
- });
2924
- });
2925
- return editorPanelUncollapsedConfig;
2926
- }
2961
+ module.exports = require("react-event-listener");
2927
2962
 
2928
- exports.uncollapseEditorConfig = uncollapseEditorConfig;
2963
+ /***/ }),
2929
2964
 
2930
- function isDynamicOption(option) {
2931
- return option && typeof option === 'string' && option.trim().startsWith('>') || false;
2932
- }
2965
+ /***/ 58:
2966
+ /***/ (function(module, exports) {
2933
2967
 
2934
- exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
2935
- // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
2968
+ module.exports = require("@splunk/visualizations-shared/i18n");
2936
2969
 
2937
- /**
2938
- * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
2939
- * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
2940
- * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
2941
- * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
2942
- *
2943
- * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
2944
- */
2970
+ /***/ }),
2945
2971
 
2946
- function hasCompatibleContexts(vizContext, presetContext) {
2947
- var presetContextKeys = Object.keys(presetContext);
2948
- return presetContextKeys.every(function (contextKey) {
2949
- return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
2950
- });
2951
- }
2952
- /**
2953
- * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
2954
- */
2972
+ /***/ 59:
2973
+ /***/ (function(module, exports) {
2955
2974
 
2975
+ module.exports = require("@splunk/themes/useSplunkTheme");
2956
2976
 
2957
- function hasCompatibleOptions(vizOptions, presetOptions) {
2958
- var presetOptionKeys = Object.keys(presetOptions);
2959
- return presetOptionKeys.every(function (optionKey) {
2960
- return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
2961
- });
2962
- }
2963
- /**
2964
- * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
2965
- * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
2966
- *
2967
- * @param {Object} vizContext - the current vizContext definition
2968
- * @param {Object} vizOptions - the current vizOptions definition
2969
- * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
2970
- */
2977
+ /***/ }),
2971
2978
 
2979
+ /***/ 6:
2980
+ /***/ (function(module, exports, __webpack_require__) {
2972
2981
 
2973
- function getInitialPreset(vizContext, vizOptions, presets) {
2974
- return presets.find(function (preset) {
2975
- var presetContext = lodash_1.get(preset, ['value', 'context'], {});
2976
- var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
2977
- var presetContextKeys = Object.keys(presetContext);
2978
- var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
2979
- // if not, then the preset is invalid in config.ts
2982
+ "use strict";
2980
2983
 
2981
- if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
2982
- return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
2983
- });
2984
- }
2985
2984
 
2986
- exports.getInitialPreset = getInitialPreset;
2987
- /**
2988
- * generates number precision values for a Select editor
2989
- *
2990
- * @param {Number} numPrecisionValues - number of integer precision values to generate
2991
- * @returns {{ label: string; value; string }[]} array of { label, value } tuples
2992
- */
2985
+ Object.defineProperty(exports, "__esModule", {
2986
+ value: true
2987
+ });
2988
+ exports.VizBehavior = void 0;
2989
+ var VizBehavior;
2993
2990
 
2994
- function generatePrecisionValues(numPrecisionValues) {
2995
- return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
2996
- return {
2997
- label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
2998
- value: i
2999
- };
3000
- });
3001
- }
2991
+ (function (VizBehavior) {
2992
+ /**
2993
+ * Dynamic Options Behavior.
2994
+ * This allows visualization options to be powered by data
2995
+ *
2996
+ * **Example**
2997
+ *
2998
+ * sparklineValues: ">primary|seriesByIndex(0)"
2999
+ * would configure sparklineValues with an array of data points
3000
+ * coming from the first series in the primary datasource
3001
+ *
3002
+ */
3003
+ VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
3004
+ VizBehavior["EVENTS"] = "events";
3005
+ /**
3006
+ * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
3007
+ * missing.
3008
+ * @type {string}
3009
+ */
3002
3010
 
3003
- exports.generatePrecisionValues = generatePrecisionValues;
3004
- /**
3005
- * insert layout in layout array, return a new layout array instead of updating the original
3006
- *
3007
- * @param {EditorLayoutConfig[][]} layout - editor layout
3008
- * @param {Number} index - the index to insert layout item(s)
3009
- * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
3010
- * @returns {EditorLayoutConfig[][]} new editor layout with insertion
3011
- */
3011
+ VizBehavior["PLACEHOLDER"] = "placeholder";
3012
+ VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
3013
+ })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
3012
3014
 
3013
- var insertLayout = function insertLayout(layout, index) {
3014
- for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
3015
- layoutItems[_key - 2] = arguments[_key];
3016
- }
3015
+ /***/ }),
3017
3016
 
3018
- return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
3019
- };
3017
+ /***/ 60:
3018
+ /***/ (function(module, exports) {
3020
3019
 
3021
- exports.insertLayout = insertLayout;
3020
+ module.exports = require("@splunk/visualizations-shared/themeUtils");
3022
3021
 
3023
3022
  /***/ }),
3024
3023
 
3025
- /***/ 60:
3024
+ /***/ 61:
3026
3025
  /***/ (function(module, exports, __webpack_require__) {
3027
3026
 
3028
3027
  "use strict";
3029
3028
 
3030
3029
 
3031
- var _classCallCheck = __webpack_require__(12);
3030
+ var _classCallCheck = __webpack_require__(11);
3032
3031
 
3033
- var _createClass = __webpack_require__(17);
3032
+ var _createClass = __webpack_require__(19);
3034
3033
 
3035
3034
  Object.defineProperty(exports, "__esModule", {
3036
3035
  value: true
@@ -3091,29 +3090,29 @@ exports.ChartingApiFunctional = ChartingApiFunctional;
3091
3090
 
3092
3091
  /***/ }),
3093
3092
 
3094
- /***/ 61:
3093
+ /***/ 62:
3095
3094
  /***/ (function(module, exports) {
3096
3095
 
3097
3096
  module.exports = require("@splunk/visualizations-shared/simpleXMLOptions");
3098
3097
 
3099
3098
  /***/ }),
3100
3099
 
3101
- /***/ 63:
3100
+ /***/ 64:
3102
3101
  /***/ (function(module, exports, __webpack_require__) {
3103
3102
 
3104
3103
  "use strict";
3105
3104
 
3106
3105
 
3107
- var _toConsumableArray = __webpack_require__(9);
3106
+ var _toConsumableArray = __webpack_require__(8);
3108
3107
 
3109
3108
  Object.defineProperty(exports, "__esModule", {
3110
3109
  value: true
3111
3110
  });
3112
3111
  exports.AxesChartDataConfigAreaColumnLine = exports.AxesChartDataConfigBubble = exports.AxesChartDataConfigScatter = exports.AxesChartDataConfigBar = void 0;
3113
3112
 
3114
- var i18n_1 = __webpack_require__(3);
3113
+ var i18n_1 = __webpack_require__(2);
3115
3114
 
3116
- var configUtils_1 = __webpack_require__(6);
3115
+ var configUtils_1 = __webpack_require__(17);
3117
3116
 
3118
3117
  var AxesChartDataConfig = {
3119
3118
  label: i18n_1._('Data configurations'),
@@ -3154,15 +3153,35 @@ exports.AxesChartDataConfigBar = {
3154
3153
  };
3155
3154
  exports.AxesChartDataConfigScatter = {
3156
3155
  label: AxesChartDataConfig.label,
3157
- // layout: insert Category after Y
3158
- layout: configUtils_1.insertLayout(AxesChartDataConfig.layout, 2, [{
3156
+ layout: [[{
3157
+ label: i18n_1._('X'),
3158
+ option: 'x',
3159
+ editor: 'editor.columnSelector',
3160
+ editorProps: {
3161
+ dataSourceKey: 'primary'
3162
+ }
3163
+ }], [{
3164
+ label: i18n_1._('Y'),
3165
+ option: 'y',
3166
+ editor: 'editor.columnSelector',
3167
+ editorProps: {
3168
+ dataSourceKey: 'primary'
3169
+ }
3170
+ }], [{
3159
3171
  label: i18n_1._('Category'),
3160
3172
  option: 'category',
3161
3173
  editor: 'editor.columnSelector',
3162
3174
  editorProps: {
3163
3175
  dataSourceKey: 'primary'
3164
3176
  }
3165
- }])
3177
+ }], [{
3178
+ label: i18n_1._('Result limit'),
3179
+ option: 'resultLimit',
3180
+ editor: 'editor.number',
3181
+ editorProps: {
3182
+ dataSourceKey: 'primary'
3183
+ }
3184
+ }]]
3166
3185
  };
3167
3186
  exports.AxesChartDataConfigBubble = {
3168
3187
  label: exports.AxesChartDataConfigScatter.label,
@@ -3198,7 +3217,7 @@ exports.default = AxesChartDataConfig;
3198
3217
 
3199
3218
  /***/ }),
3200
3219
 
3201
- /***/ 64:
3220
+ /***/ 65:
3202
3221
  /***/ (function(module, exports, __webpack_require__) {
3203
3222
 
3204
3223
  "use strict";
@@ -3208,13 +3227,13 @@ Object.defineProperty(exports, "__esModule", {
3208
3227
  value: true
3209
3228
  });
3210
3229
 
3211
- var i18n_1 = __webpack_require__(3);
3230
+ var i18n_1 = __webpack_require__(2);
3212
3231
 
3213
- var pick_1 = __webpack_require__(20);
3232
+ var pick_1 = __webpack_require__(21);
3214
3233
 
3215
- var variables_1 = __webpack_require__(10);
3234
+ var variables_1 = __webpack_require__(9);
3216
3235
 
3217
- var BackgroundColor_1 = __webpack_require__(49);
3236
+ var BackgroundColor_1 = __webpack_require__(50);
3218
3237
 
3219
3238
  var themes = {
3220
3239
  defaultBackgroundColor: function defaultBackgroundColor(props) {
@@ -3231,29 +3250,21 @@ var AxesChartColorAndStyle = {
3231
3250
  label: i18n_1._('Color and style'),
3232
3251
  layout: [BackgroundColor_1.default({
3233
3252
  themes: themes
3234
- }) // Add SeriesColorsEditor when SCP-55658 is done e.g.
3235
- // [
3236
- // {
3237
- // label: _('Series colors'),
3238
- // option: 'seriesColors',
3239
- // editor: 'editor.seriesColors',
3240
- // },
3241
- // ],
3242
- // Add SeriesColorsByFieldEditor here when SCP-55687 is done, e.g.
3243
- // [
3244
- // {
3245
- // label: _('Series colors by field name'),
3246
- // option: 'seriesColorsByField',
3247
- // editor: 'editor.seriesColorsByField',
3248
- // },
3249
- // ],
3250
- ]
3253
+ }), [{
3254
+ label: i18n_1._('Series colors'),
3255
+ option: 'seriesColors',
3256
+ editor: 'editor.seriesColors'
3257
+ }], [{
3258
+ label: i18n_1._('Series colors by field name'),
3259
+ option: 'seriesColorsByField',
3260
+ editor: 'editor.seriesColorsByField'
3261
+ }]]
3251
3262
  };
3252
3263
  exports.default = AxesChartColorAndStyle;
3253
3264
 
3254
3265
  /***/ }),
3255
3266
 
3256
- /***/ 65:
3267
+ /***/ 66:
3257
3268
  /***/ (function(module, exports, __webpack_require__) {
3258
3269
 
3259
3270
  "use strict";
@@ -3263,7 +3274,7 @@ Object.defineProperty(exports, "__esModule", {
3263
3274
  value: true
3264
3275
  });
3265
3276
 
3266
- var i18n_1 = __webpack_require__(3);
3277
+ var i18n_1 = __webpack_require__(2);
3267
3278
 
3268
3279
  var AxesChartLegend = {
3269
3280
  label: i18n_1._('Legend'),
@@ -3318,22 +3329,22 @@ exports.default = AxesChartLegend;
3318
3329
 
3319
3330
  /***/ }),
3320
3331
 
3321
- /***/ 66:
3332
+ /***/ 67:
3322
3333
  /***/ (function(module, exports, __webpack_require__) {
3323
3334
 
3324
3335
  "use strict";
3325
3336
 
3326
3337
 
3327
- var _toConsumableArray = __webpack_require__(9);
3338
+ var _toConsumableArray = __webpack_require__(8);
3328
3339
 
3329
3340
  Object.defineProperty(exports, "__esModule", {
3330
3341
  value: true
3331
3342
  });
3332
3343
  exports.AxesChartXGridAndLabelsBubbleScatter = exports.AxesChartXGridAndLabelsCommon = void 0;
3333
3344
 
3334
- var i18n_1 = __webpack_require__(3);
3345
+ var i18n_1 = __webpack_require__(2);
3335
3346
 
3336
- var configUtils_1 = __webpack_require__(6);
3347
+ var configUtils_1 = __webpack_require__(17);
3337
3348
 
3338
3349
  exports.AxesChartXGridAndLabelsCommon = {
3339
3350
  label: i18n_1._('X-axis grid and labels'),
@@ -3372,7 +3383,7 @@ var AxesChartXGridAndLabels = {
3372
3383
  layout: [].concat(_toConsumableArray(exports.AxesChartXGridAndLabelsCommon.layout), [[{
3373
3384
  label: i18n_1._('Label rotation'),
3374
3385
  option: 'xAxisLabelRotation',
3375
- editor: 'editor.radioBar',
3386
+ editor: 'editor.select',
3376
3387
  editorProps: {
3377
3388
  values: [{
3378
3389
  label: i18n_1._('-90'),
@@ -3464,7 +3475,7 @@ exports.AxesChartXGridAndLabelsBubbleScatter = {
3464
3475
  }])), [[{
3465
3476
  label: i18n_1._('Label rotation'),
3466
3477
  option: 'xAxisLabelRotation',
3467
- editor: 'editor.radioBar',
3478
+ editor: 'editor.select',
3468
3479
  editorProps: {
3469
3480
  values: [{
3470
3481
  label: i18n_1._('-90'),
@@ -3607,7 +3618,7 @@ exports.default = AxesChartXGridAndLabels;
3607
3618
 
3608
3619
  /***/ }),
3609
3620
 
3610
- /***/ 67:
3621
+ /***/ 68:
3611
3622
  /***/ (function(module, exports, __webpack_require__) {
3612
3623
 
3613
3624
  "use strict";
@@ -3617,7 +3628,7 @@ Object.defineProperty(exports, "__esModule", {
3617
3628
  value: true
3618
3629
  });
3619
3630
 
3620
- var i18n_1 = __webpack_require__(3);
3631
+ var i18n_1 = __webpack_require__(2);
3621
3632
 
3622
3633
  var AxesChartYGridAndLabels = {
3623
3634
  label: i18n_1._('Y-axis grid and labels'),
@@ -3778,96 +3789,16 @@ module.exports = require("@babel/runtime/helpers/defineProperty");
3778
3789
  /***/ }),
3779
3790
 
3780
3791
  /***/ 8:
3781
- /***/ (function(module, exports, __webpack_require__) {
3782
-
3783
- "use strict";
3784
-
3785
-
3786
- var _typeof = __webpack_require__(25);
3787
-
3788
- Object.defineProperty(exports, "__esModule", {
3789
- value: true
3790
- });
3791
- exports.deepMergeWithArrayPrimitiveOverrides = exports.extendStaticWrapperProps = void 0;
3792
-
3793
- var lodash_1 = __webpack_require__(2);
3794
-
3795
- var mapUtils_1 = __webpack_require__(41);
3796
- /**
3797
- * @method extendStaticWrapperProps
3798
- * @param {Object} props
3799
- * @param {DashboardVizType} props.Wrapper
3800
- * @param {DashboardVizType} props.Visualization
3801
- */
3802
-
3803
-
3804
- var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
3805
- var Wrapper = _ref.Wrapper,
3806
- Visualization = _ref.Visualization;
3807
- var extendProperties = ['propTypes', 'defaultProps', 'config'];
3808
- extendProperties.forEach(function (prop) {
3809
- if (Visualization[prop]) {
3810
- // eslint-disable-next-line no-param-reassign
3811
- Wrapper[prop] = Visualization[prop];
3812
- }
3813
- });
3814
- };
3815
-
3816
- exports.extendStaticWrapperProps = extendStaticWrapperProps;
3817
- /**
3818
- * helper to deeply merge objects while preserving arrays in earlier source objects
3819
- * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object
3820
- * this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).
3821
- * Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair
3822
- * will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.
3823
- *
3824
- * @method deepMergeWithArrayPrimitiveOverrides
3825
- * @param {Object} initial - target object to merge values into
3826
- * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones
3827
- *
3828
- * @returns {Object}
3829
- */
3830
-
3831
- var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
3832
- var clone = lodash_1.cloneDeep(initial);
3833
-
3834
- for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3835
- sources[_key - 1] = arguments[_key];
3836
- }
3837
-
3838
- sources.forEach(function (sourceToApply) {
3839
- Object.keys(sourceToApply).forEach(function (sourceKey) {
3840
- if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
3841
- clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
3842
- }
3843
-
3844
- if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
3845
- clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
3846
- } else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
3847
- // If option is an array of objects
3848
- for (var i = 0; i < clone[sourceKey].length; i += 1) {
3849
- if (_typeof(clone[sourceKey][i]) === 'object') {
3850
- var closestMatchIdx = mapUtils_1.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
3851
-
3852
- if (closestMatchIdx > -1) {
3853
- clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
3854
- }
3855
- }
3856
- }
3857
- }
3858
- });
3859
- });
3860
- return clone;
3861
- };
3792
+ /***/ (function(module, exports) {
3862
3793
 
3863
- exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
3794
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
3864
3795
 
3865
3796
  /***/ }),
3866
3797
 
3867
3798
  /***/ 9:
3868
3799
  /***/ (function(module, exports) {
3869
3800
 
3870
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
3801
+ module.exports = require("@splunk/themes/variables");
3871
3802
 
3872
3803
  /***/ })
3873
3804