@splunk/visualizations 25.5.0 → 25.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_TimeControlsPopover_Dark.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_TimeControlsPopover_DarkPrisma.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_TimeControlsPopover_Light.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Bar_Bar_Legend_Mode_Series_Compare.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Column_Column_Legend_Mode_Series_Compare.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Background_Color_Light_Blue.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Basic_Events.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Event_Actions.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Actions.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary_Simulated_Instance.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Value_Highlighting.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Height.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Percentage_50.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_Pagination.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_background_color.png +0 -0
- 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
- 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
- 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
- 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
- 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
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_layout_options.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_makeresults_name_age.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_makeresults_name_age_aggregations.png +0 -0
- 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
- 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
- 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
- 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
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_table.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_table_aggregations.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Basic_Single_Value_Icon_Trellis_timechart_cmd_count_aggregations.png +0 -0
- 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
- 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
- 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
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_Chart.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_Chart_Count.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_Pagination.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_Timechart.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_background_color.png +0 -0
- 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
- 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
- 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
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_layout_options.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_makeresults_name_age.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_makeresults_name_age_aggregations.png +0 -0
- 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
- 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
- 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
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_table.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_table_aggregations.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Basic_Single_Value_Radial_Trellis_timechart_cmd_count_aggregations.png +0 -0
- 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
- 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
- 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
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_Pagination.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_assign_default_trellisSplitBy_value_status.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_background_color.png +0 -0
- 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
- 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
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_count_by_status.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_count_by_status_user.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_count_by_status_user_aggregations.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_count_by_status_user_user.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_chart_cmd_max_count_avg_count_aggregations.png +0 -0
- 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
- 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
- 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
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_layout_options.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_makeresults_name_age.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_makeresults_name_age_aggregations.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_stats_cmd_avg_count_max_count_aggregations.png +0 -0
- 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
- 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
- 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
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_stats_cmd_count_by_status_user.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_stats_cmd_count_by_status_user_aggregations.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_table.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_table_aggregations.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_timechart_cmd_count_aggregations.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_timechart_cmd_count_by_status.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Basic_Single_Value_Trellis_timechart_cmd_count_by_status_aggregations.png +0 -0
- 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
- 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
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Major_value_data_null_show_N_A.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_The_Background_Color_Based_On_The_Major_Value_Trellis.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Height_Percentage.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Height_Percentage_100_no_paginator.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Height_Percentage_50_no_paginator.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline_Custom.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline_Width.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparklines_Adv.png +0 -0
- package/Area.config.js +12 -7
- package/Area.config.js.map +1 -1
- package/Area.js +330 -226
- package/Area.js.map +1 -1
- package/Bar.config.js +36 -8
- package/Bar.config.js.map +1 -1
- package/Bar.js +354 -227
- package/Bar.js.map +1 -1
- package/Bubble.config.js +7 -2
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +318 -214
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +12 -8
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +324 -229
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +36 -8
- package/Column.config.js.map +1 -1
- package/Column.js +354 -227
- package/Column.js.map +1 -1
- package/Ellipse.config.js +23 -20
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +289 -187
- package/Ellipse.js.map +1 -1
- package/Events.config.js +82 -19
- package/Events.config.js.map +1 -1
- package/Events.js +1276 -416
- package/Events.js.map +1 -1
- package/FEATUREFLAGS.md +40 -0
- package/FillerGauge.config.js +22 -19
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +311 -204
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +3 -3
- package/Image.config.js.map +1 -1
- package/Image.js +249 -151
- package/Image.js.map +1 -1
- package/LICENSE.md +444 -8
- package/Line.config.js +12 -7
- package/Line.config.js.map +1 -1
- package/Line.js +335 -226
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +9 -15
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +881 -790
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +51 -48
- package/Map.config.js.map +1 -1
- package/Map.js +804 -711
- package/Map.js.map +1 -1
- package/Markdown.config.js +10 -9
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +365 -266
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +71 -70
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +422 -330
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +3 -3
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +532 -430
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +30 -6
- package/Pie.config.js.map +1 -1
- package/Pie.js +553 -431
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +3 -2
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +556 -464
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +22 -23
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +383 -286
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +14 -13
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +3126 -3034
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +552 -580
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +410 -311
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +242 -52
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +1605 -414
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +41 -30
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +267 -58
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +1622 -410
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +249 -41
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +1517 -283
- package/SingleValueRadial.js.map +1 -1
- package/TRELLIS.md +296 -0
- package/Table.config.js +39 -41
- package/Table.config.js.map +1 -1
- package/Table.js +435 -311
- package/Table.js.map +1 -1
- package/common/EventsDoc.js +12 -6
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +2 -2
- package/common/GaugeValueMarker.js +2 -2
- package/common/OptionsDoc.js +14 -14
- package/common/OptionsDoc.js.map +1 -1
- package/common/ThemesDoc.js +10 -10
- package/common/ThemesDoc.js.map +1 -1
- package/common/docUtils.js +1 -1
- package/common/docUtils.js.map +1 -1
- package/common/utils/configUtils.js +26 -20
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +2 -2
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +2 -2
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +115 -0
- package/common/utils/layoutUtils.js.map +1 -0
- package/common/utils/mapUtils.js +1166 -23
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +54 -46
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +14 -14
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +612 -0
- package/common/utils/trellisUtils.js.map +1 -0
- package/common/withDashboardViz.js +148 -54
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +14 -12
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright © 2018 Splunk Inc.
|
|
3
|
+
* SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
4
|
+
* in part without a valid written license from Splunk Inc. is PROHIBITED.
|
|
5
|
+
*/
|
|
6
|
+
module.exports =
|
|
7
|
+
/******/ (function(modules) { // webpackBootstrap
|
|
8
|
+
/******/ // The module cache
|
|
9
|
+
/******/ var installedModules = {};
|
|
10
|
+
/******/
|
|
11
|
+
/******/ // The require function
|
|
12
|
+
/******/ function __webpack_require__(moduleId) {
|
|
13
|
+
/******/
|
|
14
|
+
/******/ // Check if module is in cache
|
|
15
|
+
/******/ if(installedModules[moduleId]) {
|
|
16
|
+
/******/ return installedModules[moduleId].exports;
|
|
17
|
+
/******/ }
|
|
18
|
+
/******/ // Create a new module (and put it into the cache)
|
|
19
|
+
/******/ var module = installedModules[moduleId] = {
|
|
20
|
+
/******/ i: moduleId,
|
|
21
|
+
/******/ l: false,
|
|
22
|
+
/******/ exports: {}
|
|
23
|
+
/******/ };
|
|
24
|
+
/******/
|
|
25
|
+
/******/ // Execute the module function
|
|
26
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
27
|
+
/******/
|
|
28
|
+
/******/ // Flag the module as loaded
|
|
29
|
+
/******/ module.l = true;
|
|
30
|
+
/******/
|
|
31
|
+
/******/ // Return the exports of the module
|
|
32
|
+
/******/ return module.exports;
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/
|
|
35
|
+
/******/
|
|
36
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
37
|
+
/******/ __webpack_require__.m = modules;
|
|
38
|
+
/******/
|
|
39
|
+
/******/ // expose the module cache
|
|
40
|
+
/******/ __webpack_require__.c = installedModules;
|
|
41
|
+
/******/
|
|
42
|
+
/******/ // define getter function for harmony exports
|
|
43
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
44
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
45
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
46
|
+
/******/ }
|
|
47
|
+
/******/ };
|
|
48
|
+
/******/
|
|
49
|
+
/******/ // define __esModule on exports
|
|
50
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
51
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
52
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
53
|
+
/******/ }
|
|
54
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
55
|
+
/******/ };
|
|
56
|
+
/******/
|
|
57
|
+
/******/ // create a fake namespace object
|
|
58
|
+
/******/ // mode & 1: value is a module id, require it
|
|
59
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
60
|
+
/******/ // mode & 4: return value when already ns object
|
|
61
|
+
/******/ // mode & 8|1: behave like require
|
|
62
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
63
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
64
|
+
/******/ if(mode & 8) return value;
|
|
65
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
66
|
+
/******/ var ns = Object.create(null);
|
|
67
|
+
/******/ __webpack_require__.r(ns);
|
|
68
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
69
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
70
|
+
/******/ return ns;
|
|
71
|
+
/******/ };
|
|
72
|
+
/******/
|
|
73
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
74
|
+
/******/ __webpack_require__.n = function(module) {
|
|
75
|
+
/******/ var getter = module && module.__esModule ?
|
|
76
|
+
/******/ function getDefault() { return module['default']; } :
|
|
77
|
+
/******/ function getModuleExports() { return module; };
|
|
78
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
79
|
+
/******/ return getter;
|
|
80
|
+
/******/ };
|
|
81
|
+
/******/
|
|
82
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
83
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
84
|
+
/******/
|
|
85
|
+
/******/ // __webpack_public_path__
|
|
86
|
+
/******/ __webpack_require__.p = "";
|
|
87
|
+
/******/
|
|
88
|
+
/******/
|
|
89
|
+
/******/ // Load entry module and return exports
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 36);
|
|
91
|
+
/******/ })
|
|
92
|
+
/************************************************************************/
|
|
93
|
+
/******/ ({
|
|
94
|
+
|
|
95
|
+
/***/ 0:
|
|
96
|
+
/***/ (function(module, exports) {
|
|
97
|
+
|
|
98
|
+
module.exports = require("lodash");
|
|
99
|
+
|
|
100
|
+
/***/ }),
|
|
101
|
+
|
|
102
|
+
/***/ 2:
|
|
103
|
+
/***/ (function(module, exports) {
|
|
104
|
+
|
|
105
|
+
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
106
|
+
|
|
107
|
+
/***/ }),
|
|
108
|
+
|
|
109
|
+
/***/ 36:
|
|
110
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
111
|
+
|
|
112
|
+
"use strict";
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
var _toConsumableArray = __webpack_require__(2);
|
|
116
|
+
|
|
117
|
+
Object.defineProperty(exports, "__esModule", {
|
|
118
|
+
value: true
|
|
119
|
+
});
|
|
120
|
+
exports.getTrellisDataSourcesBySplitMode = exports.dataSourcesSplitByModeStatsorUnknown = exports.dataSourcesSplitByModeChart = exports.dataSourcesSplitByModeTimechart = exports.dataSourcesSplitByAggregationsStats = exports.dataSourcesSplitByAggregationsTimechartAndChart = exports.dataSourcesSplitByAggregationsUnknown = exports.AGGREGATIONS = void 0;
|
|
121
|
+
|
|
122
|
+
var lodash_1 = __webpack_require__(0);
|
|
123
|
+
|
|
124
|
+
var trellisUtils_1 = __webpack_require__(37);
|
|
125
|
+
|
|
126
|
+
exports.AGGREGATIONS = 'aggregations';
|
|
127
|
+
/**
|
|
128
|
+
* There can be certain SPL cmds that can produce dataSource without a specific field meta info (like group_by_rank, split_by_field etc),
|
|
129
|
+
* to categorize it,
|
|
130
|
+
* Example1:- `index = "_internal" | chart count`
|
|
131
|
+
* Example2:- `index=_internal | chart avg(count), max(count)`
|
|
132
|
+
* Example3:- `index = "_internal" | stats count`
|
|
133
|
+
* Example4:- `index=_internal | stats avg(count), max(count)`
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
var dataSourcesSplitByAggregationsUnknown = function dataSourcesSplitByAggregationsUnknown(dataSource) {
|
|
137
|
+
var _a, _b, _c, _d;
|
|
138
|
+
|
|
139
|
+
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
140
|
+
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
141
|
+
var splitDataSources = null;
|
|
142
|
+
var errorCode = null;
|
|
143
|
+
|
|
144
|
+
if (fields && fields.length) {
|
|
145
|
+
splitDataSources = {};
|
|
146
|
+
|
|
147
|
+
for (var i = 0; i < fields.length; i += 1) {
|
|
148
|
+
var fieldName = fields[i].name;
|
|
149
|
+
|
|
150
|
+
if (!(fieldName === null || fieldName === void 0 ? void 0 : fieldName.startsWith('_'))) {
|
|
151
|
+
splitDataSources[fieldName] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
152
|
+
splitDataSources[fieldName].primary.data.fields = [fields[i]];
|
|
153
|
+
splitDataSources[fieldName].primary.data.columns = [columns[i]];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
splitDataSources: splitDataSources,
|
|
162
|
+
errorCode: errorCode
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
exports.dataSourcesSplitByAggregationsUnknown = dataSourcesSplitByAggregationsUnknown;
|
|
167
|
+
|
|
168
|
+
var dataSourcesSplitByAggregationsTimechartAndChart = function dataSourcesSplitByAggregationsTimechartAndChart(dataSource) {
|
|
169
|
+
var _a, _b, _c, _d;
|
|
170
|
+
|
|
171
|
+
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
172
|
+
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
173
|
+
var splitDataSources = null;
|
|
174
|
+
var splitByFields = [];
|
|
175
|
+
var errorCode = null;
|
|
176
|
+
|
|
177
|
+
if (typeof fields[0] !== 'string') {
|
|
178
|
+
splitByFields = trellisUtils_1.extractDataSourceAggregationKeysChart(fields);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (splitByFields && splitByFields.length > 0) {
|
|
182
|
+
splitDataSources = {};
|
|
183
|
+
splitByFields.forEach(function (splitByField) {
|
|
184
|
+
splitDataSources[splitByField] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
185
|
+
splitDataSources[splitByField].primary.data.fields = [fields[0]];
|
|
186
|
+
splitDataSources[splitByField].primary.data.columns = [columns[0]];
|
|
187
|
+
fields.forEach(function (field, idx) {
|
|
188
|
+
var fieldName = field === null || field === void 0 ? void 0 : field.name;
|
|
189
|
+
|
|
190
|
+
if (fieldName !== '_time' && !(fieldName === null || fieldName === void 0 ? void 0 : fieldName.startsWith('_')) && field.data_source === splitByField) {
|
|
191
|
+
splitDataSources[splitByField].primary.data.fields.push(field);
|
|
192
|
+
splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
} else if ((!splitByFields || !splitByFields.length) && fields.length > 1) {
|
|
197
|
+
// handle where data_source doesnot exist in fields
|
|
198
|
+
// example1 :- index=_internal | timechart count
|
|
199
|
+
// example2 :- index=_internal | timechart max(count) avg(count)
|
|
200
|
+
splitDataSources = {};
|
|
201
|
+
|
|
202
|
+
for (var i = 1; i < fields.length; i += 1) {
|
|
203
|
+
var fieldName = fields[i].name;
|
|
204
|
+
|
|
205
|
+
if (!(fieldName === null || fieldName === void 0 ? void 0 : fieldName.startsWith('_'))) {
|
|
206
|
+
splitDataSources[fieldName] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
207
|
+
splitDataSources[fieldName].primary.data.fields = [fields[0], fields[i]];
|
|
208
|
+
splitDataSources[fieldName].primary.data.columns = [columns[0], columns[i]];
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return {
|
|
216
|
+
splitDataSources: splitDataSources,
|
|
217
|
+
errorCode: errorCode
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
exports.dataSourcesSplitByAggregationsTimechartAndChart = dataSourcesSplitByAggregationsTimechartAndChart;
|
|
222
|
+
|
|
223
|
+
var dataSourcesSplitByAggregationsStats = function dataSourcesSplitByAggregationsStats(dataSource) {
|
|
224
|
+
var _a, _b, _c, _d;
|
|
225
|
+
|
|
226
|
+
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
227
|
+
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
228
|
+
var splitDataSources = null;
|
|
229
|
+
var splitByFields = [];
|
|
230
|
+
var errorCode = null;
|
|
231
|
+
|
|
232
|
+
if (typeof fields[0] !== 'string') {
|
|
233
|
+
splitByFields = trellisUtils_1.extractDataSourceAggregationKeysStats(fields);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (splitByFields && splitByFields.length > 0) {
|
|
237
|
+
splitDataSources = {};
|
|
238
|
+
splitByFields.forEach(function (splitByField) {
|
|
239
|
+
splitDataSources[splitByField] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
240
|
+
splitDataSources[splitByField].primary.data.fields = [fields[0]];
|
|
241
|
+
splitDataSources[splitByField].primary.data.columns = [columns[0]];
|
|
242
|
+
var idx = fields.findIndex(function (field) {
|
|
243
|
+
return field.name === splitByField;
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
if (idx > 0) {
|
|
247
|
+
splitDataSources[splitByField].primary.data.fields.push(fields[idx]);
|
|
248
|
+
splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
} else {
|
|
252
|
+
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return {
|
|
256
|
+
splitDataSources: splitDataSources,
|
|
257
|
+
errorCode: errorCode
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
exports.dataSourcesSplitByAggregationsStats = dataSourcesSplitByAggregationsStats;
|
|
262
|
+
|
|
263
|
+
var dataSourcesSplitByModeTimechart = function dataSourcesSplitByModeTimechart(dataSource, splitBy) {
|
|
264
|
+
var _a, _b, _c, _d, _e;
|
|
265
|
+
|
|
266
|
+
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
267
|
+
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
268
|
+
var splitDataSources = null;
|
|
269
|
+
var splitByFields = [];
|
|
270
|
+
var errorCode = null;
|
|
271
|
+
|
|
272
|
+
if (typeof fields[0] !== 'string') {
|
|
273
|
+
splitByFields = trellisUtils_1.extractSplitByFieldsChartFields(fields);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
277
|
+
splitDataSources = {};
|
|
278
|
+
var dataSourceKeys = trellisUtils_1.extractDataSourceAggregationKeysChart(fields);
|
|
279
|
+
var valueKeys = [];
|
|
280
|
+
|
|
281
|
+
for (var i = 1; i < fields.length; i += 1) {
|
|
282
|
+
// not including internal fields
|
|
283
|
+
if (!((_e = fields[i].name) === null || _e === void 0 ? void 0 : _e.startsWith('_'))) {
|
|
284
|
+
valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
valueKeys.forEach(function (val) {
|
|
289
|
+
splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
290
|
+
splitDataSources[val].primary.data.fields = [{
|
|
291
|
+
name: fields[0].name
|
|
292
|
+
}].concat(_toConsumableArray(dataSourceKeys.map(function (k) {
|
|
293
|
+
return {
|
|
294
|
+
name: k
|
|
295
|
+
};
|
|
296
|
+
})));
|
|
297
|
+
splitDataSources[val].primary.data.columns = [_toConsumableArray(columns[0])];
|
|
298
|
+
dataSourceKeys.forEach(function (dsKey) {
|
|
299
|
+
fields.forEach(function (field, idx) {
|
|
300
|
+
if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
|
|
301
|
+
splitDataSources[val].primary.data.columns.push(_toConsumableArray(columns[idx]));
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
} else {
|
|
307
|
+
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return {
|
|
311
|
+
splitDataSources: splitDataSources,
|
|
312
|
+
errorCode: errorCode
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
exports.dataSourcesSplitByModeTimechart = dataSourcesSplitByModeTimechart;
|
|
317
|
+
|
|
318
|
+
var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSource, splitBy) {
|
|
319
|
+
var _a, _b, _c, _d;
|
|
320
|
+
|
|
321
|
+
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
322
|
+
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
323
|
+
var splitDataSources = null;
|
|
324
|
+
var splitByFields = [];
|
|
325
|
+
var errorCode = null;
|
|
326
|
+
|
|
327
|
+
if (typeof fields[0] !== 'string') {
|
|
328
|
+
splitByFields = trellisUtils_1.extractSplitByFieldsChartFields(fields);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
332
|
+
splitDataSources = {};
|
|
333
|
+
var splitByFieldIdx = splitByFields.findIndex(function (f) {
|
|
334
|
+
return f === splitBy;
|
|
335
|
+
});
|
|
336
|
+
var otherSplitBy = splitByFields.filter(function (f) {
|
|
337
|
+
return f !== splitBy;
|
|
338
|
+
});
|
|
339
|
+
var dataSourceKeys = trellisUtils_1.extractDataSourceAggregationKeysChart(fields);
|
|
340
|
+
var nonDataSourceAggregations = [];
|
|
341
|
+
|
|
342
|
+
if (!dataSourceKeys.length && fields[0].groupby_rank === '0' && fields.length && !fields[1].groupby_rank) {
|
|
343
|
+
/* check for another aggregation scenario where no key 'data_source' will be returned (applies for both chart and stats cmd)
|
|
344
|
+
For example :-
|
|
345
|
+
index=_internal | chart count by status
|
|
346
|
+
index = "_internal" | chart max(count) avg(count) by status
|
|
347
|
+
index = "_internal" | stats max(count) avg(count) by status
|
|
348
|
+
where field meta info is in this format -
|
|
349
|
+
"fields": [
|
|
350
|
+
{
|
|
351
|
+
"name": "status",
|
|
352
|
+
"groupby_rank": "0"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"name": "max(count)"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"name": "avg(count)"
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
*/
|
|
362
|
+
for (var i = 1; i < fields.length; i += 1) {
|
|
363
|
+
nonDataSourceAggregations.push(fields[i].name);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
if (splitByFieldIdx === 0) {
|
|
368
|
+
// if splitBy is the first field, split row wise
|
|
369
|
+
var valueKeys = lodash_1.cloneDeep(columns[0]);
|
|
370
|
+
valueKeys.forEach(function (val, idx) {
|
|
371
|
+
splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
372
|
+
splitDataSources[val].primary.data.fields = [];
|
|
373
|
+
|
|
374
|
+
if (otherSplitBy.length) {
|
|
375
|
+
splitDataSources[val].primary.data.fields = [{
|
|
376
|
+
name: otherSplitBy[0]
|
|
377
|
+
}]; // there can only be one otherSplitBy for chart cmd
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
if (dataSourceKeys.length) {
|
|
381
|
+
(function () {
|
|
382
|
+
var columnValues = [[]];
|
|
383
|
+
splitDataSources[val].primary.data.fields = [].concat(_toConsumableArray(splitDataSources[val].primary.data.fields), _toConsumableArray(dataSourceKeys.map(function (k) {
|
|
384
|
+
return {
|
|
385
|
+
name: k
|
|
386
|
+
};
|
|
387
|
+
})));
|
|
388
|
+
dataSourceKeys.forEach(function () {
|
|
389
|
+
columnValues.push([]);
|
|
390
|
+
});
|
|
391
|
+
/**
|
|
392
|
+
* There can be chart SPL cmd where there are multiple data_source keys in the field meta info.
|
|
393
|
+
* For eg - index = "_internal" | chart avg(count) max(count) by status , user) can result in fields and columns as below where "data_source" keys are "avg(count)" and "max(count)"
|
|
394
|
+
* 'fields' : [
|
|
395
|
+
{
|
|
396
|
+
"name": "status",
|
|
397
|
+
"groupby_rank": "0"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"name": "avg(count): userA",
|
|
401
|
+
"data_source": "avg(count)",
|
|
402
|
+
"splitby_field": "user",
|
|
403
|
+
"splitby_value": "userA"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "avg(count): userB",
|
|
407
|
+
"data_source": "avg(count)",
|
|
408
|
+
"splitby_field": "user",
|
|
409
|
+
"splitby_value": "userB"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "avg(count): userC",
|
|
413
|
+
"data_source": "avg(count)",
|
|
414
|
+
"splitby_field": "user",
|
|
415
|
+
"splitby_value": "userC"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"name": "max(count): userA",
|
|
419
|
+
"data_source": "max(count)",
|
|
420
|
+
"splitby_field": "user",
|
|
421
|
+
"splitby_value": "userA"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"name": "max(count): userB",
|
|
425
|
+
"data_source": "max(count)",
|
|
426
|
+
"splitby_field": "user",
|
|
427
|
+
"splitby_value": "userB"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"name": "max(count): userC",
|
|
431
|
+
"data_source": "max(count)",
|
|
432
|
+
"splitby_field": "user",
|
|
433
|
+
"splitby_value": "userC"
|
|
434
|
+
},
|
|
435
|
+
]
|
|
436
|
+
'columns' : [['200','303','304','400'], ['1','2','3','4'], ['10','20','30','40'], ['100','200','300','400'], ['5','6','7','8'], ['50','60','70','80'],['500','600','700','800']]
|
|
437
|
+
In this case when we split row wise, the data_source keys for userA appears in indices [1, 4, ..], the data_source keys for userB appears in indices [2, 5, ..]
|
|
438
|
+
The resulting dataSplit for status '200', will have the fields => ['user','avg(count)', 'max(count)'] columns => [['userA', 'userB', 'userC'],['1','10','100'], ['5', '50', '500'] ]
|
|
439
|
+
For the example above for..loop below will iterate from i= 1 to 3 (Math.ceil((fields.length - 1) / dataSourceKeys.length)). Exclude i = 0 as first column is the splitBy input.
|
|
440
|
+
Since there are 2 data_source keys 'avg(count)' and 'max(count)', dataSourceKeys.forEach loop will collect individual arrays specific to the columnValues[indx] as below.
|
|
441
|
+
columnValues[0] = ['userA', 'userB', 'userC']
|
|
442
|
+
columnValues[1] = ['1','10','100']
|
|
443
|
+
columnValues[2] = ['5', '50', '500']
|
|
444
|
+
*/
|
|
445
|
+
|
|
446
|
+
var _loop = function _loop(_i) {
|
|
447
|
+
columnValues[0].push(fields[_i].splitby_value ? fields[_i].splitby_value : fields[_i].name);
|
|
448
|
+
dataSourceKeys.forEach(function (dskey, dsIndx) {
|
|
449
|
+
var mul = (fields.length - 1) / dataSourceKeys.length; // This line does the index calculation
|
|
450
|
+
|
|
451
|
+
columnValues[dsIndx + 1].push(columns[_i + dsIndx * mul][idx]);
|
|
452
|
+
});
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
for (var _i = 1; _i <= Math.ceil((fields.length - 1) / dataSourceKeys.length); _i += 1) {
|
|
456
|
+
_loop(_i);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
splitDataSources[val].primary.data.columns = columnValues;
|
|
460
|
+
})();
|
|
461
|
+
} else if (nonDataSourceAggregations.length) {
|
|
462
|
+
// There can be SPL where data_source field metainfo is not available and needs special handling
|
|
463
|
+
// For eg :-
|
|
464
|
+
// index=_internal | chart count by status
|
|
465
|
+
// index = "_internal" | chart max(count) avg(count) by status
|
|
466
|
+
// index = "_internal" | stats max(count) avg(count) by status
|
|
467
|
+
var columnValues = [];
|
|
468
|
+
fields.forEach(function (aggregationField, fieldIdx) {
|
|
469
|
+
if (fieldIdx > 0) {
|
|
470
|
+
splitDataSources[val].primary.data.fields.push(aggregationField);
|
|
471
|
+
columnValues.push([columns[fieldIdx][idx]]);
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
splitDataSources[val].primary.data.columns = columnValues;
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
} else {
|
|
478
|
+
// split column wise
|
|
479
|
+
var _valueKeys = [];
|
|
480
|
+
|
|
481
|
+
for (var _i2 = 1; _i2 < fields.length; _i2 += 1) {
|
|
482
|
+
_valueKeys.push(fields[_i2].splitby_value ? fields[_i2].splitby_value : fields[_i2].name);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
_valueKeys.forEach(function (val) {
|
|
486
|
+
splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
487
|
+
splitDataSources[val].primary.data.fields = [{
|
|
488
|
+
name: otherSplitBy[0]
|
|
489
|
+
}].concat(_toConsumableArray(dataSourceKeys.map(function (k) {
|
|
490
|
+
return {
|
|
491
|
+
name: k
|
|
492
|
+
};
|
|
493
|
+
})));
|
|
494
|
+
splitDataSources[val].primary.data.columns = [_toConsumableArray(columns[0])];
|
|
495
|
+
dataSourceKeys.forEach(function (dsKey) {
|
|
496
|
+
fields.forEach(function (field, idx) {
|
|
497
|
+
if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
|
|
498
|
+
splitDataSources[val].primary.data.columns.push(_toConsumableArray(columns[idx]));
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
} else {
|
|
505
|
+
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
return {
|
|
509
|
+
splitDataSources: splitDataSources,
|
|
510
|
+
errorCode: errorCode
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
exports.dataSourcesSplitByModeChart = dataSourcesSplitByModeChart;
|
|
515
|
+
/**
|
|
516
|
+
* This method does datasplitting for 'stats' and generic cmds('makeresults','table' etc - categoried as 'unknown' splitMode).
|
|
517
|
+
* The main difference is for 'stats' cmd possible splitBy fields have 'group_by_rank' in field meta info, whereas for 'unknown' cmd it can be any fieldnames
|
|
518
|
+
*/
|
|
519
|
+
|
|
520
|
+
var dataSourcesSplitByModeStatsorUnknown = function dataSourcesSplitByModeStatsorUnknown(dataSource, splitBy, splitMode) {
|
|
521
|
+
var _a, _b, _c, _d, _e, _f;
|
|
522
|
+
|
|
523
|
+
var fields = (_b = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.fields;
|
|
524
|
+
var columns = (_d = (_c = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.columns;
|
|
525
|
+
var splitDataSources = null;
|
|
526
|
+
var splitByFields = [];
|
|
527
|
+
var errorCode = null;
|
|
528
|
+
|
|
529
|
+
if (typeof fields[0] !== 'string') {
|
|
530
|
+
splitByFields = splitMode !== trellisUtils_1.UNKNOWN ? trellisUtils_1.extractSplitByFieldsForStats(fields) : trellisUtils_1.extractSplitByFieldsForUnknown(fields);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
var splitByIndex = fields === null || fields === void 0 ? void 0 : fields.findIndex(function (field) {
|
|
534
|
+
return field === splitBy || field.name === splitBy;
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
538
|
+
var splitByColumn = (_f = (_e = dataSource === null || dataSource === void 0 ? void 0 : dataSource.primary) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.columns[splitByIndex];
|
|
539
|
+
splitDataSources = {};
|
|
540
|
+
splitByColumn.forEach(function (val, idx) {
|
|
541
|
+
if (!splitDataSources[val]) {
|
|
542
|
+
splitDataSources[val] = [idx];
|
|
543
|
+
} else {
|
|
544
|
+
splitDataSources[val].push(idx);
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
var cloneFields = lodash_1.cloneDeep(fields);
|
|
548
|
+
cloneFields.splice(splitByIndex, 1);
|
|
549
|
+
var valueKeys = Object.keys(splitDataSources);
|
|
550
|
+
valueKeys.forEach(function (val) {
|
|
551
|
+
var valIndices = lodash_1.cloneDeep(splitDataSources[val]);
|
|
552
|
+
splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
|
|
553
|
+
splitDataSources[val].primary.data.fields = cloneFields;
|
|
554
|
+
splitDataSources[val].primary.data.columns = [];
|
|
555
|
+
columns.forEach(function (col, idx) {
|
|
556
|
+
if (idx !== splitByIndex) {
|
|
557
|
+
var newCol = valIndices.map(function (valIdx) {
|
|
558
|
+
return col[valIdx];
|
|
559
|
+
});
|
|
560
|
+
splitDataSources[val].primary.data.columns.push(newCol);
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
} else {
|
|
565
|
+
errorCode = 'INVALID_SPLIT_BY_FIELD';
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
return {
|
|
569
|
+
splitDataSources: splitDataSources,
|
|
570
|
+
errorCode: errorCode
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
exports.dataSourcesSplitByModeStatsorUnknown = dataSourcesSplitByModeStatsorUnknown;
|
|
575
|
+
|
|
576
|
+
var getTrellisDataSourcesBySplitMode = function getTrellisDataSourcesBySplitMode(splitMode, dataSources, trellisSplitBy) {
|
|
577
|
+
var result = null;
|
|
578
|
+
|
|
579
|
+
try {
|
|
580
|
+
if (splitMode === trellisUtils_1.TIMECHART) {
|
|
581
|
+
result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : exports.dataSourcesSplitByModeTimechart(dataSources, trellisSplitBy);
|
|
582
|
+
} else if (splitMode === trellisUtils_1.STATS) {
|
|
583
|
+
result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsStats(dataSources) : exports.dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_1.STATS);
|
|
584
|
+
} else if (splitMode === trellisUtils_1.CHART) {
|
|
585
|
+
result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : exports.dataSourcesSplitByModeChart(dataSources, trellisSplitBy);
|
|
586
|
+
} else if (splitMode === trellisUtils_1.UNKNOWN) {
|
|
587
|
+
result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsUnknown(dataSources) : exports.dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_1.UNKNOWN);
|
|
588
|
+
}
|
|
589
|
+
} catch (ex) {
|
|
590
|
+
console.error('getTrellisDataSourcesBySplitMode ', ex);
|
|
591
|
+
result = {
|
|
592
|
+
splitDataSources: null,
|
|
593
|
+
errorCode: 'UNKNOWN'
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
return result;
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
exports.getTrellisDataSourcesBySplitMode = getTrellisDataSourcesBySplitMode;
|
|
601
|
+
|
|
602
|
+
/***/ }),
|
|
603
|
+
|
|
604
|
+
/***/ 37:
|
|
605
|
+
/***/ (function(module, exports) {
|
|
606
|
+
|
|
607
|
+
module.exports = require("@splunk/visualizations-shared/trellisUtils");
|
|
608
|
+
|
|
609
|
+
/***/ })
|
|
610
|
+
|
|
611
|
+
/******/ });
|
|
612
|
+
//# sourceMappingURL=trellisUtils.js.map
|