@splunk/visualizations 25.6.0 → 25.7.1

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 (218) hide show
  1. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  2. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  3. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  4. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  5. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  6. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  7. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  8. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  9. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  10. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  11. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  12. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  13. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  14. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  15. package/.loki/reference/chrome_docker_Visualizations_Bar_Bar_Legend_Mode_Series_Compare.png +0 -0
  16. package/.loki/reference/chrome_docker_Visualizations_Column_Column_Legend_Mode_Series_Compare.png +0 -0
  17. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_Pagination.png +0 -0
  18. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_background_color.png +0 -0
  19. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_chart_cmd_count_by_status.png +0 -0
  20. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_chart_cmd_count_by_status_user.png +0 -0
  21. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_chart_cmd_count_by_status_user_aggregations.png +0 -0
  22. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_chart_cmd_max_count_avg_count_aggregations.png +0 -0
  23. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_chart_cmd_max_count_avg_count_by_status_user_aggregations.png +0 -0
  24. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_layout_options.png +0 -0
  25. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_makeresults_name_age.png +0 -0
  26. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_makeresults_name_age_aggregations.png +0 -0
  27. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_stats_cmd_avg_count_max_count_aggregations.png +0 -0
  28. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_stats_cmd_avg_count_max_count_by_status_user_aggregations.png +0 -0
  29. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_stats_cmd_count_by_status_user.png +0 -0
  30. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_stats_cmd_count_by_status_user_aggregations.png +0 -0
  31. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_table.png +0 -0
  32. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_table_aggregations.png +0 -0
  33. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_timechart_cmd_count_aggregations.png +0 -0
  34. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_timechart_cmd_count_by_status.png +0 -0
  35. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_timechart_cmd_count_by_status_aggregations.png +0 -0
  36. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_timechart_cmd_max_count_avg_count_by_status_aggregations.png +0 -0
  37. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_Chart.png +0 -0
  38. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_Chart_Count.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_Pagination.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_Timechart.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_background_color.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_chart_cmd_count_by_status_user_aggregations.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_chart_cmd_max_count_avg_count_aggregations.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_chart_cmd_max_count_avg_count_by_status_user_aggregations.png +0 -0
  45. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_layout_options.png +0 -0
  46. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_makeresults_name_age.png +0 -0
  47. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_makeresults_name_age_aggregations.png +0 -0
  48. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_stats_cmd_avg_count_max_count_aggregations.png +0 -0
  49. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_stats_cmd_count_by_status_user.png +0 -0
  50. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_stats_cmd_count_by_status_user_aggregations.png +0 -0
  51. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_table.png +0 -0
  52. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_table_aggregations.png +0 -0
  53. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_timechart_cmd_count_aggregations.png +0 -0
  54. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_timechart_cmd_count_by_status_aggregations.png +0 -0
  55. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_timechart_cmd_max_count_avg_count_by_status_aggregations.png +0 -0
  56. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Trellis_stats_cmd_avg_count_max_count_by_status_user_aggregations.png +0 -0
  57. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_Pagination.png +0 -0
  58. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_assign_default_trellisSplitBy_value_status.png +0 -0
  59. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_background_color.png +0 -0
  60. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_avg_count_max_count_by_status.png +0 -0
  61. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_avg_count_max_count_by_status_value_by_max_count.png +0 -0
  62. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_count_by_status.png +0 -0
  63. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_count_by_status_user.png +0 -0
  64. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_count_by_status_user_aggregations.png +0 -0
  65. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_count_by_status_user_user.png +0 -0
  66. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_max_count_avg_count_aggregations.png +0 -0
  67. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_max_count_avg_count_by_status_user.png +0 -0
  68. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_max_count_avg_count_by_status_user_aggregations.png +0 -0
  69. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_max_count_avg_count_by_status_user_user.png +0 -0
  70. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_layout_options.png +0 -0
  71. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_makeresults_name_age.png +0 -0
  72. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_makeresults_name_age_aggregations.png +0 -0
  73. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_stats_cmd_avg_count_max_count_aggregations.png +0 -0
  74. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_stats_cmd_avg_count_max_count_by_status.png +0 -0
  75. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_stats_cmd_avg_count_max_count_by_status_user_aggregations.png +0 -0
  76. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_stats_cmd_avg_count_max_count_by_status_value_by_max_count.png +0 -0
  77. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_stats_cmd_count_by_status_user.png +0 -0
  78. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_stats_cmd_count_by_status_user_aggregations.png +0 -0
  79. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_table.png +0 -0
  80. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_table_aggregations.png +0 -0
  81. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_timechart_cmd_count_aggregations.png +0 -0
  82. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_timechart_cmd_count_by_status.png +0 -0
  83. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_timechart_cmd_count_by_status_aggregations.png +0 -0
  84. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_timechart_cmd_max_count_avg_count_by_status.png +0 -0
  85. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_timechart_cmd_max_count_avg_count_by_status_aggregations.png +0 -0
  86. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Major_value_data_null_show_N_A.png +0 -0
  87. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_The_Background_Color_Based_On_The_Major_Value_Trellis.png +0 -0
  88. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Height_Percentage.png +0 -0
  89. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Height_Percentage_100_no_paginator.png +0 -0
  90. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Height_Percentage_50_no_paginator.png +0 -0
  91. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline.png +0 -0
  92. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline_Custom.png +0 -0
  93. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline_Width.png +0 -0
  94. package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparklines_Adv.png +0 -0
  95. package/Area.config.js +12 -7
  96. package/Area.config.js.map +1 -1
  97. package/Area.js +192 -171
  98. package/Area.js.map +1 -1
  99. package/Bar.config.js +36 -8
  100. package/Bar.config.js.map +1 -1
  101. package/Bar.js +216 -172
  102. package/Bar.js.map +1 -1
  103. package/Bubble.config.js +7 -2
  104. package/Bubble.config.js.map +1 -1
  105. package/Bubble.js +183 -162
  106. package/Bubble.js.map +1 -1
  107. package/ChoroplethSvg.config.js +12 -8
  108. package/ChoroplethSvg.config.js.map +1 -1
  109. package/ChoroplethSvg.js +191 -174
  110. package/ChoroplethSvg.js.map +1 -1
  111. package/Column.config.js +36 -8
  112. package/Column.config.js.map +1 -1
  113. package/Column.js +216 -172
  114. package/Column.js.map +1 -1
  115. package/Ellipse.config.js +23 -20
  116. package/Ellipse.config.js.map +1 -1
  117. package/Ellipse.js +168 -149
  118. package/Ellipse.js.map +1 -1
  119. package/Events.config.js +79 -19
  120. package/Events.config.js.map +1 -1
  121. package/Events.js +404 -244
  122. package/Events.js.map +1 -1
  123. package/FEATUREFLAGS.md +40 -0
  124. package/FillerGauge.config.js +22 -19
  125. package/FillerGauge.config.js.map +1 -1
  126. package/FillerGauge.js +170 -151
  127. package/FillerGauge.js.map +1 -1
  128. package/Image.config.js +3 -3
  129. package/Image.config.js.map +1 -1
  130. package/Image.js +143 -130
  131. package/Image.js.map +1 -1
  132. package/LICENSE.md +444 -8
  133. package/Line.config.js +12 -7
  134. package/Line.config.js.map +1 -1
  135. package/Line.js +192 -171
  136. package/Line.js.map +1 -1
  137. package/LinkGraph.config.js +9 -15
  138. package/LinkGraph.config.js.map +1 -1
  139. package/LinkGraph.js +743 -729
  140. package/LinkGraph.js.map +1 -1
  141. package/Map.config.js +51 -48
  142. package/Map.config.js.map +1 -1
  143. package/Map.js +602 -587
  144. package/Map.js.map +1 -1
  145. package/Markdown.config.js +10 -9
  146. package/Markdown.config.js.map +1 -1
  147. package/Markdown.js +185 -171
  148. package/Markdown.js.map +1 -1
  149. package/MarkerGauge.config.js +71 -70
  150. package/MarkerGauge.config.js.map +1 -1
  151. package/MarkerGauge.js +193 -179
  152. package/MarkerGauge.js.map +1 -1
  153. package/ParallelCoordinates.config.js +3 -3
  154. package/ParallelCoordinates.config.js.map +1 -1
  155. package/ParallelCoordinates.js +179 -155
  156. package/ParallelCoordinates.js.map +1 -1
  157. package/Pie.config.js +30 -6
  158. package/Pie.config.js.map +1 -1
  159. package/Pie.js +237 -200
  160. package/Pie.js.map +1 -1
  161. package/Punchcard.config.js +3 -2
  162. package/Punchcard.config.js.map +1 -1
  163. package/Punchcard.js +305 -291
  164. package/Punchcard.js.map +1 -1
  165. package/Rectangle.config.js +22 -23
  166. package/Rectangle.config.js.map +1 -1
  167. package/Rectangle.js +232 -220
  168. package/Rectangle.js.map +1 -1
  169. package/Sankey.config.js +14 -13
  170. package/Sankey.config.js.map +1 -1
  171. package/Sankey.js +1311 -1297
  172. package/Sankey.js.map +1 -1
  173. package/Scatter.config.js +552 -580
  174. package/Scatter.config.js.map +1 -1
  175. package/Scatter.js +258 -244
  176. package/Scatter.js.map +1 -1
  177. package/SingleValue.config.js +242 -52
  178. package/SingleValue.config.js.map +1 -1
  179. package/SingleValue.js +1456 -350
  180. package/SingleValue.js.map +1 -1
  181. package/SingleValueBasic.js +40 -29
  182. package/SingleValueBasic.js.map +1 -1
  183. package/SingleValueIcon.config.js +267 -58
  184. package/SingleValueIcon.config.js.map +1 -1
  185. package/SingleValueIcon.js +1490 -363
  186. package/SingleValueIcon.js.map +1 -1
  187. package/SingleValueRadial.config.js +249 -41
  188. package/SingleValueRadial.config.js.map +1 -1
  189. package/SingleValueRadial.js +1435 -286
  190. package/SingleValueRadial.js.map +1 -1
  191. package/TRELLIS.md +296 -0
  192. package/Table.config.js +39 -41
  193. package/Table.config.js.map +1 -1
  194. package/Table.js +352 -306
  195. package/Table.js.map +1 -1
  196. package/common/EventsDoc.js +9 -3
  197. package/common/EventsDoc.js.map +1 -1
  198. package/common/docUtils.js +1 -1
  199. package/common/docUtils.js.map +1 -1
  200. package/common/utils/configUtils.js +26 -20
  201. package/common/utils/configUtils.js.map +1 -1
  202. package/common/utils/dataUtils.js +2 -2
  203. package/common/utils/dataUtils.js.map +1 -1
  204. package/common/utils/hocUtils.js +2 -2
  205. package/common/utils/hocUtils.js.map +1 -1
  206. package/common/utils/layoutUtils.js +115 -0
  207. package/common/utils/layoutUtils.js.map +1 -0
  208. package/common/utils/mapUtils.js +1166 -23
  209. package/common/utils/mapUtils.js.map +1 -1
  210. package/common/utils/singleValueUtils.js +54 -46
  211. package/common/utils/singleValueUtils.js.map +1 -1
  212. package/common/utils/testHelper.js +14 -14
  213. package/common/utils/testHelper.js.map +1 -1
  214. package/common/utils/trellisUtils.js +612 -0
  215. package/common/utils/trellisUtils.js.map +1 -0
  216. package/common/withDashboardViz.js +31 -17
  217. package/common/withDashboardViz.js.map +1 -1
  218. package/package.json +12 -12
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 = 446);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 453);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -95,329 +95,418 @@ module.exports =
95
95
  /***/ 0:
96
96
  /***/ (function(module, exports) {
97
97
 
98
- module.exports = require("prop-types");
98
+ module.exports = require("react");
99
99
 
100
100
  /***/ }),
101
101
 
102
102
  /***/ 1:
103
103
  /***/ (function(module, exports) {
104
104
 
105
- module.exports = require("react");
105
+ module.exports = require("prop-types");
106
106
 
107
107
  /***/ }),
108
108
 
109
109
  /***/ 10:
110
110
  /***/ (function(module, exports) {
111
111
 
112
- module.exports = require("@splunk/visualizations-shared/Message");
113
-
114
- /***/ }),
115
-
116
- /***/ 11:
117
- /***/ (function(module, exports) {
118
-
119
- module.exports = require("@babel/runtime/helpers/classCallCheck");
120
-
121
- /***/ }),
122
-
123
- /***/ 12:
124
- /***/ (function(module, exports) {
125
-
126
- module.exports = require("@splunk/visualizations-shared/colorUtils");
112
+ module.exports = require("@splunk/themes/variables");
127
113
 
128
114
  /***/ }),
129
115
 
130
- /***/ 124:
116
+ /***/ 106:
131
117
  /***/ (function(module, exports, __webpack_require__) {
132
118
 
133
119
  "use strict";
134
120
 
135
121
 
122
+ var _toConsumableArray = __webpack_require__(7);
123
+
124
+ var _slicedToArray = __webpack_require__(17);
125
+
136
126
  Object.defineProperty(exports, "__esModule", {
137
127
  value: true
138
128
  });
139
- exports.truncateSVGTextWithEllipsis = exports.checkDigitsOnly = exports.computeAllConnectedLinksToNodes = exports.getAllConnectedLinks = exports.extractLinkMidPoint = exports.getAllNodeNames = exports.getLinkId = exports.getNodeId = exports.convertInputToSankeyDataFormat = exports.getColorCategoryMapping = exports.getNodesIndex = void 0;
140
- /* eslint-disable no-param-reassign */
141
-
142
- var d3_scale_1 = __webpack_require__(83);
129
+ 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;
143
130
 
144
- var types_1 = __webpack_require__(85);
131
+ var React = __webpack_require__(0);
145
132
 
146
- var insertNodeIfNotExist = function insertNodeIfNotExist(sankeyData, nodeName) {
147
- var nodes = sankeyData.nodes;
148
- nodes = nodes || [];
133
+ var react_1 = __webpack_require__(0);
149
134
 
150
- if (typeof nodeName !== 'string') {
151
- console.error('Node not created, invalid nodename:', nodeName);
152
- return;
153
- }
135
+ var T = __webpack_require__(1);
154
136
 
155
- nodeName = nodeName.trim();
137
+ var lodash_1 = __webpack_require__(3);
156
138
 
157
- if (!nodes.find(function (node) {
158
- return node.name.toLocaleLowerCase() === nodeName.toLocaleLowerCase();
159
- })) {
160
- nodes.push({
161
- name: nodeName
162
- });
163
- }
164
- };
139
+ var styled_components_1 = __webpack_require__(4);
165
140
 
166
- var insertLink = function insertLink(sankeyData, sourceFieldIdx, targetFieldIdx, linkValue, index) {
167
- var links = sankeyData.links;
168
- links = links || [];
169
- links.push({
170
- source: sourceFieldIdx,
171
- target: targetFieldIdx,
172
- value: linkValue,
173
- index: index
174
- });
175
- };
141
+ var Message_1 = __webpack_require__(9);
176
142
 
177
- var getNodesIndex = function getNodesIndex(sankeyData, nodeName) {
178
- if (!sankeyData || !sankeyData.nodes || !sankeyData.nodes.length) {
179
- return -1;
180
- }
143
+ var i18n_1 = __webpack_require__(2);
181
144
 
182
- return sankeyData.nodes.findIndex(function (node) {
183
- return node.name.toLocaleLowerCase() === nodeName.toLocaleLowerCase();
184
- });
185
- };
145
+ var SizeAwareWrapper_1 = __webpack_require__(18);
186
146
 
187
- exports.getNodesIndex = getNodesIndex;
147
+ var style_1 = __webpack_require__(14);
188
148
 
189
- var getColorCategoryMapping = function getColorCategoryMapping(_ref) {
190
- var category = _ref.category,
191
- colorMode = _ref.colorMode,
192
- seriesColors = _ref.seriesColors,
193
- linkColors = _ref.linkColors;
149
+ var visualization_color_palettes_1 = __webpack_require__(50); // eslint-disable-next-line camelcase
194
150
 
195
- if (colorMode !== 'categorical') {
196
- return linkColors;
197
- }
198
151
 
199
- return seriesColors ? d3_scale_1.scaleOrdinal().domain(category).range(seriesColors).unknown(seriesColors[0]) : null;
200
- };
152
+ var sankey_1 = __webpack_require__(454);
201
153
 
202
- exports.getColorCategoryMapping = getColorCategoryMapping;
154
+ var VizStyleWrapper_1 = __webpack_require__(68);
203
155
 
204
- var convertInputToSankeyDataFormat = function convertInputToSankeyDataFormat(columns, sourceFieldIdx, targetFieldIdx, linkValueFieldIdx, resultLimit) {
205
- 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') {
206
- return null;
207
- }
156
+ var SankeyUtils_1 = __webpack_require__(132);
208
157
 
209
- var sankeyData = {
210
- nodes: [],
211
- links: []
212
- };
213
- var maxlen = Math.min(columns[sourceFieldIdx].length, columns[targetFieldIdx].length, columns[linkValueFieldIdx].length, resultLimit);
158
+ var SankeyNode_1 = __webpack_require__(455);
214
159
 
215
- for (var i = 0; i < maxlen; i += 1) {
216
- if (typeof columns[sourceFieldIdx][i] === 'string' && typeof columns[targetFieldIdx][i] === 'string' && types_1.isNumber(columns[linkValueFieldIdx][i])) {
217
- (function () {
218
- var sourceNodeName = columns[sourceFieldIdx][i].trim();
219
- var targetNodeName = columns[targetFieldIdx][i].trim();
220
- insertNodeIfNotExist(sankeyData, sourceNodeName);
221
- insertNodeIfNotExist(sankeyData, targetNodeName); // If same link exists then sum up the value and donot insert new link
160
+ var SankeyLink_1 = __webpack_require__(456);
222
161
 
223
- var sourceNodeIdx = exports.getNodesIndex(sankeyData, sourceNodeName);
224
- var targetNodeIdx = exports.getNodesIndex(sankeyData, targetNodeName);
225
- var linkExist = sankeyData.links.find(function (link) {
226
- return link.source === sourceNodeIdx && link.target === targetNodeIdx;
227
- });
228
- var linkValue = +columns[linkValueFieldIdx][i];
162
+ var SankeyTooltip_1 = __webpack_require__(457);
229
163
 
230
- if (linkExist) {
231
- linkExist.value += linkValue;
232
- } else {
233
- insertLink(sankeyData, sourceNodeIdx, targetNodeIdx, linkValue, i);
234
- }
235
- })();
236
- } else {
237
- console.error('Link excluded. Invalid type in column input, row :- ', i, "[".concat(columns[sourceFieldIdx][i], ", ").concat(columns[targetFieldIdx][i], ", ").concat(columns[linkValueFieldIdx][i], "]"));
238
- }
164
+ exports.DEFAULT_COLORS = {
165
+ backgroundColor: '#ffffff',
166
+ nodeTextColor: '#2c2c2c',
167
+ tooltip: {
168
+ headerColor: 'rgba(0, 0, 0, 0.54)',
169
+ linkHeaderColor: '#2c2c2c',
170
+ rowColor: '#2c2c2c'
239
171
  }
240
-
241
- return sankeyData;
242
172
  };
173
+ exports.NODE_TEXT_FONT_SIZE = 10;
174
+ exports.DEFAULT_FONT_FAMILY = '"Splunk Platform Sans", "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans-serif';
175
+ exports.DEFAULT_NODE_COLOR = '#909090';
176
+ exports.DEFAULT_LINK_COLOR = '#909090';
177
+ exports.DEFAULT_SERIES_COLOR = visualization_color_palettes_1.VIZ_CATEGORICAL;
178
+ exports.DEFAULT_LINK_OPACITY = 0.5;
179
+ exports.DEFAULT_NODE_OPACITY = 1;
180
+ exports.INACTIVE_OPACITY = 0.05;
181
+ exports.CHART_MIN_WIDTH = 300;
182
+ exports.CHART_MIN_HEIGHT = 200;
183
+ exports.DEFAULT_CHART_WIDTH = 600;
184
+ exports.DEFAULT_CHART_HEIGHT = 300;
185
+ exports.DEFAULT_SOURCE_INDEX = 0;
186
+ exports.DEFAULT_TARGET_INDEX = 1;
187
+ exports.DEFAULT_LINK_VALUE_INDEX = 2;
188
+ var SankeyContainer = styled_components_1.default.div.withConfig({
189
+ displayName: "PureSankey__SankeyContainer",
190
+ componentId: "sc-1r333qx-0"
191
+ })(["overflow:hidden;", ";"], function (props) {
192
+ return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
193
+ });
243
194
 
244
- exports.convertInputToSankeyDataFormat = convertInputToSankeyDataFormat;
195
+ var PureSankey = function PureSankey(props) {
196
+ var width = props.width,
197
+ height = props.height,
198
+ columns = props.columns,
199
+ colorMode = props.colorMode,
200
+ nodeWidth = props.nodeWidth,
201
+ nodePadding = props.nodePadding,
202
+ resultLimit = props.resultLimit,
203
+ seriesColors = props.seriesColors,
204
+ linkColors = props.linkColors,
205
+ linkOpacity = props.linkOpacity,
206
+ linkValueField = props.linkValueField,
207
+ backgroundColor = props.backgroundColor,
208
+ nodeTextColor = props.nodeTextColor,
209
+ tooltipRowColor = props.tooltipRowColor,
210
+ tooltipLinkHeaderColor = props.tooltipLinkHeaderColor,
211
+ tooltipHeaderColor = props.tooltipHeaderColor;
212
+ var margin = {
213
+ top: 17,
214
+ right: 25,
215
+ bottom: 17,
216
+ left: 30
217
+ }; // This is to translate the svg's root g based on margin
218
+ // The y position is same as margin top & bottom
219
+ // The x position is an avg of margin right & left
245
220
 
246
- var getNodeId = function getNodeId(node) {
247
- if (!node) {
248
- return '';
249
- }
221
+ var translatePos = {
222
+ x: 28,
223
+ y: 17
224
+ };
250
225
 
251
- return "node-".concat(node.index);
252
- };
226
+ var _react_1$useState = react_1.useState([]),
227
+ _react_1$useState2 = _slicedToArray(_react_1$useState, 2),
228
+ activeLinks = _react_1$useState2[0],
229
+ setActiveLinks = _react_1$useState2[1];
253
230
 
254
- exports.getNodeId = getNodeId;
231
+ var _react_1$useState3 = react_1.useState([]),
232
+ _react_1$useState4 = _slicedToArray(_react_1$useState3, 2),
233
+ activeNodes = _react_1$useState4[0],
234
+ setActiveNodes = _react_1$useState4[1];
255
235
 
256
- var getLinkId = function getLinkId(link) {
257
- if (!link) {
258
- return '';
259
- }
236
+ var _react_1$useState5 = react_1.useState(null),
237
+ _react_1$useState6 = _slicedToArray(_react_1$useState5, 2),
238
+ nodeHovered = _react_1$useState6[0],
239
+ setNodeHovered = _react_1$useState6[1];
260
240
 
261
- return "link-".concat(link.id);
262
- };
241
+ var _react_1$useState7 = react_1.useState(null),
242
+ _react_1$useState8 = _slicedToArray(_react_1$useState7, 2),
243
+ hoveredNodeElement = _react_1$useState8[0],
244
+ setHoveredNodeElement = _react_1$useState8[1];
263
245
 
264
- exports.getLinkId = getLinkId;
246
+ var _react_1$useState9 = react_1.useState(false),
247
+ _react_1$useState10 = _slicedToArray(_react_1$useState9, 2),
248
+ openNodeToolTip = _react_1$useState10[0],
249
+ setOpenNodeToolTip = _react_1$useState10[1];
265
250
 
266
- var getAllNodeNames = function getAllNodeNames(sankeyData) {
267
- if (!sankeyData || !sankeyData.nodes || !sankeyData.nodes.length) {
268
- return [];
269
- }
251
+ var _react_1$useState11 = react_1.useState(null),
252
+ _react_1$useState12 = _slicedToArray(_react_1$useState11, 2),
253
+ hoveredLinkElement = _react_1$useState12[0],
254
+ setHoveredLinkElement = _react_1$useState12[1];
270
255
 
271
- return sankeyData.nodes.map(function (node) {
272
- return node.name;
273
- });
274
- };
256
+ var _react_1$useState13 = react_1.useState(false),
257
+ _react_1$useState14 = _slicedToArray(_react_1$useState13, 2),
258
+ openLinkToolTip = _react_1$useState14[0],
259
+ setOpenLinkToolTip = _react_1$useState14[1];
275
260
 
276
- exports.getAllNodeNames = getAllNodeNames;
261
+ var sankeyContainerElement = react_1.useRef(null);
277
262
 
278
- var extractLinkMidPoint = function extractLinkMidPoint(pathStr) {
279
- if (!pathStr) {
280
- return null;
281
- }
263
+ var _react_1$useState15 = react_1.useState(exports.DEFAULT_CHART_WIDTH - margin.left - margin.right),
264
+ _react_1$useState16 = _slicedToArray(_react_1$useState15, 2),
265
+ sankeyWidth = _react_1$useState16[0],
266
+ setSankeyWidth = _react_1$useState16[1];
282
267
 
283
- var mIndex = pathStr.indexOf('M');
284
- var cIndexFirst = pathStr.indexOf('C');
285
- var lIndex = pathStr.indexOf('L');
286
- var cIndexLast = pathStr.lastIndexOf('C');
287
- var zIndex = pathStr.lastIndexOf('Z');
268
+ var _react_1$useState17 = react_1.useState(exports.DEFAULT_CHART_HEIGHT - margin.top - margin.bottom),
269
+ _react_1$useState18 = _slicedToArray(_react_1$useState17, 2),
270
+ sankeyHeight = _react_1$useState18[0],
271
+ setSankeyHeight = _react_1$useState18[1];
288
272
 
289
- if (mIndex < 0 || cIndexLast < 0 || cIndexLast < 0 || zIndex < 0) {
290
- console.error('Extract link midpoint error. Invalid path -', pathStr);
291
- return null;
292
- }
273
+ react_1.useEffect(function () {
274
+ if (sankeyContainerElement && sankeyContainerElement.current) {
275
+ var w = sankeyContainerElement.current.getBoundingClientRect().width;
276
+ var h = sankeyContainerElement.current.getBoundingClientRect().height;
277
+ var sWidth = SankeyUtils_1.checkDigitsOnly(width) ? parseInt(width, 10) : w;
278
+ var sHeight = SankeyUtils_1.checkDigitsOnly(height) ? parseInt(height, 10) : h;
279
+ setSankeyWidth(sWidth - margin.left - margin.right);
280
+ setSankeyHeight(sHeight - margin.top - margin.bottom);
281
+ }
282
+ }, [width, height]);
283
+ var sankeyData = SankeyUtils_1.convertInputToSankeyDataFormat(columns, exports.DEFAULT_SOURCE_INDEX, exports.DEFAULT_TARGET_INDEX, exports.DEFAULT_LINK_VALUE_INDEX, resultLimit);
293
284
 
294
- var section1 = pathStr.slice(mIndex + 1, cIndexFirst).trim();
295
- var section2 = pathStr.slice(cIndexFirst + 1, lIndex).trim();
296
- var section3 = pathStr.slice(lIndex + 1, cIndexLast).trim();
297
- var section4 = pathStr.slice(cIndexLast + 1, zIndex).trim();
298
-
299
- if (!section1.length || !section2.length || !section3.length || !section4.length) {
300
- console.error('Extract link midpoint error. Invalid path -', pathStr);
301
- return null;
285
+ if (!sankeyData || !columns || !Array.isArray(columns) || columns.length < 3) {
286
+ return React.createElement(Message_1.default, {
287
+ width: width,
288
+ height: height,
289
+ message: i18n_1._('Invalid data to render'),
290
+ level: "info"
291
+ });
302
292
  }
303
293
 
304
- var points = [];
305
- points.push(section1.split(',').map(function (i) {
306
- return Number.parseFloat(i);
307
- }));
308
- var point2Arr = section2.split(' ');
309
- points.push(point2Arr[point2Arr.length - 1].split(',').map(function (i) {
310
- return Number.parseFloat(i);
311
- }));
312
- points.push(section3.split(',').map(function (i) {
313
- return Number.parseFloat(i);
314
- }));
315
- var point4Arr = section4.split(' ');
316
- points.push(point4Arr[point4Arr.length - 1].split(',').map(function (i) {
317
- return Number.parseFloat(i);
318
- }));
319
- var width = Math.abs(points[0][0] - points[1][0]) / 2;
320
- var x = Math.min(points[0][0], points[1][0]) + width;
321
- var height = Math.abs(points[0][1] - points[2][1]) / 2;
322
- var y = Math.min(points[0][1], points[2][1]) + height;
323
- return {
324
- x: x,
325
- y: y
294
+ var sortAndAssignLinkIds = function sortAndAssignLinkIds(links) {
295
+ links.sort(function (a, b) {
296
+ return a.dy - b.dy;
297
+ });
298
+ links.forEach(function (link) {
299
+ // eslint-disable-next-line no-param-reassign
300
+ link.id = "link-".concat(link.source.index, "-").concat(link.target.index);
301
+ });
326
302
  };
327
- };
328
303
 
329
- exports.extractLinkMidPoint = extractLinkMidPoint;
304
+ var d3sankey = sankey_1.d3_sankey().nodeWidth(nodeWidth).nodePadding(nodePadding).size([sankeyWidth, sankeyHeight]);
305
+ var path = d3sankey.reversibleLink();
306
+ d3sankey.nodes(sankeyData.nodes).links(sankeyData.links).layout(500);
307
+ sortAndAssignLinkIds(sankeyData.links);
308
+ var nodeConnectionsMap = SankeyUtils_1.computeAllConnectedLinksToNodes(sankeyData.nodes, sankeyData.links);
309
+ var uniqCategory = SankeyUtils_1.getAllNodeNames(sankeyData);
310
+ var colorCategoryMapping = SankeyUtils_1.getColorCategoryMapping({
311
+ category: uniqCategory,
312
+ colorMode: colorMode,
313
+ seriesColors: seriesColors,
314
+ linkColors: linkColors
315
+ });
330
316
 
331
- var getAllConnectedLinks = function getAllConnectedLinks(links, nodeIdx) {
332
- var result = {
333
- links: [],
334
- sourceNodes: [],
335
- targetNodes: []
317
+ var resetStates = function resetStates() {
318
+ setActiveLinks([]);
319
+ setActiveNodes([]);
320
+ setHoveredLinkElement(null);
321
+ setHoveredNodeElement(null);
322
+ setNodeHovered(null);
323
+ setOpenLinkToolTip(false);
324
+ setOpenNodeToolTip(false);
336
325
  };
337
326
 
338
- if (!links || !links.length) {
339
- return result;
340
- }
327
+ var renderVisualization = function renderVisualization(_ref) {
328
+ var containerWidth = _ref.width,
329
+ containerHeight = _ref.height;
341
330
 
342
- links.forEach(function (link) {
343
- if (link.source.index === nodeIdx || link.target.index === nodeIdx) {
344
- var linkAdded = result.links.find(function (l) {
345
- return l.id === link.id;
331
+ if (containerWidth < exports.CHART_MIN_WIDTH || containerHeight < exports.CHART_MIN_HEIGHT) {
332
+ return React.createElement(Message_1.default, {
333
+ width: containerWidth,
334
+ height: containerHeight,
335
+ message: i18n_1._('Too small to render content'),
336
+ level: "info"
346
337
  });
338
+ }
347
339
 
348
- if (!linkAdded) {
349
- result.links.push(link);
350
- }
340
+ var renderLinks = function renderLinks(links) {
341
+ return links.map(function (link) {
342
+ return React.createElement(SankeyLink_1.default, {
343
+ link: link,
344
+ activeLinks: activeLinks,
345
+ linkOpacity: linkOpacity,
346
+ path: path,
347
+ key: SankeyUtils_1.getLinkId(link),
348
+ "data-test": SankeyUtils_1.getLinkId(link),
349
+ colorCategoryMapping: colorCategoryMapping,
350
+ colorMode: colorMode,
351
+ handleMouseOver: function handleMouseOver(ev) {
352
+ setActiveLinks([link]);
353
+ setActiveNodes([link.source, link.target]);
354
+ setHoveredLinkElement(ev.currentTarget.querySelector('circle'));
355
+ setOpenNodeToolTip(false);
356
+ setOpenLinkToolTip(true);
357
+ },
358
+ handleMouseLeave: function handleMouseLeave() {
359
+ resetStates();
360
+ }
361
+ });
362
+ });
363
+ };
351
364
 
352
- var sourceNodeAdded = result.sourceNodes.find(function (n) {
353
- return n.index === link.source.index;
365
+ var renderNodes = function renderNodes(nodes) {
366
+ var chartWidth = typeof width === 'number' ? width : Number.parseInt(width, 10);
367
+ return nodes.map(function (node) {
368
+ return React.createElement(SankeyNode_1.default, {
369
+ node: node,
370
+ key: SankeyUtils_1.getNodeId(node),
371
+ "data-test": SankeyUtils_1.getNodeId(node),
372
+ activeNodes: activeNodes,
373
+ nodeWidth: nodeWidth,
374
+ chartWidth: chartWidth,
375
+ colorCategoryMapping: colorCategoryMapping,
376
+ nodeTextColor: nodeTextColor,
377
+ handleMouseOver: function handleMouseOver(ev) {
378
+ var connections = nodeConnectionsMap[node.index];
379
+ setActiveLinks(connections.links);
380
+ setNodeHovered(node);
381
+ setActiveNodes([].concat(_toConsumableArray(connections.sourceNodes), _toConsumableArray(connections.targetNodes)));
382
+ setHoveredNodeElement(ev.currentTarget);
383
+ setOpenLinkToolTip(false);
384
+ setOpenNodeToolTip(true);
385
+ },
386
+ handleMouseLeave: function handleMouseLeave() {
387
+ return resetStates();
388
+ }
389
+ });
354
390
  });
391
+ };
355
392
 
356
- if (!sourceNodeAdded) {
357
- result.sourceNodes.push(link.source);
393
+ return React.createElement(VizStyleWrapper_1.default, {
394
+ backgroundColor: backgroundColor,
395
+ dataTestKey: "SankeyWrapper",
396
+ onMouseLeave: function onMouseLeave() {
397
+ return resetStates();
358
398
  }
399
+ }, React.createElement("svg", {
400
+ height: "100%",
401
+ width: "100%",
402
+ "data-test": "sankey-svg"
403
+ }, React.createElement("g", {
404
+ transform: "translate(".concat(translatePos.x, ",").concat(translatePos.y, ")")
405
+ }, React.createElement("g", {
406
+ className: "link-group",
407
+ "data-test": "link-group"
408
+ }, renderLinks(sankeyData.links), openLinkToolTip && React.createElement(SankeyTooltip_1.default, {
409
+ mode: "link",
410
+ open: openLinkToolTip,
411
+ handleTooltipRequestClose: function handleTooltipRequestClose() {
412
+ return resetStates();
413
+ },
414
+ linkValue: linkValueField,
415
+ connectionsMap: nodeConnectionsMap,
416
+ anchor: hoveredLinkElement,
417
+ link: activeLinks[0],
418
+ height: sankeyHeight,
419
+ width: sankeyWidth,
420
+ colorCategoryMapping: colorCategoryMapping,
421
+ tooltipRowColor: tooltipRowColor,
422
+ tooltipLinkHeaderColor: tooltipLinkHeaderColor,
423
+ tooltipHeaderColor: tooltipHeaderColor
424
+ })), React.createElement("g", {
425
+ className: "node-group",
426
+ "data-test": "node-group"
427
+ }, renderNodes(sankeyData.nodes), openNodeToolTip && React.createElement(SankeyTooltip_1.default, {
428
+ mode: "node",
429
+ open: openNodeToolTip,
430
+ handleTooltipRequestClose: function handleTooltipRequestClose() {
431
+ return resetStates();
432
+ },
433
+ linkValue: linkValueField,
434
+ connectionsMap: nodeConnectionsMap,
435
+ anchor: hoveredNodeElement,
436
+ node: nodeHovered,
437
+ height: sankeyHeight,
438
+ width: sankeyWidth,
439
+ colorCategoryMapping: colorCategoryMapping,
440
+ tooltipRowColor: tooltipRowColor,
441
+ tooltipLinkHeaderColor: tooltipLinkHeaderColor,
442
+ tooltipHeaderColor: tooltipHeaderColor
443
+ })))));
444
+ };
359
445
 
360
- var targetNodeAdded = result.targetNodes.find(function (n) {
361
- return n.index === link.target.index;
362
- });
446
+ return React.createElement(SankeyContainer, {
447
+ height: height,
448
+ width: width,
449
+ ref: sankeyContainerElement
450
+ }, React.createElement(SizeAwareWrapper_1.default, null, function (containerDimension) {
451
+ return renderVisualization(containerDimension);
452
+ }));
453
+ };
363
454
 
364
- if (!targetNodeAdded) {
365
- result.targetNodes.push(link.target);
366
- }
367
- }
368
- });
369
- return result;
455
+ PureSankey.propTypes = {
456
+ columns: T.array,
457
+ width: T.oneOfType([T.string, T.number]),
458
+ height: T.oneOfType([T.string, T.number]),
459
+ // need this to satisfy props interface
460
+ // eslint-disable-next-line react/no-unused-prop-types
461
+ mode: T.string,
462
+ colorMode: T.string,
463
+ nodeWidth: T.number,
464
+ nodePadding: T.number,
465
+ resultLimit: T.number,
466
+ seriesColors: T.arrayOf(T.string),
467
+ linkColors: T.arrayOf(T.string),
468
+ linkOpacity: T.number,
469
+ linkValueField: T.string,
470
+ backgroundColor: T.string,
471
+ nodeTextColor: T.string,
472
+ tooltipRowColor: T.string,
473
+ tooltipLinkHeaderColor: T.string,
474
+ tooltipHeaderColor: T.string
475
+ };
476
+ PureSankey.defaultProps = {
477
+ columns: [],
478
+ width: exports.DEFAULT_CHART_WIDTH,
479
+ height: exports.DEFAULT_CHART_HEIGHT,
480
+ mode: 'view',
481
+ colorMode: 'categorical',
482
+ nodeWidth: 12,
483
+ nodePadding: 18,
484
+ resultLimit: 1000,
485
+ seriesColors: exports.DEFAULT_SERIES_COLOR,
486
+ linkColors: [],
487
+ linkOpacity: exports.DEFAULT_LINK_OPACITY,
488
+ linkValueField: 'value',
489
+ backgroundColor: '#0b0c0e',
490
+ nodeTextColor: 'rgba(255, 255, 255, 0.98)',
491
+ tooltipRowColor: 'rgba(255, 255, 255, 0.98)',
492
+ tooltipLinkHeaderColor: 'rgba(255, 255, 255, 0.98)',
493
+ tooltipHeaderColor: 'rgba(255, 255, 255, 0.5)'
370
494
  };
495
+ exports.default = PureSankey;
371
496
 
372
- exports.getAllConnectedLinks = getAllConnectedLinks;
497
+ /***/ }),
373
498
 
374
- var computeAllConnectedLinksToNodes = function computeAllConnectedLinksToNodes(nodes, links) {
375
- var connectionsMap = {};
499
+ /***/ 11:
500
+ /***/ (function(module, exports) {
376
501
 
377
- if (!nodes || !links) {
378
- return connectionsMap;
379
- }
380
-
381
- nodes.forEach(function (node) {
382
- var connections = exports.getAllConnectedLinks(links, node.index);
383
- connectionsMap[node.index] = connections;
384
- });
385
- return connectionsMap;
386
- };
387
-
388
- exports.computeAllConnectedLinksToNodes = computeAllConnectedLinksToNodes;
389
-
390
- var checkDigitsOnly = function checkDigitsOnly(input) {
391
- return /^\d+$/.test(input);
392
- };
393
-
394
- exports.checkDigitsOnly = checkDigitsOnly; // Truncate the node text and show ellipsis at the end if text string width exceeds the max limit
395
-
396
- var truncateSVGTextWithEllipsis = function truncateSVGTextWithEllipsis(textElement, textString, width) {
397
- if (textElement && textElement.getSubStringLength !== undefined) {
398
- textElement.textContent = textString; // ellipsis is needed
399
-
400
- if (textElement.getSubStringLength(0, textString.length) >= width) {
401
- for (var x = textString.length - 3; x > 0; x -= 3) {
402
- if (textElement.getSubStringLength(0, x) <= width) {
403
- textElement.textContent = "".concat(textString.substring(0, x), "...");
404
- return;
405
- }
406
- }
407
-
408
- textElement.textContent = '...'; // can't place at all
409
- }
410
- }
411
- };
412
-
413
- exports.truncateSVGTextWithEllipsis = truncateSVGTextWithEllipsis;
502
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
414
503
 
415
504
  /***/ }),
416
505
 
417
- /***/ 129:
506
+ /***/ 12:
418
507
  /***/ (function(module, exports) {
419
508
 
420
- module.exports = require("d3-interpolate");
509
+ module.exports = require("@splunk/visualizations-shared/colorUtils");
421
510
 
422
511
  /***/ }),
423
512
 
@@ -431,13 +520,13 @@ Object.defineProperty(exports, "__esModule", {
431
520
  value: true
432
521
  });
433
522
 
434
- var React = __webpack_require__(1);
523
+ var React = __webpack_require__(0);
435
524
 
436
525
  var styled_components_1 = __webpack_require__(4);
437
526
 
438
- var SizeAwareWrapper_1 = __webpack_require__(21);
527
+ var SizeAwareWrapper_1 = __webpack_require__(18);
439
528
 
440
- var style_1 = __webpack_require__(15);
529
+ var style_1 = __webpack_require__(14);
441
530
 
442
531
  var colorUtils_1 = __webpack_require__(12);
443
532
 
@@ -496,7 +585,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
496
585
 
497
586
  return React.createElement(FixSizeItem, {
498
587
  "data-test": "fix-size-item",
499
- "data-splunk-visualization-version": "25.6.0 - f5eb3abf9",
588
+ "data-splunk-visualization-version": "25.7.1 - 6a77c5530",
500
589
  width: width,
501
590
  height: height,
502
591
  backgroundColor: backgroundColor
@@ -518,14 +607,7 @@ exports.default = withFixedSizeContainer;
518
607
 
519
608
  /***/ }),
520
609
 
521
- /***/ 130:
522
- /***/ (function(module, exports) {
523
-
524
- module.exports = require("d3-collection");
525
-
526
- /***/ }),
527
-
528
- /***/ 14:
610
+ /***/ 132:
529
611
  /***/ (function(module, exports, __webpack_require__) {
530
612
 
531
613
  "use strict";
@@ -534,644 +616,952 @@ module.exports = require("d3-collection");
534
616
  Object.defineProperty(exports, "__esModule", {
535
617
  value: true
536
618
  });
537
- exports.extendStaticWrapperProps = void 0;
538
- /**
539
- * @method extendStaticWrapperProps
540
- * @param {Object} props
541
- * @param {DashboardVizType} props.Wrapper
542
- * @param {DashboardVizType} props.Visualization
543
- */
619
+ exports.truncateSVGTextWithEllipsis = exports.checkDigitsOnly = exports.computeAllConnectedLinksToNodes = exports.getAllConnectedLinks = exports.extractLinkMidPoint = exports.getAllNodeNames = exports.getLinkId = exports.getNodeId = exports.convertInputToSankeyDataFormat = exports.getColorCategoryMapping = exports.getNodesIndex = void 0;
620
+ /* eslint-disable no-param-reassign */
544
621
 
545
- var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
546
- var Wrapper = _ref.Wrapper,
547
- Visualization = _ref.Visualization;
548
- var extendProperties = ['propTypes', 'defaultProps', 'config'];
549
- extendProperties.forEach(function (prop) {
550
- if (Visualization[prop]) {
551
- // eslint-disable-next-line no-param-reassign
552
- Wrapper[prop] = Visualization[prop];
553
- }
554
- });
555
- };
622
+ var d3_scale_1 = __webpack_require__(86);
556
623
 
557
- exports.extendStaticWrapperProps = extendStaticWrapperProps;
624
+ var types_1 = __webpack_require__(90);
558
625
 
559
- /***/ }),
626
+ var insertNodeIfNotExist = function insertNodeIfNotExist(sankeyData, nodeName) {
627
+ var nodes = sankeyData.nodes;
628
+ nodes = nodes || [];
560
629
 
561
- /***/ 15:
562
- /***/ (function(module, exports) {
630
+ if (typeof nodeName !== 'string') {
631
+ console.error('Node not created, invalid nodename:', nodeName);
632
+ return;
633
+ }
563
634
 
564
- module.exports = require("@splunk/visualizations-shared/style");
635
+ nodeName = nodeName.trim();
565
636
 
566
- /***/ }),
637
+ if (!nodes.find(function (node) {
638
+ return node.name.toLocaleLowerCase() === nodeName.toLocaleLowerCase();
639
+ })) {
640
+ nodes.push({
641
+ name: nodeName
642
+ });
643
+ }
644
+ };
567
645
 
568
- /***/ 155:
569
- /***/ (function(module, exports, __webpack_require__) {
646
+ var insertLink = function insertLink(sankeyData, sourceFieldIdx, targetFieldIdx, linkValue, index) {
647
+ var links = sankeyData.links;
648
+ links = links || [];
649
+ links.push({
650
+ source: sourceFieldIdx,
651
+ target: targetFieldIdx,
652
+ value: linkValue,
653
+ index: index
654
+ });
655
+ };
570
656
 
571
- "use strict";
657
+ var getNodesIndex = function getNodesIndex(sankeyData, nodeName) {
658
+ if (!sankeyData || !sankeyData.nodes || !sankeyData.nodes.length) {
659
+ return -1;
660
+ }
572
661
 
662
+ return sankeyData.nodes.findIndex(function (node) {
663
+ return node.name.toLocaleLowerCase() === nodeName.toLocaleLowerCase();
664
+ });
665
+ };
573
666
 
574
- var _typeof = __webpack_require__(87);
667
+ exports.getNodesIndex = getNodesIndex;
575
668
 
576
- Object.defineProperty(exports, "__esModule", {
577
- value: true
578
- });
579
- exports.PureSankey = exports.config = exports.themes = exports.computeVizProps = exports.showPlaceHolderIcon = void 0;
669
+ var getColorCategoryMapping = function getColorCategoryMapping(_ref) {
670
+ var category = _ref.category,
671
+ colorMode = _ref.colorMode,
672
+ seriesColors = _ref.seriesColors,
673
+ linkColors = _ref.linkColors;
580
674
 
581
- var lodash_1 = __webpack_require__(3);
675
+ if (colorMode !== 'categorical') {
676
+ return linkColors;
677
+ }
582
678
 
583
- var dataSourceUtils_1 = __webpack_require__(86);
679
+ return seriesColors ? d3_scale_1.scaleOrdinal().domain(category).range(seriesColors).unknown(seriesColors[0]) : null;
680
+ };
584
681
 
585
- var colorUtils_1 = __webpack_require__(12);
682
+ exports.getColorCategoryMapping = getColorCategoryMapping;
586
683
 
587
- var withDashboardViz_1 = __webpack_require__(35);
684
+ var convertInputToSankeyDataFormat = function convertInputToSankeyDataFormat(columns, sourceFieldIdx, targetFieldIdx, linkValueFieldIdx, resultLimit) {
685
+ 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') {
686
+ return null;
687
+ }
588
688
 
589
- var PureSankey_1 = __webpack_require__(99);
689
+ var sankeyData = {
690
+ nodes: [],
691
+ links: []
692
+ };
693
+ var maxlen = Math.min(columns[sourceFieldIdx].length, columns[targetFieldIdx].length, columns[linkValueFieldIdx].length, resultLimit);
590
694
 
591
- exports.PureSankey = PureSankey_1.default;
695
+ for (var i = 0; i < maxlen; i += 1) {
696
+ if (typeof columns[sourceFieldIdx][i] === 'string' && typeof columns[targetFieldIdx][i] === 'string' && types_1.isNumber(columns[linkValueFieldIdx][i])) {
697
+ (function () {
698
+ var sourceNodeName = columns[sourceFieldIdx][i].trim();
699
+ var targetNodeName = columns[targetFieldIdx][i].trim();
700
+ insertNodeIfNotExist(sankeyData, sourceNodeName);
701
+ insertNodeIfNotExist(sankeyData, targetNodeName); // If same link exists then sum up the value and donot insert new link
592
702
 
593
- var config_1 = __webpack_require__(451);
703
+ var sourceNodeIdx = exports.getNodesIndex(sankeyData, sourceNodeName);
704
+ var targetNodeIdx = exports.getNodesIndex(sankeyData, targetNodeName);
705
+ var linkExist = sankeyData.links.find(function (link) {
706
+ return link.source === sourceNodeIdx && link.target === targetNodeIdx;
707
+ });
708
+ var linkValue = +columns[linkValueFieldIdx][i];
594
709
 
595
- exports.config = config_1.default;
596
- /**
597
- * @method showPlaceHolderIcon
598
- * @param {Object} dataSources
599
- * @returns {Boolean} return true if loading, error, non existent state or without columns in dataSources
600
- */
710
+ if (linkExist) {
711
+ linkExist.value += linkValue;
712
+ } else {
713
+ insertLink(sankeyData, sourceNodeIdx, targetNodeIdx, linkValue, i);
714
+ }
715
+ })();
716
+ } else {
717
+ console.error('Link excluded. Invalid type in column input, row :- ', i, "[".concat(columns[sourceFieldIdx][i], ", ").concat(columns[targetFieldIdx][i], ", ").concat(columns[linkValueFieldIdx][i], "]"));
718
+ }
719
+ }
601
720
 
602
- var showPlaceHolderIcon = function showPlaceHolderIcon(dataSources) {
603
- var columns = lodash_1.get(dataSources, 'primary.data.columns', undefined);
604
- var noColumns = columns === undefined;
605
- var dataSourceState = dataSourceUtils_1.getDataSourceStateInfo(dataSources);
606
- return dataSourceState === dataSourceUtils_1.DataSourceState.ERROR || dataSourceState === dataSourceUtils_1.DataSourceState.LOADING || dataSourceState === dataSourceUtils_1.DataSourceState.NONEXISTENT || noColumns;
721
+ return sankeyData;
607
722
  };
608
723
 
609
- exports.showPlaceHolderIcon = showPlaceHolderIcon;
610
-
611
- var computeVizProps = function computeVizProps(_ref) {
612
- var themeFunc = _ref.themeFunc,
613
- dataSources = _ref.dataSources,
614
- linkValues = _ref.linkValues,
615
- seriesColors = _ref.seriesColors,
616
- linkColors = _ref.linkColors;
617
-
618
- var _a, _b, _c, _d, _e, _f, _g, _h, _j; // Compute all themeColor variables needed for PureSankey
619
-
724
+ exports.convertInputToSankeyDataFormat = convertInputToSankeyDataFormat;
620
725
 
621
- var themeColorVariables = ['defaultBackgroundColor', 'nodeTextColor', 'tooltipRowColor', 'tooltipLinkHeaderColor', 'tooltipHeaderColor'];
622
- var themeColors = {};
623
- themeColorVariables.forEach(function (variable) {
624
- themeColors[variable] = themeFunc(variable);
625
- }); // Sanitize linkColors prop
626
- // eslint-disable-next-line no-param-reassign
726
+ var getNodeId = function getNodeId(node) {
727
+ if (!node) {
728
+ return '';
729
+ }
627
730
 
628
- linkColors = colorUtils_1.sanitizeArrayOfColors(linkColors); // Sanitize seriesColors prop
629
- // (Note:- This is handled outside SanitizeProps because it would impact seriesColors option used in splunk-charting viz as the types are different.
630
- // The type used in splunk-charting viz expects a string of comma separated colors, but here the type is an array of string)
631
- // eslint-disable-next-line no-param-reassign
731
+ return "node-".concat(node.index);
732
+ };
632
733
 
633
- seriesColors = colorUtils_1.isArrayOfColors(seriesColors) ? seriesColors : undefined; // Compute the columns props and linkValueField props for pure Sankey
634
- // The columns props is computed as [primary.data.columns[0], primary.data.columns[1], linkValues].
635
- // The source and target columns are the default as columns[0] and columns[1] respectively
636
- // The linkValueField props is the fieldName which is set as the source of linkValues
734
+ exports.getNodeId = getNodeId;
637
735
 
638
- var columnsFromDataSource = [];
639
- var linkValueField = '';
736
+ var getLinkId = function getLinkId(link) {
737
+ if (!link) {
738
+ return '';
739
+ }
640
740
 
641
- 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)) {
642
- var columns = dataSources.primary.data.columns;
643
- columnsFromDataSource = columns ? [columns[0], columns[1], linkValues] : null;
644
- var linkIndex = columns.findIndex(function (col) {
645
- return lodash_1.isEqual(col, linkValues);
646
- });
741
+ return "link-".concat(link.id);
742
+ };
647
743
 
648
- 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) {
649
- 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];
744
+ exports.getLinkId = getLinkId;
650
745
 
651
- if (_typeof(linkField) === 'object' && linkField !== null) {
652
- linkValueField = linkField.name;
653
- } else {
654
- linkValueField = linkField !== null && linkField !== void 0 ? linkField : '';
655
- }
656
- }
746
+ var getAllNodeNames = function getAllNodeNames(sankeyData) {
747
+ if (!sankeyData || !sankeyData.nodes || !sankeyData.nodes.length) {
748
+ return [];
657
749
  }
658
750
 
659
- return Object.assign(Object.assign({}, themeColors), {
660
- columns: columnsFromDataSource,
661
- linkValueField: linkValueField,
662
- seriesColors: seriesColors,
663
- linkColors: linkColors
751
+ return sankeyData.nodes.map(function (node) {
752
+ return node.name;
664
753
  });
665
754
  };
666
755
 
667
- exports.computeVizProps = computeVizProps;
668
- var Sankey = withDashboardViz_1.default({
669
- ReactViz: PureSankey_1.default,
670
- vizConfig: config_1.default,
671
- computeVizProps: exports.computeVizProps,
672
- useIconPlaceholder: function useIconPlaceholder(dataSources) {
673
- return exports.showPlaceHolderIcon(dataSources);
756
+ exports.getAllNodeNames = getAllNodeNames;
757
+
758
+ var extractLinkMidPoint = function extractLinkMidPoint(pathStr) {
759
+ if (!pathStr) {
760
+ return null;
674
761
  }
675
- });
676
- var themes = config_1.default.themes;
677
- exports.themes = themes;
678
- exports.default = Sankey;
679
762
 
680
- /***/ }),
763
+ var mIndex = pathStr.indexOf('M');
764
+ var cIndexFirst = pathStr.indexOf('C');
765
+ var lIndex = pathStr.indexOf('L');
766
+ var cIndexLast = pathStr.lastIndexOf('C');
767
+ var zIndex = pathStr.lastIndexOf('Z');
681
768
 
682
- /***/ 16:
683
- /***/ (function(module, exports) {
769
+ if (mIndex < 0 || cIndexLast < 0 || cIndexLast < 0 || zIndex < 0) {
770
+ console.error('Extract link midpoint error. Invalid path -', pathStr);
771
+ return null;
772
+ }
684
773
 
685
- module.exports = require("@splunk/visualizations-shared/schemaUtils");
774
+ var section1 = pathStr.slice(mIndex + 1, cIndexFirst).trim();
775
+ var section2 = pathStr.slice(cIndexFirst + 1, lIndex).trim();
776
+ var section3 = pathStr.slice(lIndex + 1, cIndexLast).trim();
777
+ var section4 = pathStr.slice(cIndexLast + 1, zIndex).trim();
686
778
 
687
- /***/ }),
779
+ if (!section1.length || !section2.length || !section3.length || !section4.length) {
780
+ console.error('Extract link midpoint error. Invalid path -', pathStr);
781
+ return null;
782
+ }
688
783
 
689
- /***/ 17:
690
- /***/ (function(module, exports) {
784
+ var points = [];
785
+ points.push(section1.split(',').map(function (i) {
786
+ return Number.parseFloat(i);
787
+ }));
788
+ var point2Arr = section2.split(' ');
789
+ points.push(point2Arr[point2Arr.length - 1].split(',').map(function (i) {
790
+ return Number.parseFloat(i);
791
+ }));
792
+ points.push(section3.split(',').map(function (i) {
793
+ return Number.parseFloat(i);
794
+ }));
795
+ var point4Arr = section4.split(' ');
796
+ points.push(point4Arr[point4Arr.length - 1].split(',').map(function (i) {
797
+ return Number.parseFloat(i);
798
+ }));
799
+ var width = Math.abs(points[0][0] - points[1][0]) / 2;
800
+ var x = Math.min(points[0][0], points[1][0]) + width;
801
+ var height = Math.abs(points[0][1] - points[2][1]) / 2;
802
+ var y = Math.min(points[0][1], points[2][1]) + height;
803
+ return {
804
+ x: x,
805
+ y: y
806
+ };
807
+ };
691
808
 
692
- module.exports = require("@babel/runtime/helpers/slicedToArray");
809
+ exports.extractLinkMidPoint = extractLinkMidPoint;
693
810
 
694
- /***/ }),
811
+ var getAllConnectedLinks = function getAllConnectedLinks(links, nodeIdx) {
812
+ var result = {
813
+ links: [],
814
+ sourceNodes: [],
815
+ targetNodes: []
816
+ };
695
817
 
696
- /***/ 18:
697
- /***/ (function(module, exports, __webpack_require__) {
818
+ if (!links || !links.length) {
819
+ return result;
820
+ }
698
821
 
699
- "use strict";
822
+ links.forEach(function (link) {
823
+ if (link.source.index === nodeIdx || link.target.index === nodeIdx) {
824
+ var linkAdded = result.links.find(function (l) {
825
+ return l.id === link.id;
826
+ });
700
827
 
828
+ if (!linkAdded) {
829
+ result.links.push(link);
830
+ }
701
831
 
702
- var _toConsumableArray = __webpack_require__(8);
832
+ var sourceNodeAdded = result.sourceNodes.find(function (n) {
833
+ return n.index === link.source.index;
834
+ });
703
835
 
704
- var _defineProperty = __webpack_require__(7);
836
+ if (!sourceNodeAdded) {
837
+ result.sourceNodes.push(link.source);
838
+ }
705
839
 
706
- var __rest = this && this.__rest || function (s, e) {
707
- var t = {};
840
+ var targetNodeAdded = result.targetNodes.find(function (n) {
841
+ return n.index === link.target.index;
842
+ });
708
843
 
709
- for (var p in s) {
710
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
711
- }
844
+ if (!targetNodeAdded) {
845
+ result.targetNodes.push(link.target);
846
+ }
847
+ }
848
+ });
849
+ return result;
850
+ };
712
851
 
713
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
714
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
852
+ exports.getAllConnectedLinks = getAllConnectedLinks;
853
+
854
+ var computeAllConnectedLinksToNodes = function computeAllConnectedLinksToNodes(nodes, links) {
855
+ var connectionsMap = {};
856
+
857
+ if (!nodes || !links) {
858
+ return connectionsMap;
715
859
  }
716
- return t;
860
+
861
+ nodes.forEach(function (node) {
862
+ var connections = exports.getAllConnectedLinks(links, node.index);
863
+ connectionsMap[node.index] = connections;
864
+ });
865
+ return connectionsMap;
717
866
  };
718
867
 
719
- Object.defineProperty(exports, "__esModule", {
720
- value: true
721
- });
722
- exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
868
+ exports.computeAllConnectedLinksToNodes = computeAllConnectedLinksToNodes;
723
869
 
724
- var lodash_1 = __webpack_require__(3);
870
+ var checkDigitsOnly = function checkDigitsOnly(input) {
871
+ return /^\d+$/.test(input);
872
+ };
725
873
 
726
- var schemaUtils_1 = __webpack_require__(16);
874
+ exports.checkDigitsOnly = checkDigitsOnly; // Truncate the node text and show ellipsis at the end if text string width exceeds the max limit
727
875
 
728
- var VizBehavior_1 = __webpack_require__(6);
876
+ var truncateSVGTextWithEllipsis = function truncateSVGTextWithEllipsis(textElement, textString, width) {
877
+ if (textElement && textElement.getSubStringLength !== undefined) {
878
+ textElement.textContent = textString; // ellipsis is needed
729
879
 
730
- var dynamicOptionsDSLType = {
731
- type: 'string',
732
- pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
880
+ if (textElement.getSubStringLength(0, textString.length) >= width) {
881
+ for (var x = textString.length - 3; x > 0; x -= 3) {
882
+ if (textElement.getSubStringLength(0, x) <= width) {
883
+ textElement.textContent = "".concat(textString.substring(0, x), "...");
884
+ return;
885
+ }
886
+ }
887
+
888
+ textElement.textContent = '...'; // can't place at all
889
+ }
890
+ }
733
891
  };
734
- /**
735
- * Helper function to extend an options schema with dynamic options DSL
736
- * @param optionsSchema a visualization's options schema
737
- * @returns an updated options schema that additionally allows strings starting with > for each option
738
- */
739
892
 
740
- function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
741
- var enhancedOptionsSchema = {};
742
- Object.keys(optionsSchema).forEach(function (key) {
743
- var _a = optionsSchema[key],
744
- title = _a.title,
745
- description = _a.description,
746
- readOnly = _a.readOnly,
747
- writeOnly = _a.writeOnly,
748
- examples = _a.examples,
749
- defaultValue = _a.default,
750
- type = _a.type,
751
- properties = _a.properties,
752
- patternProperties = _a.patternProperties,
753
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
893
+ exports.truncateSVGTextWithEllipsis = truncateSVGTextWithEllipsis;
754
894
 
755
- var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
756
- title: title
757
- }), description !== undefined && {
758
- description: description
759
- }), readOnly !== undefined && {
760
- readOnly: readOnly
761
- }), writeOnly !== undefined && {
762
- writeOnly: writeOnly
763
- }), examples !== undefined && {
764
- examples: examples
765
- }), defaultValue !== undefined && {
766
- default: defaultValue
767
- });
895
+ /***/ }),
768
896
 
769
- if (type === 'object') {
770
- enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
771
- type: type
772
- }), properties && {
773
- properties: enhanceOptionsSchemaWithDynamicOptions(properties)
774
- });
897
+ /***/ 137:
898
+ /***/ (function(module, exports) {
775
899
 
776
- if (patternProperties) {
777
- var enhancedPatternProperties = {};
778
- Object.keys(patternProperties).forEach(function (opt) {
779
- enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
780
- });
781
- enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
782
- }
783
- } else {
784
- enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
785
- anyOf: [Object.assign(Object.assign({}, type !== undefined && {
786
- type: type
787
- }), remainingSchemaEntry), dynamicOptionsDSLType]
788
- });
789
- }
790
- });
791
- return enhancedOptionsSchema;
792
- }
900
+ module.exports = require("d3-interpolate");
793
901
 
794
- exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
795
- /**
796
- * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
797
- * this function also collapse all editor panels
798
- * @param vizConfig a Visualization Config
799
- * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
800
- * and containing `open: false` for all editor panels in editorConfig
801
- */
902
+ /***/ }),
802
903
 
803
- function enhanceConfig(vizConfig) {
804
- var enhancedConfig = Object.assign({}, vizConfig);
904
+ /***/ 138:
905
+ /***/ (function(module, exports) {
805
906
 
806
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
807
- enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
808
- }
907
+ module.exports = require("d3-collection");
809
908
 
810
- enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
811
- return Object.assign(Object.assign({}, config), {
812
- open: config.open || false
813
- });
814
- });
815
- return enhancedConfig;
816
- }
909
+ /***/ }),
817
910
 
818
- exports.enhanceConfig = enhanceConfig;
819
- /**
820
- * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
821
- * Created for editor unit tests
822
- * @param vizConfig a Visualization Config
823
- * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
824
- */
911
+ /***/ 14:
912
+ /***/ (function(module, exports) {
825
913
 
826
- function uncollapseEditorConfig(vizConfig) {
827
- var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
828
- editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
829
- return Object.assign(Object.assign({}, config), {
830
- open: true
831
- });
832
- });
833
- return editorPanelUncollapsedConfig;
834
- }
914
+ module.exports = require("@splunk/visualizations-shared/style");
835
915
 
836
- exports.uncollapseEditorConfig = uncollapseEditorConfig;
916
+ /***/ }),
837
917
 
838
- function isDynamicOption(option) {
839
- return option && typeof option === 'string' && option.trim().startsWith('>') || false;
840
- }
918
+ /***/ 15:
919
+ /***/ (function(module, exports, __webpack_require__) {
841
920
 
842
- exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
843
- // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
921
+ "use strict";
844
922
 
845
- /**
846
- * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
847
- * 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
848
- * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
849
- * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
850
- *
851
- * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
852
- */
853
923
 
854
- function hasCompatibleContexts(vizContext, presetContext) {
855
- var presetContextKeys = Object.keys(presetContext);
856
- return presetContextKeys.every(function (contextKey) {
857
- return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
858
- });
859
- }
924
+ Object.defineProperty(exports, "__esModule", {
925
+ value: true
926
+ });
927
+ exports.extendStaticWrapperProps = void 0;
860
928
  /**
861
- * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
929
+ * @method extendStaticWrapperProps
930
+ * @param {Object} props
931
+ * @param {DashboardVizType} props.Wrapper
932
+ * @param {DashboardVizType} props.Visualization
862
933
  */
863
934
 
864
-
865
- function hasCompatibleOptions(vizOptions, presetOptions) {
866
- var presetOptionKeys = Object.keys(presetOptions);
867
- return presetOptionKeys.every(function (optionKey) {
868
- return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
935
+ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
936
+ var Wrapper = _ref.Wrapper,
937
+ Visualization = _ref.Visualization;
938
+ var extendProperties = ['propTypes', 'defaultProps', 'config'];
939
+ extendProperties.forEach(function (prop) {
940
+ if (Visualization[prop]) {
941
+ // eslint-disable-next-line no-param-reassign
942
+ Wrapper[prop] = Visualization[prop];
943
+ }
869
944
  });
870
- }
871
- /**
872
- * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
873
- * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
874
- *
875
- * @param {Object} vizContext - the current vizContext definition
876
- * @param {Object} vizOptions - the current vizOptions definition
877
- * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
878
- */
879
-
945
+ };
880
946
 
881
- function getInitialPreset(vizContext, vizOptions, presets) {
882
- return presets.find(function (preset) {
883
- var presetContext = lodash_1.get(preset, ['value', 'context'], {});
884
- var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
885
- var presetContextKeys = Object.keys(presetContext);
886
- var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
887
- // if not, then the preset is invalid in config.ts
947
+ exports.extendStaticWrapperProps = extendStaticWrapperProps;
888
948
 
889
- if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
890
- return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
891
- });
892
- }
949
+ /***/ }),
893
950
 
894
- exports.getInitialPreset = getInitialPreset;
895
- /**
896
- * generates number precision values for a Select editor
897
- *
898
- * @param {Number} numPrecisionValues - number of integer precision values to generate
899
- * @returns {{ label: string; value; string }[]} array of { label, value } tuples
900
- */
951
+ /***/ 16:
952
+ /***/ (function(module, exports) {
901
953
 
902
- function generatePrecisionValues(numPrecisionValues) {
903
- return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
904
- return {
905
- label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
906
- value: i
907
- };
908
- });
909
- }
954
+ module.exports = require("@splunk/visualizations-shared/schemaUtils");
910
955
 
911
- exports.generatePrecisionValues = generatePrecisionValues;
912
- /**
913
- * insert layout in layout array, return a new layout array instead of updating the original
914
- *
915
- * @param {EditorLayoutConfig[][]} layout - editor layout
916
- * @param {Number} index - the index to insert layout item(s)
917
- * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
918
- * @returns {EditorLayoutConfig[][]} new editor layout with insertion
919
- */
956
+ /***/ }),
920
957
 
921
- var insertLayout = function insertLayout(layout, index) {
922
- for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
923
- layoutItems[_key - 2] = arguments[_key];
924
- }
958
+ /***/ 162:
959
+ /***/ (function(module, exports, __webpack_require__) {
925
960
 
926
- return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
927
- };
961
+ "use strict";
928
962
 
929
- exports.insertLayout = insertLayout;
930
963
 
931
- /***/ }),
964
+ var _typeof = __webpack_require__(88);
932
965
 
933
- /***/ 19:
934
- /***/ (function(module, exports) {
966
+ Object.defineProperty(exports, "__esModule", {
967
+ value: true
968
+ });
969
+ exports.PureSankey = exports.config = exports.themes = exports.computeVizProps = exports.showPlaceHolderIcon = void 0;
935
970
 
936
- module.exports = require("@splunk/visualizations-shared/configUtils");
971
+ var lodash_1 = __webpack_require__(3);
937
972
 
938
- /***/ }),
973
+ var dataSourceUtils_1 = __webpack_require__(91);
939
974
 
940
- /***/ 2:
941
- /***/ (function(module, exports) {
975
+ var colorUtils_1 = __webpack_require__(12);
942
976
 
943
- module.exports = require("@splunk/ui-utils/i18n");
977
+ var withDashboardViz_1 = __webpack_require__(36);
944
978
 
945
- /***/ }),
979
+ var PureSankey_1 = __webpack_require__(106);
946
980
 
947
- /***/ 20:
948
- /***/ (function(module, exports) {
981
+ exports.PureSankey = PureSankey_1.default;
949
982
 
950
- module.exports = require("@babel/runtime/helpers/createClass");
983
+ var config_1 = __webpack_require__(458);
951
984
 
952
- /***/ }),
985
+ exports.config = config_1.default;
986
+ /**
987
+ * @method showPlaceHolderIcon
988
+ * @param {Object} dataSources
989
+ * @returns {Boolean} return true if loading, error, non existent state or without columns in dataSources
990
+ */
953
991
 
954
- /***/ 21:
955
- /***/ (function(module, exports) {
992
+ var showPlaceHolderIcon = function showPlaceHolderIcon(dataSources) {
993
+ var columns = lodash_1.get(dataSources, 'primary.data.columns', undefined);
994
+ var noColumns = columns === undefined;
995
+ var dataSourceState = dataSourceUtils_1.getDataSourceStateInfo(dataSources);
996
+ return dataSourceState === dataSourceUtils_1.DataSourceState.ERROR || dataSourceState === dataSourceUtils_1.DataSourceState.LOADING || dataSourceState === dataSourceUtils_1.DataSourceState.NONEXISTENT || noColumns;
997
+ };
956
998
 
957
- module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
999
+ exports.showPlaceHolderIcon = showPlaceHolderIcon;
958
1000
 
959
- /***/ }),
1001
+ var computeVizProps = function computeVizProps(_ref) {
1002
+ var themeFunc = _ref.themeFunc,
1003
+ dataSources = _ref.dataSources,
1004
+ linkValues = _ref.linkValues,
1005
+ seriesColors = _ref.seriesColors,
1006
+ linkColors = _ref.linkColors;
960
1007
 
961
- /***/ 24:
962
- /***/ (function(module, exports) {
1008
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j; // Compute all themeColor variables needed for PureSankey
963
1009
 
964
- module.exports = require("@splunk/visualization-context/TimezoneContext");
965
1010
 
966
- /***/ }),
1011
+ var themeColorVariables = ['defaultBackgroundColor', 'nodeTextColor', 'tooltipRowColor', 'tooltipLinkHeaderColor', 'tooltipHeaderColor'];
1012
+ var themeColors = {};
1013
+ themeColorVariables.forEach(function (variable) {
1014
+ themeColors[variable] = themeFunc(variable);
1015
+ }); // Sanitize linkColors prop
1016
+ // eslint-disable-next-line no-param-reassign
967
1017
 
968
- /***/ 26:
969
- /***/ (function(module, exports) {
1018
+ linkColors = colorUtils_1.sanitizeArrayOfColors(linkColors); // Sanitize seriesColors prop
1019
+ // (Note:- This is handled outside SanitizeProps because it would impact seriesColors option used in splunk-charting viz as the types are different.
1020
+ // The type used in splunk-charting viz expects a string of comma separated colors, but here the type is an array of string)
1021
+ // eslint-disable-next-line no-param-reassign
970
1022
 
971
- module.exports = require("@splunk/visualization-context/FeatureFlagContext");
1023
+ seriesColors = colorUtils_1.isArrayOfColors(seriesColors) ? seriesColors : undefined; // Compute the columns props and linkValueField props for pure Sankey
1024
+ // The columns props is computed as [primary.data.columns[0], primary.data.columns[1], linkValues].
1025
+ // The source and target columns are the default as columns[0] and columns[1] respectively
1026
+ // The linkValueField props is the fieldName which is set as the source of linkValues
972
1027
 
973
- /***/ }),
1028
+ var columnsFromDataSource = [];
1029
+ var linkValueField = '';
974
1030
 
975
- /***/ 27:
976
- /***/ (function(module, exports) {
1031
+ 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)) {
1032
+ var columns = dataSources.primary.data.columns;
1033
+ columnsFromDataSource = columns ? [columns[0], columns[1], linkValues] : null;
1034
+ var linkIndex = columns.findIndex(function (col) {
1035
+ return lodash_1.isEqual(col, linkValues);
1036
+ });
977
1037
 
978
- module.exports = require("@splunk/visualizations-shared/hocUtils");
1038
+ 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) {
1039
+ 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];
979
1040
 
980
- /***/ }),
1041
+ if (_typeof(linkField) === 'object' && linkField !== null) {
1042
+ linkValueField = linkField.name;
1043
+ } else {
1044
+ linkValueField = linkField !== null && linkField !== void 0 ? linkField : '';
1045
+ }
1046
+ }
1047
+ }
981
1048
 
982
- /***/ 28:
983
- /***/ (function(module, exports) {
1049
+ return Object.assign(Object.assign({}, themeColors), {
1050
+ columns: columnsFromDataSource,
1051
+ linkValueField: linkValueField,
1052
+ seriesColors: seriesColors,
1053
+ linkColors: linkColors
1054
+ });
1055
+ };
984
1056
 
985
- module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
1057
+ exports.computeVizProps = computeVizProps;
1058
+ var Sankey = withDashboardViz_1.default({
1059
+ ReactViz: PureSankey_1.default,
1060
+ vizConfig: config_1.default,
1061
+ computeVizProps: exports.computeVizProps,
1062
+ useIconPlaceholder: function useIconPlaceholder(dataSources) {
1063
+ return exports.showPlaceHolderIcon(dataSources);
1064
+ }
1065
+ });
1066
+ var themes = config_1.default.themes;
1067
+ exports.themes = themes;
1068
+ exports.default = Sankey;
986
1069
 
987
1070
  /***/ }),
988
1071
 
989
- /***/ 29:
1072
+ /***/ 17:
990
1073
  /***/ (function(module, exports) {
991
1074
 
992
- module.exports = require("@splunk/visualizations-shared/numberUtils");
1075
+ module.exports = require("@babel/runtime/helpers/slicedToArray");
993
1076
 
994
1077
  /***/ }),
995
1078
 
996
- /***/ 3:
1079
+ /***/ 18:
997
1080
  /***/ (function(module, exports) {
998
1081
 
999
- module.exports = require("lodash");
1082
+ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
1000
1083
 
1001
1084
  /***/ }),
1002
1085
 
1003
- /***/ 30:
1086
+ /***/ 19:
1004
1087
  /***/ (function(module, exports, __webpack_require__) {
1005
1088
 
1006
1089
  "use strict";
1007
1090
 
1008
1091
 
1092
+ var _toConsumableArray = __webpack_require__(7);
1093
+
1094
+ var _defineProperty = __webpack_require__(8);
1095
+
1096
+ var __rest = this && this.__rest || function (s, e) {
1097
+ var t = {};
1098
+
1099
+ for (var p in s) {
1100
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1101
+ }
1102
+
1103
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1104
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1105
+ }
1106
+ return t;
1107
+ };
1108
+
1009
1109
  Object.defineProperty(exports, "__esModule", {
1010
1110
  value: true
1011
1111
  });
1012
- exports.shouldShowIconPlaceholder = void 0;
1013
-
1014
- var React = __webpack_require__(1);
1015
-
1016
- var T = __webpack_require__(0);
1112
+ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
1017
1113
 
1018
1114
  var lodash_1 = __webpack_require__(3);
1019
1115
 
1020
- var i18n_1 = __webpack_require__(2);
1116
+ var schemaUtils_1 = __webpack_require__(16);
1021
1117
 
1022
- var Message_1 = __webpack_require__(10);
1118
+ var VizBehavior_1 = __webpack_require__(6);
1023
1119
 
1024
- var FixedSizeContainer_1 = __webpack_require__(13);
1120
+ var dynamicOptionsDSLType = {
1121
+ type: 'string',
1122
+ pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
1123
+ };
1025
1124
  /**
1026
- * @method shouldShowIconPlaceholder
1027
- * @param {object} dataSources
1028
- * @param {boolean} loading
1029
- * @returns {boolean}
1125
+ * Helper function to extend an options schema with dynamic options DSL
1126
+ * @param optionsSchema a visualization's options schema
1127
+ * @returns an updated options schema that additionally allows strings starting with > for each option
1030
1128
  */
1031
1129
 
1130
+ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
1131
+ var enhancedOptionsSchema = {};
1132
+ Object.keys(optionsSchema).forEach(function (key) {
1133
+ var _a = optionsSchema[key],
1134
+ title = _a.title,
1135
+ description = _a.description,
1136
+ readOnly = _a.readOnly,
1137
+ writeOnly = _a.writeOnly,
1138
+ examples = _a.examples,
1139
+ defaultValue = _a.default,
1140
+ type = _a.type,
1141
+ properties = _a.properties,
1142
+ patternProperties = _a.patternProperties,
1143
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
1032
1144
 
1033
- var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
1034
- var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1035
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1036
- var noData = data === undefined;
1037
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1038
- var noFields = fields === undefined;
1039
- return loading || noData || noFields;
1040
- };
1145
+ var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
1146
+ title: title
1147
+ }), description !== undefined && {
1148
+ description: description
1149
+ }), readOnly !== undefined && {
1150
+ readOnly: readOnly
1151
+ }), writeOnly !== undefined && {
1152
+ writeOnly: writeOnly
1153
+ }), examples !== undefined && {
1154
+ examples: examples
1155
+ }), defaultValue !== undefined && {
1156
+ default: defaultValue
1157
+ });
1041
1158
 
1042
- exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
1043
- var propTypes = {
1044
- icon: T.func,
1045
- width: T.oneOfType([T.string, T.number]),
1046
- height: T.oneOfType([T.string, T.number]),
1047
- // eslint-disable-next-line react/no-unused-prop-types
1048
- backgroundColor: T.string,
1049
- iconColor: T.string
1050
- };
1159
+ if (type === 'object') {
1160
+ enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
1161
+ type: type
1162
+ }), properties && {
1163
+ properties: enhanceOptionsSchemaWithDynamicOptions(properties)
1164
+ });
1165
+
1166
+ if (patternProperties) {
1167
+ var enhancedPatternProperties = {};
1168
+ Object.keys(patternProperties).forEach(function (opt) {
1169
+ enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
1170
+ });
1171
+ enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
1172
+ }
1173
+ } else {
1174
+ enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
1175
+ anyOf: [Object.assign(Object.assign({}, type !== undefined && {
1176
+ type: type
1177
+ }), remainingSchemaEntry), dynamicOptionsDSLType]
1178
+ });
1179
+ }
1180
+ });
1181
+ return enhancedOptionsSchema;
1182
+ }
1183
+
1184
+ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
1051
1185
  /**
1052
- * @method IconPlaceholder
1053
- * @param {IconPlaceholderProps} props
1054
- * @returns {React.ReactElement}
1186
+ * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
1187
+ * this function also collapse all editor panels
1188
+ * @param vizConfig a Visualization Config
1189
+ * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
1190
+ * and containing `open: false` for all editor panels in editorConfig
1055
1191
  */
1056
1192
 
1057
- var IconPlaceholder = function IconPlaceholder(props) {
1058
- var width = props.width,
1059
- height = props.height,
1060
- icon = props.icon,
1061
- iconColor = props.iconColor;
1193
+ function enhanceConfig(vizConfig) {
1194
+ var enhancedConfig = Object.assign({}, vizConfig);
1062
1195
 
1063
- if (icon) {
1064
- return React.createElement(icon, {
1065
- style: {
1066
- left: '50%',
1067
- top: '50%',
1068
- color: iconColor,
1069
- opacity: 0.15,
1070
- position: 'absolute',
1071
- transform: 'translate(-50%, -50%)'
1072
- },
1073
- width: '50%',
1074
- height: '50%'
1075
- });
1196
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
1197
+ enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
1076
1198
  }
1077
1199
 
1078
- return React.createElement(Message_1.default, {
1079
- width: width,
1080
- height: height,
1081
- level: "warning",
1082
- message: i18n_1._('No DataSource Connected')
1200
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
1201
+ return Object.assign(Object.assign({}, config), {
1202
+ open: config.open || false
1203
+ });
1083
1204
  });
1084
- };
1085
-
1086
- IconPlaceholder.propTypes = propTypes;
1087
- IconPlaceholder.defaultProps = {
1088
- width: '100%',
1089
- height: 250
1090
- };
1091
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1092
-
1093
- /***/ }),
1094
-
1095
- /***/ 31:
1096
- /***/ (function(module, exports) {
1205
+ return enhancedConfig;
1206
+ }
1097
1207
 
1098
- module.exports = require("@splunk/ui-utils/id");
1208
+ exports.enhanceConfig = enhanceConfig;
1209
+ /**
1210
+ * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
1211
+ * Created for editor unit tests
1212
+ * @param vizConfig a Visualization Config
1213
+ * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
1214
+ */
1099
1215
 
1100
- /***/ }),
1216
+ function uncollapseEditorConfig(vizConfig) {
1217
+ var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
1218
+ editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
1219
+ return Object.assign(Object.assign({}, config), {
1220
+ open: true
1221
+ });
1222
+ });
1223
+ return editorPanelUncollapsedConfig;
1224
+ }
1101
1225
 
1102
- /***/ 32:
1103
- /***/ (function(module, exports, __webpack_require__) {
1226
+ exports.uncollapseEditorConfig = uncollapseEditorConfig;
1104
1227
 
1105
- "use strict";
1228
+ function isDynamicOption(option) {
1229
+ return option && typeof option === 'string' && option.trim().startsWith('>') || false;
1230
+ }
1106
1231
 
1232
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
1233
+ // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
1107
1234
 
1108
- var _defineProperty = __webpack_require__(7);
1235
+ /**
1236
+ * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
1237
+ * 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
1238
+ * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
1239
+ * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
1240
+ *
1241
+ * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
1242
+ */
1109
1243
 
1110
- Object.defineProperty(exports, "__esModule", {
1111
- value: true
1112
- });
1113
- exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1244
+ function hasCompatibleContexts(vizContext, presetContext) {
1245
+ var presetContextKeys = Object.keys(presetContext);
1246
+ return presetContextKeys.every(function (contextKey) {
1247
+ return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
1248
+ });
1249
+ }
1250
+ /**
1251
+ * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
1252
+ */
1114
1253
 
1115
- var T = __webpack_require__(0);
1116
1254
 
1117
- var lodash_1 = __webpack_require__(3);
1255
+ function hasCompatibleOptions(vizOptions, presetOptions) {
1256
+ var presetOptionKeys = Object.keys(presetOptions);
1257
+ return presetOptionKeys.every(function (optionKey) {
1258
+ return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
1259
+ });
1260
+ }
1261
+ /**
1262
+ * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
1263
+ * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
1264
+ *
1265
+ * @param {Object} vizContext - the current vizContext definition
1266
+ * @param {Object} vizOptions - the current vizOptions definition
1267
+ * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
1268
+ */
1118
1269
 
1119
- var DataSource_1 = __webpack_require__(43);
1120
1270
 
1121
- exports.SortParamsPropTypes = T.shape({
1122
- currentSortKey: T.string,
1123
- currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1124
- onSort: T.func
1125
- });
1271
+ function getInitialPreset(vizContext, vizOptions, presets) {
1272
+ return presets.find(function (preset) {
1273
+ var presetContext = lodash_1.get(preset, ['value', 'context'], {});
1274
+ var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
1275
+ var presetContextKeys = Object.keys(presetContext);
1276
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
1277
+ // if not, then the preset is invalid in config.ts
1126
1278
 
1127
- var getSortingParams = function getSortingParams(_ref) {
1128
- var requestParams = _ref.requestParams,
1129
- onRequestParamsChange = _ref.onRequestParamsChange;
1130
- var currentSortKey;
1131
- var currentSortDir;
1132
- var nextSortDirMap = {
1133
- asc: 'desc',
1134
- desc: 'asc',
1135
- none: 'asc'
1136
- };
1137
- var onSort;
1279
+ if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
1280
+ return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
1281
+ });
1282
+ }
1138
1283
 
1139
- if (lodash_1.isFunction(onRequestParamsChange)) {
1140
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
1141
- currentSortKey = Object.keys(requestParams.sort).shift();
1142
- currentSortDir = requestParams.sort[currentSortKey];
1143
- } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1284
+ exports.getInitialPreset = getInitialPreset;
1285
+ /**
1286
+ * generates number precision values for a Select editor
1287
+ *
1288
+ * @param {Number} numPrecisionValues - number of integer precision values to generate
1289
+ * @returns {{ label: string; value; string }[]} array of { label, value } tuples
1290
+ */
1144
1291
 
1292
+ function generatePrecisionValues(numPrecisionValues) {
1293
+ return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
1294
+ return {
1295
+ label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
1296
+ value: i
1297
+ };
1298
+ });
1299
+ }
1145
1300
 
1146
- onSort = function onSort(e, _ref2) {
1147
- var sortKey = _ref2.sortKey,
1148
- sortDir = _ref2.sortDir;
1301
+ exports.generatePrecisionValues = generatePrecisionValues;
1302
+ /**
1303
+ * insert layout in layout array, return a new layout array instead of updating the original
1304
+ *
1305
+ * @param {EditorLayoutConfig[][]} layout - editor layout
1306
+ * @param {Number} index - the index to insert layout item(s)
1307
+ * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
1308
+ * @returns {EditorLayoutConfig[][]} new editor layout with insertion
1309
+ */
1149
1310
 
1150
- if (typeof sortKey === 'string') {
1151
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1152
- onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1153
- offset: 0,
1154
- sort: _defineProperty({}, sortKey, nextSortDir)
1155
- }));
1156
- } else {
1157
- onRequestParamsChange(requestParams);
1158
- }
1159
- };
1311
+ var insertLayout = function insertLayout(layout, index) {
1312
+ for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1313
+ layoutItems[_key - 2] = arguments[_key];
1160
1314
  }
1161
1315
 
1162
- return {
1163
- currentSortKey: currentSortKey,
1164
- currentSortDir: currentSortDir,
1165
- onSort: onSort
1166
- };
1316
+ return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
1167
1317
  };
1168
1318
 
1169
- exports.getSortingParams = getSortingParams;
1319
+ exports.insertLayout = insertLayout;
1170
1320
 
1171
1321
  /***/ }),
1172
1322
 
1173
- /***/ 33:
1174
- /***/ (function(module, exports, __webpack_require__) {
1323
+ /***/ 2:
1324
+ /***/ (function(module, exports) {
1325
+
1326
+ module.exports = require("@splunk/ui-utils/i18n");
1327
+
1328
+ /***/ }),
1329
+
1330
+ /***/ 20:
1331
+ /***/ (function(module, exports) {
1332
+
1333
+ module.exports = require("@splunk/visualization-context/FeatureFlagContext");
1334
+
1335
+ /***/ }),
1336
+
1337
+ /***/ 21:
1338
+ /***/ (function(module, exports) {
1339
+
1340
+ module.exports = require("@splunk/visualizations-shared/configUtils");
1341
+
1342
+ /***/ }),
1343
+
1344
+ /***/ 22:
1345
+ /***/ (function(module, exports) {
1346
+
1347
+ module.exports = require("@babel/runtime/helpers/createClass");
1348
+
1349
+ /***/ }),
1350
+
1351
+ /***/ 25:
1352
+ /***/ (function(module, exports) {
1353
+
1354
+ module.exports = require("@splunk/visualization-context/TimezoneContext");
1355
+
1356
+ /***/ }),
1357
+
1358
+ /***/ 26:
1359
+ /***/ (function(module, exports) {
1360
+
1361
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
1362
+
1363
+ /***/ }),
1364
+
1365
+ /***/ 27:
1366
+ /***/ (function(module, exports) {
1367
+
1368
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
1369
+
1370
+ /***/ }),
1371
+
1372
+ /***/ 29:
1373
+ /***/ (function(module, exports) {
1374
+
1375
+ module.exports = require("@splunk/visualization-encoding/Options");
1376
+
1377
+ /***/ }),
1378
+
1379
+ /***/ 3:
1380
+ /***/ (function(module, exports) {
1381
+
1382
+ module.exports = require("lodash");
1383
+
1384
+ /***/ }),
1385
+
1386
+ /***/ 30:
1387
+ /***/ (function(module, exports) {
1388
+
1389
+ module.exports = require("@splunk/visualizations-shared/numberUtils");
1390
+
1391
+ /***/ }),
1392
+
1393
+ /***/ 31:
1394
+ /***/ (function(module, exports, __webpack_require__) {
1395
+
1396
+ "use strict";
1397
+
1398
+
1399
+ Object.defineProperty(exports, "__esModule", {
1400
+ value: true
1401
+ });
1402
+ exports.shouldShowIconPlaceholder = void 0;
1403
+
1404
+ var React = __webpack_require__(0);
1405
+
1406
+ var T = __webpack_require__(1);
1407
+
1408
+ var lodash_1 = __webpack_require__(3);
1409
+
1410
+ var i18n_1 = __webpack_require__(2);
1411
+
1412
+ var Message_1 = __webpack_require__(9);
1413
+
1414
+ var FixedSizeContainer_1 = __webpack_require__(13);
1415
+ /**
1416
+ * @method shouldShowIconPlaceholder
1417
+ * @param {object} dataSources
1418
+ * @param {boolean} loading
1419
+ * @returns {boolean}
1420
+ */
1421
+
1422
+
1423
+ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
1424
+ var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1425
+ var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1426
+ var noData = data === undefined;
1427
+ var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1428
+ var noFields = fields === undefined;
1429
+ return loading || noData || noFields;
1430
+ };
1431
+
1432
+ exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
1433
+ var propTypes = {
1434
+ icon: T.func,
1435
+ width: T.oneOfType([T.string, T.number]),
1436
+ height: T.oneOfType([T.string, T.number]),
1437
+ // eslint-disable-next-line react/no-unused-prop-types
1438
+ backgroundColor: T.string,
1439
+ iconColor: T.string
1440
+ };
1441
+ /**
1442
+ * @method IconPlaceholder
1443
+ * @param {IconPlaceholderProps} props
1444
+ * @returns {React.ReactElement}
1445
+ */
1446
+
1447
+ var IconPlaceholder = function IconPlaceholder(props) {
1448
+ var width = props.width,
1449
+ height = props.height,
1450
+ icon = props.icon,
1451
+ iconColor = props.iconColor;
1452
+
1453
+ if (icon) {
1454
+ return React.createElement(icon, {
1455
+ style: {
1456
+ left: '50%',
1457
+ top: '50%',
1458
+ color: iconColor,
1459
+ opacity: 0.15,
1460
+ position: 'absolute',
1461
+ transform: 'translate(-50%, -50%)'
1462
+ },
1463
+ width: '50%',
1464
+ height: '50%'
1465
+ });
1466
+ }
1467
+
1468
+ return React.createElement(Message_1.default, {
1469
+ width: width,
1470
+ height: height,
1471
+ level: "warning",
1472
+ message: i18n_1._('No DataSource Connected')
1473
+ });
1474
+ };
1475
+
1476
+ IconPlaceholder.propTypes = propTypes;
1477
+ IconPlaceholder.defaultProps = {
1478
+ width: '100%',
1479
+ height: 250
1480
+ };
1481
+ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1482
+
1483
+ /***/ }),
1484
+
1485
+ /***/ 32:
1486
+ /***/ (function(module, exports) {
1487
+
1488
+ module.exports = require("@splunk/ui-utils/id");
1489
+
1490
+ /***/ }),
1491
+
1492
+ /***/ 33:
1493
+ /***/ (function(module, exports, __webpack_require__) {
1494
+
1495
+ "use strict";
1496
+
1497
+
1498
+ var _defineProperty = __webpack_require__(8);
1499
+
1500
+ Object.defineProperty(exports, "__esModule", {
1501
+ value: true
1502
+ });
1503
+ exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1504
+
1505
+ var T = __webpack_require__(1);
1506
+
1507
+ var lodash_1 = __webpack_require__(3);
1508
+
1509
+ var DataSource_1 = __webpack_require__(43);
1510
+
1511
+ exports.SortParamsPropTypes = T.shape({
1512
+ currentSortKey: T.string,
1513
+ currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1514
+ onSort: T.func
1515
+ });
1516
+
1517
+ var getSortingParams = function getSortingParams(_ref) {
1518
+ var requestParams = _ref.requestParams,
1519
+ onRequestParamsChange = _ref.onRequestParamsChange;
1520
+ var currentSortKey;
1521
+ var currentSortDir;
1522
+ var nextSortDirMap = {
1523
+ asc: 'desc',
1524
+ desc: 'asc',
1525
+ none: 'asc'
1526
+ };
1527
+ var onSort;
1528
+
1529
+ if (typeof onRequestParamsChange === 'function') {
1530
+ if (requestParams && lodash_1.has(requestParams, 'sort')) {
1531
+ currentSortKey = Object.keys(requestParams.sort).shift();
1532
+ currentSortDir = requestParams.sort[currentSortKey];
1533
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1534
+
1535
+
1536
+ onSort = function onSort(e, _ref2) {
1537
+ var sortKey = _ref2.sortKey,
1538
+ sortDir = _ref2.sortDir;
1539
+
1540
+ if (typeof sortKey === 'string') {
1541
+ var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1542
+ onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1543
+ offset: 0,
1544
+ sort: _defineProperty({}, sortKey, nextSortDir)
1545
+ }));
1546
+ } else {
1547
+ onRequestParamsChange(requestParams);
1548
+ }
1549
+ };
1550
+ }
1551
+
1552
+ return {
1553
+ currentSortKey: currentSortKey,
1554
+ currentSortDir: currentSortDir,
1555
+ onSort: onSort
1556
+ };
1557
+ };
1558
+
1559
+ exports.getSortingParams = getSortingParams;
1560
+
1561
+ /***/ }),
1562
+
1563
+ /***/ 34:
1564
+ /***/ (function(module, exports, __webpack_require__) {
1175
1565
 
1176
1566
  "use strict";
1177
1567
 
@@ -1181,7 +1571,7 @@ Object.defineProperty(exports, "__esModule", {
1181
1571
  });
1182
1572
  exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1183
1573
 
1184
- var T = __webpack_require__(0);
1574
+ var T = __webpack_require__(1);
1185
1575
 
1186
1576
  var lodash_1 = __webpack_require__(3);
1187
1577
 
@@ -1201,7 +1591,7 @@ var getPaginationParams = function getPaginationParams(_ref) {
1201
1591
  var count = requestParams && requestParams.count;
1202
1592
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1203
1593
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1204
- var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
1594
+ var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
1205
1595
 
1206
1596
  var onChangeHandler = function onChangeHandler(e, _ref2) {
1207
1597
  var page = _ref2.page,
@@ -1227,7 +1617,7 @@ var getPaginationParams = function getPaginationParams(_ref) {
1227
1617
  isPaging: isPaging,
1228
1618
  current: current,
1229
1619
  totalPages: totalPages,
1230
- onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
1620
+ onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
1231
1621
  };
1232
1622
  };
1233
1623
 
@@ -1235,7 +1625,7 @@ exports.getPaginationParams = getPaginationParams;
1235
1625
 
1236
1626
  /***/ }),
1237
1627
 
1238
- /***/ 34:
1628
+ /***/ 35:
1239
1629
  /***/ (function(module, exports, __webpack_require__) {
1240
1630
 
1241
1631
  "use strict";
@@ -1264,7 +1654,7 @@ var VizCategory;
1264
1654
 
1265
1655
  /***/ }),
1266
1656
 
1267
- /***/ 35:
1657
+ /***/ 36:
1268
1658
  /***/ (function(module, exports, __webpack_require__) {
1269
1659
 
1270
1660
  "use strict";
@@ -1276,39 +1666,39 @@ Object.defineProperty(exports, "__esModule", {
1276
1666
  value: true
1277
1667
  });
1278
1668
 
1279
- var React = __webpack_require__(1);
1669
+ var React = __webpack_require__(0);
1280
1670
 
1281
1671
  var lodash_1 = __webpack_require__(3);
1282
1672
 
1283
- var getSettingsFromThemedProps_1 = __webpack_require__(36);
1673
+ var getSettingsFromThemedProps_1 = __webpack_require__(37);
1284
1674
 
1285
- var Options_1 = __webpack_require__(37);
1675
+ var Options_1 = __webpack_require__(29);
1286
1676
 
1287
1677
  var SanitizeProps_1 = __webpack_require__(38);
1288
1678
 
1289
- var TimezoneContext_1 = __webpack_require__(24);
1679
+ var TimezoneContext_1 = __webpack_require__(25);
1290
1680
 
1291
1681
  var moment_1 = __webpack_require__(39);
1292
1682
 
1293
- var FeatureFlagContext_1 = __webpack_require__(26);
1683
+ var FeatureFlagContext_1 = __webpack_require__(20);
1294
1684
 
1295
1685
  var styled_components_1 = __webpack_require__(4);
1296
1686
 
1297
- var hocUtils_1 = __webpack_require__(27);
1687
+ var hocUtils_1 = __webpack_require__(26);
1298
1688
 
1299
- var JSONSchemaUtils_1 = __webpack_require__(28);
1689
+ var JSONSchemaUtils_1 = __webpack_require__(27);
1300
1690
 
1301
1691
  var async_dynamic_options_evaluator_1 = __webpack_require__(40);
1302
1692
 
1303
- var id_1 = __webpack_require__(31);
1693
+ var id_1 = __webpack_require__(32);
1304
1694
 
1305
1695
  var SplunkVisualization_1 = __webpack_require__(41);
1306
1696
 
1307
1697
  var VizBehavior_1 = __webpack_require__(6);
1308
1698
 
1309
- var getSorting_1 = __webpack_require__(32);
1699
+ var getSorting_1 = __webpack_require__(33);
1310
1700
 
1311
- var getPagination_1 = __webpack_require__(33);
1701
+ var getPagination_1 = __webpack_require__(34);
1312
1702
 
1313
1703
  var useDeepMemo_1 = __webpack_require__(44);
1314
1704
 
@@ -1337,6 +1727,8 @@ var withDashboardViz = function withDashboardViz(opts) {
1337
1727
  var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1338
1728
 
1339
1729
  var DashboardViz = function DashboardViz(props) {
1730
+ var _a;
1731
+
1340
1732
  var mode = props.mode,
1341
1733
  hasEventHandlers = props.hasEventHandlers,
1342
1734
  dataSources = props.dataSources,
@@ -1396,7 +1788,7 @@ var withDashboardViz = function withDashboardViz(opts) {
1396
1788
  _React$useState4 = _slicedToArray(_React$useState3, 1),
1397
1789
  visualizationID = _React$useState4[0];
1398
1790
 
1399
- var _React$useState5 = React.useState(Boolean(featureFlagContext && featureFlagContext['visualizations.useWebWorkersForDSL'] && typeof Worker !== 'undefined')),
1791
+ var _React$useState5 = React.useState(Boolean(featureFlagContext && featureFlagContext.visualizations_useWebWorkersForDSL && typeof Worker !== 'undefined')),
1400
1792
  _React$useState6 = _slicedToArray(_React$useState5, 2),
1401
1793
  useAsyncEvaluatedOptions = _React$useState6[0],
1402
1794
  setUseAsyncEvaluatedOptions = _React$useState6[1];
@@ -1436,11 +1828,21 @@ var withDashboardViz = function withDashboardViz(opts) {
1436
1828
 
1437
1829
  return {};
1438
1830
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
1439
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // useEffect hook needs to be initialized before any early returns
1831
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
1832
+ // 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
1833
+ // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
1834
+
1835
+ var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
1836
+ var clonedEvaluatedOptions = lodash_1.cloneDeep(evaluatedOptionsToUse);
1837
+
1838
+ 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) {
1839
+ clonedEvaluatedOptions.backgroundColor = clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor;
1840
+ } // useEffect hook needs to be initialized before any early returns
1440
1841
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1441
1842
 
1843
+
1442
1844
  React.useEffect(function () {
1443
- onComputedProps(evaluatedOptionsToUse);
1845
+ onComputedProps(clonedEvaluatedOptions);
1444
1846
  });
1445
1847
  React.useEffect(function () {
1446
1848
  return function () {
@@ -1455,15 +1857,16 @@ var withDashboardViz = function withDashboardViz(opts) {
1455
1857
  supports = vizConfig.supports;
1456
1858
  var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
1457
1859
 
1458
- if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
1459
- return React.createElement(MissingPropsMessage_1.default, {
1460
- "data-test": "missing-props-message",
1461
- width: width,
1462
- height: height,
1463
- missingProps: missing,
1464
- backgroundColor: bgColorFromTheme
1465
- });
1466
- } // events
1860
+ 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
1861
+ ) {
1862
+ return React.createElement(MissingPropsMessage_1.default, {
1863
+ "data-test": "missing-props-message",
1864
+ width: width,
1865
+ height: height,
1866
+ missingProps: missing,
1867
+ backgroundColor: bgColorFromTheme
1868
+ });
1869
+ } // events
1467
1870
 
1468
1871
 
1469
1872
  var eventCallbackProps = {};
@@ -1567,17 +1970,10 @@ exports.default = withDashboardViz;
1567
1970
 
1568
1971
  /***/ }),
1569
1972
 
1570
- /***/ 36:
1571
- /***/ (function(module, exports) {
1572
-
1573
- module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1574
-
1575
- /***/ }),
1576
-
1577
1973
  /***/ 37:
1578
1974
  /***/ (function(module, exports) {
1579
1975
 
1580
- module.exports = require("@splunk/visualization-encoding/Options");
1976
+ module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1581
1977
 
1582
1978
  /***/ }),
1583
1979
 
@@ -1623,7 +2019,7 @@ Object.defineProperty(exports, "__esModule", {
1623
2019
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1624
2020
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1625
2021
 
1626
- var T = __webpack_require__(0);
2022
+ var T = __webpack_require__(1);
1627
2023
 
1628
2024
  var lodash_1 = __webpack_require__(3);
1629
2025
 
@@ -1769,7 +2165,7 @@ exports.default = SplunkVisualization;
1769
2165
 
1770
2166
  var _classCallCheck = __webpack_require__(11);
1771
2167
 
1772
- var _createClass = __webpack_require__(20);
2168
+ var _createClass = __webpack_require__(22);
1773
2169
 
1774
2170
  Object.defineProperty(exports, "__esModule", {
1775
2171
  value: true
@@ -1824,7 +2220,7 @@ Object.defineProperty(exports, "__esModule", {
1824
2220
  });
1825
2221
  exports.useDeepMemo = void 0;
1826
2222
 
1827
- var react_1 = __webpack_require__(1);
2223
+ var react_1 = __webpack_require__(0);
1828
2224
 
1829
2225
  var lodash_1 = __webpack_require__(3);
1830
2226
  /**
@@ -1859,14 +2255,95 @@ exports.useDeepMemo = useDeepMemo;
1859
2255
 
1860
2256
  /***/ }),
1861
2257
 
1862
- /***/ 446:
2258
+ /***/ 45:
1863
2259
  /***/ (function(module, exports, __webpack_require__) {
1864
2260
 
1865
2261
  "use strict";
1866
2262
 
1867
2263
 
1868
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1869
- if (k2 === undefined) k2 = k;
2264
+ Object.defineProperty(exports, "__esModule", {
2265
+ value: true
2266
+ });
2267
+ exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
2268
+
2269
+ var React = __webpack_require__(0);
2270
+
2271
+ var T = __webpack_require__(1);
2272
+
2273
+ var i18n_1 = __webpack_require__(2);
2274
+
2275
+ var Message_1 = __webpack_require__(9);
2276
+
2277
+ var FixedSizeContainer_1 = __webpack_require__(13);
2278
+ /**
2279
+ * @method isMissing
2280
+ * @param {any} v
2281
+ * @returns {boolean} true if the input value === null or undefined
2282
+ */
2283
+
2284
+
2285
+ var isMissing = function isMissing(v) {
2286
+ return v === null || v === undefined;
2287
+ };
2288
+
2289
+ exports.isMissing = isMissing;
2290
+ /**
2291
+ * @method misskingKeys
2292
+ * @param {string[]} keys
2293
+ * @param {object} target
2294
+ * @returns {string[]} the keys of missing required props
2295
+ */
2296
+
2297
+ var missingKeys = function missingKeys(keys, target) {
2298
+ return keys.filter(function (k) {
2299
+ return exports.isMissing(target[k]);
2300
+ });
2301
+ };
2302
+
2303
+ exports.missingKeys = missingKeys;
2304
+ var propTypes = {
2305
+ width: T.oneOfType([T.string, T.number]),
2306
+ height: T.oneOfType([T.string, T.number]),
2307
+ // eslint-disable-next-line react/no-unused-prop-types
2308
+ backgroundColor: T.string,
2309
+ missingProps: T.arrayOf(T.string)
2310
+ };
2311
+ /**
2312
+ * @method MissingPropsMessage
2313
+ * @param {MissingPropsProps} props
2314
+ * @returns {React.ReactElement}
2315
+ */
2316
+
2317
+ var MissingPropsMessage = function MissingPropsMessage(props) {
2318
+ var width = props.width,
2319
+ height = props.height,
2320
+ missingProps = props.missingProps;
2321
+ return React.createElement(Message_1.default, {
2322
+ "data-test": "message",
2323
+ width: width,
2324
+ height: height,
2325
+ message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
2326
+ });
2327
+ };
2328
+
2329
+ exports.MissingPropsMessage = MissingPropsMessage;
2330
+ exports.MissingPropsMessage.propTypes = propTypes;
2331
+ exports.MissingPropsMessage.defaultProps = {
2332
+ width: '100%',
2333
+ height: 250
2334
+ };
2335
+ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
2336
+
2337
+ /***/ }),
2338
+
2339
+ /***/ 453:
2340
+ /***/ (function(module, exports, __webpack_require__) {
2341
+
2342
+ "use strict";
2343
+
2344
+
2345
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
2346
+ if (k2 === undefined) k2 = k;
1870
2347
  Object.defineProperty(o, k2, {
1871
2348
  enumerable: true,
1872
2349
  get: function get() {
@@ -1889,9 +2366,9 @@ Object.defineProperty(exports, "__esModule", {
1889
2366
  });
1890
2367
  exports.default = void 0;
1891
2368
 
1892
- __exportStar(__webpack_require__(155), exports);
2369
+ __exportStar(__webpack_require__(162), exports);
1893
2370
 
1894
- var Sankey_1 = __webpack_require__(155);
2371
+ var Sankey_1 = __webpack_require__(162);
1895
2372
 
1896
2373
  Object.defineProperty(exports, "default", {
1897
2374
  enumerable: true,
@@ -1902,17 +2379,17 @@ Object.defineProperty(exports, "default", {
1902
2379
 
1903
2380
  /***/ }),
1904
2381
 
1905
- /***/ 447:
2382
+ /***/ 454:
1906
2383
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1907
2384
 
1908
2385
  "use strict";
1909
2386
  __webpack_require__.r(__webpack_exports__);
1910
2387
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d3_sankey", function() { return d3_sankey; });
1911
- /* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(129);
2388
+ /* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(137);
1912
2389
  /* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3_interpolate__WEBPACK_IMPORTED_MODULE_0__);
1913
- /* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58);
2390
+ /* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61);
1914
2391
  /* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3_array__WEBPACK_IMPORTED_MODULE_1__);
1915
- /* harmony import */ var d3_collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(130);
2392
+ /* harmony import */ var d3_collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(138);
1916
2393
  /* harmony import */ var d3_collection__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(d3_collection__WEBPACK_IMPORTED_MODULE_2__);
1917
2394
  // reference link :- https://github.com/csaladenes/sankey
1918
2395
 
@@ -2469,7 +2946,7 @@ var d3_sankey = function d3_sankey() {
2469
2946
 
2470
2947
  /***/ }),
2471
2948
 
2472
- /***/ 448:
2949
+ /***/ 455:
2473
2950
  /***/ (function(module, exports, __webpack_require__) {
2474
2951
 
2475
2952
  "use strict";
@@ -2479,17 +2956,17 @@ Object.defineProperty(exports, "__esModule", {
2479
2956
  value: true
2480
2957
  });
2481
2958
 
2482
- var React = __webpack_require__(1);
2959
+ var React = __webpack_require__(0);
2483
2960
 
2484
- var T = __webpack_require__(0);
2961
+ var T = __webpack_require__(1);
2485
2962
 
2486
2963
  var styled_components_1 = __webpack_require__(4);
2487
2964
 
2488
- var react_1 = __webpack_require__(1);
2965
+ var react_1 = __webpack_require__(0);
2489
2966
 
2490
- var PureSankey_1 = __webpack_require__(99);
2967
+ var PureSankey_1 = __webpack_require__(106);
2491
2968
 
2492
- var SankeyUtils_1 = __webpack_require__(124);
2969
+ var SankeyUtils_1 = __webpack_require__(132);
2493
2970
 
2494
2971
  var MAX_NODE_TEXT_WIDTH = 150;
2495
2972
 
@@ -2590,7 +3067,7 @@ exports.default = SankeyNode;
2590
3067
 
2591
3068
  /***/ }),
2592
3069
 
2593
- /***/ 449:
3070
+ /***/ 456:
2594
3071
  /***/ (function(module, exports, __webpack_require__) {
2595
3072
 
2596
3073
  "use strict";
@@ -2600,13 +3077,13 @@ Object.defineProperty(exports, "__esModule", {
2600
3077
  value: true
2601
3078
  });
2602
3079
 
2603
- var React = __webpack_require__(1);
3080
+ var React = __webpack_require__(0);
2604
3081
 
2605
- var T = __webpack_require__(0);
3082
+ var T = __webpack_require__(1);
2606
3083
 
2607
- var PureSankey_1 = __webpack_require__(99);
3084
+ var PureSankey_1 = __webpack_require__(106);
2608
3085
 
2609
- var SankeyUtils_1 = __webpack_require__(124);
3086
+ var SankeyUtils_1 = __webpack_require__(132);
2610
3087
 
2611
3088
  var getLinkFill = function getLinkFill(link, colorCategoryMapping, colorMode) {
2612
3089
  if (colorMode === 'categorical') {
@@ -2699,88 +3176,7 @@ exports.default = SankeyLink;
2699
3176
 
2700
3177
  /***/ }),
2701
3178
 
2702
- /***/ 45:
2703
- /***/ (function(module, exports, __webpack_require__) {
2704
-
2705
- "use strict";
2706
-
2707
-
2708
- Object.defineProperty(exports, "__esModule", {
2709
- value: true
2710
- });
2711
- exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
2712
-
2713
- var React = __webpack_require__(1);
2714
-
2715
- var T = __webpack_require__(0);
2716
-
2717
- var i18n_1 = __webpack_require__(2);
2718
-
2719
- var Message_1 = __webpack_require__(10);
2720
-
2721
- var FixedSizeContainer_1 = __webpack_require__(13);
2722
- /**
2723
- * @method isMissing
2724
- * @param {any} v
2725
- * @returns {boolean} true if the input value === null or undefined
2726
- */
2727
-
2728
-
2729
- var isMissing = function isMissing(v) {
2730
- return v === null || v === undefined;
2731
- };
2732
-
2733
- exports.isMissing = isMissing;
2734
- /**
2735
- * @method misskingKeys
2736
- * @param {string[]} keys
2737
- * @param {object} target
2738
- * @returns {string[]} the keys of missing required props
2739
- */
2740
-
2741
- var missingKeys = function missingKeys(keys, target) {
2742
- return keys.filter(function (k) {
2743
- return exports.isMissing(target[k]);
2744
- });
2745
- };
2746
-
2747
- exports.missingKeys = missingKeys;
2748
- var propTypes = {
2749
- width: T.oneOfType([T.string, T.number]),
2750
- height: T.oneOfType([T.string, T.number]),
2751
- // eslint-disable-next-line react/no-unused-prop-types
2752
- backgroundColor: T.string,
2753
- missingProps: T.arrayOf(T.string)
2754
- };
2755
- /**
2756
- * @method MissingPropsMessage
2757
- * @param {MissingPropsProps} props
2758
- * @returns {React.ReactElement}
2759
- */
2760
-
2761
- var MissingPropsMessage = function MissingPropsMessage(props) {
2762
- var width = props.width,
2763
- height = props.height,
2764
- missingProps = props.missingProps;
2765
- return React.createElement(Message_1.default, {
2766
- "data-test": "message",
2767
- width: width,
2768
- height: height,
2769
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
2770
- });
2771
- };
2772
-
2773
- exports.MissingPropsMessage = MissingPropsMessage;
2774
- exports.MissingPropsMessage.propTypes = propTypes;
2775
- exports.MissingPropsMessage.defaultProps = {
2776
- width: '100%',
2777
- height: 250
2778
- };
2779
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
2780
-
2781
- /***/ }),
2782
-
2783
- /***/ 450:
3179
+ /***/ 457:
2784
3180
  /***/ (function(module, exports, __webpack_require__) {
2785
3181
 
2786
3182
  "use strict";
@@ -2790,17 +3186,17 @@ Object.defineProperty(exports, "__esModule", {
2790
3186
  value: true
2791
3187
  });
2792
3188
 
2793
- var React = __webpack_require__(1);
3189
+ var React = __webpack_require__(0);
2794
3190
 
2795
- var T = __webpack_require__(0);
3191
+ var T = __webpack_require__(1);
2796
3192
 
2797
- var Popover_1 = __webpack_require__(84);
3193
+ var Popover_1 = __webpack_require__(89);
2798
3194
 
2799
3195
  var styled_components_1 = __webpack_require__(4);
2800
3196
 
2801
- var numberUtils_1 = __webpack_require__(29);
3197
+ var numberUtils_1 = __webpack_require__(30);
2802
3198
 
2803
- var PureSankey_1 = __webpack_require__(99);
3199
+ var PureSankey_1 = __webpack_require__(106);
2804
3200
 
2805
3201
  var DEFAULT_PLACEMENT = 'below';
2806
3202
  var StyledTooltipContainer = styled_components_1.default.div.withConfig({
@@ -3051,7 +3447,7 @@ exports.default = SankeyTooltip;
3051
3447
 
3052
3448
  /***/ }),
3053
3449
 
3054
- /***/ 451:
3450
+ /***/ 458:
3055
3451
  /***/ (function(module, exports, __webpack_require__) {
3056
3452
 
3057
3453
  "use strict";
@@ -3069,19 +3465,19 @@ var visualization_color_palettes_1 = __webpack_require__(50);
3069
3465
 
3070
3466
  var schemaUtils_1 = __webpack_require__(16);
3071
3467
 
3072
- var PresetPalettes_1 = __webpack_require__(57);
3468
+ var PresetPalettes_1 = __webpack_require__(60);
3073
3469
 
3074
- var themes_1 = __webpack_require__(72);
3470
+ var themes_1 = __webpack_require__(59);
3075
3471
 
3076
3472
  var i18n_1 = __webpack_require__(2);
3077
3473
 
3078
3474
  var VizBehavior_1 = __webpack_require__(6);
3079
3475
 
3080
- var VizCategory_1 = __webpack_require__(34);
3476
+ var VizCategory_1 = __webpack_require__(35);
3081
3477
 
3082
- var configUtils_1 = __webpack_require__(18);
3478
+ var configUtils_1 = __webpack_require__(19);
3083
3479
 
3084
- var DynamicLinkColorsEditor_1 = __webpack_require__(452);
3480
+ var DynamicLinkColorsEditor_1 = __webpack_require__(459);
3085
3481
 
3086
3482
  var BackgroundColor_1 = __webpack_require__(53);
3087
3483
 
@@ -3295,7 +3691,7 @@ exports.default = configUtils_1.enhanceConfig(config);
3295
3691
 
3296
3692
  /***/ }),
3297
3693
 
3298
- /***/ 452:
3694
+ /***/ 459:
3299
3695
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3300
3696
 
3301
3697
  "use strict";
@@ -3303,7 +3699,7 @@ __webpack_require__.r(__webpack_exports__);
3303
3699
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicLinkColorsEditor", function() { return getDynamicLinkColorsEditor; });
3304
3700
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
3305
3701
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
3306
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
3702
+ /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
3307
3703
  /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
3308
3704
 
3309
3705
 
@@ -3311,7 +3707,7 @@ var getDynamicLinkColorsEditor = function getDynamicLinkColorsEditor(_ref) {
3311
3707
  var defaultContext = _ref.defaultContext,
3312
3708
  defaultPalettesConfig = _ref.defaultPalettesConfig;
3313
3709
  return {
3314
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic link'),
3710
+ label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Link'),
3315
3711
  option: 'linkColors',
3316
3712
  context: 'linkColorRangeConfig',
3317
3713
  editor: 'editor.dynamicColor',
@@ -3320,7 +3716,7 @@ var getDynamicLinkColorsEditor = function getDynamicLinkColorsEditor(_ref) {
3320
3716
  return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.linkColors);
3321
3717
  },
3322
3718
  editorProps: {
3323
- labelPosition: 'left',
3719
+ labelPosition: 'top',
3324
3720
  flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: link'),
3325
3721
  formatters: [{
3326
3722
  label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
@@ -3356,18 +3752,18 @@ Object.defineProperty(exports, "__esModule", {
3356
3752
  value: true
3357
3753
  });
3358
3754
 
3359
- var React = __webpack_require__(1);
3755
+ var React = __webpack_require__(0);
3360
3756
 
3361
3757
  var styled_components_1 = __webpack_require__(4);
3362
3758
 
3363
- var hocUtils_1 = __webpack_require__(14);
3759
+ var hocUtils_1 = __webpack_require__(15);
3364
3760
 
3365
3761
  var Cover = styled_components_1.default.div.withConfig({
3366
3762
  displayName: "withEditModeCover__Cover",
3367
3763
  componentId: "sc-1gsbnxb-0"
3368
3764
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
3369
3765
  var Blocker = styled_components_1.default.div.attrs({
3370
- 'data-splunk-visualization-version': "25.6.0 - f5eb3abf9"
3766
+ 'data-splunk-visualization-version': "25.7.1 - 6a77c5530"
3371
3767
  }).withConfig({
3372
3768
  displayName: "withEditModeCover__Blocker",
3373
3769
  componentId: "sc-1gsbnxb-1"
@@ -3409,17 +3805,17 @@ Object.defineProperty(exports, "__esModule", {
3409
3805
  value: true
3410
3806
  });
3411
3807
 
3412
- var React = __webpack_require__(1);
3808
+ var React = __webpack_require__(0);
3413
3809
 
3414
3810
  var colorUtils_1 = __webpack_require__(12);
3415
3811
 
3416
- var variables_1 = __webpack_require__(9);
3812
+ var variables_1 = __webpack_require__(10);
3417
3813
 
3418
- var IconPlaceholder_1 = __webpack_require__(30);
3814
+ var IconPlaceholder_1 = __webpack_require__(31);
3419
3815
 
3420
3816
  var VizBehavior_1 = __webpack_require__(6);
3421
3817
 
3422
- var hocUtils_1 = __webpack_require__(14);
3818
+ var hocUtils_1 = __webpack_require__(15);
3423
3819
 
3424
3820
  var withPlaceholder = function withPlaceholder(Visualization) {
3425
3821
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
@@ -3516,17 +3912,10 @@ exports.default = background;
3516
3912
 
3517
3913
  /***/ }),
3518
3914
 
3519
- /***/ 57:
3520
- /***/ (function(module, exports) {
3521
-
3522
- module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
3523
-
3524
- /***/ }),
3525
-
3526
- /***/ 58:
3915
+ /***/ 59:
3527
3916
  /***/ (function(module, exports) {
3528
3917
 
3529
- module.exports = require("d3-array");
3918
+ module.exports = require("@splunk/themes");
3530
3919
 
3531
3920
  /***/ }),
3532
3921
 
@@ -3564,11 +3953,26 @@ var VizBehavior;
3564
3953
 
3565
3954
  VizBehavior["PLACEHOLDER"] = "placeholder";
3566
3955
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
3956
+ VizBehavior["TRELLIS"] = "trellis";
3567
3957
  })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
3568
3958
 
3569
3959
  /***/ }),
3570
3960
 
3571
- /***/ 66:
3961
+ /***/ 60:
3962
+ /***/ (function(module, exports) {
3963
+
3964
+ module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
3965
+
3966
+ /***/ }),
3967
+
3968
+ /***/ 61:
3969
+ /***/ (function(module, exports) {
3970
+
3971
+ module.exports = require("d3-array");
3972
+
3973
+ /***/ }),
3974
+
3975
+ /***/ 68:
3572
3976
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3573
3977
 
3574
3978
  "use strict";
@@ -3595,446 +3999,56 @@ VizStyleWrapper.displayName = 'VizStyleWrapper';
3595
3999
  /***/ 7:
3596
4000
  /***/ (function(module, exports) {
3597
4001
 
3598
- module.exports = require("@babel/runtime/helpers/defineProperty");
3599
-
3600
- /***/ }),
3601
-
3602
- /***/ 72:
3603
- /***/ (function(module, exports) {
3604
-
3605
- module.exports = require("@splunk/themes");
4002
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
3606
4003
 
3607
4004
  /***/ }),
3608
4005
 
3609
4006
  /***/ 8:
3610
4007
  /***/ (function(module, exports) {
3611
4008
 
3612
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
4009
+ module.exports = require("@babel/runtime/helpers/defineProperty");
3613
4010
 
3614
4011
  /***/ }),
3615
4012
 
3616
- /***/ 83:
4013
+ /***/ 86:
3617
4014
  /***/ (function(module, exports) {
3618
4015
 
3619
4016
  module.exports = require("d3-scale");
3620
4017
 
3621
4018
  /***/ }),
3622
4019
 
3623
- /***/ 84:
4020
+ /***/ 88:
3624
4021
  /***/ (function(module, exports) {
3625
4022
 
3626
- module.exports = require("@splunk/react-ui/Popover");
4023
+ module.exports = require("@babel/runtime/helpers/typeof");
3627
4024
 
3628
4025
  /***/ }),
3629
4026
 
3630
- /***/ 85:
4027
+ /***/ 89:
3631
4028
  /***/ (function(module, exports) {
3632
4029
 
3633
- module.exports = require("@splunk/visualization-encoding/utils/types");
4030
+ module.exports = require("@splunk/react-ui/Popover");
3634
4031
 
3635
4032
  /***/ }),
3636
4033
 
3637
- /***/ 86:
4034
+ /***/ 9:
3638
4035
  /***/ (function(module, exports) {
3639
4036
 
3640
- module.exports = require("@splunk/visualizations-shared/dataSourceUtils");
4037
+ module.exports = require("@splunk/visualizations-shared/Message");
3641
4038
 
3642
4039
  /***/ }),
3643
4040
 
3644
- /***/ 87:
4041
+ /***/ 90:
3645
4042
  /***/ (function(module, exports) {
3646
4043
 
3647
- module.exports = require("@babel/runtime/helpers/typeof");
4044
+ module.exports = require("@splunk/visualization-encoding/utils/types");
3648
4045
 
3649
4046
  /***/ }),
3650
4047
 
3651
- /***/ 9:
4048
+ /***/ 91:
3652
4049
  /***/ (function(module, exports) {
3653
4050
 
3654
- module.exports = require("@splunk/themes/variables");
3655
-
3656
- /***/ }),
3657
-
3658
- /***/ 99:
3659
- /***/ (function(module, exports, __webpack_require__) {
3660
-
3661
- "use strict";
3662
-
3663
-
3664
- var _toConsumableArray = __webpack_require__(8);
3665
-
3666
- var _slicedToArray = __webpack_require__(17);
3667
-
3668
- Object.defineProperty(exports, "__esModule", {
3669
- value: true
3670
- });
3671
- 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;
3672
-
3673
- var React = __webpack_require__(1);
3674
-
3675
- var react_1 = __webpack_require__(1);
3676
-
3677
- var T = __webpack_require__(0);
3678
-
3679
- var lodash_1 = __webpack_require__(3);
3680
-
3681
- var styled_components_1 = __webpack_require__(4);
3682
-
3683
- var Message_1 = __webpack_require__(10);
3684
-
3685
- var i18n_1 = __webpack_require__(2);
3686
-
3687
- var SizeAwareWrapper_1 = __webpack_require__(21);
3688
-
3689
- var style_1 = __webpack_require__(15);
3690
-
3691
- var visualization_color_palettes_1 = __webpack_require__(50); // eslint-disable-next-line camelcase
3692
-
3693
-
3694
- var sankey_1 = __webpack_require__(447);
3695
-
3696
- var VizStyleWrapper_1 = __webpack_require__(66);
3697
-
3698
- var SankeyUtils_1 = __webpack_require__(124);
3699
-
3700
- var SankeyNode_1 = __webpack_require__(448);
3701
-
3702
- var SankeyLink_1 = __webpack_require__(449);
3703
-
3704
- var SankeyTooltip_1 = __webpack_require__(450);
3705
-
3706
- exports.DEFAULT_COLORS = {
3707
- backgroundColor: '#ffffff',
3708
- nodeTextColor: '#2c2c2c',
3709
- tooltip: {
3710
- headerColor: 'rgba(0, 0, 0, 0.54)',
3711
- linkHeaderColor: '#2c2c2c',
3712
- rowColor: '#2c2c2c'
3713
- }
3714
- };
3715
- exports.NODE_TEXT_FONT_SIZE = 10;
3716
- exports.DEFAULT_FONT_FAMILY = '"Splunk Platform Sans", "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans-serif';
3717
- exports.DEFAULT_NODE_COLOR = '#909090';
3718
- exports.DEFAULT_LINK_COLOR = '#909090';
3719
- exports.DEFAULT_SERIES_COLOR = visualization_color_palettes_1.VIZ_CATEGORICAL;
3720
- exports.DEFAULT_LINK_OPACITY = 0.5;
3721
- exports.DEFAULT_NODE_OPACITY = 1;
3722
- exports.INACTIVE_OPACITY = 0.05;
3723
- exports.CHART_MIN_WIDTH = 300;
3724
- exports.CHART_MIN_HEIGHT = 200;
3725
- exports.DEFAULT_CHART_WIDTH = 600;
3726
- exports.DEFAULT_CHART_HEIGHT = 300;
3727
- exports.DEFAULT_SOURCE_INDEX = 0;
3728
- exports.DEFAULT_TARGET_INDEX = 1;
3729
- exports.DEFAULT_LINK_VALUE_INDEX = 2;
3730
- var SankeyContainer = styled_components_1.default.div.withConfig({
3731
- displayName: "PureSankey__SankeyContainer",
3732
- componentId: "sc-1r333qx-0"
3733
- })(["overflow:hidden;", ";"], function (props) {
3734
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
3735
- });
3736
-
3737
- var PureSankey = function PureSankey(props) {
3738
- var width = props.width,
3739
- height = props.height,
3740
- columns = props.columns,
3741
- colorMode = props.colorMode,
3742
- nodeWidth = props.nodeWidth,
3743
- nodePadding = props.nodePadding,
3744
- resultLimit = props.resultLimit,
3745
- seriesColors = props.seriesColors,
3746
- linkColors = props.linkColors,
3747
- linkOpacity = props.linkOpacity,
3748
- linkValueField = props.linkValueField,
3749
- backgroundColor = props.backgroundColor,
3750
- nodeTextColor = props.nodeTextColor,
3751
- tooltipRowColor = props.tooltipRowColor,
3752
- tooltipLinkHeaderColor = props.tooltipLinkHeaderColor,
3753
- tooltipHeaderColor = props.tooltipHeaderColor;
3754
- var margin = {
3755
- top: 17,
3756
- right: 25,
3757
- bottom: 17,
3758
- left: 30
3759
- }; // This is to translate the svg's root g based on margin
3760
- // The y position is same as margin top & bottom
3761
- // The x position is an avg of margin right & left
3762
-
3763
- var translatePos = {
3764
- x: 28,
3765
- y: 17
3766
- };
3767
-
3768
- var _react_1$useState = react_1.useState([]),
3769
- _react_1$useState2 = _slicedToArray(_react_1$useState, 2),
3770
- activeLinks = _react_1$useState2[0],
3771
- setActiveLinks = _react_1$useState2[1];
3772
-
3773
- var _react_1$useState3 = react_1.useState([]),
3774
- _react_1$useState4 = _slicedToArray(_react_1$useState3, 2),
3775
- activeNodes = _react_1$useState4[0],
3776
- setActiveNodes = _react_1$useState4[1];
3777
-
3778
- var _react_1$useState5 = react_1.useState(null),
3779
- _react_1$useState6 = _slicedToArray(_react_1$useState5, 2),
3780
- nodeHovered = _react_1$useState6[0],
3781
- setNodeHovered = _react_1$useState6[1];
3782
-
3783
- var _react_1$useState7 = react_1.useState(null),
3784
- _react_1$useState8 = _slicedToArray(_react_1$useState7, 2),
3785
- hoveredNodeElement = _react_1$useState8[0],
3786
- setHoveredNodeElement = _react_1$useState8[1];
3787
-
3788
- var _react_1$useState9 = react_1.useState(false),
3789
- _react_1$useState10 = _slicedToArray(_react_1$useState9, 2),
3790
- openNodeToolTip = _react_1$useState10[0],
3791
- setOpenNodeToolTip = _react_1$useState10[1];
3792
-
3793
- var _react_1$useState11 = react_1.useState(null),
3794
- _react_1$useState12 = _slicedToArray(_react_1$useState11, 2),
3795
- hoveredLinkElement = _react_1$useState12[0],
3796
- setHoveredLinkElement = _react_1$useState12[1];
3797
-
3798
- var _react_1$useState13 = react_1.useState(false),
3799
- _react_1$useState14 = _slicedToArray(_react_1$useState13, 2),
3800
- openLinkToolTip = _react_1$useState14[0],
3801
- setOpenLinkToolTip = _react_1$useState14[1];
3802
-
3803
- var sankeyContainerElement = react_1.useRef(null);
3804
-
3805
- var _react_1$useState15 = react_1.useState(exports.DEFAULT_CHART_WIDTH - margin.left - margin.right),
3806
- _react_1$useState16 = _slicedToArray(_react_1$useState15, 2),
3807
- sankeyWidth = _react_1$useState16[0],
3808
- setSankeyWidth = _react_1$useState16[1];
3809
-
3810
- var _react_1$useState17 = react_1.useState(exports.DEFAULT_CHART_HEIGHT - margin.top - margin.bottom),
3811
- _react_1$useState18 = _slicedToArray(_react_1$useState17, 2),
3812
- sankeyHeight = _react_1$useState18[0],
3813
- setSankeyHeight = _react_1$useState18[1];
3814
-
3815
- react_1.useEffect(function () {
3816
- if (sankeyContainerElement && sankeyContainerElement.current) {
3817
- var w = sankeyContainerElement.current.getBoundingClientRect().width;
3818
- var h = sankeyContainerElement.current.getBoundingClientRect().height;
3819
- var sWidth = SankeyUtils_1.checkDigitsOnly(width) ? parseInt(width, 10) : w;
3820
- var sHeight = SankeyUtils_1.checkDigitsOnly(height) ? parseInt(height, 10) : h;
3821
- setSankeyWidth(sWidth - margin.left - margin.right);
3822
- setSankeyHeight(sHeight - margin.top - margin.bottom);
3823
- }
3824
- }, [width, height]);
3825
- var sankeyData = SankeyUtils_1.convertInputToSankeyDataFormat(columns, exports.DEFAULT_SOURCE_INDEX, exports.DEFAULT_TARGET_INDEX, exports.DEFAULT_LINK_VALUE_INDEX, resultLimit);
3826
-
3827
- if (!sankeyData || !columns || !Array.isArray(columns) || columns.length < 3) {
3828
- return React.createElement(Message_1.default, {
3829
- width: width,
3830
- height: height,
3831
- message: i18n_1._('Invalid data to render'),
3832
- level: "info"
3833
- });
3834
- }
3835
-
3836
- var sortAndAssignLinkIds = function sortAndAssignLinkIds(links) {
3837
- links.sort(function (a, b) {
3838
- return a.dy - b.dy;
3839
- });
3840
- links.forEach(function (link) {
3841
- // eslint-disable-next-line no-param-reassign
3842
- link.id = "link-".concat(link.source.index, "-").concat(link.target.index);
3843
- });
3844
- };
3845
-
3846
- var d3sankey = sankey_1.d3_sankey().nodeWidth(nodeWidth).nodePadding(nodePadding).size([sankeyWidth, sankeyHeight]);
3847
- var path = d3sankey.reversibleLink();
3848
- d3sankey.nodes(sankeyData.nodes).links(sankeyData.links).layout(500);
3849
- sortAndAssignLinkIds(sankeyData.links);
3850
- var nodeConnectionsMap = SankeyUtils_1.computeAllConnectedLinksToNodes(sankeyData.nodes, sankeyData.links);
3851
- var uniqCategory = SankeyUtils_1.getAllNodeNames(sankeyData);
3852
- var colorCategoryMapping = SankeyUtils_1.getColorCategoryMapping({
3853
- category: uniqCategory,
3854
- colorMode: colorMode,
3855
- seriesColors: seriesColors,
3856
- linkColors: linkColors
3857
- });
3858
-
3859
- var resetStates = function resetStates() {
3860
- setActiveLinks([]);
3861
- setActiveNodes([]);
3862
- setHoveredLinkElement(null);
3863
- setHoveredNodeElement(null);
3864
- setNodeHovered(null);
3865
- setOpenLinkToolTip(false);
3866
- setOpenNodeToolTip(false);
3867
- };
3868
-
3869
- var renderVisualization = function renderVisualization(_ref) {
3870
- var containerWidth = _ref.width,
3871
- containerHeight = _ref.height;
3872
-
3873
- if (containerWidth < exports.CHART_MIN_WIDTH || containerHeight < exports.CHART_MIN_HEIGHT) {
3874
- return React.createElement(Message_1.default, {
3875
- width: containerWidth,
3876
- height: containerHeight,
3877
- message: i18n_1._('Too small to render content'),
3878
- level: "info"
3879
- });
3880
- }
3881
-
3882
- var renderLinks = function renderLinks(links) {
3883
- return links.map(function (link) {
3884
- return React.createElement(SankeyLink_1.default, {
3885
- link: link,
3886
- activeLinks: activeLinks,
3887
- linkOpacity: linkOpacity,
3888
- path: path,
3889
- key: SankeyUtils_1.getLinkId(link),
3890
- "data-test": SankeyUtils_1.getLinkId(link),
3891
- colorCategoryMapping: colorCategoryMapping,
3892
- colorMode: colorMode,
3893
- handleMouseOver: function handleMouseOver(ev) {
3894
- setActiveLinks([link]);
3895
- setActiveNodes([link.source, link.target]);
3896
- setHoveredLinkElement(ev.currentTarget.querySelector('circle'));
3897
- setOpenNodeToolTip(false);
3898
- setOpenLinkToolTip(true);
3899
- },
3900
- handleMouseLeave: function handleMouseLeave() {
3901
- resetStates();
3902
- }
3903
- });
3904
- });
3905
- };
3906
-
3907
- var renderNodes = function renderNodes(nodes) {
3908
- var chartWidth = typeof width === 'number' ? width : Number.parseInt(width, 10);
3909
- return nodes.map(function (node) {
3910
- return React.createElement(SankeyNode_1.default, {
3911
- node: node,
3912
- key: SankeyUtils_1.getNodeId(node),
3913
- "data-test": SankeyUtils_1.getNodeId(node),
3914
- activeNodes: activeNodes,
3915
- nodeWidth: nodeWidth,
3916
- chartWidth: chartWidth,
3917
- colorCategoryMapping: colorCategoryMapping,
3918
- nodeTextColor: nodeTextColor,
3919
- handleMouseOver: function handleMouseOver(ev) {
3920
- var connections = nodeConnectionsMap[node.index];
3921
- setActiveLinks(connections.links);
3922
- setNodeHovered(node);
3923
- setActiveNodes([].concat(_toConsumableArray(connections.sourceNodes), _toConsumableArray(connections.targetNodes)));
3924
- setHoveredNodeElement(ev.currentTarget);
3925
- setOpenLinkToolTip(false);
3926
- setOpenNodeToolTip(true);
3927
- },
3928
- handleMouseLeave: function handleMouseLeave() {
3929
- return resetStates();
3930
- }
3931
- });
3932
- });
3933
- };
3934
-
3935
- return React.createElement(VizStyleWrapper_1.default, {
3936
- backgroundColor: backgroundColor,
3937
- dataTestKey: "SankeyWrapper",
3938
- onMouseLeave: function onMouseLeave() {
3939
- return resetStates();
3940
- }
3941
- }, React.createElement("svg", {
3942
- height: "100%",
3943
- width: "100%",
3944
- "data-test": "sankey-svg"
3945
- }, React.createElement("g", {
3946
- transform: "translate(".concat(translatePos.x, ",").concat(translatePos.y, ")")
3947
- }, React.createElement("g", {
3948
- className: "link-group",
3949
- "data-test": "link-group"
3950
- }, renderLinks(sankeyData.links), openLinkToolTip && React.createElement(SankeyTooltip_1.default, {
3951
- mode: "link",
3952
- open: openLinkToolTip,
3953
- handleTooltipRequestClose: function handleTooltipRequestClose() {
3954
- return resetStates();
3955
- },
3956
- linkValue: linkValueField,
3957
- connectionsMap: nodeConnectionsMap,
3958
- anchor: hoveredLinkElement,
3959
- link: activeLinks[0],
3960
- height: sankeyHeight,
3961
- width: sankeyWidth,
3962
- colorCategoryMapping: colorCategoryMapping,
3963
- tooltipRowColor: tooltipRowColor,
3964
- tooltipLinkHeaderColor: tooltipLinkHeaderColor,
3965
- tooltipHeaderColor: tooltipHeaderColor
3966
- })), React.createElement("g", {
3967
- className: "node-group",
3968
- "data-test": "node-group"
3969
- }, renderNodes(sankeyData.nodes), openNodeToolTip && React.createElement(SankeyTooltip_1.default, {
3970
- mode: "node",
3971
- open: openNodeToolTip,
3972
- handleTooltipRequestClose: function handleTooltipRequestClose() {
3973
- return resetStates();
3974
- },
3975
- linkValue: linkValueField,
3976
- connectionsMap: nodeConnectionsMap,
3977
- anchor: hoveredNodeElement,
3978
- node: nodeHovered,
3979
- height: sankeyHeight,
3980
- width: sankeyWidth,
3981
- colorCategoryMapping: colorCategoryMapping,
3982
- tooltipRowColor: tooltipRowColor,
3983
- tooltipLinkHeaderColor: tooltipLinkHeaderColor,
3984
- tooltipHeaderColor: tooltipHeaderColor
3985
- })))));
3986
- };
3987
-
3988
- return React.createElement(SankeyContainer, {
3989
- height: height,
3990
- width: width,
3991
- ref: sankeyContainerElement
3992
- }, React.createElement(SizeAwareWrapper_1.default, null, function (containerDimension) {
3993
- return renderVisualization(containerDimension);
3994
- }));
3995
- };
3996
-
3997
- PureSankey.propTypes = {
3998
- columns: T.array,
3999
- width: T.oneOfType([T.string, T.number]),
4000
- height: T.oneOfType([T.string, T.number]),
4001
- // need this to satisfy props interface
4002
- // eslint-disable-next-line react/no-unused-prop-types
4003
- mode: T.string,
4004
- colorMode: T.string,
4005
- nodeWidth: T.number,
4006
- nodePadding: T.number,
4007
- resultLimit: T.number,
4008
- seriesColors: T.arrayOf(T.string),
4009
- linkColors: T.arrayOf(T.string),
4010
- linkOpacity: T.number,
4011
- linkValueField: T.string,
4012
- backgroundColor: T.string,
4013
- nodeTextColor: T.string,
4014
- tooltipRowColor: T.string,
4015
- tooltipLinkHeaderColor: T.string,
4016
- tooltipHeaderColor: T.string
4017
- };
4018
- PureSankey.defaultProps = {
4019
- columns: [],
4020
- width: exports.DEFAULT_CHART_WIDTH,
4021
- height: exports.DEFAULT_CHART_HEIGHT,
4022
- mode: 'view',
4023
- colorMode: 'categorical',
4024
- nodeWidth: 12,
4025
- nodePadding: 18,
4026
- resultLimit: 1000,
4027
- seriesColors: exports.DEFAULT_SERIES_COLOR,
4028
- linkColors: [],
4029
- linkOpacity: exports.DEFAULT_LINK_OPACITY,
4030
- linkValueField: 'value',
4031
- backgroundColor: '#0b0c0e',
4032
- nodeTextColor: 'rgba(255, 255, 255, 0.98)',
4033
- tooltipRowColor: 'rgba(255, 255, 255, 0.98)',
4034
- tooltipLinkHeaderColor: 'rgba(255, 255, 255, 0.98)',
4035
- tooltipHeaderColor: 'rgba(255, 255, 255, 0.5)'
4036
- };
4037
- exports.default = PureSankey;
4051
+ module.exports = require("@splunk/visualizations-shared/dataSourceUtils");
4038
4052
 
4039
4053
  /***/ })
4040
4054