@splunk/visualizations 25.13.1 → 26.1.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 (150) hide show
  1. package/Area.config.js +318 -234
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +1131 -766
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +317 -233
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +1007 -594
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +234 -160
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +912 -509
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +80 -29
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +691 -319
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +308 -223
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +1011 -587
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +127 -62
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +576 -286
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +111 -29
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +998 -527
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +142 -73
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +962 -572
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +70 -26
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +524 -253
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +326 -242
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +1022 -606
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +99 -49
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +1184 -762
  44. package/LinkGraph.js.map +1 -1
  45. package/MIGRATION.md +1082 -0
  46. package/Map.config.js +311 -167
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +1479 -873
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +93 -43
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +603 -332
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +163 -105
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +1025 -628
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +95 -41
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +993 -622
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +99 -46
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +847 -442
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +114 -62
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +1097 -633
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +131 -65
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +580 -288
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +103 -41
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +1128 -586
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +231 -157
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +904 -504
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +212 -142
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +1506 -956
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +294 -233
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +208 -138
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +1375 -914
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +252 -137
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +2194 -1069
  95. package/SingleValueRadial.js.map +1 -1
  96. package/SparkLine.js +172 -83
  97. package/SparkLine.js.map +1 -1
  98. package/Table.config.js +123 -70
  99. package/Table.config.js.map +1 -1
  100. package/Table.js +1094 -590
  101. package/Table.js.map +1 -1
  102. package/common/Charting.js +147 -75
  103. package/common/Charting.js.map +1 -1
  104. package/common/ChartingApi.js +18 -7
  105. package/common/ChartingApi.js.map +1 -1
  106. package/common/EventsDoc.js +91 -36
  107. package/common/EventsDoc.js.map +1 -1
  108. package/common/GaugeMajorTicks.js +70 -60
  109. package/common/GaugeMajorTicks.js.map +1 -1
  110. package/common/GaugeValueMarker.js +45 -36
  111. package/common/GaugeValueMarker.js.map +1 -1
  112. package/common/OptionsDoc.js +177 -86
  113. package/common/OptionsDoc.js.map +1 -1
  114. package/common/OverviewDoc.js +65 -32
  115. package/common/OverviewDoc.js.map +1 -1
  116. package/common/SplunkVisualization.js +34 -7
  117. package/common/SplunkVisualization.js.map +1 -1
  118. package/common/SplunkVisualizationApi.js +10 -4
  119. package/common/SplunkVisualizationApi.js.map +1 -1
  120. package/common/ThemesDoc.js +41 -28
  121. package/common/ThemesDoc.js.map +1 -1
  122. package/common/chartingUtils.js +56 -24
  123. package/common/chartingUtils.js.map +1 -1
  124. package/common/docUtils.js +15 -5
  125. package/common/docUtils.js.map +1 -1
  126. package/common/gaugeUtils.js +238 -155
  127. package/common/gaugeUtils.js.map +1 -1
  128. package/common/shapeUtils.js +34 -16
  129. package/common/shapeUtils.js.map +1 -1
  130. package/common/utils/configUtils.js +59 -23
  131. package/common/utils/configUtils.js.map +1 -1
  132. package/common/utils/dataUtils.js +9 -4
  133. package/common/utils/dataUtils.js.map +1 -1
  134. package/common/utils/hocUtils.js +5 -3
  135. package/common/utils/hocUtils.js.map +1 -1
  136. package/common/utils/layoutUtils.js +3 -2
  137. package/common/utils/layoutUtils.js.map +1 -1
  138. package/common/utils/mapUtils.js +370 -206
  139. package/common/utils/mapUtils.js.map +1 -1
  140. package/common/utils/singleValueUtils.js +243 -198
  141. package/common/utils/singleValueUtils.js.map +1 -1
  142. package/common/utils/testHelper.js +36 -9
  143. package/common/utils/testHelper.js.map +1 -1
  144. package/common/utils/trellisUtils.js +87 -26
  145. package/common/utils/trellisUtils.js.map +1 -1
  146. package/common/utils/urlUtils.js +4 -2
  147. package/common/utils/urlUtils.js.map +1 -1
  148. package/common/withDashboardViz.js +375 -193
  149. package/common/withDashboardViz.js.map +1 -1
  150. package/package.json +25 -27
package/Sankey.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 = 454);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 457);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -120,35 +120,54 @@ module.exports = require("@splunk/themes/variables");
120
120
 
121
121
  /***/ }),
122
122
 
123
- /***/ 110:
123
+ /***/ 111:
124
124
  /***/ (function(module, exports, __webpack_require__) {
125
125
 
126
126
  "use strict";
127
127
 
128
128
 
129
129
  var _toConsumableArray = __webpack_require__(8);
130
+
130
131
  var _slicedToArray = __webpack_require__(17);
132
+
131
133
  Object.defineProperty(exports, "__esModule", {
132
134
  value: true
133
135
  });
134
136
  exports.DEFAULT_LINK_VALUE_INDEX = exports.DEFAULT_TARGET_INDEX = exports.DEFAULT_SOURCE_INDEX = exports.DEFAULT_CHART_HEIGHT = exports.DEFAULT_CHART_WIDTH = exports.CHART_MIN_HEIGHT = exports.CHART_MIN_WIDTH = exports.INACTIVE_OPACITY = exports.DEFAULT_NODE_OPACITY = exports.DEFAULT_LINK_OPACITY = exports.DEFAULT_SERIES_COLOR = exports.DEFAULT_LINK_COLOR = exports.DEFAULT_NODE_COLOR = exports.DEFAULT_FONT_FAMILY = exports.NODE_TEXT_FONT_SIZE = exports.DEFAULT_COLORS = void 0;
137
+
135
138
  var React = __webpack_require__(1);
139
+
136
140
  var react_1 = __webpack_require__(1);
141
+
137
142
  var T = __webpack_require__(0);
143
+
138
144
  var lodash_1 = __webpack_require__(3);
145
+
139
146
  var styled_components_1 = __webpack_require__(4);
147
+
140
148
  var Message_1 = __webpack_require__(10);
149
+
141
150
  var i18n_1 = __webpack_require__(2);
151
+
142
152
  var SizeAwareWrapper_1 = __webpack_require__(19);
153
+
143
154
  var style_1 = __webpack_require__(14);
144
- var visualization_color_palettes_1 = __webpack_require__(51);
145
- // eslint-disable-next-line camelcase
146
- var sankey_1 = __webpack_require__(455);
147
- var VizStyleWrapper_1 = __webpack_require__(72);
148
- var SankeyUtils_1 = __webpack_require__(133);
149
- var SankeyNode_1 = __webpack_require__(456);
150
- var SankeyLink_1 = __webpack_require__(457);
151
- var SankeyTooltip_1 = __webpack_require__(458);
155
+
156
+ var visualization_color_palettes_1 = __webpack_require__(51); // eslint-disable-next-line camelcase
157
+
158
+
159
+ var sankey_1 = __webpack_require__(458);
160
+
161
+ var VizStyleWrapper_1 = __webpack_require__(73);
162
+
163
+ var SankeyUtils_1 = __webpack_require__(134);
164
+
165
+ var SankeyNode_1 = __webpack_require__(459);
166
+
167
+ var SankeyLink_1 = __webpack_require__(460);
168
+
169
+ var SankeyTooltip_1 = __webpack_require__(461);
170
+
152
171
  exports.DEFAULT_COLORS = {
153
172
  backgroundColor: '#ffffff',
154
173
  nodeTextColor: '#2c2c2c',
@@ -177,94 +196,139 @@ var SankeyContainer = styled_components_1.default.div.withConfig({
177
196
  displayName: "PureSankey__SankeyContainer",
178
197
  componentId: "sc-1r333qx-0"
179
198
  })(["overflow:hidden;", ";"], function (props) {
180
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
199
+ return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
181
200
  });
201
+
182
202
  var PureSankey = function PureSankey(props) {
183
203
  var width = props.width,
184
- height = props.height,
185
- columns = props.columns,
186
- colorMode = props.colorMode,
187
- nodeWidth = props.nodeWidth,
188
- nodePadding = props.nodePadding,
189
- resultLimit = props.resultLimit,
190
- seriesColors = props.seriesColors,
191
- linkColors = props.linkColors,
192
- linkOpacity = props.linkOpacity,
193
- linkValueField = props.linkValueField,
194
- backgroundColor = props.backgroundColor,
195
- nodeTextColor = props.nodeTextColor,
196
- tooltipRowColor = props.tooltipRowColor,
197
- tooltipLinkHeaderColor = props.tooltipLinkHeaderColor,
198
- tooltipHeaderColor = props.tooltipHeaderColor;
204
+ height = props.height,
205
+ columns = props.columns,
206
+ columnsFromDataSource = props.columnsFromDataSource,
207
+ fields = props.fields,
208
+ colorMode = props.colorMode,
209
+ nodeWidth = props.nodeWidth,
210
+ nodePadding = props.nodePadding,
211
+ resultLimit = props.resultLimit,
212
+ seriesColors = props.seriesColors,
213
+ linkColors = props.linkColors,
214
+ linkOpacity = props.linkOpacity,
215
+ linkValueField = props.linkValueField,
216
+ backgroundColor = props.backgroundColor,
217
+ nodeTextColor = props.nodeTextColor,
218
+ tooltipRowColor = props.tooltipRowColor,
219
+ tooltipLinkHeaderColor = props.tooltipLinkHeaderColor,
220
+ tooltipHeaderColor = props.tooltipHeaderColor,
221
+ onNodeClick = props.onNodeClick,
222
+ onLinkClick = props.onLinkClick;
199
223
  var margin = {
200
224
  top: 17,
201
225
  right: 25,
202
226
  bottom: 17,
203
227
  left: 30
204
- };
205
- // This is to translate the svg's root g based on margin
228
+ }; // This is to translate the svg's root g based on margin
206
229
  // The y position is same as margin top & bottom
207
230
  // The x position is an avg of margin right & left
231
+
208
232
  var translatePos = {
209
233
  x: 28,
210
234
  y: 17
211
235
  };
212
- var _react_1$useState = react_1.useState([]),
213
- _react_1$useState2 = _slicedToArray(_react_1$useState, 2),
214
- activeLinks = _react_1$useState2[0],
215
- setActiveLinks = _react_1$useState2[1];
216
- var _react_1$useState3 = react_1.useState([]),
217
- _react_1$useState4 = _slicedToArray(_react_1$useState3, 2),
218
- activeNodes = _react_1$useState4[0],
219
- setActiveNodes = _react_1$useState4[1];
220
- var _react_1$useState5 = react_1.useState(null),
221
- _react_1$useState6 = _slicedToArray(_react_1$useState5, 2),
222
- nodeHovered = _react_1$useState6[0],
223
- setNodeHovered = _react_1$useState6[1];
224
- var _react_1$useState7 = react_1.useState(null),
225
- _react_1$useState8 = _slicedToArray(_react_1$useState7, 2),
226
- hoveredNodeElement = _react_1$useState8[0],
227
- setHoveredNodeElement = _react_1$useState8[1];
228
- var _react_1$useState9 = react_1.useState(false),
229
- _react_1$useState10 = _slicedToArray(_react_1$useState9, 2),
230
- openNodeToolTip = _react_1$useState10[0],
231
- setOpenNodeToolTip = _react_1$useState10[1];
232
- var _react_1$useState11 = react_1.useState(null),
233
- _react_1$useState12 = _slicedToArray(_react_1$useState11, 2),
234
- hoveredLinkElement = _react_1$useState12[0],
235
- setHoveredLinkElement = _react_1$useState12[1];
236
- var _react_1$useState13 = react_1.useState(false),
237
- _react_1$useState14 = _slicedToArray(_react_1$useState13, 2),
238
- openLinkToolTip = _react_1$useState14[0],
239
- setOpenLinkToolTip = _react_1$useState14[1];
240
- var sankeyContainerElement = react_1.useRef(null);
241
- var _react_1$useState15 = react_1.useState(exports.DEFAULT_CHART_WIDTH - margin.left - margin.right),
242
- _react_1$useState16 = _slicedToArray(_react_1$useState15, 2),
243
- sankeyWidth = _react_1$useState16[0],
244
- setSankeyWidth = _react_1$useState16[1];
245
- var _react_1$useState17 = react_1.useState(exports.DEFAULT_CHART_HEIGHT - margin.top - margin.bottom),
246
- _react_1$useState18 = _slicedToArray(_react_1$useState17, 2),
247
- sankeyHeight = _react_1$useState18[0],
248
- setSankeyHeight = _react_1$useState18[1];
249
- react_1.useEffect(function () {
236
+
237
+ var _ref = (0, react_1.useState)([]),
238
+ _ref2 = _slicedToArray(_ref, 2),
239
+ activeLinks = _ref2[0],
240
+ setActiveLinks = _ref2[1];
241
+
242
+ var _ref3 = (0, react_1.useState)([]),
243
+ _ref4 = _slicedToArray(_ref3, 2),
244
+ activeNodes = _ref4[0],
245
+ setActiveNodes = _ref4[1];
246
+
247
+ var _ref5 = (0, react_1.useState)(null),
248
+ _ref6 = _slicedToArray(_ref5, 2),
249
+ nodeHovered = _ref6[0],
250
+ setNodeHovered = _ref6[1];
251
+
252
+ var _ref7 = (0, react_1.useState)(null),
253
+ _ref8 = _slicedToArray(_ref7, 2),
254
+ hoveredNodeElement = _ref8[0],
255
+ setHoveredNodeElement = _ref8[1];
256
+
257
+ var _ref9 = (0, react_1.useState)(false),
258
+ _ref10 = _slicedToArray(_ref9, 2),
259
+ openNodeToolTip = _ref10[0],
260
+ setOpenNodeToolTip = _ref10[1];
261
+
262
+ var _ref11 = (0, react_1.useState)(null),
263
+ _ref12 = _slicedToArray(_ref11, 2),
264
+ hoveredLinkElement = _ref12[0],
265
+ setHoveredLinkElement = _ref12[1];
266
+
267
+ var _ref13 = (0, react_1.useState)(false),
268
+ _ref14 = _slicedToArray(_ref13, 2),
269
+ openLinkToolTip = _ref14[0],
270
+ setOpenLinkToolTip = _ref14[1];
271
+
272
+ var sankeyContainerElement = (0, react_1.useRef)(null);
273
+
274
+ var _ref15 = (0, react_1.useState)(exports.DEFAULT_CHART_WIDTH - margin.left - margin.right),
275
+ _ref16 = _slicedToArray(_ref15, 2),
276
+ sankeyWidth = _ref16[0],
277
+ setSankeyWidth = _ref16[1];
278
+
279
+ var _ref17 = (0, react_1.useState)(exports.DEFAULT_CHART_HEIGHT - margin.top - margin.bottom),
280
+ _ref18 = _slicedToArray(_ref17, 2),
281
+ sankeyHeight = _ref18[0],
282
+ setSankeyHeight = _ref18[1];
283
+
284
+ var handleNodeClick = (0, react_1.useCallback)(function (node) {
285
+ if (node) {
286
+ onNodeClick({
287
+ type: 'node.click',
288
+ payload: {
289
+ nodeValue: node.value,
290
+ nodeName: node.name
291
+ }
292
+ });
293
+ }
294
+ }, []);
295
+ var handleLinkClick = (0, react_1.useCallback)(function (link) {
296
+ if (link) {
297
+ var payload = {
298
+ name: linkValueField,
299
+ value: link.value
300
+ };
301
+ fields.forEach(function (field, idx) {
302
+ var rowToken = "row.".concat(field, ".value");
303
+ payload[rowToken] = columns[idx][link.index];
304
+ });
305
+ onLinkClick({
306
+ type: 'link.click',
307
+ payload: payload
308
+ });
309
+ }
310
+ }, [fields, columns, linkValueField]);
311
+ (0, react_1.useEffect)(function () {
250
312
  if (sankeyContainerElement && sankeyContainerElement.current) {
251
313
  var w = sankeyContainerElement.current.getBoundingClientRect().width;
252
314
  var h = sankeyContainerElement.current.getBoundingClientRect().height;
253
- var sWidth = SankeyUtils_1.checkDigitsOnly(width) ? parseInt(width, 10) : w;
254
- var sHeight = SankeyUtils_1.checkDigitsOnly(height) ? parseInt(height, 10) : h;
315
+ var sWidth = (0, SankeyUtils_1.checkDigitsOnly)(width) ? parseInt(width, 10) : w;
316
+ var sHeight = (0, SankeyUtils_1.checkDigitsOnly)(height) ? parseInt(height, 10) : h;
255
317
  setSankeyWidth(sWidth - margin.left - margin.right);
256
318
  setSankeyHeight(sHeight - margin.top - margin.bottom);
257
319
  }
258
320
  }, [width, height]);
259
- var sankeyData = SankeyUtils_1.convertInputToSankeyDataFormat(columns, exports.DEFAULT_SOURCE_INDEX, exports.DEFAULT_TARGET_INDEX, exports.DEFAULT_LINK_VALUE_INDEX, resultLimit);
260
- if (!sankeyData || !columns || !Array.isArray(columns) || columns.length < 3) {
321
+ var sankeyData = (0, SankeyUtils_1.convertInputToSankeyDataFormat)(columnsFromDataSource, exports.DEFAULT_SOURCE_INDEX, exports.DEFAULT_TARGET_INDEX, exports.DEFAULT_LINK_VALUE_INDEX, resultLimit);
322
+
323
+ if (!sankeyData || !columnsFromDataSource || !Array.isArray(columnsFromDataSource) || columnsFromDataSource.length < 3) {
261
324
  return React.createElement(Message_1.default, {
262
325
  width: width,
263
326
  height: height,
264
- message: i18n_1._('Invalid data to render'),
327
+ message: (0, i18n_1._)('Invalid data to render'),
265
328
  level: "info"
266
329
  });
267
330
  }
331
+
268
332
  var sortAndAssignLinkIds = function sortAndAssignLinkIds(links) {
269
333
  links.sort(function (a, b) {
270
334
  return a.dy - b.dy;
@@ -274,18 +338,20 @@ var PureSankey = function PureSankey(props) {
274
338
  link.id = "link-".concat(link.source.index, "-").concat(link.target.index);
275
339
  });
276
340
  };
277
- var d3sankey = sankey_1.d3_sankey().nodeWidth(nodeWidth).nodePadding(nodePadding).size([sankeyWidth, sankeyHeight]);
341
+
342
+ var d3sankey = (0, sankey_1.d3_sankey)().nodeWidth(nodeWidth).nodePadding(nodePadding).size([sankeyWidth, sankeyHeight]);
278
343
  var path = d3sankey.reversibleLink();
279
344
  d3sankey.nodes(sankeyData.nodes).links(sankeyData.links).layout(500);
280
345
  sortAndAssignLinkIds(sankeyData.links);
281
- var nodeConnectionsMap = SankeyUtils_1.computeAllConnectedLinksToNodes(sankeyData.nodes, sankeyData.links);
282
- var uniqCategory = SankeyUtils_1.getAllNodeNames(sankeyData);
283
- var colorCategoryMapping = SankeyUtils_1.getColorCategoryMapping({
346
+ var nodeConnectionsMap = (0, SankeyUtils_1.computeAllConnectedLinksToNodes)(sankeyData.nodes, sankeyData.links);
347
+ var uniqCategory = (0, SankeyUtils_1.getAllNodeNames)(sankeyData);
348
+ var colorCategoryMapping = (0, SankeyUtils_1.getColorCategoryMapping)({
284
349
  category: uniqCategory,
285
350
  colorMode: colorMode,
286
351
  seriesColors: seriesColors,
287
352
  linkColors: linkColors
288
353
  });
354
+
289
355
  var resetStates = function resetStates() {
290
356
  setActiveLinks([]);
291
357
  setActiveNodes([]);
@@ -295,17 +361,20 @@ var PureSankey = function PureSankey(props) {
295
361
  setOpenLinkToolTip(false);
296
362
  setOpenNodeToolTip(false);
297
363
  };
298
- var renderVisualization = function renderVisualization(_ref) {
299
- var containerWidth = _ref.width,
300
- containerHeight = _ref.height;
364
+
365
+ var renderVisualization = function renderVisualization(_ref19) {
366
+ var containerWidth = _ref19.width,
367
+ containerHeight = _ref19.height;
368
+
301
369
  if (containerWidth < exports.CHART_MIN_WIDTH || containerHeight < exports.CHART_MIN_HEIGHT) {
302
370
  return React.createElement(Message_1.default, {
303
371
  width: containerWidth,
304
372
  height: containerHeight,
305
- message: i18n_1._('Too small to render content'),
373
+ message: (0, i18n_1._)('Too small to render content'),
306
374
  level: "info"
307
375
  });
308
376
  }
377
+
309
378
  var renderLinks = function renderLinks(links) {
310
379
  return links.map(function (link) {
311
380
  return React.createElement(SankeyLink_1.default, {
@@ -313,8 +382,8 @@ var PureSankey = function PureSankey(props) {
313
382
  activeLinks: activeLinks,
314
383
  linkOpacity: linkOpacity,
315
384
  path: path,
316
- key: SankeyUtils_1.getLinkId(link),
317
- "data-test": SankeyUtils_1.getLinkId(link),
385
+ key: (0, SankeyUtils_1.getLinkId)(link),
386
+ "data-test": (0, SankeyUtils_1.getLinkId)(link),
318
387
  colorCategoryMapping: colorCategoryMapping,
319
388
  colorMode: colorMode,
320
389
  handleMouseOver: function handleMouseOver(ev) {
@@ -326,17 +395,19 @@ var PureSankey = function PureSankey(props) {
326
395
  },
327
396
  handleMouseLeave: function handleMouseLeave() {
328
397
  resetStates();
329
- }
398
+ },
399
+ handleLinkClick: handleLinkClick
330
400
  });
331
401
  });
332
402
  };
403
+
333
404
  var renderNodes = function renderNodes(nodes) {
334
405
  var chartWidth = typeof width === 'number' ? width : Number.parseInt(width, 10);
335
406
  return nodes.map(function (node) {
336
407
  return React.createElement(SankeyNode_1.default, {
337
408
  node: node,
338
- key: SankeyUtils_1.getNodeId(node),
339
- "data-test": SankeyUtils_1.getNodeId(node),
409
+ key: (0, SankeyUtils_1.getNodeId)(node),
410
+ "data-test": (0, SankeyUtils_1.getNodeId)(node),
340
411
  activeNodes: activeNodes,
341
412
  nodeWidth: nodeWidth,
342
413
  chartWidth: chartWidth,
@@ -353,10 +424,12 @@ var PureSankey = function PureSankey(props) {
353
424
  },
354
425
  handleMouseLeave: function handleMouseLeave() {
355
426
  return resetStates();
356
- }
427
+ },
428
+ handleNodeClick: handleNodeClick
357
429
  });
358
430
  });
359
431
  };
432
+
360
433
  return React.createElement(VizStyleWrapper_1.default, {
361
434
  backgroundColor: backgroundColor,
362
435
  dataTestKey: "SankeyWrapper",
@@ -409,6 +482,7 @@ var PureSankey = function PureSankey(props) {
409
482
  tooltipHeaderColor: tooltipHeaderColor
410
483
  })))));
411
484
  };
485
+
412
486
  return React.createElement(SankeyContainer, {
413
487
  height: height,
414
488
  width: width,
@@ -417,8 +491,11 @@ var PureSankey = function PureSankey(props) {
417
491
  return renderVisualization(containerDimension);
418
492
  }));
419
493
  };
494
+
420
495
  PureSankey.propTypes = {
421
496
  columns: T.array,
497
+ columnsFromDataSource: T.array,
498
+ fields: T.array,
422
499
  width: T.oneOfType([T.string, T.number]),
423
500
  height: T.oneOfType([T.string, T.number]),
424
501
  // need this to satisfy props interface
@@ -439,7 +516,9 @@ PureSankey.propTypes = {
439
516
  tooltipHeaderColor: T.string
440
517
  };
441
518
  PureSankey.defaultProps = {
519
+ columnsFromDataSource: [],
442
520
  columns: [],
521
+ fields: [],
443
522
  width: exports.DEFAULT_CHART_WIDTH,
444
523
  height: exports.DEFAULT_CHART_HEIGHT,
445
524
  mode: 'view',
@@ -455,7 +534,9 @@ PureSankey.defaultProps = {
455
534
  nodeTextColor: 'rgba(255, 255, 255, 0.98)',
456
535
  tooltipRowColor: 'rgba(255, 255, 255, 0.98)',
457
536
  tooltipLinkHeaderColor: 'rgba(255, 255, 255, 0.98)',
458
- tooltipHeaderColor: 'rgba(255, 255, 255, 0.5)'
537
+ tooltipHeaderColor: 'rgba(255, 255, 255, 0.5)',
538
+ onNodeClick: lodash_1.noop,
539
+ onLinkClick: lodash_1.noop
459
540
  };
460
541
  exports.default = PureSankey;
461
542
 
@@ -477,40 +558,46 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
477
558
  Object.defineProperty(exports, "__esModule", {
478
559
  value: true
479
560
  });
561
+
480
562
  var React = __webpack_require__(1);
563
+
481
564
  var styled_components_1 = __webpack_require__(4);
565
+
482
566
  var SizeAwareWrapper_1 = __webpack_require__(19);
567
+
483
568
  var style_1 = __webpack_require__(14);
569
+
484
570
  var colorUtils_1 = __webpack_require__(12);
571
+
485
572
  var Item = styled_components_1.default.div.attrs(function (_ref) {
486
573
  var width = _ref.width;
487
574
  return {
488
575
  style: {
489
- width: style_1.toPx(width)
576
+ width: (0, style_1.toPx)(width)
490
577
  }
491
578
  };
492
579
  }).withConfig({
493
580
  displayName: "FixedSizeContainer__Item",
494
581
  componentId: "sc-1yhgpod-0"
495
582
  })(["position:relative;background-color:", "};"], function (props) {
496
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
497
- });
498
- // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
583
+ return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
584
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
585
+
499
586
  var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
500
587
  var width = _ref2.width,
501
- height = _ref2.height;
588
+ height = _ref2.height;
502
589
  return {
503
590
  style: Object.assign(Object.assign({}, width && {
504
- width: style_1.toPx(width)
591
+ width: (0, style_1.toPx)(width)
505
592
  }), height && {
506
- height: style_1.toPx(height)
593
+ height: (0, style_1.toPx)(height)
507
594
  })
508
595
  };
509
596
  }).withConfig({
510
597
  displayName: "FixedSizeContainer__FixSizeItem",
511
598
  componentId: "sc-1yhgpod-1"
512
599
  })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
513
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
600
+ return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
514
601
  });
515
602
  var ItemContent = styled_components_1.default.div.withConfig({
516
603
  displayName: "FixedSizeContainer__ItemContent",
@@ -520,11 +607,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
520
607
  displayName: "FixedSizeContainer__FixSizeItemContent",
521
608
  componentId: "sc-1yhgpod-3"
522
609
  })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
610
+
523
611
  var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
524
612
  var FixedSizeContainer = function FixedSizeContainer(props) {
525
613
  var width = props.width,
526
- height = props.height,
527
- backgroundColor = props.backgroundColor;
614
+ height = props.height,
615
+ backgroundColor = props.backgroundColor;
616
+
528
617
  if (!height) {
529
618
  return React.createElement(Item, {
530
619
  "data-test": "item",
@@ -532,29 +621,32 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
532
621
  backgroundColor: backgroundColor
533
622
  }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
534
623
  }
624
+
535
625
  return React.createElement(FixSizeItem, {
536
626
  "data-test": "fix-size-item",
537
- "data-splunk-visualization-version": "25.13.1 - ea48ec41e",
627
+ "data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
538
628
  width: width,
539
629
  height: height,
540
630
  backgroundColor: backgroundColor
541
631
  }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
542
632
  var newWidth = _ref3.width,
543
- newHeight = _ref3.height;
633
+ newHeight = _ref3.height;
544
634
  return React.createElement(Viz, Object.assign({}, props, {
545
635
  width: newWidth,
546
636
  height: newHeight
547
637
  }));
548
638
  })));
549
639
  };
640
+
550
641
  FixedSizeContainer.displayName = 'withFixedSizeContainer';
551
642
  return FixedSizeContainer;
552
643
  };
644
+
553
645
  exports.default = withFixedSizeContainer;
554
646
 
555
647
  /***/ }),
556
648
 
557
- /***/ 133:
649
+ /***/ 134:
558
650
  /***/ (function(module, exports, __webpack_require__) {
559
651
 
560
652
  "use strict";
@@ -565,16 +657,22 @@ Object.defineProperty(exports, "__esModule", {
565
657
  });
566
658
  exports.truncateSVGTextWithEllipsis = exports.checkDigitsOnly = exports.computeAllConnectedLinksToNodes = exports.getAllConnectedLinks = exports.extractLinkMidPoint = exports.getAllNodeNames = exports.getLinkId = exports.getNodeId = exports.convertInputToSankeyDataFormat = exports.getColorCategoryMapping = exports.getNodesIndex = void 0;
567
659
  /* eslint-disable no-param-reassign */
568
- var d3_scale_1 = __webpack_require__(91);
569
- var types_1 = __webpack_require__(94);
660
+
661
+ var d3_scale_1 = __webpack_require__(93);
662
+
663
+ var types_1 = __webpack_require__(83);
664
+
570
665
  var insertNodeIfNotExist = function insertNodeIfNotExist(sankeyData, nodeName) {
571
666
  var nodes = sankeyData.nodes;
572
667
  nodes = nodes || [];
668
+
573
669
  if (typeof nodeName !== 'string') {
574
670
  console.error('Node not created, invalid nodename:', nodeName);
575
671
  return;
576
672
  }
673
+
577
674
  nodeName = nodeName.trim();
675
+
578
676
  if (!nodes.find(function (node) {
579
677
  return node.name.toLocaleLowerCase() === nodeName.toLocaleLowerCase();
580
678
  })) {
@@ -583,6 +681,7 @@ var insertNodeIfNotExist = function insertNodeIfNotExist(sankeyData, nodeName) {
583
681
  });
584
682
  }
585
683
  };
684
+
586
685
  var insertLink = function insertLink(sankeyData, sourceFieldIdx, targetFieldIdx, linkValue, index) {
587
686
  var links = sankeyData.links;
588
687
  links = links || [];
@@ -593,49 +692,60 @@ var insertLink = function insertLink(sankeyData, sourceFieldIdx, targetFieldIdx,
593
692
  index: index
594
693
  });
595
694
  };
695
+
596
696
  var getNodesIndex = function getNodesIndex(sankeyData, nodeName) {
597
697
  if (!sankeyData || !sankeyData.nodes || !sankeyData.nodes.length) {
598
698
  return -1;
599
699
  }
700
+
600
701
  return sankeyData.nodes.findIndex(function (node) {
601
702
  return node.name.toLocaleLowerCase() === nodeName.toLocaleLowerCase();
602
703
  });
603
704
  };
705
+
604
706
  exports.getNodesIndex = getNodesIndex;
707
+
605
708
  var getColorCategoryMapping = function getColorCategoryMapping(_ref) {
606
709
  var category = _ref.category,
607
- colorMode = _ref.colorMode,
608
- seriesColors = _ref.seriesColors,
609
- linkColors = _ref.linkColors;
710
+ colorMode = _ref.colorMode,
711
+ seriesColors = _ref.seriesColors,
712
+ linkColors = _ref.linkColors;
713
+
610
714
  if (colorMode !== 'categorical') {
611
715
  return linkColors;
612
716
  }
613
- return seriesColors ? d3_scale_1.scaleOrdinal().domain(category).range(seriesColors).unknown(seriesColors[0]) : null;
717
+
718
+ return seriesColors ? (0, d3_scale_1.scaleOrdinal)().domain(category).range(seriesColors).unknown(seriesColors[0]) : null;
614
719
  };
720
+
615
721
  exports.getColorCategoryMapping = getColorCategoryMapping;
722
+
616
723
  var convertInputToSankeyDataFormat = function convertInputToSankeyDataFormat(columns, sourceFieldIdx, targetFieldIdx, linkValueFieldIdx, resultLimit) {
617
724
  if (!columns || !Array.isArray(columns) || !columns.length || !columns[sourceFieldIdx] || !columns[targetFieldIdx] || !columns[linkValueFieldIdx] || columns.length < 3 || !Array.isArray(columns[sourceFieldIdx]) || !Array.isArray(columns[targetFieldIdx]) || !Array.isArray(columns[linkValueFieldIdx]) || !columns[sourceFieldIdx] || typeof columns[sourceFieldIdx][0] !== 'string' || !columns[targetFieldIdx] || typeof columns[targetFieldIdx][0] !== 'string') {
618
725
  return null;
619
726
  }
727
+
620
728
  var sankeyData = {
621
729
  nodes: [],
622
730
  links: []
623
731
  };
624
732
  var maxlen = Math.min(columns[sourceFieldIdx].length, columns[targetFieldIdx].length, columns[linkValueFieldIdx].length, resultLimit);
733
+
625
734
  for (var i = 0; i < maxlen; i += 1) {
626
- if (typeof columns[sourceFieldIdx][i] === 'string' && typeof columns[targetFieldIdx][i] === 'string' && types_1.isNumber(columns[linkValueFieldIdx][i])) {
735
+ if (typeof columns[sourceFieldIdx][i] === 'string' && typeof columns[targetFieldIdx][i] === 'string' && (0, types_1.isNumber)(columns[linkValueFieldIdx][i])) {
627
736
  (function () {
628
737
  var sourceNodeName = columns[sourceFieldIdx][i].trim();
629
738
  var targetNodeName = columns[targetFieldIdx][i].trim();
630
739
  insertNodeIfNotExist(sankeyData, sourceNodeName);
631
- insertNodeIfNotExist(sankeyData, targetNodeName);
632
- // If same link exists then sum up the value and donot insert new link
633
- var sourceNodeIdx = exports.getNodesIndex(sankeyData, sourceNodeName);
634
- var targetNodeIdx = exports.getNodesIndex(sankeyData, targetNodeName);
740
+ insertNodeIfNotExist(sankeyData, targetNodeName); // If same link exists then sum up the value and donot insert new link
741
+
742
+ var sourceNodeIdx = (0, exports.getNodesIndex)(sankeyData, sourceNodeName);
743
+ var targetNodeIdx = (0, exports.getNodesIndex)(sankeyData, targetNodeName);
635
744
  var linkExist = sankeyData.links.find(function (link) {
636
745
  return link.source === sourceNodeIdx && link.target === targetNodeIdx;
637
746
  });
638
747
  var linkValue = +columns[linkValueFieldIdx][i];
748
+
639
749
  if (linkExist) {
640
750
  linkExist.value += linkValue;
641
751
  } else {
@@ -646,53 +756,70 @@ var convertInputToSankeyDataFormat = function convertInputToSankeyDataFormat(col
646
756
  console.error('Link excluded. Invalid type in column input, row :- ', i, "[".concat(columns[sourceFieldIdx][i], ", ").concat(columns[targetFieldIdx][i], ", ").concat(columns[linkValueFieldIdx][i], "]"));
647
757
  }
648
758
  }
759
+
649
760
  return sankeyData;
650
761
  };
762
+
651
763
  exports.convertInputToSankeyDataFormat = convertInputToSankeyDataFormat;
764
+
652
765
  var getNodeId = function getNodeId(node) {
653
766
  if (!node) {
654
767
  return '';
655
768
  }
769
+
656
770
  return "node-".concat(node.index);
657
771
  };
772
+
658
773
  exports.getNodeId = getNodeId;
774
+
659
775
  var getLinkId = function getLinkId(link) {
660
776
  if (!link) {
661
777
  return '';
662
778
  }
779
+
663
780
  return "link-".concat(link.id);
664
781
  };
782
+
665
783
  exports.getLinkId = getLinkId;
784
+
666
785
  var getAllNodeNames = function getAllNodeNames(sankeyData) {
667
786
  if (!sankeyData || !sankeyData.nodes || !sankeyData.nodes.length) {
668
787
  return [];
669
788
  }
789
+
670
790
  return sankeyData.nodes.map(function (node) {
671
791
  return node.name;
672
792
  });
673
793
  };
794
+
674
795
  exports.getAllNodeNames = getAllNodeNames;
796
+
675
797
  var extractLinkMidPoint = function extractLinkMidPoint(pathStr) {
676
798
  if (!pathStr) {
677
799
  return null;
678
800
  }
801
+
679
802
  var mIndex = pathStr.indexOf('M');
680
803
  var cIndexFirst = pathStr.indexOf('C');
681
804
  var lIndex = pathStr.indexOf('L');
682
805
  var cIndexLast = pathStr.lastIndexOf('C');
683
806
  var zIndex = pathStr.lastIndexOf('Z');
807
+
684
808
  if (mIndex < 0 || cIndexLast < 0 || cIndexLast < 0 || zIndex < 0) {
685
809
  console.error('Extract link midpoint error. Invalid path -', pathStr);
686
810
  return null;
687
811
  }
812
+
688
813
  var section1 = pathStr.slice(mIndex + 1, cIndexFirst).trim();
689
814
  var section2 = pathStr.slice(cIndexFirst + 1, lIndex).trim();
690
815
  var section3 = pathStr.slice(lIndex + 1, cIndexLast).trim();
691
816
  var section4 = pathStr.slice(cIndexLast + 1, zIndex).trim();
817
+
692
818
  if (!section1.length || !section2.length || !section3.length || !section4.length) {
693
819
  console.error('Extract link midpoint error. Invalid path -', pathStr);
694
820
  return null;
695
821
  }
822
+
696
823
  var points = [];
697
824
  points.push(section1.split(',').map(function (i) {
698
825
  return Number.parseFloat(i);
@@ -717,33 +844,42 @@ var extractLinkMidPoint = function extractLinkMidPoint(pathStr) {
717
844
  y: y
718
845
  };
719
846
  };
847
+
720
848
  exports.extractLinkMidPoint = extractLinkMidPoint;
849
+
721
850
  var getAllConnectedLinks = function getAllConnectedLinks(links, nodeIdx) {
722
851
  var result = {
723
852
  links: [],
724
853
  sourceNodes: [],
725
854
  targetNodes: []
726
855
  };
856
+
727
857
  if (!links || !links.length) {
728
858
  return result;
729
859
  }
860
+
730
861
  links.forEach(function (link) {
731
862
  if (link.source.index === nodeIdx || link.target.index === nodeIdx) {
732
863
  var linkAdded = result.links.find(function (l) {
733
864
  return l.id === link.id;
734
865
  });
866
+
735
867
  if (!linkAdded) {
736
868
  result.links.push(link);
737
869
  }
870
+
738
871
  var sourceNodeAdded = result.sourceNodes.find(function (n) {
739
872
  return n.index === link.source.index;
740
873
  });
874
+
741
875
  if (!sourceNodeAdded) {
742
876
  result.sourceNodes.push(link.source);
743
877
  }
878
+
744
879
  var targetNodeAdded = result.targetNodes.find(function (n) {
745
880
  return n.index === link.target.index;
746
881
  });
882
+
747
883
  if (!targetNodeAdded) {
748
884
  result.targetNodes.push(link.target);
749
885
  }
@@ -751,28 +887,35 @@ var getAllConnectedLinks = function getAllConnectedLinks(links, nodeIdx) {
751
887
  });
752
888
  return result;
753
889
  };
890
+
754
891
  exports.getAllConnectedLinks = getAllConnectedLinks;
892
+
755
893
  var computeAllConnectedLinksToNodes = function computeAllConnectedLinksToNodes(nodes, links) {
756
894
  var connectionsMap = {};
895
+
757
896
  if (!nodes || !links) {
758
897
  return connectionsMap;
759
898
  }
899
+
760
900
  nodes.forEach(function (node) {
761
- var connections = exports.getAllConnectedLinks(links, node.index);
901
+ var connections = (0, exports.getAllConnectedLinks)(links, node.index);
762
902
  connectionsMap[node.index] = connections;
763
903
  });
764
904
  return connectionsMap;
765
905
  };
906
+
766
907
  exports.computeAllConnectedLinksToNodes = computeAllConnectedLinksToNodes;
908
+
767
909
  var checkDigitsOnly = function checkDigitsOnly(input) {
768
910
  return /^\d+$/.test(input);
769
911
  };
770
- exports.checkDigitsOnly = checkDigitsOnly;
771
- // Truncate the node text and show ellipsis at the end if text string width exceeds the max limit
912
+
913
+ exports.checkDigitsOnly = checkDigitsOnly; // Truncate the node text and show ellipsis at the end if text string width exceeds the max limit
914
+
772
915
  var truncateSVGTextWithEllipsis = function truncateSVGTextWithEllipsis(textElement, textString, width) {
773
916
  if (textElement && textElement.getSubStringLength !== undefined) {
774
- textElement.textContent = textString;
775
- // ellipsis is needed
917
+ textElement.textContent = textString; // ellipsis is needed
918
+
776
919
  if (textElement.getSubStringLength(0, textString.length) >= width) {
777
920
  for (var x = textString.length - 3; x > 0; x -= 3) {
778
921
  if (textElement.getSubStringLength(0, x) <= width) {
@@ -780,6 +923,7 @@ var truncateSVGTextWithEllipsis = function truncateSVGTextWithEllipsis(textEleme
780
923
  return;
781
924
  }
782
925
  }
926
+
783
927
  textElement.textContent = '...'; // can't place at all
784
928
  }
785
929
  }
@@ -789,24 +933,24 @@ exports.truncateSVGTextWithEllipsis = truncateSVGTextWithEllipsis;
789
933
 
790
934
  /***/ }),
791
935
 
792
- /***/ 138:
936
+ /***/ 14:
793
937
  /***/ (function(module, exports) {
794
938
 
795
- module.exports = require("d3-interpolate");
939
+ module.exports = require("@splunk/visualizations-shared/style");
796
940
 
797
941
  /***/ }),
798
942
 
799
- /***/ 139:
943
+ /***/ 140:
800
944
  /***/ (function(module, exports) {
801
945
 
802
- module.exports = require("d3-collection");
946
+ module.exports = require("d3-interpolate");
803
947
 
804
948
  /***/ }),
805
949
 
806
- /***/ 14:
950
+ /***/ 141:
807
951
  /***/ (function(module, exports) {
808
952
 
809
- module.exports = require("@splunk/visualizations-shared/style");
953
+ module.exports = require("d3-collection");
810
954
 
811
955
  /***/ }),
812
956
 
@@ -826,9 +970,10 @@ exports.extendStaticWrapperProps = void 0;
826
970
  * @param {DashboardVizType} props.Wrapper
827
971
  * @param {DashboardVizType} props.Visualization
828
972
  */
973
+
829
974
  var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
830
975
  var Wrapper = _ref.Wrapper,
831
- Visualization = _ref.Visualization;
976
+ Visualization = _ref.Visualization;
832
977
  var extendProperties = ['propTypes', 'defaultProps', 'config'];
833
978
  extendProperties.forEach(function (prop) {
834
979
  if (Visualization[prop]) {
@@ -837,6 +982,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
837
982
  }
838
983
  });
839
984
  };
985
+
840
986
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
841
987
 
842
988
  /***/ }),
@@ -848,93 +994,129 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
848
994
 
849
995
  /***/ }),
850
996
 
851
- /***/ 163:
997
+ /***/ 166:
852
998
  /***/ (function(module, exports, __webpack_require__) {
853
999
 
854
1000
  "use strict";
855
1001
 
856
1002
 
857
- var _typeof = __webpack_require__(93);
1003
+ var _typeof = __webpack_require__(82);
1004
+
858
1005
  Object.defineProperty(exports, "__esModule", {
859
1006
  value: true
860
1007
  });
861
1008
  exports.PureSankey = exports.config = exports.themes = exports.computeVizProps = exports.showPlaceHolderIcon = void 0;
1009
+
862
1010
  var lodash_1 = __webpack_require__(3);
863
- var dataSourceUtils_1 = __webpack_require__(96);
1011
+
1012
+ var dataSourceUtils_1 = __webpack_require__(97);
1013
+
864
1014
  var colorUtils_1 = __webpack_require__(12);
865
- var withDashboardViz_1 = __webpack_require__(36);
866
- var PureSankey_1 = __webpack_require__(110);
1015
+
1016
+ var withDashboardViz_1 = __webpack_require__(37);
1017
+
1018
+ var PureSankey_1 = __webpack_require__(111);
1019
+
867
1020
  exports.PureSankey = PureSankey_1.default;
868
- var config_1 = __webpack_require__(459);
1021
+
1022
+ var config_1 = __webpack_require__(462);
1023
+
869
1024
  exports.config = config_1.default;
870
1025
  /**
871
1026
  * @method showPlaceHolderIcon
872
1027
  * @param {Object} dataSources
873
1028
  * @returns {Boolean} return true if loading, error, non existent state or without columns in dataSources
874
1029
  */
1030
+
875
1031
  var showPlaceHolderIcon = function showPlaceHolderIcon(dataSources) {
876
- var columns = lodash_1.get(dataSources, 'primary.data.columns', undefined);
1032
+ var columns = (0, lodash_1.get)(dataSources, 'primary.data.columns', undefined);
877
1033
  var noColumns = columns === undefined;
878
- var dataSourceState = dataSourceUtils_1.getDataSourceStateInfo(dataSources);
1034
+ var dataSourceState = (0, dataSourceUtils_1.getDataSourceStateInfo)(dataSources);
879
1035
  return dataSourceState === dataSourceUtils_1.DataSourceState.ERROR || dataSourceState === dataSourceUtils_1.DataSourceState.LOADING || dataSourceState === dataSourceUtils_1.DataSourceState.NONEXISTENT || noColumns;
880
1036
  };
1037
+
881
1038
  exports.showPlaceHolderIcon = showPlaceHolderIcon;
1039
+
882
1040
  var computeVizProps = function computeVizProps(_ref) {
883
1041
  var themeFunc = _ref.themeFunc,
884
- dataSources = _ref.dataSources,
885
- linkValues = _ref.linkValues,
886
- seriesColors = _ref.seriesColors,
887
- linkColors = _ref.linkColors;
888
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
889
- // Compute all themeColor variables needed for PureSankey
1042
+ dataSources = _ref.dataSources,
1043
+ linkValues = _ref.linkValues,
1044
+ seriesColors = _ref.seriesColors,
1045
+ linkColors = _ref.linkColors,
1046
+ onNodeClick = _ref.onNodeClick,
1047
+ onLinkClick = _ref.onLinkClick;
1048
+
1049
+ var _a, _b, _c, _d, _e; // Compute all themeColor variables needed for PureSankey
1050
+
1051
+
890
1052
  var themeColorVariables = ['defaultBackgroundColor', 'nodeTextColor', 'tooltipRowColor', 'tooltipLinkHeaderColor', 'tooltipHeaderColor'];
891
1053
  var themeColors = {};
892
1054
  themeColorVariables.forEach(function (variable) {
893
1055
  themeColors[variable] = themeFunc(variable);
894
- });
895
- // Sanitize linkColors prop
1056
+ }); // Sanitize linkColors prop
896
1057
  // eslint-disable-next-line no-param-reassign
897
- linkColors = colorUtils_1.sanitizeArrayOfColors(linkColors);
898
- // Sanitize seriesColors prop
1058
+
1059
+ linkColors = (0, colorUtils_1.sanitizeArrayOfColors)(linkColors); // Sanitize seriesColors prop
899
1060
  // (Note:- This is handled outside SanitizeProps because it would impact seriesColors option used in splunk-charting viz as the types are different.
900
1061
  // The type used in splunk-charting viz expects a string of comma separated colors, but here the type is an array of string)
901
1062
  // eslint-disable-next-line no-param-reassign
902
- seriesColors = colorUtils_1.isArrayOfColors(seriesColors) ? seriesColors : undefined;
903
- // Compute the columns props and linkValueField props for pure Sankey
1063
+
1064
+ seriesColors = (0, colorUtils_1.isArrayOfColors)(seriesColors) ? seriesColors : undefined; // Compute the columns props and linkValueField props for pure Sankey
904
1065
  // The columns props is computed as [primary.data.columns[0], primary.data.columns[1], linkValues].
905
1066
  // The source and target columns are the default as columns[0] and columns[1] respectively
906
1067
  // The linkValueField props is the fieldName which is set as the source of linkValues
1068
+
1069
+ var _dataSources$primary$ = dataSources.primary.data,
1070
+ columns = _dataSources$primary$.columns,
1071
+ fields = _dataSources$primary$.fields;
907
1072
  var columnsFromDataSource = [];
908
1073
  var linkValueField = '';
1074
+ var fieldNames = [];
1075
+
909
1076
  if (((_b = (_a = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.columns) && ((_e = (_d = (_c = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns) === null || _e === void 0 ? void 0 : _e.length) >= 2 && Array.isArray(linkValues)) {
910
- var columns = dataSources.primary.data.columns;
911
1077
  columnsFromDataSource = columns ? [columns[0], columns[1], linkValues] : null;
912
1078
  var linkIndex = columns.findIndex(function (col) {
913
- return lodash_1.isEqual(col, linkValues);
1079
+ return (0, lodash_1.isEqual)(col, linkValues);
914
1080
  });
915
- if ((_g = (_f = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.fields) {
916
- var linkField = (_j = (_h = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.fields[linkIndex];
917
- if (_typeof(linkField) === 'object' && linkField !== null) {
918
- linkValueField = linkField.name;
919
- } else {
920
- linkValueField = linkField !== null && linkField !== void 0 ? linkField : '';
921
- }
1081
+
1082
+ if (fields) {
1083
+ fields.forEach(function (field, idx) {
1084
+ var fieldName = '';
1085
+
1086
+ if (_typeof(field) === 'object' && field !== null) {
1087
+ fieldName = field.name;
1088
+ } else {
1089
+ fieldName = field !== null && field !== void 0 ? field : '';
1090
+ }
1091
+
1092
+ if (idx === linkIndex) {
1093
+ linkValueField = fieldName;
1094
+ }
1095
+
1096
+ fieldNames.push(fieldName);
1097
+ });
922
1098
  }
923
1099
  }
1100
+
924
1101
  return Object.assign(Object.assign({}, themeColors), {
925
- columns: columnsFromDataSource,
1102
+ columns: columns,
1103
+ fields: fieldNames,
1104
+ columnsFromDataSource: columnsFromDataSource,
926
1105
  linkValueField: linkValueField,
927
1106
  seriesColors: seriesColors,
928
- linkColors: linkColors
1107
+ linkColors: linkColors,
1108
+ onNodeClick: onNodeClick,
1109
+ onLinkClick: onLinkClick
929
1110
  });
930
1111
  };
1112
+
931
1113
  exports.computeVizProps = computeVizProps;
932
- var Sankey = withDashboardViz_1.default({
1114
+ var Sankey = (0, withDashboardViz_1.default)({
933
1115
  ReactViz: PureSankey_1.default,
934
1116
  vizConfig: config_1.default,
935
1117
  computeVizProps: exports.computeVizProps,
936
1118
  useIconPlaceholder: function useIconPlaceholder(dataSources) {
937
- return exports.showPlaceHolderIcon(dataSources);
1119
+ return (0, exports.showPlaceHolderIcon)(dataSources);
938
1120
  }
939
1121
  });
940
1122
  var themes = config_1.default.themes;
@@ -978,24 +1160,33 @@ module.exports = require("@splunk/ui-utils/i18n");
978
1160
 
979
1161
 
980
1162
  var _toConsumableArray = __webpack_require__(8);
1163
+
981
1164
  var _defineProperty = __webpack_require__(7);
1165
+
982
1166
  var __rest = this && this.__rest || function (s, e) {
983
1167
  var t = {};
1168
+
984
1169
  for (var p in s) {
985
1170
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
986
1171
  }
1172
+
987
1173
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
988
1174
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
989
1175
  }
990
1176
  return t;
991
1177
  };
1178
+
992
1179
  Object.defineProperty(exports, "__esModule", {
993
1180
  value: true
994
1181
  });
995
1182
  exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
1183
+
996
1184
  var lodash_1 = __webpack_require__(3);
1185
+
997
1186
  var schemaUtils_1 = __webpack_require__(16);
1187
+
998
1188
  var VizBehavior_1 = __webpack_require__(6);
1189
+
999
1190
  var dynamicOptionsDSLType = {
1000
1191
  type: 'string',
1001
1192
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
@@ -1005,20 +1196,22 @@ var dynamicOptionsDSLType = {
1005
1196
  * @param optionsSchema a visualization's options schema
1006
1197
  * @returns an updated options schema that additionally allows strings starting with > for each option
1007
1198
  */
1199
+
1008
1200
  function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
1009
1201
  var enhancedOptionsSchema = {};
1010
1202
  Object.keys(optionsSchema).forEach(function (key) {
1011
1203
  var _a = optionsSchema[key],
1012
- title = _a.title,
1013
- description = _a.description,
1014
- readOnly = _a.readOnly,
1015
- writeOnly = _a.writeOnly,
1016
- examples = _a.examples,
1017
- defaultValue = _a.default,
1018
- type = _a.type,
1019
- properties = _a.properties,
1020
- patternProperties = _a.patternProperties,
1021
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
1204
+ title = _a.title,
1205
+ description = _a.description,
1206
+ readOnly = _a.readOnly,
1207
+ writeOnly = _a.writeOnly,
1208
+ examples = _a.examples,
1209
+ defaultValue = _a.default,
1210
+ type = _a.type,
1211
+ properties = _a.properties,
1212
+ patternProperties = _a.patternProperties,
1213
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
1214
+
1022
1215
  var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
1023
1216
  title: title
1024
1217
  }), description !== undefined && {
@@ -1032,12 +1225,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
1032
1225
  }), defaultValue !== undefined && {
1033
1226
  default: defaultValue
1034
1227
  });
1228
+
1035
1229
  if (type === 'object') {
1036
1230
  enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
1037
1231
  type: type
1038
1232
  }), properties && {
1039
1233
  properties: enhanceOptionsSchemaWithDynamicOptions(properties)
1040
1234
  });
1235
+
1041
1236
  if (patternProperties) {
1042
1237
  var enhancedPatternProperties = {};
1043
1238
  Object.keys(patternProperties).forEach(function (opt) {
@@ -1055,6 +1250,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
1055
1250
  });
1056
1251
  return enhancedOptionsSchema;
1057
1252
  }
1253
+
1058
1254
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
1059
1255
  /**
1060
1256
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
@@ -1063,11 +1259,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
1063
1259
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
1064
1260
  * and containing `open: false` for all editor panels in editorConfig
1065
1261
  */
1262
+
1066
1263
  function enhanceConfig(vizConfig) {
1067
1264
  var enhancedConfig = Object.assign({}, vizConfig);
1265
+
1068
1266
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
1069
1267
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
1070
1268
  }
1269
+
1071
1270
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
1072
1271
  return Object.assign(Object.assign({}, config), {
1073
1272
  open: config.open || false
@@ -1075,6 +1274,7 @@ function enhanceConfig(vizConfig) {
1075
1274
  });
1076
1275
  return enhancedConfig;
1077
1276
  }
1277
+
1078
1278
  exports.enhanceConfig = enhanceConfig;
1079
1279
  /**
1080
1280
  * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
@@ -1082,6 +1282,7 @@ exports.enhanceConfig = enhanceConfig;
1082
1282
  * @param vizConfig a Visualization Config
1083
1283
  * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
1084
1284
  */
1285
+
1085
1286
  function uncollapseEditorConfig(vizConfig) {
1086
1287
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
1087
1288
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
@@ -1091,13 +1292,16 @@ function uncollapseEditorConfig(vizConfig) {
1091
1292
  });
1092
1293
  return editorPanelUncollapsedConfig;
1093
1294
  }
1295
+
1094
1296
  exports.uncollapseEditorConfig = uncollapseEditorConfig;
1297
+
1095
1298
  function isDynamicOption(option) {
1096
1299
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
1097
1300
  }
1098
- exports.isDynamicOption = isDynamicOption;
1099
- // private helpers to improve readability of getInitialPreset
1301
+
1302
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
1100
1303
  // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
1304
+
1101
1305
  /**
1102
1306
  * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
1103
1307
  * 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
@@ -1106,6 +1310,7 @@ exports.isDynamicOption = isDynamicOption;
1106
1310
  *
1107
1311
  * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
1108
1312
  */
1313
+
1109
1314
  function hasCompatibleContexts(vizContext, presetContext) {
1110
1315
  var presetContextKeys = Object.keys(presetContext);
1111
1316
  return presetContextKeys.every(function (contextKey) {
@@ -1115,6 +1320,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
1115
1320
  /**
1116
1321
  * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
1117
1322
  */
1323
+
1324
+
1118
1325
  function hasCompatibleOptions(vizOptions, presetOptions) {
1119
1326
  var presetOptionKeys = Object.keys(presetOptions);
1120
1327
  return presetOptionKeys.every(function (optionKey) {
@@ -1129,18 +1336,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
1129
1336
  * @param {Object} vizOptions - the current vizOptions definition
1130
1337
  * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
1131
1338
  */
1339
+
1340
+
1132
1341
  function getInitialPreset(vizContext, vizOptions, presets) {
1133
1342
  return presets.find(function (preset) {
1134
- var presetContext = lodash_1.get(preset, ['value', 'context'], {});
1135
- var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
1343
+ var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
1344
+ var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
1136
1345
  var presetContextKeys = Object.keys(presetContext);
1137
- var presetOptionKeys = Object.keys(presetOptions);
1138
- // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
1346
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
1139
1347
  // if not, then the preset is invalid in config.ts
1348
+
1140
1349
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
1141
1350
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
1142
1351
  });
1143
1352
  }
1353
+
1144
1354
  exports.getInitialPreset = getInitialPreset;
1145
1355
  /**
1146
1356
  * generates number precision values for a Select editor
@@ -1148,14 +1358,16 @@ exports.getInitialPreset = getInitialPreset;
1148
1358
  * @param {Number} numPrecisionValues - number of integer precision values to generate
1149
1359
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
1150
1360
  */
1361
+
1151
1362
  function generatePrecisionValues(numPrecisionValues) {
1152
- return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
1363
+ return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
1153
1364
  return {
1154
1365
  label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
1155
1366
  value: i
1156
1367
  };
1157
1368
  });
1158
1369
  }
1370
+
1159
1371
  exports.generatePrecisionValues = generatePrecisionValues;
1160
1372
  /**
1161
1373
  * insert layout in layout array, return a new layout array instead of updating the original
@@ -1165,12 +1377,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
1165
1377
  * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
1166
1378
  * @returns {EditorLayoutConfig[][]} new editor layout with insertion
1167
1379
  */
1380
+
1168
1381
  var insertLayout = function insertLayout(layout, index) {
1169
1382
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1170
1383
  layoutItems[_key - 2] = arguments[_key];
1171
1384
  }
1385
+
1172
1386
  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
1173
1387
  };
1388
+
1174
1389
  exports.insertLayout = insertLayout;
1175
1390
 
1176
1391
  /***/ }),
@@ -1192,28 +1407,28 @@ module.exports = require("@splunk/visualizations-shared/configUtils");
1192
1407
  /***/ 25:
1193
1408
  /***/ (function(module, exports) {
1194
1409
 
1195
- module.exports = require("@splunk/visualization-context/TimezoneContext");
1410
+ module.exports = require("@splunk/ui-utils/id");
1196
1411
 
1197
1412
  /***/ }),
1198
1413
 
1199
1414
  /***/ 26:
1200
1415
  /***/ (function(module, exports) {
1201
1416
 
1202
- module.exports = require("@splunk/visualizations-shared/hocUtils");
1417
+ module.exports = require("@splunk/visualization-context/TimezoneContext");
1203
1418
 
1204
1419
  /***/ }),
1205
1420
 
1206
1421
  /***/ 27:
1207
1422
  /***/ (function(module, exports) {
1208
1423
 
1209
- module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
1424
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
1210
1425
 
1211
1426
  /***/ }),
1212
1427
 
1213
- /***/ 29:
1428
+ /***/ 28:
1214
1429
  /***/ (function(module, exports) {
1215
1430
 
1216
- module.exports = require("@splunk/visualization-encoding/Options");
1431
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
1217
1432
 
1218
1433
  /***/ }),
1219
1434
 
@@ -1227,11 +1442,18 @@ module.exports = require("lodash");
1227
1442
  /***/ 30:
1228
1443
  /***/ (function(module, exports) {
1229
1444
 
1230
- module.exports = require("@splunk/visualizations-shared/numberUtils");
1445
+ module.exports = require("@splunk/visualization-encoding/Options");
1231
1446
 
1232
1447
  /***/ }),
1233
1448
 
1234
1449
  /***/ 31:
1450
+ /***/ (function(module, exports) {
1451
+
1452
+ module.exports = require("@splunk/visualizations-shared/numberUtils");
1453
+
1454
+ /***/ }),
1455
+
1456
+ /***/ 32:
1235
1457
  /***/ (function(module, exports, __webpack_require__) {
1236
1458
 
1237
1459
  "use strict";
@@ -1241,11 +1463,17 @@ Object.defineProperty(exports, "__esModule", {
1241
1463
  value: true
1242
1464
  });
1243
1465
  exports.shouldShowIconPlaceholder = void 0;
1466
+
1244
1467
  var React = __webpack_require__(1);
1468
+
1245
1469
  var T = __webpack_require__(0);
1470
+
1246
1471
  var lodash_1 = __webpack_require__(3);
1472
+
1247
1473
  var i18n_1 = __webpack_require__(2);
1474
+
1248
1475
  var Message_1 = __webpack_require__(10);
1476
+
1249
1477
  var FixedSizeContainer_1 = __webpack_require__(13);
1250
1478
  /**
1251
1479
  * @method shouldShowIconPlaceholder
@@ -1253,14 +1481,17 @@ var FixedSizeContainer_1 = __webpack_require__(13);
1253
1481
  * @param {boolean} loading
1254
1482
  * @returns {boolean}
1255
1483
  */
1484
+
1485
+
1256
1486
  var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
1257
1487
  var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1258
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1488
+ var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
1259
1489
  var noData = data === undefined;
1260
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1490
+ var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
1261
1491
  var noFields = fields === undefined;
1262
1492
  return loading || noData || noFields;
1263
1493
  };
1494
+
1264
1495
  exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
1265
1496
  var propTypes = {
1266
1497
  icon: T.func,
@@ -1275,11 +1506,13 @@ var propTypes = {
1275
1506
  * @param {IconPlaceholderProps} props
1276
1507
  * @returns {React.ReactElement}
1277
1508
  */
1509
+
1278
1510
  var IconPlaceholder = function IconPlaceholder(props) {
1279
1511
  var width = props.width,
1280
- height = props.height,
1281
- icon = props.icon,
1282
- iconColor = props.iconColor;
1512
+ height = props.height,
1513
+ icon = props.icon,
1514
+ iconColor = props.iconColor;
1515
+
1283
1516
  if (icon) {
1284
1517
  return React.createElement(icon, {
1285
1518
  style: {
@@ -1294,26 +1527,21 @@ var IconPlaceholder = function IconPlaceholder(props) {
1294
1527
  height: '50%'
1295
1528
  });
1296
1529
  }
1530
+
1297
1531
  return React.createElement(Message_1.default, {
1298
1532
  width: width,
1299
1533
  height: height,
1300
1534
  level: "warning",
1301
- message: i18n_1._('No DataSource Connected')
1535
+ message: (0, i18n_1._)('No DataSource Connected')
1302
1536
  });
1303
1537
  };
1538
+
1304
1539
  IconPlaceholder.propTypes = propTypes;
1305
1540
  IconPlaceholder.defaultProps = {
1306
1541
  width: '100%',
1307
1542
  height: 250
1308
1543
  };
1309
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1310
-
1311
- /***/ }),
1312
-
1313
- /***/ 32:
1314
- /***/ (function(module, exports) {
1315
-
1316
- module.exports = require("@splunk/ui-utils/id");
1544
+ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
1317
1545
 
1318
1546
  /***/ }),
1319
1547
 
@@ -1324,21 +1552,27 @@ module.exports = require("@splunk/ui-utils/id");
1324
1552
 
1325
1553
 
1326
1554
  var _defineProperty = __webpack_require__(7);
1555
+
1327
1556
  Object.defineProperty(exports, "__esModule", {
1328
1557
  value: true
1329
1558
  });
1330
1559
  exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1560
+
1331
1561
  var T = __webpack_require__(0);
1562
+
1332
1563
  var lodash_1 = __webpack_require__(3);
1333
- var DataSource_1 = __webpack_require__(43);
1564
+
1565
+ var DataSource_1 = __webpack_require__(34);
1566
+
1334
1567
  exports.SortParamsPropTypes = T.shape({
1335
1568
  currentSortKey: T.string,
1336
1569
  currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1337
1570
  onSort: T.func
1338
1571
  });
1572
+
1339
1573
  var getSortingParams = function getSortingParams(_ref) {
1340
1574
  var requestParams = _ref.requestParams,
1341
- onRequestParamsChange = _ref.onRequestParamsChange;
1575
+ onRequestParamsChange = _ref.onRequestParamsChange;
1342
1576
  var currentSortKey;
1343
1577
  var currentSortDir;
1344
1578
  var nextSortDirMap = {
@@ -1347,17 +1581,20 @@ var getSortingParams = function getSortingParams(_ref) {
1347
1581
  none: 'asc'
1348
1582
  };
1349
1583
  var onSort;
1584
+
1350
1585
  if (typeof onRequestParamsChange === 'function') {
1351
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
1586
+ if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
1352
1587
  currentSortKey = Object.keys(requestParams.sort).shift();
1353
1588
  currentSortDir = requestParams.sort[currentSortKey];
1354
- }
1355
- // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1589
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1590
+
1591
+
1356
1592
  onSort = function onSort(e, _ref2) {
1357
1593
  var sortKey = _ref2.sortKey,
1358
- sortDir = _ref2.sortDir;
1594
+ sortDir = _ref2.sortDir;
1595
+
1359
1596
  if (typeof sortKey === 'string') {
1360
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1597
+ var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1361
1598
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1362
1599
  offset: 0,
1363
1600
  sort: _defineProperty({}, sortKey, nextSortDir)
@@ -1367,12 +1604,14 @@ var getSortingParams = function getSortingParams(_ref) {
1367
1604
  }
1368
1605
  };
1369
1606
  }
1607
+
1370
1608
  return {
1371
1609
  currentSortKey: currentSortKey,
1372
1610
  currentSortDir: currentSortDir,
1373
1611
  onSort: onSort
1374
1612
  };
1375
1613
  };
1614
+
1376
1615
  exports.getSortingParams = getSortingParams;
1377
1616
 
1378
1617
  /***/ }),
@@ -1386,40 +1625,66 @@ exports.getSortingParams = getSortingParams;
1386
1625
  Object.defineProperty(exports, "__esModule", {
1387
1626
  value: true
1388
1627
  });
1389
- exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1390
- var T = __webpack_require__(0);
1391
- var lodash_1 = __webpack_require__(3);
1392
- exports.PaginatorParamsPropTypes = T.shape({
1393
- isPaging: T.bool,
1394
- current: T.number,
1395
- totalPages: T.number,
1396
- onChange: T.func
1397
- });
1398
- var getPaginationParams = function getPaginationParams(_ref) {
1628
+ exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
1629
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1630
+ exports.validSegmentationModes = ['none', 'inner'];
1631
+ exports.validOutputModes = ['json_cols', 'json'];
1632
+
1633
+ /***/ }),
1634
+
1635
+ /***/ 35:
1636
+ /***/ (function(module, exports, __webpack_require__) {
1637
+
1638
+ "use strict";
1639
+
1640
+
1641
+ Object.defineProperty(exports, "__esModule", {
1642
+ value: true
1643
+ });
1644
+ exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1645
+
1646
+ var T = __webpack_require__(0);
1647
+
1648
+ var lodash_1 = __webpack_require__(3);
1649
+
1650
+ exports.PaginatorParamsPropTypes = T.shape({
1651
+ isPaging: T.bool,
1652
+ current: T.number,
1653
+ totalPages: T.number,
1654
+ onChange: T.func
1655
+ });
1656
+
1657
+ var getPaginationParams = function getPaginationParams(_ref) {
1399
1658
  var requestParams = _ref.requestParams,
1400
- meta = _ref.meta,
1401
- onRequestParamsChange = _ref.onRequestParamsChange;
1659
+ meta = _ref.meta,
1660
+ onRequestParamsChange = _ref.onRequestParamsChange;
1402
1661
  var totalCount = meta && meta.totalCount || 0;
1403
1662
  var offset = requestParams && requestParams.offset || 0;
1404
1663
  var count = requestParams && requestParams.count;
1405
1664
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1406
1665
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1407
1666
  var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
1667
+
1408
1668
  var onChangeHandler = function onChangeHandler(e, _ref2) {
1409
1669
  var page = _ref2.page,
1410
- countArg = _ref2.count;
1411
- var newParams = lodash_1.cloneDeep(requestParams);
1670
+ countArg = _ref2.count;
1671
+ var newParams = (0, lodash_1.cloneDeep)(requestParams);
1672
+
1412
1673
  if (typeof countArg === 'number') {
1413
1674
  newParams.count = countArg;
1414
1675
  newParams.offset = 0;
1415
1676
  }
1677
+
1416
1678
  var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1679
+
1417
1680
  if (typeof page === 'number' && page > 0) {
1418
1681
  newParams.count = pageCount;
1419
1682
  newParams.offset = (page - 1) * pageCount;
1420
1683
  }
1684
+
1421
1685
  onRequestParamsChange(newParams);
1422
1686
  };
1687
+
1423
1688
  return {
1424
1689
  isPaging: isPaging,
1425
1690
  current: current,
@@ -1427,11 +1692,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
1427
1692
  onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
1428
1693
  };
1429
1694
  };
1695
+
1430
1696
  exports.getPaginationParams = getPaginationParams;
1431
1697
 
1432
1698
  /***/ }),
1433
1699
 
1434
- /***/ 35:
1700
+ /***/ 36:
1435
1701
  /***/ (function(module, exports, __webpack_require__) {
1436
1702
 
1437
1703
  "use strict";
@@ -1442,6 +1708,7 @@ Object.defineProperty(exports, "__esModule", {
1442
1708
  });
1443
1709
  exports.VizCategory = void 0;
1444
1710
  var VizCategory;
1711
+
1445
1712
  (function (VizCategory) {
1446
1713
  VizCategory["SINGLE_VALUE"] = "Single Value";
1447
1714
  VizCategory["TRENDS"] = "Trends";
@@ -1459,67 +1726,96 @@ var VizCategory;
1459
1726
 
1460
1727
  /***/ }),
1461
1728
 
1462
- /***/ 36:
1729
+ /***/ 37:
1463
1730
  /***/ (function(module, exports, __webpack_require__) {
1464
1731
 
1465
1732
  "use strict";
1466
1733
 
1467
1734
 
1468
1735
  var _slicedToArray = __webpack_require__(17);
1736
+
1469
1737
  Object.defineProperty(exports, "__esModule", {
1470
1738
  value: true
1471
1739
  });
1740
+
1472
1741
  var React = __webpack_require__(1);
1742
+
1473
1743
  var lodash_1 = __webpack_require__(3);
1474
- var getSettingsFromThemedProps_1 = __webpack_require__(37);
1475
- var Options_1 = __webpack_require__(29);
1476
- var SanitizeProps_1 = __webpack_require__(38);
1477
- var TimezoneContext_1 = __webpack_require__(25);
1478
- var moment_1 = __webpack_require__(39);
1744
+
1745
+ var getSettingsFromThemedProps_1 = __webpack_require__(38);
1746
+
1747
+ var Options_1 = __webpack_require__(30);
1748
+
1749
+ var SanitizeProps_1 = __webpack_require__(39);
1750
+
1751
+ var TimezoneContext_1 = __webpack_require__(26);
1752
+
1753
+ var moment_1 = __webpack_require__(40);
1754
+
1479
1755
  var FeatureFlagContext_1 = __webpack_require__(21);
1756
+
1480
1757
  var styled_components_1 = __webpack_require__(4);
1481
- var hocUtils_1 = __webpack_require__(26);
1482
- var JSONSchemaUtils_1 = __webpack_require__(27);
1483
- var async_dynamic_options_evaluator_1 = __webpack_require__(40);
1484
- var id_1 = __webpack_require__(32);
1485
- var SplunkVisualization_1 = __webpack_require__(41);
1758
+
1759
+ var hocUtils_1 = __webpack_require__(27);
1760
+
1761
+ var JSONSchemaUtils_1 = __webpack_require__(28);
1762
+
1763
+ var async_dynamic_options_evaluator_1 = __webpack_require__(41);
1764
+
1765
+ var id_1 = __webpack_require__(25);
1766
+
1767
+ var SplunkVisualization_1 = __webpack_require__(42);
1768
+
1486
1769
  var VizBehavior_1 = __webpack_require__(6);
1770
+
1487
1771
  var getSorting_1 = __webpack_require__(33);
1488
- var getPagination_1 = __webpack_require__(34);
1772
+
1773
+ var getPagination_1 = __webpack_require__(35);
1774
+
1489
1775
  var useDeepMemo_1 = __webpack_require__(44);
1776
+
1490
1777
  var MissingPropsMessage_1 = __webpack_require__(45);
1778
+
1491
1779
  var withEditModeCover_1 = __webpack_require__(46);
1780
+
1492
1781
  var withPlaceholder_1 = __webpack_require__(47);
1493
1782
  /**
1494
1783
  * hoc that wraps a pure react visualization in a Dashboard visualization
1495
1784
  * @param {DashboardVizOpts} opts
1496
1785
  * @returns {HOC}
1497
1786
  */
1787
+
1788
+
1498
1789
  var withDashboardViz = function withDashboardViz(opts) {
1499
1790
  var ReactViz = opts.ReactViz,
1500
- vizConfig = opts.vizConfig,
1501
- _opts$computeVizProps = opts.computeVizProps,
1502
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1503
- disableEditModeCover = opts.disableEditModeCover,
1504
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1505
- var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1506
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1791
+ vizConfig = opts.vizConfig,
1792
+ _opts$computeVizProps = opts.computeVizProps,
1793
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1794
+ disableEditModeCover = opts.disableEditModeCover,
1795
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1796
+
1797
+ var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
1798
+ var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
1799
+
1507
1800
  var DashboardViz = function DashboardViz(props) {
1508
1801
  var _a;
1802
+
1509
1803
  var mode = props.mode,
1510
- hasEventHandlers = props.hasEventHandlers,
1511
- dataSources = props.dataSources,
1512
- options = props.options,
1513
- _props$context = props.context,
1514
- context = _props$context === void 0 ? {} : _props$context,
1515
- width = props.width,
1516
- height = props.height,
1517
- onComputedProps = props.onComputedProps,
1518
- onEventTrigger = props.onEventTrigger,
1519
- theme = props.theme,
1520
- onRequestParamsChange = props.onRequestParamsChange;
1804
+ hasEventHandlers = props.hasEventHandlers,
1805
+ dataSources = props.dataSources,
1806
+ options = props.options,
1807
+ _props$context = props.context,
1808
+ context = _props$context === void 0 ? {} : _props$context,
1809
+ width = props.width,
1810
+ height = props.height,
1811
+ onComputedProps = props.onComputedProps,
1812
+ onEventTrigger = props.onEventTrigger,
1813
+ theme = props.theme,
1814
+ onRequestParamsChange = props.onRequestParamsChange;
1815
+
1521
1816
  var _React$useContext = React.useContext(TimezoneContext_1.default),
1522
- serializedTimezone = _React$useContext.serializedTimezone;
1817
+ serializedTimezone = _React$useContext.serializedTimezone;
1818
+
1523
1819
  if (serializedTimezone) {
1524
1820
  /*
1525
1821
  @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
@@ -1533,44 +1829,58 @@ var withDashboardViz = function withDashboardViz(opts) {
1533
1829
  moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1534
1830
  }
1535
1831
  }
1832
+
1536
1833
  var themeFunc = function themeFunc(themeVar) {
1537
1834
  var _a, _b;
1835
+
1538
1836
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1539
1837
  };
1838
+
1540
1839
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1541
- var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1542
- theme: theme
1543
- }),
1544
- currentThemeFamily = _getSettingsFromTheme.family,
1545
- currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1546
- currentThemeDensity = _getSettingsFromTheme.density;
1840
+
1841
+ var _ref = (0, getSettingsFromThemedProps_1.default)({
1842
+ theme: theme
1843
+ }),
1844
+ currentThemeFamily = _ref.family,
1845
+ currentThemeColorScheme = _ref.colorScheme,
1846
+ currentThemeDensity = _ref.density;
1847
+
1547
1848
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1849
+
1548
1850
  var _React$useState = React.useState({}),
1549
- _React$useState2 = _slicedToArray(_React$useState, 2),
1550
- evaluatedOptionsAsync = _React$useState2[0],
1551
- setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1851
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1852
+ evaluatedOptionsAsync = _React$useState2[0],
1853
+ setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1854
+
1855
+
1552
1856
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
1553
- var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat(id_1.createGUID())),
1554
- _React$useState4 = _slicedToArray(_React$useState3, 1),
1555
- visualizationID = _React$useState4[0];
1857
+
1858
+ var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
1859
+ _React$useState4 = _slicedToArray(_React$useState3, 1),
1860
+ visualizationID = _React$useState4[0];
1861
+
1556
1862
  var _React$useState5 = React.useState({}),
1557
- _React$useState6 = _slicedToArray(_React$useState5, 2),
1558
- dataSourcesInState = _React$useState6[0],
1559
- setDataSourcesInState = _React$useState6[1];
1863
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
1864
+ dataSourcesInState = _React$useState6[0],
1865
+ setDataSourcesInState = _React$useState6[1];
1866
+
1560
1867
  var _React$useState7 = React.useState(),
1561
- _React$useState8 = _slicedToArray(_React$useState7, 2),
1562
- dataFramesInState = _React$useState8[0],
1563
- setDataFramesInState = _React$useState8[1];
1564
- var _React$useState9 = React.useState(Boolean(featureFlagContext && featureFlagContext.visualizations_useWebWorkersForDSL && typeof Worker !== 'undefined')),
1565
- _React$useState10 = _slicedToArray(_React$useState9, 2),
1566
- useAsyncEvaluatedOptions = _React$useState10[0],
1567
- setUseAsyncEvaluatedOptions = _React$useState10[1];
1568
- evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1868
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
1869
+ dataFramesInState = _React$useState8[0],
1870
+ setDataFramesInState = _React$useState8[1];
1871
+
1872
+ var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
1873
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
1874
+ useAsyncEvaluatedOptions = _React$useState10[0],
1875
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
1876
+
1877
+ var isMounted = React.useRef(true);
1878
+ evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
1569
1879
  try {
1570
1880
  if (useAsyncEvaluatedOptions) {
1571
1881
  var optionsToEvaluate = {
1572
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1573
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1882
+ context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
1883
+ options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
1574
1884
  };
1575
1885
  var asyncDynamicOptionsEvaluatorParams = {
1576
1886
  visualizationID: visualizationID,
@@ -1581,21 +1891,23 @@ var withDashboardViz = function withDashboardViz(opts) {
1581
1891
  };
1582
1892
  async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
1583
1893
  setEvaluatedOptionsAsync(results.results);
1584
- }).catch(function (e) {
1585
- // eslint-disable-next-line no-console
1586
- console.error("unexpected error evaluating options - async: ".concat(e.message));
1587
- setUseAsyncEvaluatedOptions(false);
1894
+ }).catch(function () {
1895
+ if (isMounted.current) {
1896
+ setUseAsyncEvaluatedOptions(false);
1897
+ }
1588
1898
  });
1589
1899
  } else {
1590
1900
  var dataFrames = dataFramesInState;
1901
+
1591
1902
  if (dataSources !== dataSourcesInState) {
1592
1903
  setDataSourcesInState(dataSources);
1593
1904
  dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
1594
1905
  setDataFramesInState(dataFrames);
1595
1906
  }
1907
+
1596
1908
  return Options_1.Options.evaluate({
1597
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1598
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1909
+ context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
1910
+ options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
1599
1911
  }, dataSources, themeFunc, dataFrames);
1600
1912
  }
1601
1913
  } catch (e) {
@@ -1603,67 +1915,76 @@ var withDashboardViz = function withDashboardViz(opts) {
1603
1915
  console.error("unexpected error evaluating options: ".concat(e.message));
1604
1916
  return {};
1605
1917
  }
1918
+
1606
1919
  return {};
1607
1920
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
1608
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
1609
- // trellis specific backgroundColor update for onComputedProps
1921
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
1610
1922
  // if trellis is enabled following these three criteria - 1) trellis feature flag is enabled 2) vizConfig supports array has 'trellis' 3) option 'splitByLayout' is set to 'trellis
1611
1923
  // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
1924
+
1612
1925
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
1613
1926
  var clonedEvaluatedOptions = evaluatedOptionsToUse;
1927
+
1614
1928
  if (isTrellisFeatureFlagOn && ((_a = vizConfig === null || vizConfig === void 0 ? void 0 : vizConfig.supports) === null || _a === void 0 ? void 0 : _a.includes(VizBehavior_1.VizBehavior.TRELLIS)) && (clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.splitByLayout) === VizBehavior_1.VizBehavior.TRELLIS) {
1615
1929
  clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
1616
1930
  backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
1617
1931
  });
1618
- }
1619
- // useEffect hook needs to be initialized before any early returns
1932
+ } // useEffect hook needs to be initialized before any early returns
1620
1933
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1934
+
1935
+
1621
1936
  React.useEffect(function () {
1622
1937
  onComputedProps(clonedEvaluatedOptions);
1623
1938
  });
1624
1939
  React.useEffect(function () {
1625
1940
  return function () {
1626
1941
  if (useAsyncEvaluatedOptions) {
1942
+ isMounted.current = false;
1627
1943
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
1628
1944
  }
1629
- };
1630
- // eslint-disable-next-line react-hooks/exhaustive-deps
1631
- }, []);
1632
- // present warning message if any required props are missing
1945
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
1946
+ }, []); // present warning message if any required props are missing
1947
+
1633
1948
  var _vizConfig$requiredPr = vizConfig.requiredProps,
1634
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1635
- supports = vizConfig.supports;
1636
- var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
1949
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1950
+ supports = vizConfig.supports;
1951
+ var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
1952
+
1637
1953
  if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && vizConfig.key !== 'splunk.singlevalue' // For SV missing props msg is not displayed if required props majorValue is missing, instead this will be handled from the component, instead handled within component
1638
1954
  ) {
1639
- return React.createElement(MissingPropsMessage_1.default, {
1640
- "data-test": "missing-props-message",
1641
- width: width,
1642
- height: height,
1643
- missingProps: missing,
1644
- backgroundColor: bgColorFromTheme
1645
- });
1646
- }
1647
- // events
1955
+ return React.createElement(MissingPropsMessage_1.default, {
1956
+ "data-test": "missing-props-message",
1957
+ width: width,
1958
+ height: height,
1959
+ missingProps: missing,
1960
+ backgroundColor: bgColorFromTheme
1961
+ });
1962
+ } // events
1963
+
1964
+
1648
1965
  var eventCallbackProps = {};
1966
+
1649
1967
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1650
1968
  var supportedEvents = vizConfig.events;
1651
1969
  Object.keys(supportedEvents).forEach(function (eventName) {
1652
- var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1653
- eventCallbackProps[eventCallbackPropName] = null;
1654
- // todo: refactor single value and single value icon to send payload from viz
1970
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
1971
+ eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1655
1972
  // then remove these lines
1973
+
1656
1974
  var payloadKeys = supportedEvents[eventName].payloadKeys;
1657
1975
  var payload = {};
1976
+
1658
1977
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
1659
1978
  payloadKeys.forEach(function (p) {
1660
1979
  payload[p] = evaluatedOptionsToUse[p];
1661
1980
  });
1662
1981
  }
1982
+
1663
1983
  eventCallbackProps[eventCallbackPropName] = function (ev) {
1664
1984
  if (ev && ev.payload) {
1665
1985
  payload = ev.payload;
1666
1986
  }
1987
+
1667
1988
  return onEventTrigger({
1668
1989
  originalEvent: ev,
1669
1990
  payload: payload,
@@ -1671,8 +1992,9 @@ var withDashboardViz = function withDashboardViz(opts) {
1671
1992
  });
1672
1993
  };
1673
1994
  });
1674
- }
1675
- // compute pure viz props which are not from options
1995
+ } // compute pure viz props which are not from options
1996
+
1997
+
1676
1998
  var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
1677
1999
  themeFunc: themeFunc
1678
2000
  }));
@@ -1690,21 +2012,25 @@ var withDashboardViz = function withDashboardViz(opts) {
1690
2012
  * In future, we could automatically detect which all datasources are being used
1691
2013
  * and bind those magically to pagination/sorting behavior.
1692
2014
  */
2015
+
1693
2016
  var dataSourceMetadata = {};
1694
2017
  var OptionKey = 'paginateDataSourceKey';
1695
- var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1696
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1697
- var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1698
- var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
2018
+ var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
2019
+
2020
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
2021
+ var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
2022
+ var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
2023
+
1699
2024
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1700
2025
  return onRequestParamsChange(paginateDataSourceKey, payload);
1701
2026
  };
1702
- var sortParams = getSorting_1.getSortingParams({
2027
+
2028
+ var sortParams = (0, getSorting_1.getSortingParams)({
1703
2029
  requestParams: requestParams,
1704
2030
  meta: meta,
1705
2031
  onRequestParamsChange: handleRequestParamsChange
1706
2032
  });
1707
- var paginatorParams = getPagination_1.getPaginationParams({
2033
+ var paginatorParams = (0, getPagination_1.getPaginationParams)({
1708
2034
  requestParams: requestParams,
1709
2035
  meta: meta,
1710
2036
  onRequestParamsChange: handleRequestParamsChange
@@ -1713,115 +2039,132 @@ var withDashboardViz = function withDashboardViz(opts) {
1713
2039
  sortParams: sortParams,
1714
2040
  paginatorParams: paginatorParams
1715
2041
  };
1716
- }
1717
- // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
2042
+ } // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
2043
+
2044
+
1718
2045
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
1719
2046
  return null;
1720
2047
  }
2048
+
1721
2049
  return React.createElement(SanitizedReactViz, Object.assign({
1722
2050
  mode: mode,
1723
2051
  width: width,
1724
2052
  height: height
1725
2053
  }, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
1726
2054
  };
2055
+
1727
2056
  DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1728
2057
  DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1729
2058
  // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1730
2059
  theme: {}
1731
- });
1732
- // attach viz config
1733
- DashboardViz.config = vizConfig;
1734
- // @ts-ignore: TODO fix sc upgrade TS issues
1735
- return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
2060
+ }); // attach viz config
2061
+
2062
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
2063
+
2064
+ return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
1736
2065
  };
2066
+
1737
2067
  exports.default = withDashboardViz;
1738
2068
 
1739
2069
  /***/ }),
1740
2070
 
1741
- /***/ 37:
2071
+ /***/ 38:
1742
2072
  /***/ (function(module, exports) {
1743
2073
 
1744
2074
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1745
2075
 
1746
2076
  /***/ }),
1747
2077
 
1748
- /***/ 38:
2078
+ /***/ 39:
1749
2079
  /***/ (function(module, exports) {
1750
2080
 
1751
2081
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1752
2082
 
1753
2083
  /***/ }),
1754
2084
 
1755
- /***/ 39:
2085
+ /***/ 4:
1756
2086
  /***/ (function(module, exports) {
1757
2087
 
1758
- module.exports = require("@splunk/moment");
2088
+ module.exports = require("styled-components");
1759
2089
 
1760
2090
  /***/ }),
1761
2091
 
1762
- /***/ 4:
2092
+ /***/ 40:
1763
2093
  /***/ (function(module, exports) {
1764
2094
 
1765
- module.exports = require("styled-components");
2095
+ module.exports = require("@splunk/moment");
1766
2096
 
1767
2097
  /***/ }),
1768
2098
 
1769
- /***/ 40:
2099
+ /***/ 41:
1770
2100
  /***/ (function(module, exports) {
1771
2101
 
1772
2102
  module.exports = require("@splunk/async-dynamic-options-evaluator");
1773
2103
 
1774
2104
  /***/ }),
1775
2105
 
1776
- /***/ 41:
2106
+ /***/ 42:
1777
2107
  /***/ (function(module, exports, __webpack_require__) {
1778
2108
 
1779
2109
  "use strict";
1780
2110
 
1781
2111
 
1782
2112
  var _classCallCheck = __webpack_require__(9);
2113
+
1783
2114
  Object.defineProperty(exports, "__esModule", {
1784
2115
  value: true
1785
2116
  });
1786
2117
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1787
2118
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
2119
+
1788
2120
  var T = __webpack_require__(0);
2121
+
1789
2122
  var lodash_1 = __webpack_require__(3);
1790
- var VizActionHandler_1 = __webpack_require__(42);
1791
- // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
2123
+
2124
+ var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
2125
+
2126
+
1792
2127
  exports.INITIAL_WIDTH = 250;
1793
2128
  exports.INITIAL_HEIGHT = 250;
1794
2129
  /**
1795
2130
  * A Splunk visualization
1796
2131
  */
2132
+
1797
2133
  var SplunkVisualization = function SplunkVisualization() {
1798
2134
  _classCallCheck(this, SplunkVisualization);
1799
2135
  };
2136
+
1800
2137
  SplunkVisualization.propTypes = {
1801
2138
  /**
1802
2139
  * display mode
1803
2140
  */
1804
2141
  mode: T.oneOf(['view', 'edit', 'export']).isRequired,
2142
+
1805
2143
  /**
1806
2144
  * width in pixel or string, defaults to 100%
1807
2145
  */
1808
2146
  width: T.oneOfType([T.string, T.number]).isRequired,
2147
+
1809
2148
  /**
1810
2149
  * height in pixel or string
1811
2150
  */
1812
2151
  height: T.oneOfType([T.string, T.number]).isRequired,
2152
+
1813
2153
  /**
1814
2154
  * visualization context used for dynamic option evaluation
1815
2155
  */
1816
2156
  context: T.object,
2157
+
1817
2158
  /**
1818
2159
  * visualization formatting options
1819
2160
  */
1820
2161
  options: T.object,
2162
+
1821
2163
  /**
1822
2164
  * A callback to update formatting options
1823
2165
  */
1824
2166
  onOptionsChange: T.func,
2167
+
1825
2168
  /**
1826
2169
  * datasource state which include data and request params, object key indicate the datasource type.
1827
2170
  */
@@ -1830,6 +2173,7 @@ SplunkVisualization.propTypes = {
1830
2173
  * current request params
1831
2174
  */
1832
2175
  requestParams: T.object,
2176
+
1833
2177
  /**
1834
2178
  * current dataset
1835
2179
  */
@@ -1837,6 +2181,7 @@ SplunkVisualization.propTypes = {
1837
2181
  fields: T.array,
1838
2182
  columns: T.array
1839
2183
  }),
2184
+
1840
2185
  /**
1841
2186
  * error
1842
2187
  */
@@ -1844,29 +2189,35 @@ SplunkVisualization.propTypes = {
1844
2189
  level: T.string,
1845
2190
  message: T.string
1846
2191
  }),
2192
+
1847
2193
  /**
1848
2194
  * meta data that came with the dataset
1849
2195
  */
1850
2196
  meta: T.object
1851
2197
  })),
2198
+
1852
2199
  /**
1853
2200
  * A callback to trigger event
1854
2201
  */
1855
2202
  onEventTrigger: T.func,
2203
+
1856
2204
  /**
1857
2205
  * Inform viz if there are handlers listening to events
1858
2206
  */
1859
2207
  hasEventHandlers: T.bool,
2208
+
1860
2209
  /**
1861
2210
  * A callback to communicate computed props to a consumer
1862
2211
  */
1863
2212
  onComputedProps: T.func,
2213
+
1864
2214
  /**
1865
2215
  * A callback to obtain visualization api
1866
2216
  */
1867
2217
  vizActionHandlerRef: T.func,
1868
2218
  loading: T.bool,
1869
2219
  theme: T.object,
2220
+
1870
2221
  /**
1871
2222
  * A callback to request new data with updated request params
1872
2223
  */
@@ -1875,6 +2226,7 @@ SplunkVisualization.propTypes = {
1875
2226
  /**
1876
2227
  *
1877
2228
  */
2229
+
1878
2230
  SplunkVisualization.defaultProps = {
1879
2231
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1880
2232
  width: '100%',
@@ -1903,26 +2255,29 @@ exports.default = SplunkVisualization;
1903
2255
 
1904
2256
  /***/ }),
1905
2257
 
1906
- /***/ 42:
2258
+ /***/ 43:
1907
2259
  /***/ (function(module, exports, __webpack_require__) {
1908
2260
 
1909
2261
  "use strict";
1910
2262
 
1911
2263
 
1912
2264
  var _classCallCheck = __webpack_require__(9);
2265
+
1913
2266
  var _createClass = __webpack_require__(18);
2267
+
1914
2268
  Object.defineProperty(exports, "__esModule", {
1915
2269
  value: true
1916
2270
  });
1917
2271
  exports.DefaultVizActionHandler = void 0;
2272
+
1918
2273
  var DefaultVizActionHandler = /*#__PURE__*/function () {
1919
2274
  function DefaultVizActionHandler() {
1920
2275
  _classCallCheck(this, DefaultVizActionHandler);
1921
2276
  }
2277
+
1922
2278
  _createClass(DefaultVizActionHandler, [{
1923
2279
  key: "focus",
1924
- value: function focus() {
1925
- // noop
2280
+ value: function focus() {// noop
1926
2281
  }
1927
2282
  }, {
1928
2283
  key: "snapshot",
@@ -1930,23 +2285,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
1930
2285
  return null; // noop
1931
2286
  }
1932
2287
  }]);
2288
+
1933
2289
  return DefaultVizActionHandler;
1934
2290
  }();
1935
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1936
-
1937
- /***/ }),
1938
2291
 
1939
- /***/ 43:
1940
- /***/ (function(module, exports, __webpack_require__) {
1941
-
1942
- "use strict";
1943
-
1944
-
1945
- Object.defineProperty(exports, "__esModule", {
1946
- value: true
1947
- });
1948
- exports.validSortDirs = void 0;
1949
- exports.validSortDirs = ['asc', 'desc', 'none'];
2292
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1950
2293
 
1951
2294
  /***/ }),
1952
2295
 
@@ -1960,7 +2303,9 @@ Object.defineProperty(exports, "__esModule", {
1960
2303
  value: true
1961
2304
  });
1962
2305
  exports.useDeepMemo = void 0;
2306
+
1963
2307
  var react_1 = __webpack_require__(1);
2308
+
1964
2309
  var lodash_1 = __webpack_require__(3);
1965
2310
  /**
1966
2311
  * This hook evaluates and stores the result of a passed function and only
@@ -1975,16 +2320,21 @@ var lodash_1 = __webpack_require__(3);
1975
2320
  * @param fn the function to be executed and
1976
2321
  * @param dependencies an array of dependencies
1977
2322
  */
2323
+
2324
+
1978
2325
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
1979
- var ref = react_1.useRef();
1980
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
2326
+ var ref = (0, react_1.useRef)();
2327
+
2328
+ if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
1981
2329
  ref.current = {
1982
2330
  dependencies: dependencies,
1983
2331
  value: fn()
1984
2332
  };
1985
2333
  }
2334
+
1986
2335
  return ref.current.value;
1987
2336
  };
2337
+
1988
2338
  exports.useDeepMemo = useDeepMemo;
1989
2339
 
1990
2340
  /***/ }),
@@ -1999,19 +2349,27 @@ Object.defineProperty(exports, "__esModule", {
1999
2349
  value: true
2000
2350
  });
2001
2351
  exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
2352
+
2002
2353
  var React = __webpack_require__(1);
2354
+
2003
2355
  var T = __webpack_require__(0);
2356
+
2004
2357
  var i18n_1 = __webpack_require__(2);
2358
+
2005
2359
  var Message_1 = __webpack_require__(10);
2360
+
2006
2361
  var FixedSizeContainer_1 = __webpack_require__(13);
2007
2362
  /**
2008
2363
  * @method isMissing
2009
2364
  * @param {any} v
2010
2365
  * @returns {boolean} true if the input value === null or undefined
2011
2366
  */
2367
+
2368
+
2012
2369
  var isMissing = function isMissing(v) {
2013
2370
  return v === null || v === undefined;
2014
2371
  };
2372
+
2015
2373
  exports.isMissing = isMissing;
2016
2374
  /**
2017
2375
  * @method misskingKeys
@@ -2019,11 +2377,13 @@ exports.isMissing = isMissing;
2019
2377
  * @param {object} target
2020
2378
  * @returns {string[]} the keys of missing required props
2021
2379
  */
2380
+
2022
2381
  var missingKeys = function missingKeys(keys, target) {
2023
2382
  return keys.filter(function (k) {
2024
- return exports.isMissing(target[k]);
2383
+ return (0, exports.isMissing)(target[k]);
2025
2384
  });
2026
2385
  };
2386
+
2027
2387
  exports.missingKeys = missingKeys;
2028
2388
  var propTypes = {
2029
2389
  width: T.oneOfType([T.string, T.number]),
@@ -2037,28 +2397,30 @@ var propTypes = {
2037
2397
  * @param {MissingPropsProps} props
2038
2398
  * @returns {React.ReactElement}
2039
2399
  */
2400
+
2040
2401
  var MissingPropsMessage = function MissingPropsMessage(props) {
2041
2402
  var width = props.width,
2042
- height = props.height,
2043
- missingProps = props.missingProps;
2403
+ height = props.height,
2404
+ missingProps = props.missingProps;
2044
2405
  return React.createElement(Message_1.default, {
2045
2406
  "data-test": "message",
2046
2407
  width: width,
2047
2408
  height: height,
2048
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
2409
+ message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
2049
2410
  });
2050
2411
  };
2412
+
2051
2413
  exports.MissingPropsMessage = MissingPropsMessage;
2052
2414
  exports.MissingPropsMessage.propTypes = propTypes;
2053
2415
  exports.MissingPropsMessage.defaultProps = {
2054
2416
  width: '100%',
2055
2417
  height: 250
2056
2418
  };
2057
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
2419
+ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
2058
2420
 
2059
2421
  /***/ }),
2060
2422
 
2061
- /***/ 454:
2423
+ /***/ 457:
2062
2424
  /***/ (function(module, exports, __webpack_require__) {
2063
2425
 
2064
2426
  "use strict";
@@ -2066,27 +2428,38 @@ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
2066
2428
 
2067
2429
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
2068
2430
  if (k2 === undefined) k2 = k;
2069
- Object.defineProperty(o, k2, {
2070
- enumerable: true,
2071
- get: function get() {
2072
- return m[k];
2073
- }
2074
- });
2431
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2432
+
2433
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2434
+ desc = {
2435
+ enumerable: true,
2436
+ get: function get() {
2437
+ return m[k];
2438
+ }
2439
+ };
2440
+ }
2441
+
2442
+ Object.defineProperty(o, k2, desc);
2075
2443
  } : function (o, m, k, k2) {
2076
2444
  if (k2 === undefined) k2 = k;
2077
2445
  o[k2] = m[k];
2078
2446
  });
2447
+
2079
2448
  var __exportStar = this && this.__exportStar || function (m, exports) {
2080
2449
  for (var p in m) {
2081
2450
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2082
2451
  }
2083
2452
  };
2453
+
2084
2454
  Object.defineProperty(exports, "__esModule", {
2085
2455
  value: true
2086
2456
  });
2087
2457
  exports.default = void 0;
2088
- __exportStar(__webpack_require__(163), exports);
2089
- var Sankey_1 = __webpack_require__(163);
2458
+
2459
+ __exportStar(__webpack_require__(166), exports);
2460
+
2461
+ var Sankey_1 = __webpack_require__(166);
2462
+
2090
2463
  Object.defineProperty(exports, "default", {
2091
2464
  enumerable: true,
2092
2465
  get: function get() {
@@ -2096,56 +2469,63 @@ Object.defineProperty(exports, "default", {
2096
2469
 
2097
2470
  /***/ }),
2098
2471
 
2099
- /***/ 455:
2472
+ /***/ 458:
2100
2473
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2101
2474
 
2102
2475
  "use strict";
2103
2476
  __webpack_require__.r(__webpack_exports__);
2104
2477
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d3_sankey", function() { return d3_sankey; });
2105
- /* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(138);
2478
+ /* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(140);
2106
2479
  /* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3_interpolate__WEBPACK_IMPORTED_MODULE_0__);
2107
- /* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(63);
2480
+ /* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64);
2108
2481
  /* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3_array__WEBPACK_IMPORTED_MODULE_1__);
2109
- /* harmony import */ var d3_collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(139);
2482
+ /* harmony import */ var d3_collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(141);
2110
2483
  /* harmony import */ var d3_collection__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(d3_collection__WEBPACK_IMPORTED_MODULE_2__);
2111
2484
  // reference link :- https://github.com/csaladenes/sankey
2485
+
2112
2486
  /* eslint-disable */
2113
2487
 
2114
2488
 
2115
2489
 
2116
2490
  var d3_sankey = function d3_sankey() {
2117
2491
  var sankey = {},
2118
- nodeWidth = 24,
2119
- nodePadding = 8,
2120
- size = [1, 1],
2121
- nodes = [],
2122
- links = [],
2123
- components = [];
2492
+ nodeWidth = 24,
2493
+ nodePadding = 8,
2494
+ size = [1, 1],
2495
+ nodes = [],
2496
+ links = [],
2497
+ components = [];
2498
+
2124
2499
  sankey.nodeWidth = function (_) {
2125
2500
  if (!arguments.length) return nodeWidth;
2126
2501
  nodeWidth = +_;
2127
2502
  return sankey;
2128
2503
  };
2504
+
2129
2505
  sankey.nodePadding = function (_) {
2130
2506
  if (!arguments.length) return nodePadding;
2131
2507
  nodePadding = +_;
2132
2508
  return sankey;
2133
2509
  };
2510
+
2134
2511
  sankey.nodes = function (_) {
2135
2512
  if (!arguments.length) return nodes;
2136
2513
  nodes = _;
2137
2514
  return sankey;
2138
2515
  };
2516
+
2139
2517
  sankey.links = function (_) {
2140
2518
  if (!arguments.length) return links;
2141
2519
  links = _;
2142
2520
  return sankey;
2143
2521
  };
2522
+
2144
2523
  sankey.size = function (_) {
2145
2524
  if (!arguments.length) return size;
2146
2525
  size = _;
2147
2526
  return sankey;
2148
2527
  };
2528
+
2149
2529
  sankey.layout = function (iterations) {
2150
2530
  computeNodeLinks();
2151
2531
  computeNodeValues();
@@ -2155,12 +2535,11 @@ var d3_sankey = function d3_sankey() {
2155
2535
  computeLinkDepths();
2156
2536
  return sankey;
2157
2537
  };
2538
+
2158
2539
  sankey.relayout = function () {
2159
2540
  computeLinkDepths();
2160
2541
  return sankey;
2161
- };
2162
-
2163
- // A more involved path generator that requires 3 elements to render --
2542
+ }; // A more involved path generator that requires 3 elements to render --
2164
2543
  // It draws a starting element, intermediate and end element that are useful
2165
2544
  // while drawing reverse links to get an appropriate fill.
2166
2545
  //
@@ -2183,32 +2562,34 @@ var d3_sankey = function d3_sankey() {
2183
2562
  // .attr("d", path(i))
2184
2563
  // .attr("fill", ...)
2185
2564
  // }
2186
- sankey.reversibleLink = function () {
2187
- var curvature = 0.5;
2188
2565
 
2189
- // Used when source is behind target, the first and last paths are simple
2566
+
2567
+ sankey.reversibleLink = function () {
2568
+ var curvature = 0.5; // Used when source is behind target, the first and last paths are simple
2190
2569
  // lines at the start and end node while the second path is the spline
2570
+
2191
2571
  function forwardLink(part, d) {
2192
2572
  var x0 = d.source.x + d.source.dx,
2193
- x1 = d.target.x,
2194
- xi = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_0__["interpolateNumber"])(x0, x1),
2195
- x2 = xi(curvature),
2196
- x3 = xi(1 - curvature),
2197
- y0 = d.source.y + d.sy,
2198
- y1 = d.target.y + d.ty,
2199
- y2 = d.source.y + d.sy + d.dy,
2200
- y3 = d.target.y + d.ty + d.dy;
2573
+ x1 = d.target.x,
2574
+ xi = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_0__["interpolateNumber"])(x0, x1),
2575
+ x2 = xi(curvature),
2576
+ x3 = xi(1 - curvature),
2577
+ y0 = d.source.y + d.sy,
2578
+ y1 = d.target.y + d.ty,
2579
+ y2 = d.source.y + d.sy + d.dy,
2580
+ y3 = d.target.y + d.ty + d.dy;
2581
+
2201
2582
  switch (part) {
2202
2583
  case 0:
2203
2584
  return 'M' + x0 + ',' + y0 + 'L' + x0 + ',' + (y0 + d.dy);
2585
+
2204
2586
  case 1:
2205
2587
  return 'M' + x0 + ',' + y0 + 'C' + x2 + ',' + y0 + ' ' + x3 + ',' + y1 + ' ' + x1 + ',' + y1 + 'L' + x1 + ',' + y3 + 'C' + x3 + ',' + y3 + ' ' + x2 + ',' + y2 + ' ' + x0 + ',' + y2 + 'Z';
2588
+
2206
2589
  case 2:
2207
2590
  return 'M' + x1 + ',' + y1 + 'L' + x1 + ',' + (y1 + d.dy);
2208
2591
  }
2209
- }
2210
-
2211
- // Used for self loops and when the source is actually in front of the
2592
+ } // Used for self loops and when the source is actually in front of the
2212
2593
  // target; the first element is a turning path from the source to the
2213
2594
  // destination, the second element connects the two twists and the last
2214
2595
  // twists into the target element.
@@ -2218,29 +2599,38 @@ var d3_sankey = function d3_sankey() {
2218
2599
  // \----------------------\
2219
2600
  // Source--/
2220
2601
  //
2602
+
2603
+
2221
2604
  function backwardLink(part, d) {
2222
2605
  var curveExtension = 30;
2223
2606
  var curveDepth = 15;
2607
+
2224
2608
  function getDir(d) {
2225
2609
  return d.source.y + d.sy > d.target.y + d.ty ? -1 : 1;
2226
2610
  }
2611
+
2227
2612
  function p(x, y) {
2228
2613
  return x + ',' + y + ' ';
2229
2614
  }
2615
+
2230
2616
  var dt = getDir(d) * curveDepth,
2231
- x0 = d.source.x + d.source.dx,
2232
- y0 = d.source.y + d.sy,
2233
- x1 = d.target.x,
2234
- y1 = d.target.y + d.ty;
2617
+ x0 = d.source.x + d.source.dx,
2618
+ y0 = d.source.y + d.sy,
2619
+ x1 = d.target.x,
2620
+ y1 = d.target.y + d.ty;
2621
+
2235
2622
  switch (part) {
2236
2623
  case 0:
2237
2624
  return 'M' + p(x0, y0) + 'C' + p(x0, y0) + p(x0 + curveExtension, y0) + p(x0 + curveExtension, y0 + dt) + 'L' + p(x0 + curveExtension, y0 + dt + d.dy) + 'C' + p(x0 + curveExtension, y0 + d.dy) + p(x0, y0 + d.dy) + p(x0, y0 + d.dy) + 'Z';
2625
+
2238
2626
  case 1:
2239
2627
  return 'M' + p(x0 + curveExtension, y0 + dt) + 'C' + p(x0 + curveExtension, y0 + 3 * dt) + p(x1 - curveExtension, y1 - 3 * dt) + p(x1 - curveExtension, y1 - dt) + 'L' + p(x1 - curveExtension, y1 - dt + d.dy) + 'C' + p(x1 - curveExtension, y1 - 3 * dt + d.dy) + p(x0 + curveExtension, y0 + 3 * dt + d.dy) + p(x0 + curveExtension, y0 + dt + d.dy) + 'Z';
2628
+
2240
2629
  case 2:
2241
2630
  return 'M' + p(x1 - curveExtension, y1 - dt) + 'C' + p(x1 - curveExtension, y1) + p(x1, y1) + p(x1, y1) + 'L' + p(x1, y1 + d.dy) + 'C' + p(x1, y1 + d.dy) + p(x1 - curveExtension, y1 + d.dy) + p(x1 - curveExtension, y1 + d.dy - dt) + 'Z';
2242
2631
  }
2243
2632
  }
2633
+
2244
2634
  return function (part) {
2245
2635
  return function (d) {
2246
2636
  if (d.source.x < d.target.x) {
@@ -2250,32 +2640,35 @@ var d3_sankey = function d3_sankey() {
2250
2640
  }
2251
2641
  };
2252
2642
  };
2253
- };
2254
-
2255
- // The standard link path using a constant width spline that needs a
2643
+ }; // The standard link path using a constant width spline that needs a
2256
2644
  // single path element.
2645
+
2646
+
2257
2647
  sankey.link = function () {
2258
2648
  var curvature = 0.5;
2649
+
2259
2650
  function link(d) {
2260
2651
  var x0 = d.source.x + d.source.dx,
2261
- x1 = d.target.x,
2262
- xi = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_0__["interpolateNumber"])(x0, x1),
2263
- x2 = xi(curvature),
2264
- x3 = xi(1 - curvature),
2265
- y0 = d.source.y + d.sy + d.dy / 2,
2266
- y1 = d.target.y + d.ty + d.dy / 2;
2652
+ x1 = d.target.x,
2653
+ xi = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_0__["interpolateNumber"])(x0, x1),
2654
+ x2 = xi(curvature),
2655
+ x3 = xi(1 - curvature),
2656
+ y0 = d.source.y + d.sy + d.dy / 2,
2657
+ y1 = d.target.y + d.ty + d.dy / 2;
2267
2658
  return 'M' + x0 + ',' + y0 + 'C' + x2 + ',' + y0 + ' ' + x3 + ',' + y1 + ' ' + x1 + ',' + y1;
2268
2659
  }
2660
+
2269
2661
  link.curvature = function (_) {
2270
2662
  if (!arguments.length) return curvature;
2271
2663
  curvature = +_;
2272
2664
  return link;
2273
2665
  };
2274
- return link;
2275
- };
2276
2666
 
2277
- // Populate the sourceLinks and targetLinks for each node.
2667
+ return link;
2668
+ }; // Populate the sourceLinks and targetLinks for each node.
2278
2669
  // Also, if the source and target are not objects, assume they are indices.
2670
+
2671
+
2279
2672
  function computeNodeLinks() {
2280
2673
  nodes.forEach(function (node) {
2281
2674
  node.sourceLinks = [];
@@ -2283,44 +2676,46 @@ var d3_sankey = function d3_sankey() {
2283
2676
  });
2284
2677
  links.forEach(function (link) {
2285
2678
  var source = link.source,
2286
- target = link.target;
2679
+ target = link.target;
2287
2680
  if (typeof source === 'number') source = link.source = nodes[link.source];
2288
2681
  if (typeof target === 'number') target = link.target = nodes[link.target];
2289
2682
  source.sourceLinks.push(link);
2290
2683
  target.targetLinks.push(link);
2291
2684
  });
2292
- }
2685
+ } // Compute the value (size) of each node by summing the associated links.
2686
+
2293
2687
 
2294
- // Compute the value (size) of each node by summing the associated links.
2295
2688
  function computeNodeValues() {
2296
2689
  nodes.forEach(function (node) {
2297
- if (!node.value)
2298
- //if not already given
2690
+ if (!node.value) //if not already given
2299
2691
  node.value = Math.max(Object(d3_array__WEBPACK_IMPORTED_MODULE_1__["sum"])(node.sourceLinks, value), Object(d3_array__WEBPACK_IMPORTED_MODULE_1__["sum"])(node.targetLinks, value));
2300
2692
  });
2301
- }
2302
-
2303
- // Take the list of nodes and create a DAG of supervertices, each consisting
2693
+ } // Take the list of nodes and create a DAG of supervertices, each consisting
2304
2694
  // of a strongly connected component of the graph
2305
2695
  //
2306
2696
  // Based off:
2307
2697
  // http://en.wikipedia.org/wiki/Tarjan's_strongly_connected_components_algorithm
2698
+
2699
+
2308
2700
  function computeNodeStructure() {
2309
2701
  var nodeStack = [],
2310
- index = 0;
2702
+ index = 0;
2311
2703
  nodes.forEach(function (node) {
2312
2704
  if (!node.index) {
2313
2705
  connect(node);
2314
2706
  }
2315
2707
  });
2708
+
2316
2709
  function connect(node) {
2317
2710
  node.index = index++;
2318
2711
  node.lowIndex = node.index;
2319
2712
  node.onStack = true;
2320
2713
  nodeStack.push(node);
2714
+
2321
2715
  if (node.sourceLinks) {
2322
2716
  node.sourceLinks.forEach(function (sourceLink) {
2323
2717
  var target = sourceLink.target;
2718
+
2324
2719
  if (!target.hasOwnProperty('index')) {
2325
2720
  connect(target);
2326
2721
  node.lowIndex = Math.min(node.lowIndex, target.lowIndex);
@@ -2328,14 +2723,17 @@ var d3_sankey = function d3_sankey() {
2328
2723
  node.lowIndex = Math.min(node.lowIndex, target.index);
2329
2724
  }
2330
2725
  });
2726
+
2331
2727
  if (node.lowIndex === node.index) {
2332
2728
  var component = [],
2333
- currentNode;
2729
+ currentNode;
2730
+
2334
2731
  do {
2335
2732
  currentNode = nodeStack.pop();
2336
2733
  currentNode.onStack = false;
2337
2734
  component.push(currentNode);
2338
2735
  } while (currentNode != node);
2736
+
2339
2737
  components.push({
2340
2738
  root: node,
2341
2739
  scc: component
@@ -2343,16 +2741,17 @@ var d3_sankey = function d3_sankey() {
2343
2741
  }
2344
2742
  }
2345
2743
  }
2744
+
2346
2745
  components.forEach(function (component, i) {
2347
2746
  component.index = i;
2348
2747
  component.scc.forEach(function (node) {
2349
2748
  node.component = i;
2350
2749
  });
2351
2750
  });
2352
- }
2353
-
2354
- // Assign the breadth (x-position) for each strongly connected component,
2751
+ } // Assign the breadth (x-position) for each strongly connected component,
2355
2752
  // followed by assigning breadth within the component.
2753
+
2754
+
2356
2755
  function computeNodeBreadths() {
2357
2756
  layerComponents();
2358
2757
  components.forEach(function (component, i) {
@@ -2372,7 +2771,7 @@ var d3_sankey = function d3_sankey() {
2372
2771
  return d.values;
2373
2772
  });
2374
2773
  var max = -1,
2375
- nextMax = -1;
2774
+ nextMax = -1;
2376
2775
  componentsByBreadth.forEach(function (c) {
2377
2776
  c.forEach(function (component) {
2378
2777
  component.x = max + 1;
@@ -2392,14 +2791,17 @@ var d3_sankey = function d3_sankey() {
2392
2791
  node.x = node.layer ? node.x : max;
2393
2792
  });
2394
2793
  scaleNodeBreadths((size[0] - nodeWidth) / Math.max(max, 1));
2794
+
2395
2795
  function flatten(a) {
2396
2796
  return [].concat.apply([], a);
2397
2797
  }
2798
+
2398
2799
  function layerComponents() {
2399
2800
  var remainingComponents = components,
2400
- nextComponents,
2401
- visitedIndex,
2402
- x = 0;
2801
+ nextComponents,
2802
+ visitedIndex,
2803
+ x = 0;
2804
+
2403
2805
  while (remainingComponents.length) {
2404
2806
  nextComponents = [];
2405
2807
  visitedIndex = {};
@@ -2418,14 +2820,17 @@ var d3_sankey = function d3_sankey() {
2418
2820
  ++x;
2419
2821
  }
2420
2822
  }
2823
+
2421
2824
  function bfs(node, extractTargets) {
2422
2825
  var queue = [node],
2423
- currentCount = 1,
2424
- nextCount = 0;
2826
+ currentCount = 1,
2827
+ nextCount = 0;
2425
2828
  var x = 0;
2829
+
2426
2830
  while (currentCount > 0) {
2427
2831
  var currentNode = queue.shift();
2428
2832
  currentCount--;
2833
+
2429
2834
  if (!currentNode.hasOwnProperty('x')) {
2430
2835
  currentNode.x = x;
2431
2836
  currentNode.dx = nodeWidth;
@@ -2433,6 +2838,7 @@ var d3_sankey = function d3_sankey() {
2433
2838
  queue = queue.concat(targets);
2434
2839
  nextCount += targets.length;
2435
2840
  }
2841
+
2436
2842
  if (currentCount == 0) {
2437
2843
  // level change
2438
2844
  x++;
@@ -2440,9 +2846,8 @@ var d3_sankey = function d3_sankey() {
2440
2846
  nextCount = 0;
2441
2847
  }
2442
2848
  }
2443
- }
2849
+ } //extra code for fixed layout - x part
2444
2850
 
2445
- //extra code for fixed layout - x part
2446
2851
  /*
2447
2852
  if (fixedlayout && fixedlayout.length > 0) {
2448
2853
  sankey.nodes().forEach(function (d, i) {
@@ -2450,6 +2855,7 @@ var d3_sankey = function d3_sankey() {
2450
2855
  });
2451
2856
  }
2452
2857
  */
2858
+
2453
2859
  }
2454
2860
 
2455
2861
  function moveSourcesRight() {
@@ -2461,6 +2867,7 @@ var d3_sankey = function d3_sankey() {
2461
2867
  }
2462
2868
  });
2463
2869
  }
2870
+
2464
2871
  function moveSinksRight(x) {
2465
2872
  nodes.forEach(function (node) {
2466
2873
  if (!node.sourceLinks.length) {
@@ -2468,11 +2875,13 @@ var d3_sankey = function d3_sankey() {
2468
2875
  }
2469
2876
  });
2470
2877
  }
2878
+
2471
2879
  function scaleNodeBreadths(kx) {
2472
2880
  nodes.forEach(function (node) {
2473
2881
  node.x *= kx;
2474
2882
  });
2475
2883
  }
2884
+
2476
2885
  function computeNodeDepths(iterations) {
2477
2886
  var nodesByBreadth = Object(d3_collection__WEBPACK_IMPORTED_MODULE_2__["nest"])().key(function (d) {
2478
2887
  return d.x;
@@ -2481,12 +2890,14 @@ var d3_sankey = function d3_sankey() {
2481
2890
  });
2482
2891
  initializeNodeDepth();
2483
2892
  resolveCollisions();
2893
+
2484
2894
  for (var alpha = 1; iterations > 0; --iterations) {
2485
2895
  relaxRightToLeft(alpha *= 0.99);
2486
2896
  resolveCollisions();
2487
2897
  relaxLeftToRight(alpha);
2488
2898
  resolveCollisions();
2489
2899
  }
2900
+
2490
2901
  function initializeNodeDepth() {
2491
2902
  var ky = Object(d3_array__WEBPACK_IMPORTED_MODULE_1__["min"])(nodesByBreadth, function (nodes) {
2492
2903
  return (size[1] - (nodes.length - 1) * nodePadding) / Object(d3_array__WEBPACK_IMPORTED_MODULE_1__["sum"])(nodes, value);
@@ -2501,6 +2912,7 @@ var d3_sankey = function d3_sankey() {
2501
2912
  link.dy = link.value * ky;
2502
2913
  });
2503
2914
  }
2915
+
2504
2916
  function relaxLeftToRight(alpha) {
2505
2917
  nodesByBreadth.forEach(function (nodes, breadth) {
2506
2918
  nodes.forEach(function (node) {
@@ -2510,10 +2922,12 @@ var d3_sankey = function d3_sankey() {
2510
2922
  }
2511
2923
  });
2512
2924
  });
2925
+
2513
2926
  function weightedSource(link) {
2514
2927
  return center(link.source) * link.value;
2515
2928
  }
2516
2929
  }
2930
+
2517
2931
  function relaxRightToLeft(alpha) {
2518
2932
  nodesByBreadth.slice().reverse().forEach(function (nodes) {
2519
2933
  nodes.forEach(function (node) {
@@ -2523,35 +2937,38 @@ var d3_sankey = function d3_sankey() {
2523
2937
  }
2524
2938
  });
2525
2939
  });
2940
+
2526
2941
  function weightedTarget(link) {
2527
2942
  return center(link.target) * link.value;
2528
2943
  }
2529
2944
  }
2945
+
2530
2946
  function resolveCollisions() {
2531
2947
  nodesByBreadth.forEach(function (nodes) {
2532
2948
  var node,
2533
- dy,
2534
- y0 = 0,
2535
- n = nodes.length,
2536
- i;
2949
+ dy,
2950
+ y0 = 0,
2951
+ n = nodes.length,
2952
+ i; // Push any overlapping nodes down.
2537
2953
 
2538
- // Push any overlapping nodes down.
2539
2954
  nodes.sort(ascendingDepth);
2955
+
2540
2956
  for (i = 0; i < n; ++i) {
2541
2957
  node = nodes[i];
2958
+
2542
2959
  if (node) {
2543
2960
  dy = y0 - node.y;
2544
2961
  if (dy > 0) node.y += dy;
2545
2962
  y0 = node.y + node.dy + nodePadding;
2546
2963
  }
2547
- }
2964
+ } // If the bottommost node goes outside the bounds, push it back up.
2965
+
2548
2966
 
2549
- // If the bottommost node goes outside the bounds, push it back up.
2550
2967
  dy = y0 - nodePadding - size[1];
2968
+
2551
2969
  if (node && dy > 0) {
2552
- y0 = node.y -= dy;
2970
+ y0 = node.y -= dy; // Push any overlapping nodes back up.
2553
2971
 
2554
- // Push any overlapping nodes back up.
2555
2972
  for (i = n - 2; i >= 0; --i) {
2556
2973
  node = nodes[i];
2557
2974
  dy = node.y + node.dy + nodePadding - y0;
@@ -2561,11 +2978,11 @@ var d3_sankey = function d3_sankey() {
2561
2978
  }
2562
2979
  });
2563
2980
  }
2981
+
2564
2982
  function ascendingDepth(a, b) {
2565
2983
  return a.y - b.y;
2566
- }
2984
+ } //extra code for fixed layout - y part
2567
2985
 
2568
- //extra code for fixed layout - y part
2569
2986
  /*
2570
2987
  if (fixedlayout.length > 0) {
2571
2988
  sankey.nodes().forEach(function (d, i) {
@@ -2573,17 +2990,20 @@ var d3_sankey = function d3_sankey() {
2573
2990
  });
2574
2991
  }
2575
2992
  */
2993
+
2576
2994
  }
2577
2995
 
2578
2996
  function computeLinkDepths() {
2579
2997
  nodes.forEach(function (node) {
2580
2998
  var parallelrendering = false;
2999
+
2581
3000
  if (parallelrendering) {} else node.sourceLinks.sort(ascendingTargetDepth);
3001
+
2582
3002
  node.targetLinks.sort(ascendingSourceDepth);
2583
3003
  });
2584
3004
  nodes.forEach(function (node) {
2585
3005
  var sy = 0,
2586
- ty = 0;
3006
+ ty = 0;
2587
3007
  node.sourceLinks.forEach(function (link) {
2588
3008
  link.sy = sy;
2589
3009
  sy += link.dy;
@@ -2593,25 +3013,30 @@ var d3_sankey = function d3_sankey() {
2593
3013
  ty += link.dy;
2594
3014
  });
2595
3015
  });
3016
+
2596
3017
  function ascendingSourceDepth(a, b) {
2597
3018
  return a.source.y - b.source.y;
2598
3019
  }
3020
+
2599
3021
  function ascendingTargetDepth(a, b) {
2600
3022
  return a.target.y - b.target.y;
2601
3023
  }
2602
3024
  }
3025
+
2603
3026
  function center(node) {
2604
3027
  return node.y + node.dy / 2;
2605
3028
  }
3029
+
2606
3030
  function value(link) {
2607
3031
  return link.value;
2608
3032
  }
3033
+
2609
3034
  return sankey;
2610
3035
  };
2611
3036
 
2612
3037
  /***/ }),
2613
3038
 
2614
- /***/ 456:
3039
+ /***/ 459:
2615
3040
  /***/ (function(module, exports, __webpack_require__) {
2616
3041
 
2617
3042
  "use strict";
@@ -2620,29 +3045,40 @@ var d3_sankey = function d3_sankey() {
2620
3045
  Object.defineProperty(exports, "__esModule", {
2621
3046
  value: true
2622
3047
  });
3048
+
2623
3049
  var React = __webpack_require__(1);
3050
+
2624
3051
  var T = __webpack_require__(0);
3052
+
2625
3053
  var styled_components_1 = __webpack_require__(4);
3054
+
2626
3055
  var react_1 = __webpack_require__(1);
2627
- var PureSankey_1 = __webpack_require__(110);
2628
- var SankeyUtils_1 = __webpack_require__(133);
3056
+
3057
+ var PureSankey_1 = __webpack_require__(111);
3058
+
3059
+ var SankeyUtils_1 = __webpack_require__(134);
3060
+
2629
3061
  var MAX_NODE_TEXT_WIDTH = 150;
3062
+
2630
3063
  var getNodeOpacity = function getNodeOpacity(nodeIndex, activeNodes) {
2631
3064
  if (!activeNodes || !activeNodes.length) {
2632
3065
  return PureSankey_1.DEFAULT_NODE_OPACITY;
2633
3066
  }
3067
+
2634
3068
  var isActiveNode = activeNodes.find(function (node) {
2635
3069
  return node.index === nodeIndex;
2636
3070
  });
2637
3071
  return isActiveNode ? PureSankey_1.DEFAULT_NODE_OPACITY : PureSankey_1.INACTIVE_OPACITY;
2638
3072
  };
3073
+
2639
3074
  var getNodeHeight = function getNodeHeight(node) {
2640
3075
  return node.dy < 0 ? 1 : node.dy;
2641
3076
  };
3077
+
2642
3078
  var NodeGroup = styled_components_1.default.g.withConfig({
2643
3079
  displayName: "SankeyNode__NodeGroup",
2644
3080
  componentId: "sc-1a3nkch-0"
2645
- })(["opacity:", ";"], function (props) {
3081
+ })(["opacity:", ";&:hover{cursor:pointer;}"], function (props) {
2646
3082
  return getNodeOpacity(props.node.index, props.activeNodes);
2647
3083
  });
2648
3084
  NodeGroup.displayName = 'NodeGroup';
@@ -2660,26 +3096,32 @@ var NodeText = styled_components_1.default.text.withConfig({
2660
3096
  }, PureSankey_1.DEFAULT_FONT_FAMILY, function (props) {
2661
3097
  return props.nodeTextColor;
2662
3098
  });
3099
+
2663
3100
  var SankeyNode = function SankeyNode(props) {
2664
3101
  var node = props.node,
2665
- activeNodes = props.activeNodes,
2666
- nodeWidth = props.nodeWidth,
2667
- chartWidth = props.chartWidth,
2668
- handleMouseOver = props.handleMouseOver,
2669
- handleMouseLeave = props.handleMouseLeave,
2670
- colorCategoryMapping = props.colorCategoryMapping,
2671
- nodeTextColor = props.nodeTextColor;
2672
- var nodeTextRef = react_1.useRef();
2673
- react_1.useEffect(function () {
2674
- SankeyUtils_1.truncateSVGTextWithEllipsis(nodeTextRef.current, node.name, MAX_NODE_TEXT_WIDTH);
3102
+ activeNodes = props.activeNodes,
3103
+ nodeWidth = props.nodeWidth,
3104
+ chartWidth = props.chartWidth,
3105
+ handleMouseOver = props.handleMouseOver,
3106
+ handleMouseLeave = props.handleMouseLeave,
3107
+ handleNodeClick = props.handleNodeClick,
3108
+ colorCategoryMapping = props.colorCategoryMapping,
3109
+ nodeTextColor = props.nodeTextColor;
3110
+ var nodeTextRef = (0, react_1.useRef)();
3111
+ (0, react_1.useEffect)(function () {
3112
+ (0, SankeyUtils_1.truncateSVGTextWithEllipsis)(nodeTextRef.current, node.name, MAX_NODE_TEXT_WIDTH);
2675
3113
  });
3114
+ var nodeClickHandler = (0, react_1.useCallback)(function () {
3115
+ return handleNodeClick(node);
3116
+ }, [node]);
2676
3117
  return React.createElement(NodeGroup, {
2677
3118
  node: node,
2678
3119
  activeNodes: activeNodes,
2679
3120
  className: "node",
2680
3121
  key: "node-".concat(node.index),
2681
3122
  "data-test": "node-".concat(node.index),
2682
- transform: "translate(".concat(node.x, ",").concat(node.y, ")")
3123
+ transform: "translate(".concat(node.x, ",").concat(node.y, ")"),
3124
+ onClick: nodeClickHandler
2683
3125
  }, React.createElement(React.Fragment, null, React.createElement(NodeRect, {
2684
3126
  node: node,
2685
3127
  height: getNodeHeight(node),
@@ -2701,6 +3143,7 @@ var SankeyNode = function SankeyNode(props) {
2701
3143
  nodeTextColor: nodeTextColor
2702
3144
  }, node.name)));
2703
3145
  };
3146
+
2704
3147
  SankeyNode.propTypes = {
2705
3148
  node: T.object,
2706
3149
  activeNodes: T.arrayOf(T.object),
@@ -2719,7 +3162,60 @@ exports.default = SankeyNode;
2719
3162
 
2720
3163
  /***/ }),
2721
3164
 
2722
- /***/ 457:
3165
+ /***/ 46:
3166
+ /***/ (function(module, exports, __webpack_require__) {
3167
+
3168
+ "use strict";
3169
+
3170
+
3171
+ Object.defineProperty(exports, "__esModule", {
3172
+ value: true
3173
+ });
3174
+
3175
+ var React = __webpack_require__(1);
3176
+
3177
+ var styled_components_1 = __webpack_require__(4);
3178
+
3179
+ var hocUtils_1 = __webpack_require__(15);
3180
+
3181
+ var Cover = styled_components_1.default.div.withConfig({
3182
+ displayName: "withEditModeCover__Cover",
3183
+ componentId: "sc-1gsbnxb-0"
3184
+ })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
3185
+ var Blocker = styled_components_1.default.div.attrs({
3186
+ 'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
3187
+ }).withConfig({
3188
+ displayName: "withEditModeCover__Blocker",
3189
+ componentId: "sc-1gsbnxb-1"
3190
+ })(["position:relative;width:100%;height:100%;"]);
3191
+ /**
3192
+ * HOC that renders a cover layer in edit mode
3193
+ * @method withEditModeCover
3194
+ * @param {ExtendedDashViz} Visualization
3195
+ * @returns {ExtendedDashViz} Wrapper
3196
+ */
3197
+
3198
+ var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
3199
+ var Wrapper = function Wrapper(props) {
3200
+ var mode = props.mode;
3201
+ var showEditCover = mode === 'edit' && !disableEditModeCover;
3202
+ return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
3203
+ "data-test": "edit-mode-cover"
3204
+ }));
3205
+ };
3206
+
3207
+ (0, hocUtils_1.extendStaticWrapperProps)({
3208
+ Wrapper: Wrapper,
3209
+ Visualization: Visualization
3210
+ });
3211
+ return Wrapper;
3212
+ };
3213
+
3214
+ exports.default = withEditModeCover;
3215
+
3216
+ /***/ }),
3217
+
3218
+ /***/ 460:
2723
3219
  /***/ (function(module, exports, __webpack_require__) {
2724
3220
 
2725
3221
  "use strict";
@@ -2728,52 +3224,76 @@ exports.default = SankeyNode;
2728
3224
  Object.defineProperty(exports, "__esModule", {
2729
3225
  value: true
2730
3226
  });
3227
+
2731
3228
  var React = __webpack_require__(1);
3229
+
3230
+ var react_1 = __webpack_require__(1);
3231
+
2732
3232
  var T = __webpack_require__(0);
2733
- var PureSankey_1 = __webpack_require__(110);
2734
- var SankeyUtils_1 = __webpack_require__(133);
3233
+
3234
+ var styled_components_1 = __webpack_require__(4);
3235
+
3236
+ var PureSankey_1 = __webpack_require__(111);
3237
+
3238
+ var SankeyUtils_1 = __webpack_require__(134);
3239
+
2735
3240
  var getLinkFill = function getLinkFill(link, colorCategoryMapping, colorMode) {
2736
3241
  if (colorMode === 'categorical') {
2737
3242
  return colorCategoryMapping ? colorCategoryMapping(link.source.name) : PureSankey_1.DEFAULT_LINK_COLOR;
2738
3243
  }
3244
+
2739
3245
  return colorCategoryMapping && colorCategoryMapping[link.index] ? colorCategoryMapping[link.index] : PureSankey_1.DEFAULT_LINK_COLOR;
2740
3246
  };
3247
+
2741
3248
  var getLinkOpacity = function getLinkOpacity(link, activeLinks, linkOpacity) {
2742
3249
  if (!activeLinks || !activeLinks.length) {
2743
3250
  return linkOpacity;
2744
3251
  }
3252
+
2745
3253
  var isActiveLink = activeLinks.find(function (l) {
2746
3254
  return l.id === link.id;
2747
3255
  });
2748
3256
  return isActiveLink ? linkOpacity : PureSankey_1.INACTIVE_OPACITY;
2749
3257
  };
3258
+
3259
+ var StyledSankeyLink = styled_components_1.default.g.withConfig({
3260
+ displayName: "SankeyLink__StyledSankeyLink",
3261
+ componentId: "sc-1w9ez3l-0"
3262
+ })(["&:hover{cursor:pointer;}"]);
3263
+
2750
3264
  var SankeyLink = function SankeyLink(props) {
2751
3265
  var link = props.link,
2752
- colorCategoryMapping = props.colorCategoryMapping,
2753
- activeLinks = props.activeLinks,
2754
- linkOpacity = props.linkOpacity,
2755
- colorMode = props.colorMode,
2756
- path = props.path,
2757
- handleMouseOver = props.handleMouseOver,
2758
- handleMouseLeave = props.handleMouseLeave; // This is to draw an invisible circle added to the link's path midpoint,
3266
+ colorCategoryMapping = props.colorCategoryMapping,
3267
+ activeLinks = props.activeLinks,
3268
+ linkOpacity = props.linkOpacity,
3269
+ colorMode = props.colorMode,
3270
+ path = props.path,
3271
+ handleMouseOver = props.handleMouseOver,
3272
+ handleMouseLeave = props.handleMouseLeave,
3273
+ handleLinkClick = props.handleLinkClick; // This is to draw an invisible circle added to the link's path midpoint,
2759
3274
  // which acts as an anchor for the link tooltip
2760
- var circlePoints = SankeyUtils_1.extractLinkMidPoint(path(1)(link));
2761
- return React.createElement("g", {
3275
+
3276
+ var circlePoints = (0, SankeyUtils_1.extractLinkMidPoint)(path(1)(link));
3277
+ var linkClickHandler = (0, react_1.useCallback)(function () {
3278
+ return handleLinkClick(link);
3279
+ }, [link]);
3280
+ return React.createElement(StyledSankeyLink, {
2762
3281
  className: "link",
2763
3282
  key: link.id,
2764
3283
  id: link.id,
2765
3284
  "data-test": link.id,
2766
3285
  fill: getLinkFill(link, colorCategoryMapping, colorMode),
2767
3286
  opacity: getLinkOpacity(link, activeLinks, linkOpacity),
3287
+ onClick: linkClickHandler,
2768
3288
  onMouseOver: function onMouseOver(ev) {
2769
3289
  handleMouseOver(ev);
2770
3290
  },
2771
3291
  onMouseLeave: function onMouseLeave(ev) {
2772
3292
  var relatedTarget = ev.relatedTarget;
2773
- var isRelatedTargetPopover = false;
2774
- // This is to verify if the mouseLeave is being triggered because of mouseover on a the popover itself.
3293
+ var isRelatedTargetPopover = false; // This is to verify if the mouseLeave is being triggered because of mouseover on a the popover itself.
2775
3294
  // In that case the relatedTarget will have the popover elements and this logic will check on the class name used.
2776
3295
  // If detects the relatedTarget is a popover, then mouseLeave event handler wont be triggered.
3296
+
2777
3297
  if (relatedTarget && relatedTarget.classList) {
2778
3298
  var classList = relatedTarget.classList;
2779
3299
  classList.forEach(function (name) {
@@ -2782,6 +3302,7 @@ var SankeyLink = function SankeyLink(props) {
2782
3302
  }
2783
3303
  });
2784
3304
  }
3305
+
2785
3306
  if (!isRelatedTargetPopover) {
2786
3307
  handleMouseLeave(ev);
2787
3308
  }
@@ -2799,6 +3320,7 @@ var SankeyLink = function SankeyLink(props) {
2799
3320
  fill: "transparent"
2800
3321
  }));
2801
3322
  };
3323
+
2802
3324
  SankeyLink.propTypes = {
2803
3325
  link: T.object,
2804
3326
  activeLinks: T.arrayOf(T.object),
@@ -2816,7 +3338,7 @@ exports.default = SankeyLink;
2816
3338
 
2817
3339
  /***/ }),
2818
3340
 
2819
- /***/ 458:
3341
+ /***/ 461:
2820
3342
  /***/ (function(module, exports, __webpack_require__) {
2821
3343
 
2822
3344
  "use strict";
@@ -2825,12 +3347,19 @@ exports.default = SankeyLink;
2825
3347
  Object.defineProperty(exports, "__esModule", {
2826
3348
  value: true
2827
3349
  });
3350
+
2828
3351
  var React = __webpack_require__(1);
3352
+
2829
3353
  var T = __webpack_require__(0);
2830
- var Popover_1 = __webpack_require__(61);
3354
+
3355
+ var Popover_1 = __webpack_require__(62);
3356
+
2831
3357
  var styled_components_1 = __webpack_require__(4);
2832
- var numberUtils_1 = __webpack_require__(30);
2833
- var PureSankey_1 = __webpack_require__(110);
3358
+
3359
+ var numberUtils_1 = __webpack_require__(31);
3360
+
3361
+ var PureSankey_1 = __webpack_require__(111);
3362
+
2834
3363
  var DEFAULT_PLACEMENT = 'below';
2835
3364
  var StyledTooltipContainer = styled_components_1.default.div.withConfig({
2836
3365
  displayName: "SankeyTooltip__StyledTooltipContainer",
@@ -2876,50 +3405,59 @@ var NodeValue = styled_components_1.default.div.withConfig({
2876
3405
  displayName: "SankeyTooltip__NodeValue",
2877
3406
  componentId: "x563qp-8"
2878
3407
  })(["margin-left:8px;max-width:200px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"]);
3408
+
2879
3409
  var SankeyTooltip = function SankeyTooltip(props) {
2880
3410
  var mode = props.mode,
2881
- node = props.node,
2882
- link = props.link,
2883
- open = props.open,
2884
- connectionsMap = props.connectionsMap,
2885
- anchor = props.anchor,
2886
- linkValue = props.linkValue,
2887
- colorCategoryMapping = props.colorCategoryMapping,
2888
- width = props.width,
2889
- tooltipRowColor = props.tooltipRowColor,
2890
- tooltipLinkHeaderColor = props.tooltipLinkHeaderColor,
2891
- tooltipHeaderColor = props.tooltipHeaderColor,
2892
- handleTooltipRequestClose = props.handleTooltipRequestClose;
3411
+ node = props.node,
3412
+ link = props.link,
3413
+ open = props.open,
3414
+ connectionsMap = props.connectionsMap,
3415
+ anchor = props.anchor,
3416
+ linkValue = props.linkValue,
3417
+ colorCategoryMapping = props.colorCategoryMapping,
3418
+ width = props.width,
3419
+ tooltipRowColor = props.tooltipRowColor,
3420
+ tooltipLinkHeaderColor = props.tooltipLinkHeaderColor,
3421
+ tooltipHeaderColor = props.tooltipHeaderColor,
3422
+ handleTooltipRequestClose = props.handleTooltipRequestClose;
3423
+
2893
3424
  var showSection = function showSection(connection, nodeData, section) {
2894
3425
  if (!connection) {
2895
3426
  return false;
2896
3427
  }
3428
+
2897
3429
  var connectionNodes = section === 'source' ? connection.sourceNodes : connection.targetNodes;
2898
3430
  var filteredNodes = connectionNodes.filter(function (cNode) {
2899
3431
  return cNode.index !== nodeData.index;
2900
3432
  });
2901
3433
  return filteredNodes.length > 0;
2902
3434
  };
3435
+
2903
3436
  var getPopoverPlacement = function getPopoverPlacement(anchorElement) {
2904
3437
  if (!anchorElement) {
2905
3438
  return DEFAULT_PLACEMENT;
2906
3439
  }
2907
- var bBox = anchorElement.getBoundingClientRect();
2908
- // TODO: Depending on the testing result in dashboard reg tooltip position, might need further optimization
3440
+
3441
+ var bBox = anchorElement.getBoundingClientRect(); // TODO: Depending on the testing result in dashboard reg tooltip position, might need further optimization
2909
3442
  // If anchorElement is too close to the left border of the chart, place it to the right side of anchorElement
3443
+
2910
3444
  if (bBox.x <= 15) {
2911
3445
  return 'right';
2912
3446
  }
3447
+
2913
3448
  if (bBox.x >= width - 15) {
2914
3449
  // If anchorElement is too close to the right border of the chart, place it to the right side of anchorElement
2915
3450
  return 'left';
2916
3451
  }
3452
+
2917
3453
  return DEFAULT_PLACEMENT;
2918
3454
  };
3455
+
2919
3456
  var renderNodeToolTip = function renderNodeToolTip() {
2920
3457
  if (!node) {
2921
3458
  return null;
2922
3459
  }
3460
+
2923
3461
  var connections = connectionsMap[node.index];
2924
3462
  return React.createElement(Popover_1.default, {
2925
3463
  open: open,
@@ -2940,12 +3478,13 @@ var SankeyTooltip = function SankeyTooltip(props) {
2940
3478
  colorCategoryMapping: colorCategoryMapping
2941
3479
  }), React.createElement(NodeValue, null, node === null || node === void 0 ? void 0 : node.name)), React.createElement(StyledTooltipRightCell, {
2942
3480
  "data-test": "main-row-value"
2943
- }, numberUtils_1.formatNumber(node === null || node === void 0 ? void 0 : node.value, 0, {
3481
+ }, (0, numberUtils_1.formatNumber)(node === null || node === void 0 ? void 0 : node.value, 0, {
2944
3482
  useTrendUnits: true
2945
3483
  }))), showSection(connections, node, 'source') && React.createElement(StyledTooltipHeader, {
2946
3484
  headerColor: tooltipHeaderColor
2947
3485
  }, React.createElement(StyledTooltipLeftCell, null, "Source"), React.createElement(StyledTooltipRightCell, null, linkValue)), React.createElement(StyledTooltipSection, null, connections && connections.sourceNodes.map(function (sNode, idx) {
2948
3486
  var _a, _b;
3487
+
2949
3488
  if ((sNode === null || sNode === void 0 ? void 0 : sNode.index) !== (node === null || node === void 0 ? void 0 : node.index) || ((_a = connections.sourceNodes[idx]) === null || _a === void 0 ? void 0 : _a.index) === ((_b = connections.targetNodes[idx]) === null || _b === void 0 ? void 0 : _b.index)) {
2950
3489
  return React.createElement(StyledTooltipRow, {
2951
3490
  key: sNode.index,
@@ -2958,15 +3497,17 @@ var SankeyTooltip = function SankeyTooltip(props) {
2958
3497
  "data-test": "source-row-name"
2959
3498
  }, sNode === null || sNode === void 0 ? void 0 : sNode.name)), React.createElement(StyledTooltipRightCell, {
2960
3499
  "data-test": "source-row-value"
2961
- }, numberUtils_1.formatNumber(sNode === null || sNode === void 0 ? void 0 : sNode.value, 0, {
3500
+ }, (0, numberUtils_1.formatNumber)(sNode === null || sNode === void 0 ? void 0 : sNode.value, 0, {
2962
3501
  useTrendUnits: true
2963
3502
  })));
2964
3503
  }
3504
+
2965
3505
  return null;
2966
3506
  })), showSection(connections, node, 'target') && React.createElement(StyledTooltipHeader, {
2967
3507
  headerColor: tooltipHeaderColor
2968
3508
  }, React.createElement(StyledTooltipLeftCell, null, "Target"), React.createElement(StyledTooltipRightCell, null, linkValue)), React.createElement(StyledTooltipSection, null, connections && connections.targetNodes.map(function (tNode, idx) {
2969
3509
  var _a, _b;
3510
+
2970
3511
  if ((tNode === null || tNode === void 0 ? void 0 : tNode.index) !== (node === null || node === void 0 ? void 0 : node.index) || ((_a = connections.sourceNodes[idx]) === null || _a === void 0 ? void 0 : _a.index) === ((_b = connections.targetNodes[idx]) === null || _b === void 0 ? void 0 : _b.index)) {
2971
3512
  return React.createElement(StyledTooltipRow, {
2972
3513
  key: tNode.index,
@@ -2979,18 +3520,22 @@ var SankeyTooltip = function SankeyTooltip(props) {
2979
3520
  "data-test": "target-row-name"
2980
3521
  }, tNode === null || tNode === void 0 ? void 0 : tNode.name)), React.createElement(StyledTooltipRightCell, {
2981
3522
  "data-test": "target-row-value"
2982
- }, numberUtils_1.formatNumber(tNode === null || tNode === void 0 ? void 0 : tNode.value, 0, {
3523
+ }, (0, numberUtils_1.formatNumber)(tNode === null || tNode === void 0 ? void 0 : tNode.value, 0, {
2983
3524
  useTrendUnits: true
2984
3525
  })));
2985
3526
  }
3527
+
2986
3528
  return null;
2987
3529
  }))));
2988
3530
  };
3531
+
2989
3532
  var renderLinkToolTip = function renderLinkToolTip() {
2990
3533
  var _a, _b, _c, _d;
3534
+
2991
3535
  if (!link) {
2992
3536
  return null;
2993
3537
  }
3538
+
2994
3539
  return React.createElement(Popover_1.default, {
2995
3540
  open: open,
2996
3541
  anchor: anchor,
@@ -3006,7 +3551,7 @@ var SankeyTooltip = function SankeyTooltip(props) {
3006
3551
  "data-test": "main-row-name"
3007
3552
  }, "Link Size"), React.createElement(StyledTooltipRightCell, {
3008
3553
  "data-test": "main-row-value"
3009
- }, numberUtils_1.formatNumber(link === null || link === void 0 ? void 0 : link.value, 0, {
3554
+ }, (0, numberUtils_1.formatNumber)(link === null || link === void 0 ? void 0 : link.value, 0, {
3010
3555
  useTrendUnits: true
3011
3556
  }))), React.createElement(StyledTooltipHeader, {
3012
3557
  headerColor: tooltipHeaderColor
@@ -3020,7 +3565,7 @@ var SankeyTooltip = function SankeyTooltip(props) {
3020
3565
  "data-test": "source-row-name"
3021
3566
  }, (_a = link === null || link === void 0 ? void 0 : link.source) === null || _a === void 0 ? void 0 : _a.name)), React.createElement(StyledTooltipRightCell, {
3022
3567
  "data-test": "source-row-value"
3023
- }, numberUtils_1.formatNumber((_b = link === null || link === void 0 ? void 0 : link.source) === null || _b === void 0 ? void 0 : _b.value, 0, {
3568
+ }, (0, numberUtils_1.formatNumber)((_b = link === null || link === void 0 ? void 0 : link.source) === null || _b === void 0 ? void 0 : _b.value, 0, {
3024
3569
  useTrendUnits: true
3025
3570
  }), ' '))), React.createElement(StyledTooltipHeader, {
3026
3571
  headerColor: tooltipHeaderColor
@@ -3034,12 +3579,14 @@ var SankeyTooltip = function SankeyTooltip(props) {
3034
3579
  "data-test": "target-row-name"
3035
3580
  }, (_c = link === null || link === void 0 ? void 0 : link.target) === null || _c === void 0 ? void 0 : _c.name)), React.createElement(StyledTooltipRightCell, {
3036
3581
  "data-test": "target-row-value"
3037
- }, numberUtils_1.formatNumber((_d = link === null || link === void 0 ? void 0 : link.target) === null || _d === void 0 ? void 0 : _d.value, 0, {
3582
+ }, (0, numberUtils_1.formatNumber)((_d = link === null || link === void 0 ? void 0 : link.target) === null || _d === void 0 ? void 0 : _d.value, 0, {
3038
3583
  useTrendUnits: true
3039
3584
  }))))));
3040
3585
  };
3586
+
3041
3587
  return mode === 'node' ? renderNodeToolTip() : renderLinkToolTip();
3042
3588
  };
3589
+
3043
3590
  SankeyTooltip.propTypes = {
3044
3591
  mode: T.string,
3045
3592
  node: T.object,
@@ -3062,7 +3609,7 @@ exports.default = SankeyTooltip;
3062
3609
 
3063
3610
  /***/ }),
3064
3611
 
3065
- /***/ 459:
3612
+ /***/ 462:
3066
3613
  /***/ (function(module, exports, __webpack_require__) {
3067
3614
 
3068
3615
  "use strict";
@@ -3071,18 +3618,31 @@ exports.default = SankeyTooltip;
3071
3618
  Object.defineProperty(exports, "__esModule", {
3072
3619
  value: true
3073
3620
  });
3621
+
3074
3622
  var visualization_icons_1 = __webpack_require__(52);
3075
- var placeholders_1 = __webpack_require__(49);
3623
+
3624
+ var placeholders_1 = __webpack_require__(50);
3625
+
3076
3626
  var visualization_color_palettes_1 = __webpack_require__(51);
3627
+
3077
3628
  var schemaUtils_1 = __webpack_require__(16);
3078
- var PresetPalettes_1 = __webpack_require__(60);
3079
- var themes_1 = __webpack_require__(59);
3629
+
3630
+ var PresetPalettes_1 = __webpack_require__(61);
3631
+
3632
+ var themes_1 = __webpack_require__(60);
3633
+
3080
3634
  var i18n_1 = __webpack_require__(2);
3635
+
3081
3636
  var VizBehavior_1 = __webpack_require__(6);
3082
- var VizCategory_1 = __webpack_require__(35);
3637
+
3638
+ var VizCategory_1 = __webpack_require__(36);
3639
+
3083
3640
  var configUtils_1 = __webpack_require__(20);
3084
- var DynamicLinkColorsEditor_1 = __webpack_require__(460);
3641
+
3642
+ var DynamicLinkColorsEditor_1 = __webpack_require__(463);
3643
+
3085
3644
  var BackgroundColor_1 = __webpack_require__(53);
3645
+
3086
3646
  var defaultContext = {
3087
3647
  linkColorRangeConfig: [{
3088
3648
  to: 20,
@@ -3135,7 +3695,7 @@ var optionsSchema = {
3135
3695
  colorMode: {
3136
3696
  default: 'categorical',
3137
3697
  description: 'Specify the coloring method used for the links. When set to "categorical" the nodes and links will be colored based on the "seriesColors". When set to "dynamic" the links will be colored based on the dynamic string assigned to "linkColors".',
3138
- pattern: schemaUtils_1.getPattern(['categorical', 'dynamic']),
3698
+ pattern: (0, schemaUtils_1.getPattern)(['categorical', 'dynamic']),
3139
3699
  type: 'string'
3140
3700
  },
3141
3701
  linkColors: {
@@ -3173,7 +3733,7 @@ var optionsSchema = {
3173
3733
  };
3174
3734
  var themes = {
3175
3735
  defaultBackgroundColor: function defaultBackgroundColor(props) {
3176
- return themes_1.pick({
3736
+ return (0, themes_1.pick)({
3177
3737
  enterprise: {
3178
3738
  dark: themes_1.variables.black(props),
3179
3739
  light: themes_1.variables.backgroundColor(props)
@@ -3182,7 +3742,7 @@ var themes = {
3182
3742
  })(props);
3183
3743
  },
3184
3744
  nodeTextColor: function nodeTextColor(props) {
3185
- return themes_1.pick({
3745
+ return (0, themes_1.pick)({
3186
3746
  enterprise: {
3187
3747
  dark: themes_1.variables.textColor(props),
3188
3748
  light: themes_1.variables.textColor(props)
@@ -3191,7 +3751,7 @@ var themes = {
3191
3751
  })(props);
3192
3752
  },
3193
3753
  tooltipRowColor: function tooltipRowColor(props) {
3194
- return themes_1.pick({
3754
+ return (0, themes_1.pick)({
3195
3755
  enterprise: {
3196
3756
  dark: themes_1.variables.textColor(props),
3197
3757
  light: themes_1.variables.textColor(props)
@@ -3200,7 +3760,7 @@ var themes = {
3200
3760
  })(props);
3201
3761
  },
3202
3762
  tooltipLinkHeaderColor: function tooltipLinkHeaderColor(props) {
3203
- return themes_1.pick({
3763
+ return (0, themes_1.pick)({
3204
3764
  enterprise: {
3205
3765
  dark: themes_1.variables.textColor(props),
3206
3766
  light: themes_1.variables.textColor(props)
@@ -3209,7 +3769,7 @@ var themes = {
3209
3769
  })(props);
3210
3770
  },
3211
3771
  tooltipHeaderColor: function tooltipHeaderColor(props) {
3212
- return themes_1.pick({
3772
+ return (0, themes_1.pick)({
3213
3773
  enterprise: {
3214
3774
  dark: themes_1.variables.textGray(props),
3215
3775
  light: themes_1.variables.textGray(props)
@@ -3219,7 +3779,7 @@ var themes = {
3219
3779
  }
3220
3780
  };
3221
3781
  var editorConfig = [{
3222
- label: i18n_1._('Data configurations'),
3782
+ label: (0, i18n_1._)('Data configurations'),
3223
3783
  layout: [[{
3224
3784
  label: 'Link value',
3225
3785
  editor: 'editor.columnSelector',
@@ -3231,21 +3791,21 @@ var editorConfig = [{
3231
3791
  }
3232
3792
  }]]
3233
3793
  }, {
3234
- label: i18n_1._('Color and style'),
3794
+ label: (0, i18n_1._)('Color and style'),
3235
3795
  layout: [[{
3236
- label: i18n_1._('Color mode'),
3796
+ label: (0, i18n_1._)('Color mode'),
3237
3797
  option: 'colorMode',
3238
3798
  editor: 'editor.radioBar',
3239
3799
  editorProps: {
3240
3800
  values: [{
3241
- label: i18n_1._('Categorical'),
3801
+ label: (0, i18n_1._)('Categorical'),
3242
3802
  value: 'categorical'
3243
3803
  }, {
3244
- label: i18n_1._('Dynamic'),
3804
+ label: (0, i18n_1._)('Dynamic'),
3245
3805
  value: 'dynamic'
3246
3806
  }]
3247
3807
  }
3248
- }], [Object.assign(Object.assign({}, DynamicLinkColorsEditor_1.getDynamicLinkColorsEditor({
3808
+ }], [Object.assign(Object.assign({}, (0, DynamicLinkColorsEditor_1.getDynamicLinkColorsEditor)({
3249
3809
  defaultContext: defaultContext,
3250
3810
  defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
3251
3811
  })), {
@@ -3253,24 +3813,27 @@ var editorConfig = [{
3253
3813
  var options = _ref.options;
3254
3814
  return options.colorMode === 'dynamic';
3255
3815
  }
3256
- })], BackgroundColor_1.default({
3816
+ })], (0, BackgroundColor_1.default)({
3257
3817
  themes: themes
3258
3818
  })]
3259
3819
  }];
3260
3820
  /**
3261
3821
  * visualization configuration
3262
3822
  */
3823
+
3263
3824
  var config = {
3264
3825
  /**
3265
3826
  * unique viz key
3266
3827
  */
3267
3828
  key: 'splunk.sankey',
3829
+
3268
3830
  /**
3269
3831
  * viz name
3270
3832
  */
3271
- name: i18n_1._('Sankey'),
3833
+ name: (0, i18n_1._)('Sankey'),
3272
3834
  category: VizCategory_1.VizCategory.FLOW,
3273
3835
  status: 'preview',
3836
+
3274
3837
  /**
3275
3838
  * viz icon
3276
3839
  */
@@ -3281,62 +3844,23 @@ var config = {
3281
3844
  defaultContext: defaultContext,
3282
3845
  optionsSchema: optionsSchema,
3283
3846
  editorConfig: editorConfig,
3284
- events: {},
3847
+ events: {
3848
+ 'node.click': {
3849
+ description: 'Triggered when user clicks on a node'
3850
+ },
3851
+ 'link.click': {
3852
+ description: 'Triggered when user clicks on a link'
3853
+ }
3854
+ },
3285
3855
  supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER],
3286
3856
  themes: themes,
3287
3857
  requiredProps: []
3288
3858
  };
3289
- exports.default = configUtils_1.enhanceConfig(config);
3290
-
3291
- /***/ }),
3292
-
3293
- /***/ 46:
3294
- /***/ (function(module, exports, __webpack_require__) {
3295
-
3296
- "use strict";
3297
-
3298
-
3299
- Object.defineProperty(exports, "__esModule", {
3300
- value: true
3301
- });
3302
- var React = __webpack_require__(1);
3303
- var styled_components_1 = __webpack_require__(4);
3304
- var hocUtils_1 = __webpack_require__(15);
3305
- var Cover = styled_components_1.default.div.withConfig({
3306
- displayName: "withEditModeCover__Cover",
3307
- componentId: "sc-1gsbnxb-0"
3308
- })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
3309
- var Blocker = styled_components_1.default.div.attrs({
3310
- 'data-splunk-visualization-version': "25.13.1 - ea48ec41e"
3311
- }).withConfig({
3312
- displayName: "withEditModeCover__Blocker",
3313
- componentId: "sc-1gsbnxb-1"
3314
- })(["position:relative;width:100%;height:100%;"]);
3315
- /**
3316
- * HOC that renders a cover layer in edit mode
3317
- * @method withEditModeCover
3318
- * @param {ExtendedDashViz} Visualization
3319
- * @returns {ExtendedDashViz} Wrapper
3320
- */
3321
- var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
3322
- var Wrapper = function Wrapper(props) {
3323
- var mode = props.mode;
3324
- var showEditCover = mode === 'edit' && !disableEditModeCover;
3325
- return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
3326
- "data-test": "edit-mode-cover"
3327
- }));
3328
- };
3329
- hocUtils_1.extendStaticWrapperProps({
3330
- Wrapper: Wrapper,
3331
- Visualization: Visualization
3332
- });
3333
- return Wrapper;
3334
- };
3335
- exports.default = withEditModeCover;
3859
+ exports.default = (0, configUtils_1.enhanceConfig)(config);
3336
3860
 
3337
3861
  /***/ }),
3338
3862
 
3339
- /***/ 460:
3863
+ /***/ 463:
3340
3864
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3341
3865
 
3342
3866
  "use strict";
@@ -3350,7 +3874,7 @@ __webpack_require__.r(__webpack_exports__);
3350
3874
 
3351
3875
  var getDynamicLinkColorsEditor = function getDynamicLinkColorsEditor(_ref) {
3352
3876
  var defaultContext = _ref.defaultContext,
3353
- defaultPalettesConfig = _ref.defaultPalettesConfig;
3877
+ defaultPalettesConfig = _ref.defaultPalettesConfig;
3354
3878
  return {
3355
3879
  label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Link'),
3356
3880
  option: 'linkColors',
@@ -3396,27 +3920,37 @@ var getDynamicLinkColorsEditor = function getDynamicLinkColorsEditor(_ref) {
3396
3920
  Object.defineProperty(exports, "__esModule", {
3397
3921
  value: true
3398
3922
  });
3923
+
3399
3924
  var React = __webpack_require__(1);
3925
+
3400
3926
  var colorUtils_1 = __webpack_require__(12);
3927
+
3401
3928
  var variables_1 = __webpack_require__(11);
3402
- var IconPlaceholder_1 = __webpack_require__(31);
3929
+
3930
+ var IconPlaceholder_1 = __webpack_require__(32);
3931
+
3403
3932
  var VizBehavior_1 = __webpack_require__(6);
3933
+
3404
3934
  var hocUtils_1 = __webpack_require__(15);
3935
+
3405
3936
  var withPlaceholder = function withPlaceholder(Visualization) {
3406
3937
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
3407
3938
  var config = Visualization.config;
3408
3939
  var themes = config.themes;
3940
+
3409
3941
  var Wrapper = function Wrapper(props) {
3410
3942
  var _a, _b;
3943
+
3411
3944
  var dataSources = props.dataSources,
3412
- loading = props.loading,
3413
- options = props.options,
3414
- height = props.height,
3415
- width = props.width;
3945
+ loading = props.loading,
3946
+ options = props.options,
3947
+ height = props.height,
3948
+ width = props.width;
3416
3949
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
3417
- 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);
3950
+ var bgColorFromTheme = (0, 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);
3418
3951
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
3419
3952
  var iconColor = variables_1.default.contentColorActive(props);
3953
+
3420
3954
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
3421
3955
  return React.createElement(IconPlaceholder_1.default, {
3422
3956
  "data-test": "icon-placeholder",
@@ -3427,19 +3961,22 @@ var withPlaceholder = function withPlaceholder(Visualization) {
3427
3961
  iconColor: iconColor
3428
3962
  });
3429
3963
  }
3964
+
3430
3965
  return React.createElement(Visualization, Object.assign({}, props));
3431
3966
  };
3432
- hocUtils_1.extendStaticWrapperProps({
3967
+
3968
+ (0, hocUtils_1.extendStaticWrapperProps)({
3433
3969
  Wrapper: Wrapper,
3434
3970
  Visualization: Visualization
3435
3971
  });
3436
3972
  return Wrapper;
3437
3973
  };
3974
+
3438
3975
  exports.default = withPlaceholder;
3439
3976
 
3440
3977
  /***/ }),
3441
3978
 
3442
- /***/ 49:
3979
+ /***/ 50:
3443
3980
  /***/ (function(module, exports) {
3444
3981
 
3445
3982
  module.exports = require("@splunk/visualization-icons/placeholders");
@@ -3469,13 +4006,15 @@ module.exports = require("@splunk/visualization-icons");
3469
4006
  Object.defineProperty(exports, "__esModule", {
3470
4007
  value: true
3471
4008
  });
4009
+
3472
4010
  var i18n_1 = __webpack_require__(2);
4011
+
3473
4012
  var background = function background(_ref) {
3474
4013
  var label = _ref.label,
3475
- themes = _ref.themes,
3476
- labelPosition = _ref.labelPosition;
4014
+ themes = _ref.themes,
4015
+ labelPosition = _ref.labelPosition;
3477
4016
  return [{
3478
- label: i18n_1._(label || 'Background'),
4017
+ label: (0, i18n_1._)(label || 'Background'),
3479
4018
  option: 'backgroundColor',
3480
4019
  editor: 'editor.color',
3481
4020
  editorProps: {
@@ -3484,14 +4023,8 @@ var background = function background(_ref) {
3484
4023
  }
3485
4024
  }];
3486
4025
  };
3487
- exports.default = background;
3488
-
3489
- /***/ }),
3490
-
3491
- /***/ 59:
3492
- /***/ (function(module, exports) {
3493
4026
 
3494
- module.exports = require("@splunk/themes");
4027
+ exports.default = background;
3495
4028
 
3496
4029
  /***/ }),
3497
4030
 
@@ -3506,6 +4039,7 @@ Object.defineProperty(exports, "__esModule", {
3506
4039
  });
3507
4040
  exports.VizBehavior = void 0;
3508
4041
  var VizBehavior;
4042
+
3509
4043
  (function (VizBehavior) {
3510
4044
  /**
3511
4045
  * Dynamic Options Behavior.
@@ -3525,6 +4059,7 @@ var VizBehavior;
3525
4059
  * missing.
3526
4060
  * @type {string}
3527
4061
  */
4062
+
3528
4063
  VizBehavior["PLACEHOLDER"] = "placeholder";
3529
4064
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
3530
4065
  VizBehavior["TRELLIS"] = "trellis";
@@ -3535,18 +4070,25 @@ var VizBehavior;
3535
4070
  /***/ 60:
3536
4071
  /***/ (function(module, exports) {
3537
4072
 
3538
- module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
4073
+ module.exports = require("@splunk/themes");
3539
4074
 
3540
4075
  /***/ }),
3541
4076
 
3542
4077
  /***/ 61:
3543
4078
  /***/ (function(module, exports) {
3544
4079
 
4080
+ module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
4081
+
4082
+ /***/ }),
4083
+
4084
+ /***/ 62:
4085
+ /***/ (function(module, exports) {
4086
+
3545
4087
  module.exports = require("@splunk/react-ui/Popover");
3546
4088
 
3547
4089
  /***/ }),
3548
4090
 
3549
- /***/ 63:
4091
+ /***/ 64:
3550
4092
  /***/ (function(module, exports) {
3551
4093
 
3552
4094
  module.exports = require("d3-array");
@@ -3560,7 +4102,7 @@ module.exports = require("@babel/runtime/helpers/defineProperty");
3560
4102
 
3561
4103
  /***/ }),
3562
4104
 
3563
- /***/ 72:
4105
+ /***/ 73:
3564
4106
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3565
4107
 
3566
4108
  "use strict";
@@ -3592,35 +4134,35 @@ module.exports = require("@babel/runtime/helpers/toConsumableArray");
3592
4134
 
3593
4135
  /***/ }),
3594
4136
 
3595
- /***/ 9:
4137
+ /***/ 82:
3596
4138
  /***/ (function(module, exports) {
3597
4139
 
3598
- module.exports = require("@babel/runtime/helpers/classCallCheck");
4140
+ module.exports = require("@babel/runtime/helpers/typeof");
3599
4141
 
3600
4142
  /***/ }),
3601
4143
 
3602
- /***/ 91:
4144
+ /***/ 83:
3603
4145
  /***/ (function(module, exports) {
3604
4146
 
3605
- module.exports = require("d3-scale");
4147
+ module.exports = require("@splunk/visualization-encoding/utils/types");
3606
4148
 
3607
4149
  /***/ }),
3608
4150
 
3609
- /***/ 93:
4151
+ /***/ 9:
3610
4152
  /***/ (function(module, exports) {
3611
4153
 
3612
- module.exports = require("@babel/runtime/helpers/typeof");
4154
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
3613
4155
 
3614
4156
  /***/ }),
3615
4157
 
3616
- /***/ 94:
4158
+ /***/ 93:
3617
4159
  /***/ (function(module, exports) {
3618
4160
 
3619
- module.exports = require("@splunk/visualization-encoding/utils/types");
4161
+ module.exports = require("d3-scale");
3620
4162
 
3621
4163
  /***/ }),
3622
4164
 
3623
- /***/ 96:
4165
+ /***/ 97:
3624
4166
  /***/ (function(module, exports) {
3625
4167
 
3626
4168
  module.exports = require("@splunk/visualizations-shared/dataSourceUtils");