@splunk/visualizations 27.0.0 → 27.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/Area.config.js +269 -122
  2. package/Area.config.js.map +4 -4
  3. package/Area.js +1065 -209
  4. package/Area.js.map +4 -4
  5. package/Bar.config.js +266 -82
  6. package/Bar.config.js.map +4 -4
  7. package/Bar.js +1065 -171
  8. package/Bar.js.map +4 -4
  9. package/Bubble.config.js +127 -1
  10. package/Bubble.config.js.map +4 -4
  11. package/Bubble.js +323 -80
  12. package/Bubble.js.map +4 -4
  13. package/ChoroplethSvg.js +60 -30
  14. package/ChoroplethSvg.js.map +4 -4
  15. package/Column.config.js +271 -82
  16. package/Column.config.js.map +4 -4
  17. package/Column.js +1070 -171
  18. package/Column.js.map +4 -4
  19. package/Ellipse.js +44 -14
  20. package/Ellipse.js.map +4 -4
  21. package/Events.js +82 -52
  22. package/Events.js.map +4 -4
  23. package/FillerGauge.js +44 -14
  24. package/FillerGauge.js.map +4 -4
  25. package/Image.js +42 -12
  26. package/Image.js.map +4 -4
  27. package/Line.config.js +271 -119
  28. package/Line.config.js.map +4 -4
  29. package/Line.js +1067 -206
  30. package/Line.js.map +4 -4
  31. package/LinkGraph.js +563 -529
  32. package/LinkGraph.js.map +4 -4
  33. package/Map.js +44 -14
  34. package/Map.js.map +4 -4
  35. package/Markdown.js +46 -16
  36. package/Markdown.js.map +4 -4
  37. package/MarkerGauge.js +42 -12
  38. package/MarkerGauge.js.map +4 -4
  39. package/ParallelCoordinates.js +122 -86
  40. package/ParallelCoordinates.js.map +4 -4
  41. package/Pie.js +198 -81
  42. package/Pie.js.map +4 -4
  43. package/Punchcard.js +54 -24
  44. package/Punchcard.js.map +4 -4
  45. package/Rectangle.js +56 -26
  46. package/Rectangle.js.map +4 -4
  47. package/Sankey.js +68 -38
  48. package/Sankey.js.map +4 -4
  49. package/Scatter.config.js +127 -1
  50. package/Scatter.config.js.map +4 -4
  51. package/Scatter.js +323 -80
  52. package/Scatter.js.map +4 -4
  53. package/SingleValue.config.js +43 -67
  54. package/SingleValue.config.js.map +4 -4
  55. package/SingleValue.js +1419 -1351
  56. package/SingleValue.js.map +4 -4
  57. package/SingleValueBasic.js.map +1 -1
  58. package/SingleValueIcon.config.js +45 -69
  59. package/SingleValueIcon.config.js.map +4 -4
  60. package/SingleValueIcon.js +1307 -1238
  61. package/SingleValueIcon.js.map +4 -4
  62. package/SingleValueRadial.config.js +43 -67
  63. package/SingleValueRadial.config.js.map +4 -4
  64. package/SingleValueRadial.js +1352 -1266
  65. package/SingleValueRadial.js.map +4 -4
  66. package/TRELLIS.md +16 -15
  67. package/Table.js +52 -22
  68. package/Table.js.map +4 -4
  69. package/common/Charting.js +133 -27
  70. package/common/Charting.js.map +4 -4
  71. package/common/OptionsDoc.js +6 -1
  72. package/common/OptionsDoc.js.map +2 -2
  73. package/common/utils/singleValueUtils.js +8 -7
  74. package/common/utils/singleValueUtils.js.map +2 -2
  75. package/common/utils/trellisUtils.js +41 -1
  76. package/common/utils/trellisUtils.js.map +2 -2
  77. package/common/withDashboardViz.js +42 -12
  78. package/common/withDashboardViz.js.map +4 -4
  79. package/package.json +17 -18
package/Area.js CHANGED
@@ -195,6 +195,15 @@ var defaultImport14 = __toESM(require("@splunk/visualizations-shared/themeUtils"
195
195
  __reExport(themeUtils_exports, require("@splunk/visualizations-shared/themeUtils"));
196
196
  var themeUtils_default = "default" in defaultImport14 ? defaultImport14.default : defaultImport14;
197
197
 
198
+ // esm-externals:@splunk/visualization-schemas
199
+ var visualization_schemas_exports = {};
200
+ __export(visualization_schemas_exports, {
201
+ default: () => visualization_schemas_default
202
+ });
203
+ var defaultImport15 = __toESM(require("@splunk/visualization-schemas"));
204
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
205
+ var visualization_schemas_default = "default" in defaultImport15 ? defaultImport15.default : defaultImport15;
206
+
198
207
  // src/common/ChartingApi.ts
199
208
  var ChartingApiFunctional = class {
200
209
  // eslint-disable-next-line no-useless-constructor
@@ -248,9 +257,9 @@ var numberUtils_exports = {};
248
257
  __export(numberUtils_exports, {
249
258
  default: () => numberUtils_default
250
259
  });
251
- var defaultImport15 = __toESM(require("@splunk/visualizations-shared/numberUtils"));
260
+ var defaultImport16 = __toESM(require("@splunk/visualizations-shared/numberUtils"));
252
261
  __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUtils"));
253
- var numberUtils_default = "default" in defaultImport15 ? defaultImport15.default : defaultImport15;
262
+ var numberUtils_default = "default" in defaultImport16 ? defaultImport16.default : defaultImport16;
254
263
 
255
264
  // src/common/interfaces/DataSource.ts
256
265
  var validSortDirs = ["asc", "desc", "none"];
@@ -527,6 +536,57 @@ var downsampleDataSources = ({ dataSources, threshold, options }) => {
527
536
  return downsampledDataSources;
528
537
  };
529
538
 
539
+ // esm-externals:@splunk/visualization-context/FeatureFlagContext
540
+ var FeatureFlagContext_exports = {};
541
+ __export(FeatureFlagContext_exports, {
542
+ default: () => FeatureFlagContext_default
543
+ });
544
+ var defaultImport17 = __toESM(require("@splunk/visualization-context/FeatureFlagContext"));
545
+ __reExport(FeatureFlagContext_exports, require("@splunk/visualization-context/FeatureFlagContext"));
546
+ var FeatureFlagContext_default = "default" in defaultImport17 ? defaultImport17.default : defaultImport17;
547
+
548
+ // src/common/hooks/useTrellisEnabled.ts
549
+ var useTrellisFeatureFlagOn = () => {
550
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
551
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
552
+ };
553
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
554
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
555
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
556
+ };
557
+
558
+ // src/common/components/TrellisTitle.tsx
559
+ var TRELLIS_TITLE_HEIGHT = 28;
560
+ var TrellisTitleText = styled_components_default.div`
561
+ margin-left: 10px;
562
+ margin-right: 10px;
563
+ padding-top: 8px;
564
+ text-overflow: ellipsis;
565
+ white-space: nowrap;
566
+ overflow: hidden;
567
+ `;
568
+ var TrellisTitleDiv = styled_components_default.div`
569
+ height: ${TRELLIS_TITLE_HEIGHT}px;
570
+ font-size: 14px;
571
+ font-weight: 700;
572
+ color: ${(props) => props.fontColor};
573
+ background-color: ${(props) => props.backgroundColor};
574
+ box-shadow: 0 1px ${(props) => props.backgroundColor}; // this is added to avoid a 1px gap between title and viz divs that showed up intermittently because of pixel rounding error in chrome.
575
+ `;
576
+ var TrellisTitle = (props) => {
577
+ const titleText = String(props.trellisKey).toString();
578
+ return /* @__PURE__ */ react_exports.createElement(
579
+ TrellisTitleDiv,
580
+ {
581
+ fontColor: props.fontColor,
582
+ backgroundColor: props.backgroundColor,
583
+ "data-test": "trellis-title",
584
+ title: titleText
585
+ },
586
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
587
+ );
588
+ };
589
+
530
590
  // src/common/Charting.tsx
531
591
  var NO_INPLACE_PROPS = [
532
592
  "chart",
@@ -535,6 +595,15 @@ var NO_INPLACE_PROPS = [
535
595
  "chart.style",
536
596
  "legend.placement"
537
597
  ];
598
+ var appendTrellisToPayload = (props, payload) => {
599
+ if (props.trellisSplitBy) {
600
+ payload["trellis.name"] = props.trellisSplitBy;
601
+ }
602
+ if (props.trellisKey) {
603
+ payload["trellis.value"] = props.trellisKey;
604
+ }
605
+ return payload;
606
+ };
538
607
  var changedOptions = (curOptions, nextOptions) => Object.keys(curOptions).filter((key) => !(key in nextOptions)).concat(
539
608
  Object.keys(nextOptions).filter(
540
609
  (key) => !(key in curOptions) || curOptions[key] !== nextOptions[key]
@@ -581,7 +650,12 @@ var propTypes = {
581
650
  originalDataSources: prop_types_exports.object,
582
651
  onDownsamplingThresholdChange: prop_types_exports.func,
583
652
  xField: prop_types_exports.string,
584
- y2Fields: prop_types_exports.array
653
+ y2Fields: prop_types_exports.array,
654
+ splitByLayout: prop_types_exports.oneOf(Object.values(visualization_schemas_exports.LAYOUT_TYPE)),
655
+ trellisKey: prop_types_exports.string,
656
+ trellisSplitBy: prop_types_exports.string,
657
+ backgroundColor: prop_types_exports.string,
658
+ defaultFontColor: prop_types_exports.string
585
659
  };
586
660
  var Charting = (props) => {
587
661
  var _a, _b;
@@ -592,6 +666,7 @@ var Charting = (props) => {
592
666
  const api = (0, react_exports.useRef)(new ChartingApiFunctional(chart));
593
667
  const timezone = (0, react_exports.useContext)(TimezoneContext_default);
594
668
  const selectChartEvent = (0, react_exports.useRef)(null);
669
+ const trellisEnabled = useTrellisEnabled(props.splitByLayout);
595
670
  const computeChartingSize = () => {
596
671
  if (container.current) {
597
672
  const rect = container.current.getBoundingClientRect();
@@ -618,7 +693,10 @@ var Charting = (props) => {
618
693
  onEventTrigger,
619
694
  originalDataSources,
620
695
  onDownsamplingThresholdChange,
621
- xField
696
+ xField,
697
+ backgroundColor,
698
+ defaultFontColor,
699
+ trellisKey
622
700
  } = props;
623
701
  const prevOptions = usePrevious(options);
624
702
  const prevTimezone = usePrevious(timezone);
@@ -637,6 +715,7 @@ var Charting = (props) => {
637
715
  delete payload.value2;
638
716
  payload = updateRowPayload(chartEvent.rowContext, payload);
639
717
  }
718
+ payload = appendTrellisToPayload(props, payload);
640
719
  onClick({
641
720
  type,
642
721
  originalEvent: chartEvent,
@@ -673,18 +752,22 @@ var Charting = (props) => {
673
752
  const handleSelect = useEventCallback_default((chartEvent) => {
674
753
  selectChartEvent.current = chartEvent;
675
754
  recalculateDownsamplingThreshold();
755
+ const payload = appendTrellisToPayload(
756
+ props,
757
+ (0, lodash_exports.pick)(chartEvent, "startXIndex", "endXIndex", "startXValue", "endXValue")
758
+ );
676
759
  if (onSelect && typeof onSelect === "function") {
677
760
  onSelect({
678
761
  type: "range.select",
679
762
  originalEvent: chartEvent,
680
- payload: (0, lodash_exports.pick)(chartEvent, "startXIndex", "endXIndex", "startXValue", "endXValue")
763
+ payload
681
764
  });
682
765
  return;
683
766
  }
684
767
  onEventTrigger({
685
768
  type: "range.select",
686
769
  originalEvent: chartEvent,
687
- payload: (0, lodash_exports.pick)(chartEvent, "startXIndex", "endXIndex", "startXValue", "endXValue")
770
+ payload
688
771
  });
689
772
  });
690
773
  const handlePointMouseOut = useEventCallback_default(
@@ -701,7 +784,7 @@ var Charting = (props) => {
701
784
  delete payload.name2;
702
785
  payload.value = payload.value2;
703
786
  delete payload.value2;
704
- payload = updateRowPayload(chartEvent.rowContext, payload);
787
+ payload = appendTrellisToPayload(props, updateRowPayload(chartEvent.rowContext, payload));
705
788
  onPointMouseOut({
706
789
  type,
707
790
  originalEvent: chartEvent,
@@ -723,7 +806,7 @@ var Charting = (props) => {
723
806
  delete payload.name2;
724
807
  payload.value = payload.value2;
725
808
  delete payload.value2;
726
- payload = updateRowPayload(chartEvent.rowContext, payload);
809
+ payload = appendTrellisToPayload(props, updateRowPayload(chartEvent.rowContext, payload));
727
810
  onPointMouseOver({
728
811
  type,
729
812
  originalEvent: chartEvent,
@@ -787,10 +870,15 @@ var Charting = (props) => {
787
870
  if (colorPalette.length > 0) {
788
871
  charting_bundle_default.setColorPalette(colorPalette);
789
872
  }
873
+ const payload = appendTrellisToPayload(props, {
874
+ width,
875
+ height,
876
+ currentTime: (/* @__PURE__ */ new Date()).getTime()
877
+ });
790
878
  chart.current.prepareAndDraw(chartData, updatedOptions, () => {
791
879
  onEventTrigger({
792
880
  type: "viz.renderedWithData",
793
- payload: { width, height, currentTime: (/* @__PURE__ */ new Date()).getTime() }
881
+ payload
794
882
  });
795
883
  });
796
884
  }
@@ -837,7 +925,23 @@ var Charting = (props) => {
837
925
  themeKey,
838
926
  onClick
839
927
  ]);
840
- return /* @__PURE__ */ react_exports.createElement(ChartingContainer, { style, ref: onContainerMount, width, height }, /* @__PURE__ */ react_exports.createElement(react_event_listener_default, { target: window, onResize: debouncedDrawChart }));
928
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
929
+ TrellisTitle,
930
+ {
931
+ trellisKey,
932
+ backgroundColor,
933
+ fontColor: defaultFontColor
934
+ }
935
+ ), /* @__PURE__ */ react_exports.createElement(
936
+ ChartingContainer,
937
+ {
938
+ style,
939
+ ref: onContainerMount,
940
+ width,
941
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height
942
+ },
943
+ /* @__PURE__ */ react_exports.createElement(react_event_listener_default, { target: window, onResize: debouncedDrawChart })
944
+ ));
841
945
  };
842
946
  var defaultProps = {
843
947
  width: "100%",
@@ -857,81 +961,73 @@ var defaultProps = {
857
961
  onDownsamplingThresholdChange: null,
858
962
  originalDataSources: null,
859
963
  xField: null,
860
- y2Fields: []
964
+ y2Fields: [],
965
+ splitByLayout: void 0,
966
+ trellisKey: void 0,
967
+ trellisSplitBy: void 0,
968
+ backgroundColor: "",
969
+ defaultFontColor: ""
861
970
  };
862
971
  Charting.propTypes = propTypes;
863
972
  Charting.defaultProps = defaultProps;
864
- var withEmptyChartMessage = (Chart) => {
865
- const Wrapper = (props) => {
866
- const { chartData } = props;
867
- if (!chartData) {
868
- return /* @__PURE__ */ react_exports.createElement(Message_default, { message: (0, i18n_exports._)("No DataSource"), level: "warning" });
869
- }
870
- if (chartData && !Object.keys(chartData).length) {
871
- return /* @__PURE__ */ react_exports.createElement(Message_default, { message: (0, i18n_exports._)("No Result"), level: "info" });
872
- }
873
- return /* @__PURE__ */ react_exports.createElement(Chart, __spreadValues({}, props));
874
- };
875
- Wrapper.displayName = "ChartingWrapper";
876
- Wrapper.propTypes = propTypes;
877
- Wrapper.defaultProps = defaultProps;
878
- return Wrapper;
973
+ var ChartingWrapper = (props) => {
974
+ const { chartData } = props;
975
+ if (!chartData) {
976
+ return /* @__PURE__ */ react_exports.createElement(Message_default, { message: (0, i18n_exports._)("No DataSource"), level: "warning" });
977
+ }
978
+ if (!Object.keys(chartData).length) {
979
+ return /* @__PURE__ */ react_exports.createElement(Message_default, { message: (0, i18n_exports._)("No Result"), level: "info" });
980
+ }
981
+ return /* @__PURE__ */ react_exports.createElement(Charting, __spreadValues({}, props));
879
982
  };
880
- var Charting_default = withEmptyChartMessage(Charting);
983
+ ChartingWrapper.propTypes = propTypes;
984
+ ChartingWrapper.defaultProps = defaultProps;
985
+ var Charting_default = ChartingWrapper;
881
986
 
882
987
  // esm-externals:@splunk/visualization-icons
883
988
  var visualization_icons_exports = {};
884
989
  __export(visualization_icons_exports, {
885
990
  default: () => visualization_icons_default
886
991
  });
887
- var defaultImport16 = __toESM(require("@splunk/visualization-icons"));
992
+ var defaultImport18 = __toESM(require("@splunk/visualization-icons"));
888
993
  __reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
889
- var visualization_icons_default = "default" in defaultImport16 ? defaultImport16.default : defaultImport16;
994
+ var visualization_icons_default = "default" in defaultImport18 ? defaultImport18.default : defaultImport18;
890
995
 
891
996
  // esm-externals:@splunk/visualization-icons/placeholders
892
997
  var placeholders_exports = {};
893
998
  __export(placeholders_exports, {
894
999
  default: () => placeholders_default
895
1000
  });
896
- var defaultImport17 = __toESM(require("@splunk/visualization-icons/placeholders"));
1001
+ var defaultImport19 = __toESM(require("@splunk/visualization-icons/placeholders"));
897
1002
  __reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
898
- var placeholders_default = "default" in defaultImport17 ? defaultImport17.default : defaultImport17;
899
-
900
- // esm-externals:@splunk/visualization-schemas
901
- var visualization_schemas_exports = {};
902
- __export(visualization_schemas_exports, {
903
- default: () => visualization_schemas_default
904
- });
905
- var defaultImport18 = __toESM(require("@splunk/visualization-schemas"));
906
- __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
907
- var visualization_schemas_default = "default" in defaultImport18 ? defaultImport18.default : defaultImport18;
1003
+ var placeholders_default = "default" in defaultImport19 ? defaultImport19.default : defaultImport19;
908
1004
 
909
1005
  // esm-externals:@splunk/themes/pick
910
1006
  var pick_exports = {};
911
1007
  __export(pick_exports, {
912
1008
  default: () => pick_default
913
1009
  });
914
- var defaultImport19 = __toESM(require("@splunk/themes/pick"));
1010
+ var defaultImport20 = __toESM(require("@splunk/themes/pick"));
915
1011
  __reExport(pick_exports, require("@splunk/themes/pick"));
916
- var pick_default = "default" in defaultImport19 ? defaultImport19.default : defaultImport19;
1012
+ var pick_default = "default" in defaultImport20 ? defaultImport20.default : defaultImport20;
917
1013
 
918
1014
  // esm-externals:@splunk/themes/variables
919
1015
  var variables_exports = {};
920
1016
  __export(variables_exports, {
921
1017
  default: () => variables_default
922
1018
  });
923
- var defaultImport20 = __toESM(require("@splunk/themes/variables"));
1019
+ var defaultImport21 = __toESM(require("@splunk/themes/variables"));
924
1020
  __reExport(variables_exports, require("@splunk/themes/variables"));
925
- var variables_default = "default" in defaultImport20 ? defaultImport20.default : defaultImport20;
1021
+ var variables_default = "default" in defaultImport21 ? defaultImport21.default : defaultImport21;
926
1022
 
927
1023
  // esm-externals:@splunk/visualizations-shared/configUtils
928
1024
  var configUtils_exports = {};
929
1025
  __export(configUtils_exports, {
930
1026
  default: () => configUtils_default
931
1027
  });
932
- var defaultImport21 = __toESM(require("@splunk/visualizations-shared/configUtils"));
1028
+ var defaultImport22 = __toESM(require("@splunk/visualizations-shared/configUtils"));
933
1029
  __reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
934
- var configUtils_default = "default" in defaultImport21 ? defaultImport21.default : defaultImport21;
1030
+ var configUtils_default = "default" in defaultImport22 ? defaultImport22.default : defaultImport22;
935
1031
 
936
1032
  // src/common/utils/configUtils.ts
937
1033
  function enhanceConfig(vizConfig) {
@@ -953,6 +1049,13 @@ var insertLayout = (layout, index, ...layoutItems) => [
953
1049
  ];
954
1050
 
955
1051
  // src/common/editorConfig/AxesChartDataConfig.ts
1052
+ var isTrellisFeatureFlagOn = ({ featureFlags }) => {
1053
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
1054
+ };
1055
+ var isTrellisEnabled = ({ options, featureFlags }) => {
1056
+ const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
1057
+ return isTrellisFeatureFlagOn({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1058
+ };
956
1059
  var AxesChartDataConfig = {
957
1060
  label: (0, i18n_exports._)("Data configurations"),
958
1061
  layout: [
@@ -1006,7 +1109,8 @@ var AxesChartDataConfigBar = {
1006
1109
  filterByTypes: ["number"],
1007
1110
  supportsDSL: true,
1008
1111
  expectedDataPrimitive: ["series", "frame"]
1009
- }
1112
+ },
1113
+ isDisabled: isTrellisEnabled
1010
1114
  }
1011
1115
  ])
1012
1116
  };
@@ -1109,10 +1213,136 @@ var AxesChartDataConfigAreaColumnLine = {
1109
1213
  ]
1110
1214
  };
1111
1215
 
1216
+ // src/common/editorConfig/TrellisEditors.ts
1217
+ var isTrellisFeatureFlagOn2 = ({ featureFlags }) => {
1218
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
1219
+ };
1220
+ var isTrellisEnabled2 = ({ options, featureFlags }) => {
1221
+ const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
1222
+ return isTrellisFeatureFlagOn2({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1223
+ };
1224
+ var TrellisEditorConfig = [
1225
+ [
1226
+ {
1227
+ label: (0, i18n_exports._)("Trellis layout"),
1228
+ option: "splitByLayout",
1229
+ editor: "editor.toggle",
1230
+ showEditor: isTrellisFeatureFlagOn2
1231
+ }
1232
+ ],
1233
+ [
1234
+ {
1235
+ label: (0, i18n_exports._)("Split by"),
1236
+ option: "trellisSplitBy",
1237
+ editor: "editor.trellisSplitBy",
1238
+ editorProps: {
1239
+ dataSourceKey: "primary"
1240
+ },
1241
+ showEditor: isTrellisEnabled2
1242
+ }
1243
+ ],
1244
+ [
1245
+ {
1246
+ label: (0, i18n_exports._)("Number of columns"),
1247
+ option: "trellisColumns",
1248
+ editor: "editor.number",
1249
+ editorProps: {
1250
+ min: 1
1251
+ },
1252
+ placeholder: (0, i18n_exports._)("Auto"),
1253
+ showEditor: isTrellisEnabled2
1254
+ }
1255
+ ],
1256
+ [
1257
+ {
1258
+ label: (0, i18n_exports._)("Min column width"),
1259
+ option: "trellisMinColumnWidth",
1260
+ editor: "editor.number",
1261
+ editorProps: {
1262
+ min: 1
1263
+ },
1264
+ showEditor: isTrellisEnabled2
1265
+ },
1266
+ {
1267
+ label: (0, i18n_exports._)("Row height"),
1268
+ option: "trellisRowHeight",
1269
+ editor: "editor.number",
1270
+ editorProps: {
1271
+ min: 1
1272
+ },
1273
+ showEditor: isTrellisEnabled2
1274
+ }
1275
+ ],
1276
+ [
1277
+ {
1278
+ label: (0, i18n_exports._)("Max number of components per page"),
1279
+ option: "trellisPageCount",
1280
+ editor: "editor.number",
1281
+ editorProps: {
1282
+ min: 1
1283
+ },
1284
+ showEditor: isTrellisEnabled2
1285
+ }
1286
+ ]
1287
+ ];
1288
+ var TimechartTrellisEditorConfig = [
1289
+ [
1290
+ {
1291
+ label: (0, i18n_exports._)("Trellis layout"),
1292
+ option: "splitByLayout",
1293
+ editor: "editor.toggle",
1294
+ showEditor: isTrellisFeatureFlagOn2,
1295
+ // add help text for timecharts
1296
+ editorProps: {
1297
+ help: (0, i18n_exports._)(
1298
+ "Y2-axis and overlay field configurations are not supported when trellis is enabled."
1299
+ ),
1300
+ helpFormat: "under"
1301
+ }
1302
+ }
1303
+ ],
1304
+ ...TrellisEditorConfig.slice(1),
1305
+ [
1306
+ {
1307
+ label: (0, i18n_exports._)("Shared y-axis scale"),
1308
+ option: "trellisSharedScale",
1309
+ editor: "editor.checkbox",
1310
+ showEditor: isTrellisEnabled2
1311
+ }
1312
+ ]
1313
+ ];
1314
+ var TrellisBackgroundColorEditor = {
1315
+ label: (0, i18n_exports._)("Trellis background"),
1316
+ option: "trellisBackgroundColor",
1317
+ editor: "editor.color",
1318
+ showEditor: isTrellisEnabled2
1319
+ };
1320
+
1112
1321
  // src/common/editorConfig/AxesChartDataDisplay.ts
1113
- var AxesChartDataDisplayLine = {
1322
+ var isTrellisFeatureFlagOn3 = ({ featureFlags }) => {
1323
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
1324
+ };
1325
+ var isTrellisEnabled3 = ({ options, featureFlags }) => {
1326
+ const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
1327
+ return isTrellisFeatureFlagOn3({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1328
+ };
1329
+ var AxesChartDataDisplayBase = {
1114
1330
  label: (0, i18n_exports._)("Data display"),
1115
1331
  layout: [
1332
+ [
1333
+ {
1334
+ label: (0, i18n_exports._)("Stack mode"),
1335
+ option: "stackMode",
1336
+ editor: "editor.select",
1337
+ editorProps: {
1338
+ values: [
1339
+ { label: (0, i18n_exports._)("Not stacked"), value: "auto" },
1340
+ { label: (0, i18n_exports._)("Stacked"), value: "stacked" },
1341
+ { label: (0, i18n_exports._)("Stacked 100%"), value: "stacked100" }
1342
+ ]
1343
+ }
1344
+ }
1345
+ ],
1116
1346
  [
1117
1347
  {
1118
1348
  label: (0, i18n_exports._)("Null value display"),
@@ -1148,7 +1378,8 @@ var AxesChartDataDisplayLine = {
1148
1378
  editor: "editor.columnMultiSelectionByFieldNameEditor",
1149
1379
  editorProps: {
1150
1380
  filterByTypes: ["number"]
1151
- }
1381
+ },
1382
+ isDisabled: isTrellisEnabled3
1152
1383
  }
1153
1384
  ],
1154
1385
  [
@@ -1165,60 +1396,33 @@ var AxesChartDataDisplayLine = {
1165
1396
  editor: "editor.checkbox",
1166
1397
  showEditor: ({ options }) => options.showSplitSeries
1167
1398
  }
1168
- ]
1169
- ]
1170
- };
1171
- var AxesChartDataDisplay = {
1172
- label: AxesChartDataDisplayLine.label,
1173
- layout: [
1174
- [
1175
- {
1176
- label: (0, i18n_exports._)("Stack mode"),
1177
- option: "stackMode",
1178
- editor: "editor.select",
1179
- editorProps: {
1180
- values: [
1181
- { label: (0, i18n_exports._)("Not stacked"), value: "auto" },
1182
- { label: (0, i18n_exports._)("Stacked"), value: "stacked" },
1183
- { label: (0, i18n_exports._)("Stacked 100%"), value: "stacked100" }
1184
- ]
1185
- }
1186
- }
1187
1399
  ],
1188
- ...AxesChartDataDisplayLine.layout
1400
+ ...TimechartTrellisEditorConfig
1189
1401
  ]
1190
1402
  };
1403
+ var AxesChartDataDisplayArea = AxesChartDataDisplayBase;
1191
1404
  var AxesChartDataDisplayBar = {
1192
- label: AxesChartDataDisplayLine.label,
1405
+ label: AxesChartDataDisplayBase.label,
1193
1406
  layout: [
1194
- [
1195
- {
1196
- label: (0, i18n_exports._)("Stack mode"),
1197
- option: "stackMode",
1198
- editor: "editor.select",
1199
- editorProps: {
1200
- values: [
1201
- { label: (0, i18n_exports._)("Not stacked"), value: "auto" },
1202
- { label: (0, i18n_exports._)("Stacked"), value: "stacked" },
1203
- { label: (0, i18n_exports._)("Stacked 100%"), value: "stacked100" }
1204
- ]
1205
- }
1206
- }
1207
- ],
1208
- // remove nullValueDisplay
1209
- ...(0, lodash_exports.drop)(AxesChartDataDisplayLine.layout)
1407
+ AxesChartDataDisplayBase.layout[0],
1408
+ // remove null value display editor at index 1
1409
+ ...AxesChartDataDisplayBase.layout.slice(2)
1210
1410
  ]
1211
1411
  };
1212
1412
  var AxesChartDataDisplayColumn = {
1213
- label: AxesChartDataDisplayBar.label,
1413
+ label: AxesChartDataDisplayBase.label,
1214
1414
  layout: [
1215
- ...insertLayout(AxesChartDataDisplayBar.layout, 2, [
1415
+ AxesChartDataDisplayBase.layout[0],
1416
+ // remove null value display and add data value display
1417
+ AxesChartDataDisplayBase.layout[2],
1418
+ [
1216
1419
  {
1217
1420
  label: (0, i18n_exports._)("Show tooltip on hover"),
1218
1421
  option: "showTooltip",
1219
1422
  editor: "editor.checkbox"
1220
1423
  }
1221
- ]),
1424
+ ],
1425
+ ...AxesChartDataDisplayBase.layout.slice(3),
1222
1426
  [
1223
1427
  {
1224
1428
  label: (0, i18n_exports._)("Column grouping mode"),
@@ -1234,7 +1438,13 @@ var AxesChartDataDisplayColumn = {
1234
1438
  ]
1235
1439
  ]
1236
1440
  };
1237
- var AxesChartDataDisplay_default = AxesChartDataDisplay;
1441
+ var AxesChartDataDisplayLine = {
1442
+ label: AxesChartDataDisplayBase.label,
1443
+ layout: [
1444
+ // remove stacked mode editor
1445
+ ...AxesChartDataDisplayBase.layout.slice(1)
1446
+ ]
1447
+ };
1238
1448
 
1239
1449
  // src/common/editorConfig/BackgroundColor.ts
1240
1450
  var background = ({
@@ -1284,7 +1494,19 @@ var AxesChartColorAndStyle = {
1284
1494
  ]
1285
1495
  ]
1286
1496
  };
1287
- var AxesChartColorAndStyle_default = AxesChartColorAndStyle;
1497
+ var AreaAxesChartColorAndStyleWithTrellis = __spreadProps(__spreadValues({}, AxesChartColorAndStyle), {
1498
+ layout: [
1499
+ AxesChartColorAndStyle.layout[0],
1500
+ [
1501
+ __spreadProps(__spreadValues({}, TrellisBackgroundColorEditor), {
1502
+ editorProps: {
1503
+ themes
1504
+ }
1505
+ })
1506
+ ],
1507
+ ...AxesChartColorAndStyle.layout.slice(1)
1508
+ ]
1509
+ });
1288
1510
 
1289
1511
  // src/common/editorConfig/AxesChartLegend.ts
1290
1512
  var AxesChartLegend = {
@@ -1324,7 +1546,54 @@ var AxesChartLegend = {
1324
1546
  ]
1325
1547
  ]
1326
1548
  };
1327
- var AxesChartLegend_default = AxesChartLegend;
1549
+ var AxesChartLegendWithTrellisAndMode = ({
1550
+ showLegendTooltip = false,
1551
+ hideModeWhenOff = false
1552
+ }) => ({
1553
+ label: AxesChartLegend.label,
1554
+ layout: [
1555
+ [
1556
+ {
1557
+ label: (0, i18n_exports._)("Legend display"),
1558
+ option: "legendDisplay",
1559
+ editor: "editor.select",
1560
+ editorProps: {
1561
+ values: [
1562
+ { label: (0, i18n_exports._)("Right"), value: "right" },
1563
+ { label: (0, i18n_exports._)("Left"), value: "left" },
1564
+ { label: (0, i18n_exports._)("Top"), value: "top" },
1565
+ { label: (0, i18n_exports._)("Bottom"), value: "bottom" },
1566
+ { label: (0, i18n_exports._)("Off"), value: "off" }
1567
+ ],
1568
+ tooltip: showLegendTooltip && (0, i18n_exports._)('Legend mode must be "Standard" to configure legend display')
1569
+ },
1570
+ isDisabled: showLegendTooltip ? ({ options }) => options.legendMode === "seriesCompare" : void 0,
1571
+ overrideDefaultValue: ({ options }) => (options == null ? void 0 : options.splitByLayout) === "trellis" ? "off" : "right"
1572
+ }
1573
+ ],
1574
+ [
1575
+ __spreadProps(__spreadValues({}, AxesChartLegend.layout[1][0]), {
1576
+ showEditor: ({ options }) => options.legendDisplay === "left" || options.legendDisplay === "right" || options.legendDisplay === "top" || options.legendDisplay === "bottom" || // when Trellis is on, the default value of legendDisplay is off
1577
+ options.legendDisplay === void 0 && options.splitByLayout !== "trellis"
1578
+ })
1579
+ ],
1580
+ [
1581
+ {
1582
+ label: (0, i18n_exports._)("Legend mode"),
1583
+ option: "legendMode",
1584
+ editor: "editor.radioBar",
1585
+ editorProps: {
1586
+ values: [
1587
+ { label: (0, i18n_exports._)("Standard"), value: "standard" },
1588
+ { label: (0, i18n_exports._)("Compare series"), value: "seriesCompare" }
1589
+ ]
1590
+ },
1591
+ showEditor: ({ options }) => hideModeWhenOff ? options.legendDisplay === "left" || options.legendDisplay === "right" || options.legendDisplay === "top" || options.legendDisplay === "bottom" || // when Trellis is on, the default value of legendDisplay is off
1592
+ options.legendDisplay === void 0 && options.splitByLayout !== "trellis" : true
1593
+ }
1594
+ ]
1595
+ ]
1596
+ });
1328
1597
 
1329
1598
  // src/common/editorConfig/AxesChartXGridAndLabels.ts
1330
1599
  var AxesChartXGridAndLabelsCommon = {
@@ -1768,6 +2037,13 @@ var AxesChartYGridAndLabels = {
1768
2037
  var AxesChartYGridAndLabels_default = AxesChartYGridAndLabels;
1769
2038
 
1770
2039
  // src/common/editorConfig/AxesChartY2GridAndLabels.ts
2040
+ var isTrellisFeatureFlagOn4 = ({ featureFlags }) => {
2041
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
2042
+ };
2043
+ var isTrellisOff = ({ options, featureFlags }) => {
2044
+ const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
2045
+ return !isTrellisFeatureFlagOn4({ featureFlags }) || splitByLayout !== visualization_schemas_exports.LAYOUT_TYPE.Trellis;
2046
+ };
1771
2047
  var axesChartY2GridAndLabels = {
1772
2048
  label: (0, i18n_exports._)("Y2-axis grid and labels"),
1773
2049
  layout: [
@@ -1775,15 +2051,16 @@ var axesChartY2GridAndLabels = {
1775
2051
  {
1776
2052
  label: (0, i18n_exports._)("Axis title"),
1777
2053
  option: "y2AxisTitleVisibility",
1778
- editor: "editor.toggle"
2054
+ editor: "editor.toggle",
2055
+ showEditor: isTrellisOff
1779
2056
  }
1780
2057
  ],
1781
2058
  [
1782
2059
  {
1783
- label: (0, i18n_exports._)("Axis title"),
2060
+ label: (0, i18n_exports._)("Axis title text"),
1784
2061
  option: "y2AxisTitleText",
1785
2062
  editor: "editor.text",
1786
- showEditor: ({ options }) => options.y2AxisTitleVisibility === "show" || options.y2AxisTitleVisibility === void 0
2063
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && (options.y2AxisTitleVisibility === "show" || options.y2AxisTitleVisibility === void 0)
1787
2064
  }
1788
2065
  ],
1789
2066
  [
@@ -1791,7 +2068,7 @@ var axesChartY2GridAndLabels = {
1791
2068
  label: (0, i18n_exports._)("Show overlays on the y2-axis"),
1792
2069
  option: "showOverlayY2Axis",
1793
2070
  editor: "editor.checkbox",
1794
- showEditor: ({ options }) => Array.isArray(options.overlayFields) && options.overlayFields.length > 0
2071
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && Array.isArray(options.overlayFields) && options.overlayFields.length > 0
1795
2072
  }
1796
2073
  ],
1797
2074
  [
@@ -1804,7 +2081,8 @@ var axesChartY2GridAndLabels = {
1804
2081
  { label: (0, i18n_exports._)("Linear"), value: "linear" },
1805
2082
  { label: (0, i18n_exports._)("Log"), value: "log" }
1806
2083
  ]
1807
- }
2084
+ },
2085
+ showEditor: isTrellisOff
1808
2086
  }
1809
2087
  ],
1810
2088
  [
@@ -1818,7 +2096,8 @@ var axesChartY2GridAndLabels = {
1818
2096
  { label: (0, i18n_exports._)("Show"), value: "show" },
1819
2097
  { label: (0, i18n_exports._)("Hide"), value: "hide" }
1820
2098
  ]
1821
- }
2099
+ },
2100
+ showEditor: isTrellisOff
1822
2101
  }
1823
2102
  ],
1824
2103
  [
@@ -1826,7 +2105,7 @@ var axesChartY2GridAndLabels = {
1826
2105
  label: (0, i18n_exports._)("Round axis labels"),
1827
2106
  option: "showRoundedY2AxisLabels",
1828
2107
  editor: "editor.checkbox",
1829
- showEditor: ({ options }) => options.y2AxisLabelVisibility === "show" || options.y2AxisLabelVisibility === "auto" || options.y2AxisLabelVisibility === void 0
2108
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && (options.y2AxisLabelVisibility === "show" || options.y2AxisLabelVisibility === "auto" || options.y2AxisLabelVisibility === void 0)
1830
2109
  }
1831
2110
  ],
1832
2111
  [
@@ -1834,40 +2113,45 @@ var axesChartY2GridAndLabels = {
1834
2113
  label: (0, i18n_exports._)("SI prefix abbreviation for labels"),
1835
2114
  option: "y2AxisAbbreviation",
1836
2115
  editor: "editor.checkbox",
1837
- showEditor: ({ options }) => options.y2AxisLabelVisibility === "show" || options.y2AxisLabelVisibility === "auto" || options.y2AxisLabelVisibility === void 0
2116
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && (options.y2AxisLabelVisibility === "show" || options.y2AxisLabelVisibility === "auto" || options.y2AxisLabelVisibility === void 0)
1838
2117
  }
1839
2118
  ],
1840
2119
  [
1841
2120
  {
1842
2121
  label: (0, i18n_exports._)("Include zero"),
1843
2122
  option: "showY2AxisWithZero",
1844
- editor: "editor.checkbox"
2123
+ editor: "editor.checkbox",
2124
+ showEditor: isTrellisOff
1845
2125
  }
1846
2126
  ],
1847
2127
  [
1848
2128
  {
1849
2129
  label: (0, i18n_exports._)("Minimum axis value"),
1850
2130
  option: "y2AxisMin",
1851
- editor: "editor.number"
2131
+ editor: "editor.number",
2132
+ showEditor: isTrellisOff
1852
2133
  },
1853
2134
  {
1854
2135
  label: (0, i18n_exports._)("Maximum axis value"),
1855
2136
  option: "y2AxisMax",
1856
- editor: "editor.number"
2137
+ editor: "editor.number",
2138
+ showEditor: isTrellisOff
1857
2139
  }
1858
2140
  ],
1859
2141
  [
1860
2142
  {
1861
2143
  label: (0, i18n_exports._)("Axis line visibility"),
1862
2144
  option: "y2AxisLineVisibility",
1863
- editor: "editor.checkbox"
2145
+ editor: "editor.checkbox",
2146
+ showEditor: isTrellisOff
1864
2147
  }
1865
2148
  ],
1866
2149
  [
1867
2150
  {
1868
2151
  label: (0, i18n_exports._)("Major gridlines"),
1869
2152
  option: "showY2MajorGridLines",
1870
- editor: "editor.checkbox"
2153
+ editor: "editor.checkbox",
2154
+ showEditor: isTrellisOff
1871
2155
  }
1872
2156
  ],
1873
2157
  [
@@ -1881,7 +2165,8 @@ var axesChartY2GridAndLabels = {
1881
2165
  { label: (0, i18n_exports._)("Show"), value: "show" },
1882
2166
  { label: (0, i18n_exports._)("Hide"), value: "hide" }
1883
2167
  ]
1884
- }
2168
+ },
2169
+ showEditor: isTrellisOff
1885
2170
  }
1886
2171
  ],
1887
2172
  [
@@ -1894,7 +2179,7 @@ var axesChartY2GridAndLabels = {
1894
2179
  max: 10,
1895
2180
  step: 1
1896
2181
  },
1897
- showEditor: ({ options }) => options.y2AxisMajorTickVisibility === "show" || options.y2AxisMajorTickVisibility === "auto" || options.y2AxisMajorTickVisibility === void 0
2182
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && (options.y2AxisMajorTickVisibility === "show" || options.y2AxisMajorTickVisibility === "auto" || options.y2AxisMajorTickVisibility === void 0)
1898
2183
  }
1899
2184
  ],
1900
2185
  [
@@ -1902,14 +2187,15 @@ var axesChartY2GridAndLabels = {
1902
2187
  label: (0, i18n_exports._)("Major tick interval spacing"),
1903
2188
  option: "y2AxisMajorTickInterval",
1904
2189
  editor: "editor.number",
1905
- showEditor: ({ options }) => options.y2AxisMajorTickVisibility === "show" || options.y2AxisMajorTickVisibility === "auto" || options.y2AxisMajorTickVisibility === void 0
2190
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && (options.y2AxisMajorTickVisibility === "show" || options.y2AxisMajorTickVisibility === "auto" || options.y2AxisMajorTickVisibility === void 0)
1906
2191
  }
1907
2192
  ],
1908
2193
  [
1909
2194
  {
1910
2195
  label: (0, i18n_exports._)("Minor gridlines"),
1911
2196
  option: "showY2MinorGridLines",
1912
- editor: "editor.checkbox"
2197
+ editor: "editor.checkbox",
2198
+ showEditor: isTrellisOff
1913
2199
  }
1914
2200
  ],
1915
2201
  [
@@ -1923,7 +2209,8 @@ var axesChartY2GridAndLabels = {
1923
2209
  { label: (0, i18n_exports._)("Show"), value: "show" },
1924
2210
  { label: (0, i18n_exports._)("Hide"), value: "hide" }
1925
2211
  ]
1926
- }
2212
+ },
2213
+ showEditor: isTrellisOff
1927
2214
  }
1928
2215
  ],
1929
2216
  [
@@ -1936,7 +2223,7 @@ var axesChartY2GridAndLabels = {
1936
2223
  max: 10,
1937
2224
  step: 1
1938
2225
  },
1939
- showEditor: ({ options }) => options.y2AxisMinorTickVisibility === "show" || options.y2AxisMinorTickVisibility === "auto" || options.y2AxisMinorTickVisibility === void 0
2226
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && (options.y2AxisMinorTickVisibility === "show" || options.y2AxisMinorTickVisibility === "auto" || options.y2AxisMinorTickVisibility === void 0)
1940
2227
  }
1941
2228
  ]
1942
2229
  ]
@@ -1974,15 +2261,22 @@ var themes2 = {
1974
2261
  light: variables_default.backgroundColor(props)
1975
2262
  },
1976
2263
  prisma: variables_default.backgroundColorSidebar(props)
2264
+ })(props),
2265
+ defaultFontColor: (props) => pick_default({
2266
+ enterprise: {
2267
+ dark: variables_default.textColor(props),
2268
+ light: variables_default.textColor(props)
2269
+ },
2270
+ prisma: variables_default.contentColorDefault(props)
1977
2271
  })(props)
1978
2272
  };
1979
2273
  var editorConfig = [
1980
2274
  AxesChartDataConfigAreaColumnLine,
1981
- AxesChartDataDisplay_default,
2275
+ AxesChartDataDisplayArea,
1982
2276
  {
1983
- label: AxesChartColorAndStyle_default.label,
2277
+ label: AreaAxesChartColorAndStyleWithTrellis.label,
1984
2278
  layout: [
1985
- ...AxesChartColorAndStyle_default.layout,
2279
+ ...AreaAxesChartColorAndStyleWithTrellis.layout,
1986
2280
  [
1987
2281
  {
1988
2282
  label: (0, i18n_exports._)("Area opacity (0-1)"),
@@ -2029,59 +2323,7 @@ var editorConfig = [
2029
2323
  ]
2030
2324
  ]
2031
2325
  },
2032
- {
2033
- label: AxesChartLegend_default.label,
2034
- layout: [
2035
- [
2036
- {
2037
- label: (0, i18n_exports._)("Legend display"),
2038
- option: "legendDisplay",
2039
- editor: "editor.select",
2040
- editorProps: {
2041
- values: [
2042
- { label: (0, i18n_exports._)("Right"), value: "right" },
2043
- { label: (0, i18n_exports._)("Left"), value: "left" },
2044
- { label: (0, i18n_exports._)("Top"), value: "top" },
2045
- { label: (0, i18n_exports._)("Bottom"), value: "bottom" },
2046
- { label: (0, i18n_exports._)("Off"), value: "off" }
2047
- ],
2048
- tooltip: (0, i18n_exports._)('Legend mode must be "Standard" to configure legend display')
2049
- },
2050
- isDisabled: ({ options }) => options.legendMode === "seriesCompare"
2051
- }
2052
- ],
2053
- [
2054
- {
2055
- label: (0, i18n_exports._)("Legend truncation"),
2056
- option: "legendTruncation",
2057
- editor: "editor.radioBar",
2058
- editorProps: {
2059
- values: [
2060
- { label: (0, i18n_exports._)("A..."), value: "ellipsisEnd" },
2061
- { label: (0, i18n_exports._)("A...Z"), value: "ellipsisMiddle" },
2062
- { label: (0, i18n_exports._)("...Z"), value: "ellipsisStart" },
2063
- { label: (0, i18n_exports._)("Off"), value: "ellipsisOff" }
2064
- ]
2065
- },
2066
- showEditor: ({ options }) => options.legendDisplay === "left" || options.legendDisplay === "right" || options.legendDisplay === "top" || options.legendDisplay === "bottom" || options.legendDisplay === void 0
2067
- }
2068
- ],
2069
- [
2070
- {
2071
- label: (0, i18n_exports._)("Legend mode"),
2072
- option: "legendMode",
2073
- editor: "editor.radioBar",
2074
- editorProps: {
2075
- values: [
2076
- { label: (0, i18n_exports._)("Standard"), value: "standard" },
2077
- { label: (0, i18n_exports._)("Compare series"), value: "seriesCompare" }
2078
- ]
2079
- },
2080
- showEditor: ({ options }) => options.legendDisplay === "left" || options.legendDisplay === "right" || options.legendDisplay === "top" || options.legendDisplay === "bottom" || options.legendDisplay === void 0
2081
- }
2082
- ]
2083
- ]
2084
- },
2326
+ AxesChartLegendWithTrellisAndMode({ showLegendTooltip: true, hideModeWhenOff: true }),
2085
2327
  AxesChartXGridAndLabels_default,
2086
2328
  AxesChartYGridAndLabels_default,
2087
2329
  AxesChartY2GridAndLabels_default
@@ -2127,7 +2369,8 @@ var config = {
2127
2369
  "dynamic-options" /* DYNAMIC_OPTIONS */,
2128
2370
  "placeholder" /* PLACEHOLDER */,
2129
2371
  "events" /* EVENTS */,
2130
- "downsampling" /* DOWNSAMPLING */
2372
+ "downsampling" /* DOWNSAMPLING */,
2373
+ "trellis" /* TRELLIS */
2131
2374
  ],
2132
2375
  themes: themes2
2133
2376
  };
@@ -2138,45 +2381,36 @@ var getSettingsFromThemedProps_exports = {};
2138
2381
  __export(getSettingsFromThemedProps_exports, {
2139
2382
  default: () => getSettingsFromThemedProps_default
2140
2383
  });
2141
- var defaultImport22 = __toESM(require("@splunk/themes/getSettingsFromThemedProps"));
2384
+ var defaultImport23 = __toESM(require("@splunk/themes/getSettingsFromThemedProps"));
2142
2385
  __reExport(getSettingsFromThemedProps_exports, require("@splunk/themes/getSettingsFromThemedProps"));
2143
- var getSettingsFromThemedProps_default = "default" in defaultImport22 ? defaultImport22.default : defaultImport22;
2386
+ var getSettingsFromThemedProps_default = "default" in defaultImport23 ? defaultImport23.default : defaultImport23;
2144
2387
 
2145
2388
  // esm-externals:@splunk/visualization-encoding/Options
2146
2389
  var Options_exports = {};
2147
2390
  __export(Options_exports, {
2148
2391
  default: () => Options_default
2149
2392
  });
2150
- var defaultImport23 = __toESM(require("@splunk/visualization-encoding/Options"));
2393
+ var defaultImport24 = __toESM(require("@splunk/visualization-encoding/Options"));
2151
2394
  __reExport(Options_exports, require("@splunk/visualization-encoding/Options"));
2152
- var Options_default = "default" in defaultImport23 ? defaultImport23.default : defaultImport23;
2395
+ var Options_default = "default" in defaultImport24 ? defaultImport24.default : defaultImport24;
2153
2396
 
2154
2397
  // esm-externals:@splunk/visualizations-shared/SanitizeProps
2155
2398
  var SanitizeProps_exports = {};
2156
2399
  __export(SanitizeProps_exports, {
2157
2400
  default: () => SanitizeProps_default
2158
2401
  });
2159
- var defaultImport24 = __toESM(require("@splunk/visualizations-shared/SanitizeProps"));
2402
+ var defaultImport25 = __toESM(require("@splunk/visualizations-shared/SanitizeProps"));
2160
2403
  __reExport(SanitizeProps_exports, require("@splunk/visualizations-shared/SanitizeProps"));
2161
- var SanitizeProps_default = "default" in defaultImport24 ? defaultImport24.default : defaultImport24;
2404
+ var SanitizeProps_default = "default" in defaultImport25 ? defaultImport25.default : defaultImport25;
2162
2405
 
2163
2406
  // esm-externals:@splunk/moment
2164
2407
  var moment_exports = {};
2165
2408
  __export(moment_exports, {
2166
2409
  default: () => moment_default
2167
2410
  });
2168
- var defaultImport25 = __toESM(require("@splunk/moment"));
2411
+ var defaultImport26 = __toESM(require("@splunk/moment"));
2169
2412
  __reExport(moment_exports, require("@splunk/moment"));
2170
- var moment_default = "default" in defaultImport25 ? defaultImport25.default : defaultImport25;
2171
-
2172
- // esm-externals:@splunk/visualization-context/FeatureFlagContext
2173
- var FeatureFlagContext_exports = {};
2174
- __export(FeatureFlagContext_exports, {
2175
- default: () => FeatureFlagContext_default
2176
- });
2177
- var defaultImport26 = __toESM(require("@splunk/visualization-context/FeatureFlagContext"));
2178
- __reExport(FeatureFlagContext_exports, require("@splunk/visualization-context/FeatureFlagContext"));
2179
- var FeatureFlagContext_default = "default" in defaultImport26 ? defaultImport26.default : defaultImport26;
2413
+ var moment_default = "default" in defaultImport26 ? defaultImport26.default : defaultImport26;
2180
2414
 
2181
2415
  // esm-externals:@splunk/visualizations-shared/hocUtils
2182
2416
  var hocUtils_exports = {};
@@ -2466,7 +2700,7 @@ var withFixedSizeContainer = (Viz) => {
2466
2700
  FixSizeItem,
2467
2701
  {
2468
2702
  "data-test": "fix-size-item",
2469
- "data-splunk-visualization-version": "27.0.0 - 9bf093b7d",
2703
+ "data-splunk-visualization-version": "27.1.0 - fe8b048df",
2470
2704
  width,
2471
2705
  height,
2472
2706
  backgroundColor
@@ -2532,7 +2766,7 @@ var Cover = styled_components_default.div`
2532
2766
  bottom: 0;
2533
2767
  `;
2534
2768
  var Blocker = styled_components_default.div.attrs({
2535
- "data-splunk-visualization-version": "27.0.0 - 9bf093b7d"
2769
+ "data-splunk-visualization-version": "27.1.0 - fe8b048df"
2536
2770
  })`
2537
2771
  position: relative;
2538
2772
  width: 100%;
@@ -2794,6 +3028,350 @@ var getFeatureFlag = (context, flagName) => {
2794
3028
  return false;
2795
3029
  };
2796
3030
 
3031
+ // esm-externals:@splunk/visualizations-shared/trellisUtils
3032
+ var trellisUtils_exports = {};
3033
+ __export(trellisUtils_exports, {
3034
+ default: () => trellisUtils_default
3035
+ });
3036
+ var defaultImport34 = __toESM(require("@splunk/visualizations-shared/trellisUtils"));
3037
+ __reExport(trellisUtils_exports, require("@splunk/visualizations-shared/trellisUtils"));
3038
+ var trellisUtils_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
3039
+
3040
+ // src/common/utils/trellisUtils.ts
3041
+ var AGGREGATIONS = "aggregations";
3042
+ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
3043
+ var _a, _b, _c, _d;
3044
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3045
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3046
+ let splitDataSources = null;
3047
+ let errorCode = null;
3048
+ if (fields && fields.length) {
3049
+ splitDataSources = {};
3050
+ for (let i = 0; i < fields.length; i += 1) {
3051
+ const fieldName = fields[i].name;
3052
+ if (!(fieldName == null ? void 0 : fieldName.startsWith("_"))) {
3053
+ splitDataSources[fieldName] = (0, lodash_exports.cloneDeep)(
3054
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3055
+ );
3056
+ splitDataSources[fieldName].primary.data.fields = [fields[i]];
3057
+ splitDataSources[fieldName].primary.data.columns = [columns[i]];
3058
+ }
3059
+ }
3060
+ } else {
3061
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3062
+ }
3063
+ return { splitDataSources, errorCode };
3064
+ };
3065
+ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
3066
+ var _a, _b, _c, _d;
3067
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3068
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3069
+ let splitDataSources = null;
3070
+ let splitByFields = [];
3071
+ let errorCode = null;
3072
+ if (typeof fields[0] !== "string") {
3073
+ splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
3074
+ }
3075
+ if (splitByFields && splitByFields.length > 0) {
3076
+ splitDataSources = {};
3077
+ splitByFields.forEach((splitByField) => {
3078
+ splitDataSources[splitByField] = (0, lodash_exports.cloneDeep)(
3079
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3080
+ );
3081
+ splitDataSources[splitByField].primary.data.fields = [fields[0]];
3082
+ splitDataSources[splitByField].primary.data.columns = [columns[0]];
3083
+ fields.forEach((field, idx) => {
3084
+ const fieldName = field == null ? void 0 : field.name;
3085
+ if (fieldName !== "_time" && !(fieldName == null ? void 0 : fieldName.startsWith("_")) && field.data_source === splitByField) {
3086
+ splitDataSources[splitByField].primary.data.fields.push(field);
3087
+ splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
3088
+ }
3089
+ });
3090
+ });
3091
+ } else if ((!splitByFields || !splitByFields.length) && fields.length > 1) {
3092
+ splitDataSources = {};
3093
+ for (let i = 1; i < fields.length; i += 1) {
3094
+ const fieldName = fields[i].name;
3095
+ if (!(fieldName == null ? void 0 : fieldName.startsWith("_"))) {
3096
+ splitDataSources[fieldName] = (0, lodash_exports.cloneDeep)(
3097
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3098
+ );
3099
+ splitDataSources[fieldName].primary.data.fields = [fields[0], fields[i]];
3100
+ splitDataSources[fieldName].primary.data.columns = [columns[0], columns[i]];
3101
+ }
3102
+ }
3103
+ } else {
3104
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3105
+ }
3106
+ return { splitDataSources, errorCode };
3107
+ };
3108
+ var dataSourcesSplitByAggregationsStats = (dataSource) => {
3109
+ var _a, _b, _c, _d;
3110
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3111
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3112
+ let splitDataSources = null;
3113
+ let splitByFields = [];
3114
+ let errorCode = null;
3115
+ if (typeof fields[0] !== "string") {
3116
+ splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
3117
+ }
3118
+ if (splitByFields && splitByFields.length > 0) {
3119
+ splitDataSources = {};
3120
+ splitByFields.forEach((splitByField) => {
3121
+ splitDataSources[splitByField] = (0, lodash_exports.cloneDeep)(
3122
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3123
+ );
3124
+ splitDataSources[splitByField].primary.data.fields = [fields[0]];
3125
+ splitDataSources[splitByField].primary.data.columns = [columns[0]];
3126
+ const idx = fields.findIndex((field) => field.name === splitByField);
3127
+ if (idx > 0) {
3128
+ splitDataSources[splitByField].primary.data.fields.push(fields[idx]);
3129
+ splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
3130
+ }
3131
+ });
3132
+ } else {
3133
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3134
+ }
3135
+ return { splitDataSources, errorCode };
3136
+ };
3137
+ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
3138
+ var _a, _b, _c, _d, _e;
3139
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3140
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3141
+ let splitDataSources = null;
3142
+ let splitByFields = [];
3143
+ let errorCode = null;
3144
+ if (typeof fields[0] !== "string") {
3145
+ splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
3146
+ }
3147
+ if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
3148
+ splitDataSources = {};
3149
+ const dataSourceKeys = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
3150
+ const valueKeys = [];
3151
+ for (let i = 1; i < fields.length; i += 1) {
3152
+ if (!((_e = fields[i].name) == null ? void 0 : _e.startsWith("_"))) {
3153
+ valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
3154
+ }
3155
+ }
3156
+ valueKeys.forEach((val) => {
3157
+ splitDataSources[val] = (0, lodash_exports.cloneDeep)(
3158
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3159
+ );
3160
+ splitDataSources[val].primary.data.fields = [
3161
+ { name: fields[0].name },
3162
+ ...dataSourceKeys.map((k) => ({
3163
+ name: k
3164
+ }))
3165
+ ];
3166
+ splitDataSources[val].primary.data.columns = [[...columns[0]]];
3167
+ dataSourceKeys.forEach((dsKey) => {
3168
+ fields.forEach((field, idx) => {
3169
+ if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
3170
+ splitDataSources[val].primary.data.columns.push([...columns[idx]]);
3171
+ }
3172
+ });
3173
+ });
3174
+ });
3175
+ } else {
3176
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3177
+ }
3178
+ return { splitDataSources, errorCode };
3179
+ };
3180
+ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
3181
+ var _a, _b, _c, _d;
3182
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3183
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3184
+ let splitDataSources = null;
3185
+ let splitByFields = [];
3186
+ let errorCode = null;
3187
+ if (typeof fields[0] !== "string") {
3188
+ splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
3189
+ }
3190
+ if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
3191
+ splitDataSources = {};
3192
+ const splitByFieldIdx = splitByFields.findIndex((f) => f === splitBy);
3193
+ const otherSplitBy = splitByFields.filter((f) => f !== splitBy);
3194
+ const dataSourceKeys = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
3195
+ const nonDataSourceAggregations = [];
3196
+ if (!dataSourceKeys.length && fields[0].groupby_rank === "0" && fields.length && !fields[1].groupby_rank) {
3197
+ for (let i = 1; i < fields.length; i += 1) {
3198
+ nonDataSourceAggregations.push(fields[i].name);
3199
+ }
3200
+ }
3201
+ if (splitByFieldIdx === 0) {
3202
+ const valueKeys = (0, lodash_exports.cloneDeep)(columns[0]);
3203
+ valueKeys.forEach((val, idx) => {
3204
+ splitDataSources[val] = (0, lodash_exports.cloneDeep)(
3205
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3206
+ );
3207
+ splitDataSources[val].primary.data.fields = [];
3208
+ if (otherSplitBy.length) {
3209
+ splitDataSources[val].primary.data.fields = [{ name: otherSplitBy[0] }];
3210
+ }
3211
+ if (dataSourceKeys.length) {
3212
+ const columnValues = [[]];
3213
+ splitDataSources[val].primary.data.fields = [
3214
+ ...splitDataSources[val].primary.data.fields,
3215
+ ...dataSourceKeys.map((k) => ({
3216
+ name: k
3217
+ }))
3218
+ ];
3219
+ dataSourceKeys.forEach(() => {
3220
+ columnValues.push([]);
3221
+ });
3222
+ for (let i = 1; i <= Math.ceil((fields.length - 1) / dataSourceKeys.length); i += 1) {
3223
+ columnValues[0].push(
3224
+ fields[i].splitby_value ? fields[i].splitby_value : fields[i].name
3225
+ );
3226
+ dataSourceKeys.forEach((dskey, dsIndx) => {
3227
+ const mul = (fields.length - 1) / dataSourceKeys.length;
3228
+ columnValues[dsIndx + 1].push(columns[i + dsIndx * mul][idx]);
3229
+ });
3230
+ }
3231
+ splitDataSources[val].primary.data.columns = columnValues;
3232
+ } else if (nonDataSourceAggregations.length) {
3233
+ const columnValues = [];
3234
+ fields.forEach((aggregationField, fieldIdx) => {
3235
+ if (fieldIdx > 0) {
3236
+ splitDataSources[val].primary.data.fields.push(aggregationField);
3237
+ columnValues.push([columns[fieldIdx][idx]]);
3238
+ }
3239
+ });
3240
+ splitDataSources[val].primary.data.columns = columnValues;
3241
+ }
3242
+ });
3243
+ } else {
3244
+ const valueKeys = [];
3245
+ for (let i = 1; i < fields.length; i += 1) {
3246
+ valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
3247
+ }
3248
+ valueKeys.forEach((val) => {
3249
+ splitDataSources[val] = (0, lodash_exports.cloneDeep)(
3250
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3251
+ );
3252
+ splitDataSources[val].primary.data.fields = [
3253
+ { name: otherSplitBy[0] },
3254
+ ...dataSourceKeys.map((k) => ({
3255
+ name: k
3256
+ }))
3257
+ ];
3258
+ splitDataSources[val].primary.data.columns = [[...columns[0]]];
3259
+ dataSourceKeys.forEach((dsKey) => {
3260
+ fields.forEach((field, idx) => {
3261
+ if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
3262
+ splitDataSources[val].primary.data.columns.push([...columns[idx]]);
3263
+ }
3264
+ });
3265
+ });
3266
+ });
3267
+ }
3268
+ } else {
3269
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3270
+ }
3271
+ return { splitDataSources, errorCode };
3272
+ };
3273
+ var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
3274
+ var _a, _b, _c, _d, _e, _f;
3275
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3276
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3277
+ let splitDataSources = null;
3278
+ let splitByFields = [];
3279
+ let errorCode = null;
3280
+ if (typeof fields[0] !== "string") {
3281
+ splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
3282
+ }
3283
+ const splitByIndex = fields == null ? void 0 : fields.findIndex(
3284
+ (field) => field === splitBy || field.name === splitBy
3285
+ );
3286
+ if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
3287
+ const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
3288
+ splitDataSources = {};
3289
+ splitByColumn.forEach((val, idx) => {
3290
+ if (!splitDataSources[val]) {
3291
+ splitDataSources[val] = [idx];
3292
+ } else {
3293
+ splitDataSources[val].push(idx);
3294
+ }
3295
+ });
3296
+ const cloneFields = (0, lodash_exports.cloneDeep)(fields);
3297
+ cloneFields.splice(splitByIndex, 1);
3298
+ const valueKeys = Object.keys(splitDataSources);
3299
+ valueKeys.forEach((val) => {
3300
+ const valIndices = (0, lodash_exports.cloneDeep)(splitDataSources[val]);
3301
+ splitDataSources[val] = (0, lodash_exports.cloneDeep)(
3302
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3303
+ );
3304
+ splitDataSources[val].primary.data.fields = cloneFields;
3305
+ splitDataSources[val].primary.data.columns = [];
3306
+ columns.forEach((col, idx) => {
3307
+ if (idx !== splitByIndex) {
3308
+ const newCol = valIndices.map((valIdx) => col[valIdx]);
3309
+ splitDataSources[val].primary.data.columns.push(newCol);
3310
+ }
3311
+ });
3312
+ });
3313
+ } else {
3314
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3315
+ }
3316
+ return { splitDataSources, errorCode };
3317
+ };
3318
+ var getTrellisDataSourcesBySplitMode = (splitMode, dataSources, trellisSplitBy) => {
3319
+ let result = null;
3320
+ try {
3321
+ if (splitMode === trellisUtils_exports.TIMECHART) {
3322
+ result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : dataSourcesSplitByModeTimechart(dataSources, trellisSplitBy);
3323
+ } else if (splitMode === trellisUtils_exports.STATS) {
3324
+ result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsStats(dataSources) : dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_exports.STATS);
3325
+ } else if (splitMode === trellisUtils_exports.CHART) {
3326
+ result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : dataSourcesSplitByModeChart(dataSources, trellisSplitBy);
3327
+ } else if (splitMode === trellisUtils_exports.UNKNOWN) {
3328
+ result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsUnknown(dataSources) : dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_exports.UNKNOWN);
3329
+ }
3330
+ } catch (ex) {
3331
+ console.error("getTrellisDataSourcesBySplitMode ", ex);
3332
+ result = { splitDataSources: null, errorCode: "UNKNOWN" };
3333
+ }
3334
+ return result;
3335
+ };
3336
+ var turnOffLegendDisplayWhenTrellisIsOn = (isTrellisOn, options) => {
3337
+ if (isTrellisOn && !options.legendDisplay) {
3338
+ return {
3339
+ legendDisplay: "off"
3340
+ };
3341
+ }
3342
+ return {};
3343
+ };
3344
+ var calculateSharedMinMax = (splitData) => {
3345
+ let max = -Infinity;
3346
+ let min = Infinity;
3347
+ Object.keys(splitData).forEach((splitByKey) => {
3348
+ const datasources = splitData[splitByKey];
3349
+ Object.keys(datasources).forEach((datasourceName) => {
3350
+ const dataColumns = datasources[datasourceName].data.columns;
3351
+ dataColumns.forEach((column) => {
3352
+ column.forEach((point) => {
3353
+ const pointNumber = Number(point);
3354
+ if (pointNumber > max) {
3355
+ max = pointNumber;
3356
+ }
3357
+ if (pointNumber < min) {
3358
+ min = pointNumber;
3359
+ }
3360
+ });
3361
+ });
3362
+ });
3363
+ });
3364
+ return [min, max];
3365
+ };
3366
+ var determineMinMax = (splitData, trellisSharedScale, yAxisMin, yAxisMax, stackMode) => {
3367
+ if (!trellisSharedScale || stackMode === "stacked100" || yAxisMin !== "auto" && yAxisMax !== "auto")
3368
+ return [yAxisMin, yAxisMax];
3369
+ const [sharedMin, sharedMax] = calculateSharedMinMax(splitData);
3370
+ const shouldUseSharedMax = sharedMax !== -Infinity && yAxisMax === "auto";
3371
+ const shouldUseSharedMin = sharedMin !== Infinity && yAxisMin === "auto";
3372
+ return [shouldUseSharedMin ? sharedMin : yAxisMin, shouldUseSharedMax ? sharedMax : yAxisMax];
3373
+ };
3374
+
2797
3375
  // src/common/withDashboardViz.tsx
2798
3376
  var withDashboardViz = (opts) => {
2799
3377
  const {
@@ -2801,6 +3379,8 @@ var withDashboardViz = (opts) => {
2801
3379
  vizConfig,
2802
3380
  computeVizProps: computeVizProps2 = () => {
2803
3381
  },
3382
+ computeVizPropsBeforeEval = () => {
3383
+ },
2804
3384
  disableEditModeCover,
2805
3385
  useIconPlaceholder
2806
3386
  } = opts;
@@ -2850,14 +3430,26 @@ var withDashboardViz = (opts) => {
2850
3430
  const isDownsamplingEnabledByFeatureFlag = Boolean(
2851
3431
  featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableDownsampling
2852
3432
  );
3433
+ const isTrellisFeatureFlagOn5 = Boolean(
3434
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
3435
+ );
3436
+ const isTrellisOn = isTrellisFeatureFlagOn5 && ((_a = vizConfig == null ? void 0 : vizConfig.supports) == null ? void 0 : _a.includes("trellis" /* TRELLIS */)) && (options == null ? void 0 : options.splitByLayout) === "trellis" /* TRELLIS */;
2853
3437
  const isMounted = react_exports.useRef(true);
2854
- const optionsToEvaluate = react_exports.useMemo(
2855
- () => ({
3438
+ const optionsToEvaluate = react_exports.useMemo(() => {
3439
+ var _a2;
3440
+ const legendDisplay = turnOffLegendDisplayWhenTrellisIsOn(isTrellisOn, options);
3441
+ const computedOptions = (_a2 = computeVizPropsBeforeEval(options)) != null ? _a2 : {};
3442
+ return {
2856
3443
  context: (0, lodash_exports.defaultsDeep)({}, context, vizConfig.defaultContext),
2857
- options: (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
2858
- }),
2859
- [options, context]
2860
- );
3444
+ options: (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)(
3445
+ {},
3446
+ legendDisplay,
3447
+ computedOptions,
3448
+ options,
3449
+ defaultOptions
3450
+ )
3451
+ };
3452
+ }, [isTrellisOn, options, context]);
2861
3453
  const [threshold, setThreshold] = react_exports.useState(Number(width));
2862
3454
  const onDownsamplingThresholdChange = react_exports.useCallback((newThreshold) => {
2863
3455
  setThreshold(newThreshold);
@@ -2938,11 +3530,8 @@ var withDashboardViz = (opts) => {
2938
3530
  useAsyncEvaluatedOptions
2939
3531
  ]);
2940
3532
  const evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
2941
- const isTrellisFeatureFlagOn = Boolean(
2942
- featureFlagContext && featureFlagContext.visualizations_enableTrellis
2943
- );
2944
3533
  let clonedEvaluatedOptions = evaluatedOptionsToUse;
2945
- if (isTrellisFeatureFlagOn && ((_a = vizConfig == null ? void 0 : vizConfig.supports) == null ? void 0 : _a.includes("trellis" /* TRELLIS */)) && (clonedEvaluatedOptions == null ? void 0 : clonedEvaluatedOptions.splitByLayout) === "trellis" /* TRELLIS */) {
3534
+ if (isTrellisOn) {
2946
3535
  clonedEvaluatedOptions = __spreadProps(__spreadValues({}, evaluatedOptionsToUse), {
2947
3536
  backgroundColor: clonedEvaluatedOptions == null ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
2948
3537
  });
@@ -3053,18 +3642,18 @@ var propUtils_exports = {};
3053
3642
  __export(propUtils_exports, {
3054
3643
  default: () => propUtils_default
3055
3644
  });
3056
- var defaultImport34 = __toESM(require("@splunk/visualizations-shared/propUtils"));
3645
+ var defaultImport35 = __toESM(require("@splunk/visualizations-shared/propUtils"));
3057
3646
  __reExport(propUtils_exports, require("@splunk/visualizations-shared/propUtils"));
3058
- var propUtils_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
3647
+ var propUtils_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
3059
3648
 
3060
3649
  // esm-externals:@splunk/visualizations-shared/simpleXMLOptions
3061
3650
  var simpleXMLOptions_exports = {};
3062
3651
  __export(simpleXMLOptions_exports, {
3063
3652
  default: () => simpleXMLOptions_default
3064
3653
  });
3065
- var defaultImport35 = __toESM(require("@splunk/visualizations-shared/simpleXMLOptions"));
3654
+ var defaultImport36 = __toESM(require("@splunk/visualizations-shared/simpleXMLOptions"));
3066
3655
  __reExport(simpleXMLOptions_exports, require("@splunk/visualizations-shared/simpleXMLOptions"));
3067
- var simpleXMLOptions_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
3656
+ var simpleXMLOptions_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
3068
3657
 
3069
3658
  // src/Area/areaUtils.ts
3070
3659
  var transformOptions = (originalOptions) => {
@@ -3191,6 +3780,258 @@ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
3191
3780
  return !!rangeSelectEventHandler && xAxisIsTime;
3192
3781
  };
3193
3782
 
3783
+ // esm-externals:@splunk/react-ui/Paginator
3784
+ var Paginator_exports = {};
3785
+ __export(Paginator_exports, {
3786
+ default: () => Paginator_default
3787
+ });
3788
+ var defaultImport37 = __toESM(require("@splunk/react-ui/Paginator"));
3789
+ __reExport(Paginator_exports, require("@splunk/react-ui/Paginator"));
3790
+ var Paginator_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
3791
+
3792
+ // esm-externals:@splunk/themes
3793
+ var themes_exports = {};
3794
+ __export(themes_exports, {
3795
+ default: () => themes_default
3796
+ });
3797
+ var defaultImport38 = __toESM(require("@splunk/themes"));
3798
+ __reExport(themes_exports, require("@splunk/themes"));
3799
+ var themes_default = "default" in defaultImport38 ? defaultImport38.default : defaultImport38;
3800
+
3801
+ // src/common/hocs/withTrellis.tsx
3802
+ var TrellisContainer = styled_components_default.div`
3803
+ overflow: hidden;
3804
+ display: flex;
3805
+ flex-direction: column;
3806
+ background-color: ${(props) => props.backgroundColor};
3807
+ ${(props) => (0, style_exports.toDimension)((0, lodash_exports.pick)(props, ["width", "height"]))};
3808
+ > [data-test='paginator'] {
3809
+ align-self: flex-end;
3810
+ margin-bottom: 10px;
3811
+ }
3812
+ `;
3813
+ var TrellisContainerGrid = styled_components_default.div`
3814
+ display: grid;
3815
+ height: ${(props) => {
3816
+ return `${props.height}px`;
3817
+ }};
3818
+ gap: 10px 10px;
3819
+ grid-template-columns: ${(props) => {
3820
+ return props.colCount ? `repeat(${props.colCount}, minmax(${props.colMinWidth}px, 1fr))` : `repeat(auto-fit, minmax(${props.colMinWidth}px, 1fr))`;
3821
+ }};
3822
+ overflow: auto;
3823
+ justify-items: stretch;
3824
+ grid-auto-rows: ${(props) => `${props.rowHeight}px`};
3825
+ .child {
3826
+ height: ${(props) => `${props.rowHeight}px`};
3827
+ }
3828
+ `;
3829
+ var showErrorMessage = (errorCode, width, height) => {
3830
+ if (errorCode === "INVALID_SPLIT_BY_FIELD") {
3831
+ return /* @__PURE__ */ react_exports.createElement(
3832
+ Message_default,
3833
+ {
3834
+ width,
3835
+ height,
3836
+ message: (0, i18n_exports._)("Select a valid trellis split by field"),
3837
+ level: "info"
3838
+ }
3839
+ );
3840
+ }
3841
+ if (errorCode === "UNKNOWN_DATA_SPLIT_MODE") {
3842
+ return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Unknown data split mode"), level: "info" });
3843
+ }
3844
+ return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Error render in trellis"), level: "info" });
3845
+ };
3846
+ var withTrellis = (Viz) => {
3847
+ const VizWithTrellis = (opts) => {
3848
+ const cachedHandleResize = react_exports.useCallback((w, h) => {
3849
+ setContainerWidth(w);
3850
+ setContainerHeight(h);
3851
+ }, []);
3852
+ const [containerWidth, setContainerWidth] = react_exports.useState(Number(opts.width));
3853
+ const [containerHeight, setContainerHeight] = react_exports.useState(Number(opts.height));
3854
+ const _a = opts, { options = {}, height, width } = _a, otherProps = __objRest(_a, ["options", "height", "width"]);
3855
+ const defaultOptions = (0, JSONSchemaUtils_exports.pickFieldFromJSONSchema)(Viz.config.optionsSchema, "default");
3856
+ const mergedOptions = (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions);
3857
+ const {
3858
+ trellisColumns,
3859
+ trellisPageCount,
3860
+ trellisMinColumnWidth,
3861
+ trellisRowHeight,
3862
+ splitByLayout,
3863
+ trellisSplitBy,
3864
+ trellisSharedScale,
3865
+ stackMode,
3866
+ yAxisMin,
3867
+ yAxisMax
3868
+ } = mergedOptions;
3869
+ const colCount = trellisColumns > 0 ? trellisColumns : defaultOptions.trellisColumns;
3870
+ const pageCount = +trellisPageCount > 0 ? +trellisPageCount : defaultOptions.trellisPageCount;
3871
+ const colMinWidth = trellisMinColumnWidth > 0 ? trellisMinColumnWidth : defaultOptions.trellisMinColumnWidth;
3872
+ const rowHeight = trellisRowHeight > 0 ? trellisRowHeight : defaultOptions.trellisRowHeight;
3873
+ const [pageNum, setPageNum] = (0, react_exports.useState)(1);
3874
+ const [pagedData, setPagedData] = (0, react_exports.useState)(null);
3875
+ let splitByKeys = [];
3876
+ let totalPages = 0;
3877
+ let showPaginator = false;
3878
+ const { dataSources } = otherProps;
3879
+ const theme = {
3880
+ splunkThemeV1: useSplunkTheme_default()
3881
+ };
3882
+ const {
3883
+ family: currentThemeFamily,
3884
+ colorScheme: currentThemeColorScheme,
3885
+ density: currentThemeDensity
3886
+ } = (0, themes_exports.getSettingsFromThemedProps)({ theme });
3887
+ const trellisBackgroundColor = (0, react_exports.useMemo)(() => {
3888
+ const themeFunc = (themeVar) => {
3889
+ var _a2, _b;
3890
+ return (_b = (_a2 = Viz.config.themes)[themeVar]) == null ? void 0 : _b.call(_a2, {
3891
+ trellisBackgroundColor: mergedOptions.trellisBackgroundColor,
3892
+ theme
3893
+ });
3894
+ };
3895
+ const evaluated = Options_exports.Options.evaluate(
3896
+ {
3897
+ context: Viz.config.context,
3898
+ options: { trellisBackgroundColor: mergedOptions.trellisBackgroundColor }
3899
+ },
3900
+ {},
3901
+ themeFunc
3902
+ );
3903
+ return evaluated.trellisBackgroundColor;
3904
+ }, [
3905
+ mergedOptions.trellisBackgroundColor,
3906
+ currentThemeFamily,
3907
+ currentThemeColorScheme,
3908
+ currentThemeDensity
3909
+ ]);
3910
+ const columns = (0, lodash_exports.get)(dataSources, "primary.data.columns", void 0);
3911
+ const fields = (0, lodash_exports.get)(dataSources, "primary.data.fields", void 0);
3912
+ const noColumns = columns === void 0;
3913
+ const noFields = fields === void 0;
3914
+ const updateDataDisplay = (currPage) => {
3915
+ if (!showPaginator) {
3916
+ setPagedData(splitByKeys);
3917
+ setPageNum(1);
3918
+ } else {
3919
+ const startIdx = pageCount * (currPage - 1);
3920
+ const paged = splitByKeys.slice(startIdx, startIdx + pageCount);
3921
+ setPagedData(paged);
3922
+ }
3923
+ };
3924
+ (0, react_exports.useEffect)(() => {
3925
+ setPageNum(1);
3926
+ updateDataDisplay(1);
3927
+ }, [pageCount, trellisSplitBy]);
3928
+ (0, react_exports.useEffect)(() => {
3929
+ updateDataDisplay(pageNum);
3930
+ }, [columns, fields, trellisSplitBy, pageNum, splitByLayout]);
3931
+ const handlePageChange = (0, react_exports.useCallback)(
3932
+ (event, { page }) => {
3933
+ setPageNum(page);
3934
+ },
3935
+ [pageNum, pagedData]
3936
+ );
3937
+ const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
3938
+ const isTrellisFeatureFlagOn5 = Boolean(
3939
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
3940
+ );
3941
+ if (!isTrellisFeatureFlagOn5 || !splitByLayout || splitByLayout !== visualization_schemas_exports.LAYOUT_TYPE.Trellis) {
3942
+ return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({}, opts));
3943
+ }
3944
+ if (splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis) {
3945
+ if (noColumns || noFields) {
3946
+ return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Loading"), level: "info" });
3947
+ }
3948
+ let currTrellisSplitBy = trellisSplitBy;
3949
+ if (!trellisSplitBy || trellisSplitBy.length === 0) {
3950
+ const splitByPossibleFields = (0, trellisUtils_exports.getAllPossibleSplitByFields)(fields);
3951
+ currTrellisSplitBy = splitByPossibleFields.fields && splitByPossibleFields.fields.length ? splitByPossibleFields.fields[0] : AGGREGATIONS;
3952
+ }
3953
+ const splitMode = (0, trellisUtils_exports.getTrellisDataSplitterMode)(fields);
3954
+ const dataSplitResult = getTrellisDataSourcesBySplitMode(
3955
+ splitMode,
3956
+ dataSources,
3957
+ currTrellisSplitBy
3958
+ );
3959
+ const modifiedDataSourceBySplitBy = dataSplitResult == null ? void 0 : dataSplitResult.splitDataSources;
3960
+ const dataSplitErrorCode = dataSplitResult == null ? void 0 : dataSplitResult.errorCode;
3961
+ if (!modifiedDataSourceBySplitBy || Object.keys(modifiedDataSourceBySplitBy).length === 0 || dataSplitErrorCode) {
3962
+ return showErrorMessage(dataSplitErrorCode, width, height);
3963
+ }
3964
+ const splitByKeysModified = modifiedDataSourceBySplitBy ? Object.keys(modifiedDataSourceBySplitBy) : [];
3965
+ if (splitByKeysModified) {
3966
+ showPaginator = splitByKeysModified.length > pageCount;
3967
+ splitByKeys = splitByKeysModified;
3968
+ totalPages = splitByKeysModified ? Math.ceil(splitByKeysModified.length / pageCount) : 0;
3969
+ }
3970
+ const [calculatedMin, calculatedMax] = determineMinMax(
3971
+ modifiedDataSourceBySplitBy,
3972
+ trellisSharedScale,
3973
+ yAxisMin,
3974
+ yAxisMax,
3975
+ stackMode
3976
+ );
3977
+ return /* @__PURE__ */ react_exports.createElement(TrellisContainer, { height, width, backgroundColor: trellisBackgroundColor }, /* @__PURE__ */ react_exports.createElement(
3978
+ TrellisContainerGrid,
3979
+ {
3980
+ height,
3981
+ colCount,
3982
+ colMinWidth,
3983
+ rowHeight
3984
+ },
3985
+ pagedData == null ? void 0 : pagedData.map((splitByKey, idx) => /* @__PURE__ */ react_exports.createElement(
3986
+ "div",
3987
+ {
3988
+ className: "child",
3989
+ "data-test": "trellis-child",
3990
+ key: `div-child-${idx.toString()}`
3991
+ },
3992
+ /* @__PURE__ */ react_exports.createElement(
3993
+ SizeAwareWrapper_default,
3994
+ {
3995
+ width,
3996
+ height,
3997
+ onResize: cachedHandleResize
3998
+ }
3999
+ ),
4000
+ /* @__PURE__ */ react_exports.createElement(
4001
+ Viz,
4002
+ __spreadProps(__spreadValues({}, otherProps), {
4003
+ trellisKey: splitByKey,
4004
+ trellisSplitBy: currTrellisSplitBy,
4005
+ dataSources: modifiedDataSourceBySplitBy[splitByKey],
4006
+ options: __spreadProps(__spreadValues({}, options), {
4007
+ yAxisMin: calculatedMin,
4008
+ yAxisMax: calculatedMax
4009
+ }),
4010
+ key: `viz-${idx.toString()}`,
4011
+ height: containerHeight,
4012
+ width: containerWidth
4013
+ })
4014
+ )
4015
+ ))
4016
+ ), showPaginator && totalPages >= pageNum && /* @__PURE__ */ react_exports.createElement(
4017
+ Paginator_default,
4018
+ {
4019
+ onChange: handlePageChange,
4020
+ current: pageNum,
4021
+ alwaysShowLastPageLink: true,
4022
+ totalPages
4023
+ }
4024
+ ));
4025
+ }
4026
+ return null;
4027
+ };
4028
+ VizWithTrellis.propTypes = Viz.proptypes;
4029
+ VizWithTrellis.defaultProps = Viz.defaultProps;
4030
+ VizWithTrellis.config = Viz.config;
4031
+ return VizWithTrellis;
4032
+ };
4033
+ var withTrellis_default = withTrellis;
4034
+
3194
4035
  // src/Area/Area.tsx
3195
4036
  var computeVizProps = (_a) => {
3196
4037
  var _b = _a, {
@@ -3203,7 +4044,10 @@ var computeVizProps = (_a) => {
3203
4044
  annotationX,
3204
4045
  annotationColor,
3205
4046
  annotationLabel,
3206
- visualizationApiRef
4047
+ visualizationApiRef,
4048
+ trellisKey,
4049
+ trellisSplitBy,
4050
+ themeFunc
3207
4051
  } = _b, otherOptions = __objRest(_b, [
3208
4052
  "dataSources",
3209
4053
  "onEventTrigger",
@@ -3214,9 +4058,19 @@ var computeVizProps = (_a) => {
3214
4058
  "annotationX",
3215
4059
  "annotationColor",
3216
4060
  "annotationLabel",
3217
- "visualizationApiRef"
4061
+ "visualizationApiRef",
4062
+ "trellisKey",
4063
+ "trellisSplitBy",
4064
+ "themeFunc"
3218
4065
  ]);
3219
- const computedProps = { visualizationApiRef, onEventTrigger };
4066
+ const defaultFontColor = themeFunc("defaultFontColor");
4067
+ const computedProps = {
4068
+ visualizationApiRef,
4069
+ trellisKey,
4070
+ trellisSplitBy,
4071
+ defaultFontColor,
4072
+ onEventTrigger
4073
+ };
3220
4074
  const { y2, y2Fields, hasEventHandlers, eventHandlers } = otherOptions;
3221
4075
  computedProps.options = transformOptions(otherOptions);
3222
4076
  const chartingAnnotations = getAnnotations({ annotationX, annotationColor, annotationLabel });
@@ -3238,11 +4092,13 @@ var computeVizProps = (_a) => {
3238
4092
  }
3239
4093
  return computedProps;
3240
4094
  };
3241
- var Area = withDashboardViz_default({
3242
- ReactViz: Charting_default,
3243
- computeVizProps,
3244
- vizConfig: config_default
3245
- });
4095
+ var Area = withTrellis_default(
4096
+ withDashboardViz_default({
4097
+ ReactViz: Charting_default,
4098
+ computeVizProps,
4099
+ vizConfig: config_default
4100
+ })
4101
+ );
3246
4102
  var themes3 = null;
3247
4103
  var Area_default = Area;
3248
4104
  //# sourceMappingURL=Area.js.map