@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/Column.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,90 +961,82 @@ 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/visualizations-shared/simpleXMLOptions
883
988
  var simpleXMLOptions_exports = {};
884
989
  __export(simpleXMLOptions_exports, {
885
990
  default: () => simpleXMLOptions_default
886
991
  });
887
- var defaultImport16 = __toESM(require("@splunk/visualizations-shared/simpleXMLOptions"));
992
+ var defaultImport18 = __toESM(require("@splunk/visualizations-shared/simpleXMLOptions"));
888
993
  __reExport(simpleXMLOptions_exports, require("@splunk/visualizations-shared/simpleXMLOptions"));
889
- var simpleXMLOptions_default = "default" in defaultImport16 ? defaultImport16.default : defaultImport16;
994
+ var simpleXMLOptions_default = "default" in defaultImport18 ? defaultImport18.default : defaultImport18;
890
995
 
891
996
  // esm-externals:@splunk/visualization-icons
892
997
  var visualization_icons_exports = {};
893
998
  __export(visualization_icons_exports, {
894
999
  default: () => visualization_icons_default
895
1000
  });
896
- var defaultImport17 = __toESM(require("@splunk/visualization-icons"));
1001
+ var defaultImport19 = __toESM(require("@splunk/visualization-icons"));
897
1002
  __reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
898
- var visualization_icons_default = "default" in defaultImport17 ? defaultImport17.default : defaultImport17;
1003
+ var visualization_icons_default = "default" in defaultImport19 ? defaultImport19.default : defaultImport19;
899
1004
 
900
1005
  // esm-externals:@splunk/visualization-icons/placeholders
901
1006
  var placeholders_exports = {};
902
1007
  __export(placeholders_exports, {
903
1008
  default: () => placeholders_default
904
1009
  });
905
- var defaultImport18 = __toESM(require("@splunk/visualization-icons/placeholders"));
1010
+ var defaultImport20 = __toESM(require("@splunk/visualization-icons/placeholders"));
906
1011
  __reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
907
- var placeholders_default = "default" in defaultImport18 ? defaultImport18.default : defaultImport18;
908
-
909
- // esm-externals:@splunk/visualization-schemas
910
- var visualization_schemas_exports = {};
911
- __export(visualization_schemas_exports, {
912
- default: () => visualization_schemas_default
913
- });
914
- var defaultImport19 = __toESM(require("@splunk/visualization-schemas"));
915
- __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
916
- var visualization_schemas_default = "default" in defaultImport19 ? defaultImport19.default : defaultImport19;
1012
+ var placeholders_default = "default" in defaultImport20 ? defaultImport20.default : defaultImport20;
917
1013
 
918
1014
  // esm-externals:@splunk/themes/pick
919
1015
  var pick_exports = {};
920
1016
  __export(pick_exports, {
921
1017
  default: () => pick_default
922
1018
  });
923
- var defaultImport20 = __toESM(require("@splunk/themes/pick"));
1019
+ var defaultImport21 = __toESM(require("@splunk/themes/pick"));
924
1020
  __reExport(pick_exports, require("@splunk/themes/pick"));
925
- var pick_default = "default" in defaultImport20 ? defaultImport20.default : defaultImport20;
1021
+ var pick_default = "default" in defaultImport21 ? defaultImport21.default : defaultImport21;
926
1022
 
927
1023
  // esm-externals:@splunk/themes/variables
928
1024
  var variables_exports = {};
929
1025
  __export(variables_exports, {
930
1026
  default: () => variables_default
931
1027
  });
932
- var defaultImport21 = __toESM(require("@splunk/themes/variables"));
1028
+ var defaultImport22 = __toESM(require("@splunk/themes/variables"));
933
1029
  __reExport(variables_exports, require("@splunk/themes/variables"));
934
- var variables_default = "default" in defaultImport21 ? defaultImport21.default : defaultImport21;
1030
+ var variables_default = "default" in defaultImport22 ? defaultImport22.default : defaultImport22;
935
1031
 
936
1032
  // esm-externals:@splunk/visualizations-shared/configUtils
937
1033
  var configUtils_exports = {};
938
1034
  __export(configUtils_exports, {
939
1035
  default: () => configUtils_default
940
1036
  });
941
- var defaultImport22 = __toESM(require("@splunk/visualizations-shared/configUtils"));
1037
+ var defaultImport23 = __toESM(require("@splunk/visualizations-shared/configUtils"));
942
1038
  __reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
943
- var configUtils_default = "default" in defaultImport22 ? defaultImport22.default : defaultImport22;
1039
+ var configUtils_default = "default" in defaultImport23 ? defaultImport23.default : defaultImport23;
944
1040
 
945
1041
  // src/common/utils/configUtils.ts
946
1042
  function enhanceConfig(vizConfig) {
@@ -962,6 +1058,13 @@ var insertLayout = (layout, index, ...layoutItems) => [
962
1058
  ];
963
1059
 
964
1060
  // src/common/editorConfig/AxesChartDataConfig.ts
1061
+ var isTrellisFeatureFlagOn = ({ featureFlags }) => {
1062
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
1063
+ };
1064
+ var isTrellisEnabled = ({ options, featureFlags }) => {
1065
+ const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
1066
+ return isTrellisFeatureFlagOn({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1067
+ };
965
1068
  var AxesChartDataConfig = {
966
1069
  label: (0, i18n_exports._)("Data configurations"),
967
1070
  layout: [
@@ -1015,7 +1118,8 @@ var AxesChartDataConfigBar = {
1015
1118
  filterByTypes: ["number"],
1016
1119
  supportsDSL: true,
1017
1120
  expectedDataPrimitive: ["series", "frame"]
1018
- }
1121
+ },
1122
+ isDisabled: isTrellisEnabled
1019
1123
  }
1020
1124
  ])
1021
1125
  };
@@ -1118,10 +1222,136 @@ var AxesChartDataConfigAreaColumnLine = {
1118
1222
  ]
1119
1223
  };
1120
1224
 
1225
+ // src/common/editorConfig/TrellisEditors.ts
1226
+ var isTrellisFeatureFlagOn2 = ({ featureFlags }) => {
1227
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
1228
+ };
1229
+ var isTrellisEnabled2 = ({ options, featureFlags }) => {
1230
+ const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
1231
+ return isTrellisFeatureFlagOn2({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1232
+ };
1233
+ var TrellisEditorConfig = [
1234
+ [
1235
+ {
1236
+ label: (0, i18n_exports._)("Trellis layout"),
1237
+ option: "splitByLayout",
1238
+ editor: "editor.toggle",
1239
+ showEditor: isTrellisFeatureFlagOn2
1240
+ }
1241
+ ],
1242
+ [
1243
+ {
1244
+ label: (0, i18n_exports._)("Split by"),
1245
+ option: "trellisSplitBy",
1246
+ editor: "editor.trellisSplitBy",
1247
+ editorProps: {
1248
+ dataSourceKey: "primary"
1249
+ },
1250
+ showEditor: isTrellisEnabled2
1251
+ }
1252
+ ],
1253
+ [
1254
+ {
1255
+ label: (0, i18n_exports._)("Number of columns"),
1256
+ option: "trellisColumns",
1257
+ editor: "editor.number",
1258
+ editorProps: {
1259
+ min: 1
1260
+ },
1261
+ placeholder: (0, i18n_exports._)("Auto"),
1262
+ showEditor: isTrellisEnabled2
1263
+ }
1264
+ ],
1265
+ [
1266
+ {
1267
+ label: (0, i18n_exports._)("Min column width"),
1268
+ option: "trellisMinColumnWidth",
1269
+ editor: "editor.number",
1270
+ editorProps: {
1271
+ min: 1
1272
+ },
1273
+ showEditor: isTrellisEnabled2
1274
+ },
1275
+ {
1276
+ label: (0, i18n_exports._)("Row height"),
1277
+ option: "trellisRowHeight",
1278
+ editor: "editor.number",
1279
+ editorProps: {
1280
+ min: 1
1281
+ },
1282
+ showEditor: isTrellisEnabled2
1283
+ }
1284
+ ],
1285
+ [
1286
+ {
1287
+ label: (0, i18n_exports._)("Max number of components per page"),
1288
+ option: "trellisPageCount",
1289
+ editor: "editor.number",
1290
+ editorProps: {
1291
+ min: 1
1292
+ },
1293
+ showEditor: isTrellisEnabled2
1294
+ }
1295
+ ]
1296
+ ];
1297
+ var TimechartTrellisEditorConfig = [
1298
+ [
1299
+ {
1300
+ label: (0, i18n_exports._)("Trellis layout"),
1301
+ option: "splitByLayout",
1302
+ editor: "editor.toggle",
1303
+ showEditor: isTrellisFeatureFlagOn2,
1304
+ // add help text for timecharts
1305
+ editorProps: {
1306
+ help: (0, i18n_exports._)(
1307
+ "Y2-axis and overlay field configurations are not supported when trellis is enabled."
1308
+ ),
1309
+ helpFormat: "under"
1310
+ }
1311
+ }
1312
+ ],
1313
+ ...TrellisEditorConfig.slice(1),
1314
+ [
1315
+ {
1316
+ label: (0, i18n_exports._)("Shared y-axis scale"),
1317
+ option: "trellisSharedScale",
1318
+ editor: "editor.checkbox",
1319
+ showEditor: isTrellisEnabled2
1320
+ }
1321
+ ]
1322
+ ];
1323
+ var TrellisBackgroundColorEditor = {
1324
+ label: (0, i18n_exports._)("Trellis background"),
1325
+ option: "trellisBackgroundColor",
1326
+ editor: "editor.color",
1327
+ showEditor: isTrellisEnabled2
1328
+ };
1329
+
1121
1330
  // src/common/editorConfig/AxesChartDataDisplay.ts
1122
- var AxesChartDataDisplayLine = {
1331
+ var isTrellisFeatureFlagOn3 = ({ featureFlags }) => {
1332
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
1333
+ };
1334
+ var isTrellisEnabled3 = ({ options, featureFlags }) => {
1335
+ const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
1336
+ return isTrellisFeatureFlagOn3({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1337
+ };
1338
+ var AxesChartDataDisplayBase = {
1123
1339
  label: (0, i18n_exports._)("Data display"),
1124
1340
  layout: [
1341
+ [
1342
+ {
1343
+ label: (0, i18n_exports._)("Stack mode"),
1344
+ option: "stackMode",
1345
+ editor: "editor.select",
1346
+ editorProps: {
1347
+ values: [
1348
+ { label: (0, i18n_exports._)("Not stacked"), value: "auto" },
1349
+ { label: (0, i18n_exports._)("Stacked"), value: "stacked" },
1350
+ { label: (0, i18n_exports._)("Stacked 100%"), value: "stacked100" }
1351
+ ]
1352
+ }
1353
+ }
1354
+ ],
1125
1355
  [
1126
1356
  {
1127
1357
  label: (0, i18n_exports._)("Null value display"),
@@ -1157,7 +1387,8 @@ var AxesChartDataDisplayLine = {
1157
1387
  editor: "editor.columnMultiSelectionByFieldNameEditor",
1158
1388
  editorProps: {
1159
1389
  filterByTypes: ["number"]
1160
- }
1390
+ },
1391
+ isDisabled: isTrellisEnabled3
1161
1392
  }
1162
1393
  ],
1163
1394
  [
@@ -1174,60 +1405,32 @@ var AxesChartDataDisplayLine = {
1174
1405
  editor: "editor.checkbox",
1175
1406
  showEditor: ({ options }) => options.showSplitSeries
1176
1407
  }
1177
- ]
1178
- ]
1179
- };
1180
- var AxesChartDataDisplay = {
1181
- label: AxesChartDataDisplayLine.label,
1182
- layout: [
1183
- [
1184
- {
1185
- label: (0, i18n_exports._)("Stack mode"),
1186
- option: "stackMode",
1187
- editor: "editor.select",
1188
- editorProps: {
1189
- values: [
1190
- { label: (0, i18n_exports._)("Not stacked"), value: "auto" },
1191
- { label: (0, i18n_exports._)("Stacked"), value: "stacked" },
1192
- { label: (0, i18n_exports._)("Stacked 100%"), value: "stacked100" }
1193
- ]
1194
- }
1195
- }
1196
1408
  ],
1197
- ...AxesChartDataDisplayLine.layout
1409
+ ...TimechartTrellisEditorConfig
1198
1410
  ]
1199
1411
  };
1200
1412
  var AxesChartDataDisplayBar = {
1201
- label: AxesChartDataDisplayLine.label,
1413
+ label: AxesChartDataDisplayBase.label,
1202
1414
  layout: [
1203
- [
1204
- {
1205
- label: (0, i18n_exports._)("Stack mode"),
1206
- option: "stackMode",
1207
- editor: "editor.select",
1208
- editorProps: {
1209
- values: [
1210
- { label: (0, i18n_exports._)("Not stacked"), value: "auto" },
1211
- { label: (0, i18n_exports._)("Stacked"), value: "stacked" },
1212
- { label: (0, i18n_exports._)("Stacked 100%"), value: "stacked100" }
1213
- ]
1214
- }
1215
- }
1216
- ],
1217
- // remove nullValueDisplay
1218
- ...(0, lodash_exports.drop)(AxesChartDataDisplayLine.layout)
1415
+ AxesChartDataDisplayBase.layout[0],
1416
+ // remove null value display editor at index 1
1417
+ ...AxesChartDataDisplayBase.layout.slice(2)
1219
1418
  ]
1220
1419
  };
1221
1420
  var AxesChartDataDisplayColumn = {
1222
- label: AxesChartDataDisplayBar.label,
1421
+ label: AxesChartDataDisplayBase.label,
1223
1422
  layout: [
1224
- ...insertLayout(AxesChartDataDisplayBar.layout, 2, [
1423
+ AxesChartDataDisplayBase.layout[0],
1424
+ // remove null value display and add data value display
1425
+ AxesChartDataDisplayBase.layout[2],
1426
+ [
1225
1427
  {
1226
1428
  label: (0, i18n_exports._)("Show tooltip on hover"),
1227
1429
  option: "showTooltip",
1228
1430
  editor: "editor.checkbox"
1229
1431
  }
1230
- ]),
1432
+ ],
1433
+ ...AxesChartDataDisplayBase.layout.slice(3),
1231
1434
  [
1232
1435
  {
1233
1436
  label: (0, i18n_exports._)("Column grouping mode"),
@@ -1243,6 +1446,13 @@ var AxesChartDataDisplayColumn = {
1243
1446
  ]
1244
1447
  ]
1245
1448
  };
1449
+ var AxesChartDataDisplayLine = {
1450
+ label: AxesChartDataDisplayBase.label,
1451
+ layout: [
1452
+ // remove stacked mode editor
1453
+ ...AxesChartDataDisplayBase.layout.slice(1)
1454
+ ]
1455
+ };
1246
1456
 
1247
1457
  // src/common/editorConfig/BackgroundColor.ts
1248
1458
  var background = ({
@@ -1292,7 +1502,19 @@ var AxesChartColorAndStyle = {
1292
1502
  ]
1293
1503
  ]
1294
1504
  };
1295
- var AxesChartColorAndStyle_default = AxesChartColorAndStyle;
1505
+ var AreaAxesChartColorAndStyleWithTrellis = __spreadProps(__spreadValues({}, AxesChartColorAndStyle), {
1506
+ layout: [
1507
+ AxesChartColorAndStyle.layout[0],
1508
+ [
1509
+ __spreadProps(__spreadValues({}, TrellisBackgroundColorEditor), {
1510
+ editorProps: {
1511
+ themes
1512
+ }
1513
+ })
1514
+ ],
1515
+ ...AxesChartColorAndStyle.layout.slice(1)
1516
+ ]
1517
+ });
1296
1518
 
1297
1519
  // src/common/editorConfig/AxesChartLegend.ts
1298
1520
  var AxesChartLegend = {
@@ -1332,7 +1554,54 @@ var AxesChartLegend = {
1332
1554
  ]
1333
1555
  ]
1334
1556
  };
1335
- var AxesChartLegend_default = AxesChartLegend;
1557
+ var AxesChartLegendWithTrellisAndMode = ({
1558
+ showLegendTooltip = false,
1559
+ hideModeWhenOff = false
1560
+ }) => ({
1561
+ label: AxesChartLegend.label,
1562
+ layout: [
1563
+ [
1564
+ {
1565
+ label: (0, i18n_exports._)("Legend display"),
1566
+ option: "legendDisplay",
1567
+ editor: "editor.select",
1568
+ editorProps: {
1569
+ values: [
1570
+ { label: (0, i18n_exports._)("Right"), value: "right" },
1571
+ { label: (0, i18n_exports._)("Left"), value: "left" },
1572
+ { label: (0, i18n_exports._)("Top"), value: "top" },
1573
+ { label: (0, i18n_exports._)("Bottom"), value: "bottom" },
1574
+ { label: (0, i18n_exports._)("Off"), value: "off" }
1575
+ ],
1576
+ tooltip: showLegendTooltip && (0, i18n_exports._)('Legend mode must be "Standard" to configure legend display')
1577
+ },
1578
+ isDisabled: showLegendTooltip ? ({ options }) => options.legendMode === "seriesCompare" : void 0,
1579
+ overrideDefaultValue: ({ options }) => (options == null ? void 0 : options.splitByLayout) === "trellis" ? "off" : "right"
1580
+ }
1581
+ ],
1582
+ [
1583
+ __spreadProps(__spreadValues({}, AxesChartLegend.layout[1][0]), {
1584
+ 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
1585
+ options.legendDisplay === void 0 && options.splitByLayout !== "trellis"
1586
+ })
1587
+ ],
1588
+ [
1589
+ {
1590
+ label: (0, i18n_exports._)("Legend mode"),
1591
+ option: "legendMode",
1592
+ editor: "editor.radioBar",
1593
+ editorProps: {
1594
+ values: [
1595
+ { label: (0, i18n_exports._)("Standard"), value: "standard" },
1596
+ { label: (0, i18n_exports._)("Compare series"), value: "seriesCompare" }
1597
+ ]
1598
+ },
1599
+ 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
1600
+ options.legendDisplay === void 0 && options.splitByLayout !== "trellis" : true
1601
+ }
1602
+ ]
1603
+ ]
1604
+ });
1336
1605
 
1337
1606
  // src/common/editorConfig/AxesChartXGridAndLabels.ts
1338
1607
  var AxesChartXGridAndLabelsCommon = {
@@ -1776,6 +2045,13 @@ var AxesChartYGridAndLabels = {
1776
2045
  var AxesChartYGridAndLabels_default = AxesChartYGridAndLabels;
1777
2046
 
1778
2047
  // src/common/editorConfig/AxesChartY2GridAndLabels.ts
2048
+ var isTrellisFeatureFlagOn4 = ({ featureFlags }) => {
2049
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
2050
+ };
2051
+ var isTrellisOff = ({ options, featureFlags }) => {
2052
+ const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
2053
+ return !isTrellisFeatureFlagOn4({ featureFlags }) || splitByLayout !== visualization_schemas_exports.LAYOUT_TYPE.Trellis;
2054
+ };
1779
2055
  var axesChartY2GridAndLabels = {
1780
2056
  label: (0, i18n_exports._)("Y2-axis grid and labels"),
1781
2057
  layout: [
@@ -1783,15 +2059,16 @@ var axesChartY2GridAndLabels = {
1783
2059
  {
1784
2060
  label: (0, i18n_exports._)("Axis title"),
1785
2061
  option: "y2AxisTitleVisibility",
1786
- editor: "editor.toggle"
2062
+ editor: "editor.toggle",
2063
+ showEditor: isTrellisOff
1787
2064
  }
1788
2065
  ],
1789
2066
  [
1790
2067
  {
1791
- label: (0, i18n_exports._)("Axis title"),
2068
+ label: (0, i18n_exports._)("Axis title text"),
1792
2069
  option: "y2AxisTitleText",
1793
2070
  editor: "editor.text",
1794
- showEditor: ({ options }) => options.y2AxisTitleVisibility === "show" || options.y2AxisTitleVisibility === void 0
2071
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && (options.y2AxisTitleVisibility === "show" || options.y2AxisTitleVisibility === void 0)
1795
2072
  }
1796
2073
  ],
1797
2074
  [
@@ -1799,7 +2076,7 @@ var axesChartY2GridAndLabels = {
1799
2076
  label: (0, i18n_exports._)("Show overlays on the y2-axis"),
1800
2077
  option: "showOverlayY2Axis",
1801
2078
  editor: "editor.checkbox",
1802
- showEditor: ({ options }) => Array.isArray(options.overlayFields) && options.overlayFields.length > 0
2079
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && Array.isArray(options.overlayFields) && options.overlayFields.length > 0
1803
2080
  }
1804
2081
  ],
1805
2082
  [
@@ -1812,7 +2089,8 @@ var axesChartY2GridAndLabels = {
1812
2089
  { label: (0, i18n_exports._)("Linear"), value: "linear" },
1813
2090
  { label: (0, i18n_exports._)("Log"), value: "log" }
1814
2091
  ]
1815
- }
2092
+ },
2093
+ showEditor: isTrellisOff
1816
2094
  }
1817
2095
  ],
1818
2096
  [
@@ -1826,7 +2104,8 @@ var axesChartY2GridAndLabels = {
1826
2104
  { label: (0, i18n_exports._)("Show"), value: "show" },
1827
2105
  { label: (0, i18n_exports._)("Hide"), value: "hide" }
1828
2106
  ]
1829
- }
2107
+ },
2108
+ showEditor: isTrellisOff
1830
2109
  }
1831
2110
  ],
1832
2111
  [
@@ -1834,7 +2113,7 @@ var axesChartY2GridAndLabels = {
1834
2113
  label: (0, i18n_exports._)("Round axis labels"),
1835
2114
  option: "showRoundedY2AxisLabels",
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
  [
@@ -1842,40 +2121,45 @@ var axesChartY2GridAndLabels = {
1842
2121
  label: (0, i18n_exports._)("SI prefix abbreviation for labels"),
1843
2122
  option: "y2AxisAbbreviation",
1844
2123
  editor: "editor.checkbox",
1845
- showEditor: ({ options }) => options.y2AxisLabelVisibility === "show" || options.y2AxisLabelVisibility === "auto" || options.y2AxisLabelVisibility === void 0
2124
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && (options.y2AxisLabelVisibility === "show" || options.y2AxisLabelVisibility === "auto" || options.y2AxisLabelVisibility === void 0)
1846
2125
  }
1847
2126
  ],
1848
2127
  [
1849
2128
  {
1850
2129
  label: (0, i18n_exports._)("Include zero"),
1851
2130
  option: "showY2AxisWithZero",
1852
- editor: "editor.checkbox"
2131
+ editor: "editor.checkbox",
2132
+ showEditor: isTrellisOff
1853
2133
  }
1854
2134
  ],
1855
2135
  [
1856
2136
  {
1857
2137
  label: (0, i18n_exports._)("Minimum axis value"),
1858
2138
  option: "y2AxisMin",
1859
- editor: "editor.number"
2139
+ editor: "editor.number",
2140
+ showEditor: isTrellisOff
1860
2141
  },
1861
2142
  {
1862
2143
  label: (0, i18n_exports._)("Maximum axis value"),
1863
2144
  option: "y2AxisMax",
1864
- editor: "editor.number"
2145
+ editor: "editor.number",
2146
+ showEditor: isTrellisOff
1865
2147
  }
1866
2148
  ],
1867
2149
  [
1868
2150
  {
1869
2151
  label: (0, i18n_exports._)("Axis line visibility"),
1870
2152
  option: "y2AxisLineVisibility",
1871
- editor: "editor.checkbox"
2153
+ editor: "editor.checkbox",
2154
+ showEditor: isTrellisOff
1872
2155
  }
1873
2156
  ],
1874
2157
  [
1875
2158
  {
1876
2159
  label: (0, i18n_exports._)("Major gridlines"),
1877
2160
  option: "showY2MajorGridLines",
1878
- editor: "editor.checkbox"
2161
+ editor: "editor.checkbox",
2162
+ showEditor: isTrellisOff
1879
2163
  }
1880
2164
  ],
1881
2165
  [
@@ -1889,7 +2173,8 @@ var axesChartY2GridAndLabels = {
1889
2173
  { label: (0, i18n_exports._)("Show"), value: "show" },
1890
2174
  { label: (0, i18n_exports._)("Hide"), value: "hide" }
1891
2175
  ]
1892
- }
2176
+ },
2177
+ showEditor: isTrellisOff
1893
2178
  }
1894
2179
  ],
1895
2180
  [
@@ -1902,7 +2187,7 @@ var axesChartY2GridAndLabels = {
1902
2187
  max: 10,
1903
2188
  step: 1
1904
2189
  },
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
  [
@@ -1910,14 +2195,15 @@ var axesChartY2GridAndLabels = {
1910
2195
  label: (0, i18n_exports._)("Major tick interval spacing"),
1911
2196
  option: "y2AxisMajorTickInterval",
1912
2197
  editor: "editor.number",
1913
- showEditor: ({ options }) => options.y2AxisMajorTickVisibility === "show" || options.y2AxisMajorTickVisibility === "auto" || options.y2AxisMajorTickVisibility === void 0
2198
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && (options.y2AxisMajorTickVisibility === "show" || options.y2AxisMajorTickVisibility === "auto" || options.y2AxisMajorTickVisibility === void 0)
1914
2199
  }
1915
2200
  ],
1916
2201
  [
1917
2202
  {
1918
2203
  label: (0, i18n_exports._)("Minor gridlines"),
1919
2204
  option: "showY2MinorGridLines",
1920
- editor: "editor.checkbox"
2205
+ editor: "editor.checkbox",
2206
+ showEditor: isTrellisOff
1921
2207
  }
1922
2208
  ],
1923
2209
  [
@@ -1931,7 +2217,8 @@ var axesChartY2GridAndLabels = {
1931
2217
  { label: (0, i18n_exports._)("Show"), value: "show" },
1932
2218
  { label: (0, i18n_exports._)("Hide"), value: "hide" }
1933
2219
  ]
1934
- }
2220
+ },
2221
+ showEditor: isTrellisOff
1935
2222
  }
1936
2223
  ],
1937
2224
  [
@@ -1944,7 +2231,7 @@ var axesChartY2GridAndLabels = {
1944
2231
  max: 10,
1945
2232
  step: 1
1946
2233
  },
1947
- showEditor: ({ options }) => options.y2AxisMinorTickVisibility === "show" || options.y2AxisMinorTickVisibility === "auto" || options.y2AxisMinorTickVisibility === void 0
2234
+ showEditor: ({ options, featureFlags }) => isTrellisOff({ options, featureFlags }) && (options.y2AxisMinorTickVisibility === "show" || options.y2AxisMinorTickVisibility === "auto" || options.y2AxisMinorTickVisibility === void 0)
1948
2235
  }
1949
2236
  ]
1950
2237
  ]
@@ -1982,29 +2269,22 @@ var themes2 = {
1982
2269
  light: variables_default.backgroundColor(props)
1983
2270
  },
1984
2271
  prisma: variables_default.backgroundColorSidebar(props)
2272
+ })(props),
2273
+ defaultFontColor: (props) => pick_default({
2274
+ enterprise: {
2275
+ dark: variables_default.textColor(props),
2276
+ light: variables_default.textColor(props)
2277
+ },
2278
+ prisma: variables_default.contentColorDefault(props)
1985
2279
  })(props)
1986
2280
  };
1987
- var updatedAxesChartLegend = (0, lodash_exports.cloneDeep)(AxesChartLegend_default);
1988
- updatedAxesChartLegend.layout.push([
1989
- {
1990
- label: (0, i18n_exports._)("Legend mode"),
1991
- option: "legendMode",
1992
- editor: "editor.radioBar",
1993
- editorProps: {
1994
- values: [
1995
- { label: (0, i18n_exports._)("Standard"), value: "standard" },
1996
- { label: (0, i18n_exports._)("Compare series"), value: "seriesCompare" }
1997
- ]
1998
- }
1999
- }
2000
- ]);
2001
2281
  var editorConfig = [
2002
2282
  AxesChartDataConfigAreaColumnLine,
2003
2283
  AxesChartDataDisplayColumn,
2004
2284
  {
2005
- label: AxesChartColorAndStyle_default.label,
2285
+ label: AreaAxesChartColorAndStyleWithTrellis.label,
2006
2286
  layout: [
2007
- ...AxesChartColorAndStyle_default.layout,
2287
+ ...AreaAxesChartColorAndStyleWithTrellis.layout,
2008
2288
  [
2009
2289
  {
2010
2290
  label: (0, i18n_exports._)("Spacing between column series"),
@@ -2046,7 +2326,7 @@ var editorConfig = [
2046
2326
  ]
2047
2327
  ]
2048
2328
  },
2049
- updatedAxesChartLegend,
2329
+ AxesChartLegendWithTrellisAndMode({ showLegendTooltip: false }),
2050
2330
  AxesChartXGridAndLabels_default,
2051
2331
  AxesChartYGridAndLabels_default,
2052
2332
  AxesChartY2GridAndLabels_default
@@ -2088,7 +2368,12 @@ var config = {
2088
2368
  description: "triggered when user moves out of a data point"
2089
2369
  }
2090
2370
  },
2091
- supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "placeholder" /* PLACEHOLDER */, "downsampling" /* DOWNSAMPLING */],
2371
+ supports: [
2372
+ "dynamic-options" /* DYNAMIC_OPTIONS */,
2373
+ "placeholder" /* PLACEHOLDER */,
2374
+ "downsampling" /* DOWNSAMPLING */,
2375
+ "trellis" /* TRELLIS */
2376
+ ],
2092
2377
  themes: themes2
2093
2378
  };
2094
2379
  var config_default = enhanceConfig(config);
@@ -2098,45 +2383,36 @@ var getSettingsFromThemedProps_exports = {};
2098
2383
  __export(getSettingsFromThemedProps_exports, {
2099
2384
  default: () => getSettingsFromThemedProps_default
2100
2385
  });
2101
- var defaultImport23 = __toESM(require("@splunk/themes/getSettingsFromThemedProps"));
2386
+ var defaultImport24 = __toESM(require("@splunk/themes/getSettingsFromThemedProps"));
2102
2387
  __reExport(getSettingsFromThemedProps_exports, require("@splunk/themes/getSettingsFromThemedProps"));
2103
- var getSettingsFromThemedProps_default = "default" in defaultImport23 ? defaultImport23.default : defaultImport23;
2388
+ var getSettingsFromThemedProps_default = "default" in defaultImport24 ? defaultImport24.default : defaultImport24;
2104
2389
 
2105
2390
  // esm-externals:@splunk/visualization-encoding/Options
2106
2391
  var Options_exports = {};
2107
2392
  __export(Options_exports, {
2108
2393
  default: () => Options_default
2109
2394
  });
2110
- var defaultImport24 = __toESM(require("@splunk/visualization-encoding/Options"));
2395
+ var defaultImport25 = __toESM(require("@splunk/visualization-encoding/Options"));
2111
2396
  __reExport(Options_exports, require("@splunk/visualization-encoding/Options"));
2112
- var Options_default = "default" in defaultImport24 ? defaultImport24.default : defaultImport24;
2397
+ var Options_default = "default" in defaultImport25 ? defaultImport25.default : defaultImport25;
2113
2398
 
2114
2399
  // esm-externals:@splunk/visualizations-shared/SanitizeProps
2115
2400
  var SanitizeProps_exports = {};
2116
2401
  __export(SanitizeProps_exports, {
2117
2402
  default: () => SanitizeProps_default
2118
2403
  });
2119
- var defaultImport25 = __toESM(require("@splunk/visualizations-shared/SanitizeProps"));
2404
+ var defaultImport26 = __toESM(require("@splunk/visualizations-shared/SanitizeProps"));
2120
2405
  __reExport(SanitizeProps_exports, require("@splunk/visualizations-shared/SanitizeProps"));
2121
- var SanitizeProps_default = "default" in defaultImport25 ? defaultImport25.default : defaultImport25;
2406
+ var SanitizeProps_default = "default" in defaultImport26 ? defaultImport26.default : defaultImport26;
2122
2407
 
2123
2408
  // esm-externals:@splunk/moment
2124
2409
  var moment_exports = {};
2125
2410
  __export(moment_exports, {
2126
2411
  default: () => moment_default
2127
2412
  });
2128
- var defaultImport26 = __toESM(require("@splunk/moment"));
2413
+ var defaultImport27 = __toESM(require("@splunk/moment"));
2129
2414
  __reExport(moment_exports, require("@splunk/moment"));
2130
- var moment_default = "default" in defaultImport26 ? defaultImport26.default : defaultImport26;
2131
-
2132
- // esm-externals:@splunk/visualization-context/FeatureFlagContext
2133
- var FeatureFlagContext_exports = {};
2134
- __export(FeatureFlagContext_exports, {
2135
- default: () => FeatureFlagContext_default
2136
- });
2137
- var defaultImport27 = __toESM(require("@splunk/visualization-context/FeatureFlagContext"));
2138
- __reExport(FeatureFlagContext_exports, require("@splunk/visualization-context/FeatureFlagContext"));
2139
- var FeatureFlagContext_default = "default" in defaultImport27 ? defaultImport27.default : defaultImport27;
2415
+ var moment_default = "default" in defaultImport27 ? defaultImport27.default : defaultImport27;
2140
2416
 
2141
2417
  // esm-externals:@splunk/visualizations-shared/hocUtils
2142
2418
  var hocUtils_exports = {};
@@ -2426,7 +2702,7 @@ var withFixedSizeContainer = (Viz) => {
2426
2702
  FixSizeItem,
2427
2703
  {
2428
2704
  "data-test": "fix-size-item",
2429
- "data-splunk-visualization-version": "27.0.0 - 9bf093b7d",
2705
+ "data-splunk-visualization-version": "27.1.0 - fe8b048df",
2430
2706
  width,
2431
2707
  height,
2432
2708
  backgroundColor
@@ -2492,7 +2768,7 @@ var Cover = styled_components_default.div`
2492
2768
  bottom: 0;
2493
2769
  `;
2494
2770
  var Blocker = styled_components_default.div.attrs({
2495
- "data-splunk-visualization-version": "27.0.0 - 9bf093b7d"
2771
+ "data-splunk-visualization-version": "27.1.0 - fe8b048df"
2496
2772
  })`
2497
2773
  position: relative;
2498
2774
  width: 100%;
@@ -2754,6 +3030,350 @@ var getFeatureFlag = (context, flagName) => {
2754
3030
  return false;
2755
3031
  };
2756
3032
 
3033
+ // esm-externals:@splunk/visualizations-shared/trellisUtils
3034
+ var trellisUtils_exports = {};
3035
+ __export(trellisUtils_exports, {
3036
+ default: () => trellisUtils_default
3037
+ });
3038
+ var defaultImport35 = __toESM(require("@splunk/visualizations-shared/trellisUtils"));
3039
+ __reExport(trellisUtils_exports, require("@splunk/visualizations-shared/trellisUtils"));
3040
+ var trellisUtils_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
3041
+
3042
+ // src/common/utils/trellisUtils.ts
3043
+ var AGGREGATIONS = "aggregations";
3044
+ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
3045
+ var _a, _b, _c, _d;
3046
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3047
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3048
+ let splitDataSources = null;
3049
+ let errorCode = null;
3050
+ if (fields && fields.length) {
3051
+ splitDataSources = {};
3052
+ for (let i = 0; i < fields.length; i += 1) {
3053
+ const fieldName = fields[i].name;
3054
+ if (!(fieldName == null ? void 0 : fieldName.startsWith("_"))) {
3055
+ splitDataSources[fieldName] = (0, lodash_exports.cloneDeep)(
3056
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3057
+ );
3058
+ splitDataSources[fieldName].primary.data.fields = [fields[i]];
3059
+ splitDataSources[fieldName].primary.data.columns = [columns[i]];
3060
+ }
3061
+ }
3062
+ } else {
3063
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3064
+ }
3065
+ return { splitDataSources, errorCode };
3066
+ };
3067
+ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
3068
+ var _a, _b, _c, _d;
3069
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3070
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3071
+ let splitDataSources = null;
3072
+ let splitByFields = [];
3073
+ let errorCode = null;
3074
+ if (typeof fields[0] !== "string") {
3075
+ splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
3076
+ }
3077
+ if (splitByFields && splitByFields.length > 0) {
3078
+ splitDataSources = {};
3079
+ splitByFields.forEach((splitByField) => {
3080
+ splitDataSources[splitByField] = (0, lodash_exports.cloneDeep)(
3081
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3082
+ );
3083
+ splitDataSources[splitByField].primary.data.fields = [fields[0]];
3084
+ splitDataSources[splitByField].primary.data.columns = [columns[0]];
3085
+ fields.forEach((field, idx) => {
3086
+ const fieldName = field == null ? void 0 : field.name;
3087
+ if (fieldName !== "_time" && !(fieldName == null ? void 0 : fieldName.startsWith("_")) && field.data_source === splitByField) {
3088
+ splitDataSources[splitByField].primary.data.fields.push(field);
3089
+ splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
3090
+ }
3091
+ });
3092
+ });
3093
+ } else if ((!splitByFields || !splitByFields.length) && fields.length > 1) {
3094
+ splitDataSources = {};
3095
+ for (let i = 1; i < fields.length; i += 1) {
3096
+ const fieldName = fields[i].name;
3097
+ if (!(fieldName == null ? void 0 : fieldName.startsWith("_"))) {
3098
+ splitDataSources[fieldName] = (0, lodash_exports.cloneDeep)(
3099
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3100
+ );
3101
+ splitDataSources[fieldName].primary.data.fields = [fields[0], fields[i]];
3102
+ splitDataSources[fieldName].primary.data.columns = [columns[0], columns[i]];
3103
+ }
3104
+ }
3105
+ } else {
3106
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3107
+ }
3108
+ return { splitDataSources, errorCode };
3109
+ };
3110
+ var dataSourcesSplitByAggregationsStats = (dataSource) => {
3111
+ var _a, _b, _c, _d;
3112
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3113
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3114
+ let splitDataSources = null;
3115
+ let splitByFields = [];
3116
+ let errorCode = null;
3117
+ if (typeof fields[0] !== "string") {
3118
+ splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
3119
+ }
3120
+ if (splitByFields && splitByFields.length > 0) {
3121
+ splitDataSources = {};
3122
+ splitByFields.forEach((splitByField) => {
3123
+ splitDataSources[splitByField] = (0, lodash_exports.cloneDeep)(
3124
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3125
+ );
3126
+ splitDataSources[splitByField].primary.data.fields = [fields[0]];
3127
+ splitDataSources[splitByField].primary.data.columns = [columns[0]];
3128
+ const idx = fields.findIndex((field) => field.name === splitByField);
3129
+ if (idx > 0) {
3130
+ splitDataSources[splitByField].primary.data.fields.push(fields[idx]);
3131
+ splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
3132
+ }
3133
+ });
3134
+ } else {
3135
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3136
+ }
3137
+ return { splitDataSources, errorCode };
3138
+ };
3139
+ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
3140
+ var _a, _b, _c, _d, _e;
3141
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3142
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3143
+ let splitDataSources = null;
3144
+ let splitByFields = [];
3145
+ let errorCode = null;
3146
+ if (typeof fields[0] !== "string") {
3147
+ splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
3148
+ }
3149
+ if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
3150
+ splitDataSources = {};
3151
+ const dataSourceKeys = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
3152
+ const valueKeys = [];
3153
+ for (let i = 1; i < fields.length; i += 1) {
3154
+ if (!((_e = fields[i].name) == null ? void 0 : _e.startsWith("_"))) {
3155
+ valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
3156
+ }
3157
+ }
3158
+ valueKeys.forEach((val) => {
3159
+ splitDataSources[val] = (0, lodash_exports.cloneDeep)(
3160
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3161
+ );
3162
+ splitDataSources[val].primary.data.fields = [
3163
+ { name: fields[0].name },
3164
+ ...dataSourceKeys.map((k) => ({
3165
+ name: k
3166
+ }))
3167
+ ];
3168
+ splitDataSources[val].primary.data.columns = [[...columns[0]]];
3169
+ dataSourceKeys.forEach((dsKey) => {
3170
+ fields.forEach((field, idx) => {
3171
+ if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
3172
+ splitDataSources[val].primary.data.columns.push([...columns[idx]]);
3173
+ }
3174
+ });
3175
+ });
3176
+ });
3177
+ } else {
3178
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3179
+ }
3180
+ return { splitDataSources, errorCode };
3181
+ };
3182
+ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
3183
+ var _a, _b, _c, _d;
3184
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3185
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3186
+ let splitDataSources = null;
3187
+ let splitByFields = [];
3188
+ let errorCode = null;
3189
+ if (typeof fields[0] !== "string") {
3190
+ splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
3191
+ }
3192
+ if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
3193
+ splitDataSources = {};
3194
+ const splitByFieldIdx = splitByFields.findIndex((f) => f === splitBy);
3195
+ const otherSplitBy = splitByFields.filter((f) => f !== splitBy);
3196
+ const dataSourceKeys = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
3197
+ const nonDataSourceAggregations = [];
3198
+ if (!dataSourceKeys.length && fields[0].groupby_rank === "0" && fields.length && !fields[1].groupby_rank) {
3199
+ for (let i = 1; i < fields.length; i += 1) {
3200
+ nonDataSourceAggregations.push(fields[i].name);
3201
+ }
3202
+ }
3203
+ if (splitByFieldIdx === 0) {
3204
+ const valueKeys = (0, lodash_exports.cloneDeep)(columns[0]);
3205
+ valueKeys.forEach((val, idx) => {
3206
+ splitDataSources[val] = (0, lodash_exports.cloneDeep)(
3207
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3208
+ );
3209
+ splitDataSources[val].primary.data.fields = [];
3210
+ if (otherSplitBy.length) {
3211
+ splitDataSources[val].primary.data.fields = [{ name: otherSplitBy[0] }];
3212
+ }
3213
+ if (dataSourceKeys.length) {
3214
+ const columnValues = [[]];
3215
+ splitDataSources[val].primary.data.fields = [
3216
+ ...splitDataSources[val].primary.data.fields,
3217
+ ...dataSourceKeys.map((k) => ({
3218
+ name: k
3219
+ }))
3220
+ ];
3221
+ dataSourceKeys.forEach(() => {
3222
+ columnValues.push([]);
3223
+ });
3224
+ for (let i = 1; i <= Math.ceil((fields.length - 1) / dataSourceKeys.length); i += 1) {
3225
+ columnValues[0].push(
3226
+ fields[i].splitby_value ? fields[i].splitby_value : fields[i].name
3227
+ );
3228
+ dataSourceKeys.forEach((dskey, dsIndx) => {
3229
+ const mul = (fields.length - 1) / dataSourceKeys.length;
3230
+ columnValues[dsIndx + 1].push(columns[i + dsIndx * mul][idx]);
3231
+ });
3232
+ }
3233
+ splitDataSources[val].primary.data.columns = columnValues;
3234
+ } else if (nonDataSourceAggregations.length) {
3235
+ const columnValues = [];
3236
+ fields.forEach((aggregationField, fieldIdx) => {
3237
+ if (fieldIdx > 0) {
3238
+ splitDataSources[val].primary.data.fields.push(aggregationField);
3239
+ columnValues.push([columns[fieldIdx][idx]]);
3240
+ }
3241
+ });
3242
+ splitDataSources[val].primary.data.columns = columnValues;
3243
+ }
3244
+ });
3245
+ } else {
3246
+ const valueKeys = [];
3247
+ for (let i = 1; i < fields.length; i += 1) {
3248
+ valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
3249
+ }
3250
+ valueKeys.forEach((val) => {
3251
+ splitDataSources[val] = (0, lodash_exports.cloneDeep)(
3252
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3253
+ );
3254
+ splitDataSources[val].primary.data.fields = [
3255
+ { name: otherSplitBy[0] },
3256
+ ...dataSourceKeys.map((k) => ({
3257
+ name: k
3258
+ }))
3259
+ ];
3260
+ splitDataSources[val].primary.data.columns = [[...columns[0]]];
3261
+ dataSourceKeys.forEach((dsKey) => {
3262
+ fields.forEach((field, idx) => {
3263
+ if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
3264
+ splitDataSources[val].primary.data.columns.push([...columns[idx]]);
3265
+ }
3266
+ });
3267
+ });
3268
+ });
3269
+ }
3270
+ } else {
3271
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3272
+ }
3273
+ return { splitDataSources, errorCode };
3274
+ };
3275
+ var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
3276
+ var _a, _b, _c, _d, _e, _f;
3277
+ const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3278
+ const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3279
+ let splitDataSources = null;
3280
+ let splitByFields = [];
3281
+ let errorCode = null;
3282
+ if (typeof fields[0] !== "string") {
3283
+ splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
3284
+ }
3285
+ const splitByIndex = fields == null ? void 0 : fields.findIndex(
3286
+ (field) => field === splitBy || field.name === splitBy
3287
+ );
3288
+ if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
3289
+ const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
3290
+ splitDataSources = {};
3291
+ splitByColumn.forEach((val, idx) => {
3292
+ if (!splitDataSources[val]) {
3293
+ splitDataSources[val] = [idx];
3294
+ } else {
3295
+ splitDataSources[val].push(idx);
3296
+ }
3297
+ });
3298
+ const cloneFields = (0, lodash_exports.cloneDeep)(fields);
3299
+ cloneFields.splice(splitByIndex, 1);
3300
+ const valueKeys = Object.keys(splitDataSources);
3301
+ valueKeys.forEach((val) => {
3302
+ const valIndices = (0, lodash_exports.cloneDeep)(splitDataSources[val]);
3303
+ splitDataSources[val] = (0, lodash_exports.cloneDeep)(
3304
+ (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
3305
+ );
3306
+ splitDataSources[val].primary.data.fields = cloneFields;
3307
+ splitDataSources[val].primary.data.columns = [];
3308
+ columns.forEach((col, idx) => {
3309
+ if (idx !== splitByIndex) {
3310
+ const newCol = valIndices.map((valIdx) => col[valIdx]);
3311
+ splitDataSources[val].primary.data.columns.push(newCol);
3312
+ }
3313
+ });
3314
+ });
3315
+ } else {
3316
+ errorCode = "INVALID_SPLIT_BY_FIELD";
3317
+ }
3318
+ return { splitDataSources, errorCode };
3319
+ };
3320
+ var getTrellisDataSourcesBySplitMode = (splitMode, dataSources, trellisSplitBy) => {
3321
+ let result = null;
3322
+ try {
3323
+ if (splitMode === trellisUtils_exports.TIMECHART) {
3324
+ result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : dataSourcesSplitByModeTimechart(dataSources, trellisSplitBy);
3325
+ } else if (splitMode === trellisUtils_exports.STATS) {
3326
+ result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsStats(dataSources) : dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_exports.STATS);
3327
+ } else if (splitMode === trellisUtils_exports.CHART) {
3328
+ result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : dataSourcesSplitByModeChart(dataSources, trellisSplitBy);
3329
+ } else if (splitMode === trellisUtils_exports.UNKNOWN) {
3330
+ result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsUnknown(dataSources) : dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_exports.UNKNOWN);
3331
+ }
3332
+ } catch (ex) {
3333
+ console.error("getTrellisDataSourcesBySplitMode ", ex);
3334
+ result = { splitDataSources: null, errorCode: "UNKNOWN" };
3335
+ }
3336
+ return result;
3337
+ };
3338
+ var turnOffLegendDisplayWhenTrellisIsOn = (isTrellisOn, options) => {
3339
+ if (isTrellisOn && !options.legendDisplay) {
3340
+ return {
3341
+ legendDisplay: "off"
3342
+ };
3343
+ }
3344
+ return {};
3345
+ };
3346
+ var calculateSharedMinMax = (splitData) => {
3347
+ let max = -Infinity;
3348
+ let min = Infinity;
3349
+ Object.keys(splitData).forEach((splitByKey) => {
3350
+ const datasources = splitData[splitByKey];
3351
+ Object.keys(datasources).forEach((datasourceName) => {
3352
+ const dataColumns = datasources[datasourceName].data.columns;
3353
+ dataColumns.forEach((column) => {
3354
+ column.forEach((point) => {
3355
+ const pointNumber = Number(point);
3356
+ if (pointNumber > max) {
3357
+ max = pointNumber;
3358
+ }
3359
+ if (pointNumber < min) {
3360
+ min = pointNumber;
3361
+ }
3362
+ });
3363
+ });
3364
+ });
3365
+ });
3366
+ return [min, max];
3367
+ };
3368
+ var determineMinMax = (splitData, trellisSharedScale, yAxisMin, yAxisMax, stackMode) => {
3369
+ if (!trellisSharedScale || stackMode === "stacked100" || yAxisMin !== "auto" && yAxisMax !== "auto")
3370
+ return [yAxisMin, yAxisMax];
3371
+ const [sharedMin, sharedMax] = calculateSharedMinMax(splitData);
3372
+ const shouldUseSharedMax = sharedMax !== -Infinity && yAxisMax === "auto";
3373
+ const shouldUseSharedMin = sharedMin !== Infinity && yAxisMin === "auto";
3374
+ return [shouldUseSharedMin ? sharedMin : yAxisMin, shouldUseSharedMax ? sharedMax : yAxisMax];
3375
+ };
3376
+
2757
3377
  // src/common/withDashboardViz.tsx
2758
3378
  var withDashboardViz = (opts) => {
2759
3379
  const {
@@ -2761,6 +3381,8 @@ var withDashboardViz = (opts) => {
2761
3381
  vizConfig,
2762
3382
  computeVizProps: computeVizProps2 = () => {
2763
3383
  },
3384
+ computeVizPropsBeforeEval = () => {
3385
+ },
2764
3386
  disableEditModeCover,
2765
3387
  useIconPlaceholder
2766
3388
  } = opts;
@@ -2810,14 +3432,26 @@ var withDashboardViz = (opts) => {
2810
3432
  const isDownsamplingEnabledByFeatureFlag = Boolean(
2811
3433
  featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableDownsampling
2812
3434
  );
3435
+ const isTrellisFeatureFlagOn5 = Boolean(
3436
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
3437
+ );
3438
+ 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 */;
2813
3439
  const isMounted = react_exports.useRef(true);
2814
- const optionsToEvaluate = react_exports.useMemo(
2815
- () => ({
3440
+ const optionsToEvaluate = react_exports.useMemo(() => {
3441
+ var _a2;
3442
+ const legendDisplay = turnOffLegendDisplayWhenTrellisIsOn(isTrellisOn, options);
3443
+ const computedOptions = (_a2 = computeVizPropsBeforeEval(options)) != null ? _a2 : {};
3444
+ return {
2816
3445
  context: (0, lodash_exports.defaultsDeep)({}, context, vizConfig.defaultContext),
2817
- options: (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
2818
- }),
2819
- [options, context]
2820
- );
3446
+ options: (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)(
3447
+ {},
3448
+ legendDisplay,
3449
+ computedOptions,
3450
+ options,
3451
+ defaultOptions
3452
+ )
3453
+ };
3454
+ }, [isTrellisOn, options, context]);
2821
3455
  const [threshold, setThreshold] = react_exports.useState(Number(width));
2822
3456
  const onDownsamplingThresholdChange = react_exports.useCallback((newThreshold) => {
2823
3457
  setThreshold(newThreshold);
@@ -2898,11 +3532,8 @@ var withDashboardViz = (opts) => {
2898
3532
  useAsyncEvaluatedOptions
2899
3533
  ]);
2900
3534
  const evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
2901
- const isTrellisFeatureFlagOn = Boolean(
2902
- featureFlagContext && featureFlagContext.visualizations_enableTrellis
2903
- );
2904
3535
  let clonedEvaluatedOptions = evaluatedOptionsToUse;
2905
- if (isTrellisFeatureFlagOn && ((_a = vizConfig == null ? void 0 : vizConfig.supports) == null ? void 0 : _a.includes("trellis" /* TRELLIS */)) && (clonedEvaluatedOptions == null ? void 0 : clonedEvaluatedOptions.splitByLayout) === "trellis" /* TRELLIS */) {
3536
+ if (isTrellisOn) {
2906
3537
  clonedEvaluatedOptions = __spreadProps(__spreadValues({}, evaluatedOptionsToUse), {
2907
3538
  backgroundColor: clonedEvaluatedOptions == null ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
2908
3539
  });
@@ -3013,9 +3644,9 @@ var propUtils_exports = {};
3013
3644
  __export(propUtils_exports, {
3014
3645
  default: () => propUtils_default
3015
3646
  });
3016
- var defaultImport35 = __toESM(require("@splunk/visualizations-shared/propUtils"));
3647
+ var defaultImport36 = __toESM(require("@splunk/visualizations-shared/propUtils"));
3017
3648
  __reExport(propUtils_exports, require("@splunk/visualizations-shared/propUtils"));
3018
- var propUtils_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
3649
+ var propUtils_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
3019
3650
 
3020
3651
  // src/common/chartingUtils.ts
3021
3652
  var getAnnotations = ({ annotationX, annotationColor, annotationLabel }) => annotationX && annotationX.length ? annotationX.map((timestamp, i) => ({
@@ -3139,7 +3770,8 @@ var columnOptionsSCMapping = {
3139
3770
  showRoundedY2AxisLabels: "roundY2AxisLabelsToInteger",
3140
3771
  xAxisLineVisibility: "xAxisVisibility",
3141
3772
  yAxisLineVisibility: "yAxisVisibility",
3142
- y2AxisLineVisibility: "y2AxisVisibility"
3773
+ y2AxisLineVisibility: "y2AxisVisibility",
3774
+ lineDashStylesByField: "fieldDashStyles"
3143
3775
  };
3144
3776
  var columnOptionValuesSCMapping = {
3145
3777
  xAxisTitleVisibility: {
@@ -3209,13 +3841,265 @@ var convertAuto = (originalOptions) => {
3209
3841
  var convertToStringValues = (options) => {
3210
3842
  const updatedOptions = (0, propUtils_exports.convertPropsToString)({
3211
3843
  vizProps: options,
3212
- propNames: ["seriesColors", "fieldColors", "legendLabels"]
3844
+ propNames: ["seriesColors", "fieldColors", "legendLabels", "fieldDashStyles"]
3213
3845
  });
3214
3846
  return __spreadValues(__spreadValues({}, options), updatedOptions);
3215
3847
  };
3216
3848
  var mapToOldKey = (options) => (0, lodash_exports.mapKeys)(options, (val, key) => columnOptionsSCMapping[key] ? columnOptionsSCMapping[key] : key);
3217
3849
  var convertToColumnSCProperties = (originalOptions) => (0, lodash_exports.chain)(mapToOldKey(originalOptions)).thru(mapToValues(columnOptionValuesSCMapping)).thru(convertY2AxisOptions).thru(convertOverlayFields).thru(convertTitleVisibilityOptions).thru(convertLegendDisplayOptions).thru(convertToStringValues).thru(convertAuto).thru(convertYAxisLabelOptions).value();
3218
3850
 
3851
+ // esm-externals:@splunk/react-ui/Paginator
3852
+ var Paginator_exports = {};
3853
+ __export(Paginator_exports, {
3854
+ default: () => Paginator_default
3855
+ });
3856
+ var defaultImport37 = __toESM(require("@splunk/react-ui/Paginator"));
3857
+ __reExport(Paginator_exports, require("@splunk/react-ui/Paginator"));
3858
+ var Paginator_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
3859
+
3860
+ // esm-externals:@splunk/themes
3861
+ var themes_exports = {};
3862
+ __export(themes_exports, {
3863
+ default: () => themes_default
3864
+ });
3865
+ var defaultImport38 = __toESM(require("@splunk/themes"));
3866
+ __reExport(themes_exports, require("@splunk/themes"));
3867
+ var themes_default = "default" in defaultImport38 ? defaultImport38.default : defaultImport38;
3868
+
3869
+ // src/common/hocs/withTrellis.tsx
3870
+ var TrellisContainer = styled_components_default.div`
3871
+ overflow: hidden;
3872
+ display: flex;
3873
+ flex-direction: column;
3874
+ background-color: ${(props) => props.backgroundColor};
3875
+ ${(props) => (0, style_exports.toDimension)((0, lodash_exports.pick)(props, ["width", "height"]))};
3876
+ > [data-test='paginator'] {
3877
+ align-self: flex-end;
3878
+ margin-bottom: 10px;
3879
+ }
3880
+ `;
3881
+ var TrellisContainerGrid = styled_components_default.div`
3882
+ display: grid;
3883
+ height: ${(props) => {
3884
+ return `${props.height}px`;
3885
+ }};
3886
+ gap: 10px 10px;
3887
+ grid-template-columns: ${(props) => {
3888
+ return props.colCount ? `repeat(${props.colCount}, minmax(${props.colMinWidth}px, 1fr))` : `repeat(auto-fit, minmax(${props.colMinWidth}px, 1fr))`;
3889
+ }};
3890
+ overflow: auto;
3891
+ justify-items: stretch;
3892
+ grid-auto-rows: ${(props) => `${props.rowHeight}px`};
3893
+ .child {
3894
+ height: ${(props) => `${props.rowHeight}px`};
3895
+ }
3896
+ `;
3897
+ var showErrorMessage = (errorCode, width, height) => {
3898
+ if (errorCode === "INVALID_SPLIT_BY_FIELD") {
3899
+ return /* @__PURE__ */ react_exports.createElement(
3900
+ Message_default,
3901
+ {
3902
+ width,
3903
+ height,
3904
+ message: (0, i18n_exports._)("Select a valid trellis split by field"),
3905
+ level: "info"
3906
+ }
3907
+ );
3908
+ }
3909
+ if (errorCode === "UNKNOWN_DATA_SPLIT_MODE") {
3910
+ return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Unknown data split mode"), level: "info" });
3911
+ }
3912
+ return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Error render in trellis"), level: "info" });
3913
+ };
3914
+ var withTrellis = (Viz) => {
3915
+ const VizWithTrellis = (opts) => {
3916
+ const cachedHandleResize = react_exports.useCallback((w, h) => {
3917
+ setContainerWidth(w);
3918
+ setContainerHeight(h);
3919
+ }, []);
3920
+ const [containerWidth, setContainerWidth] = react_exports.useState(Number(opts.width));
3921
+ const [containerHeight, setContainerHeight] = react_exports.useState(Number(opts.height));
3922
+ const _a = opts, { options = {}, height, width } = _a, otherProps = __objRest(_a, ["options", "height", "width"]);
3923
+ const defaultOptions = (0, JSONSchemaUtils_exports.pickFieldFromJSONSchema)(Viz.config.optionsSchema, "default");
3924
+ const mergedOptions = (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions);
3925
+ const {
3926
+ trellisColumns,
3927
+ trellisPageCount,
3928
+ trellisMinColumnWidth,
3929
+ trellisRowHeight,
3930
+ splitByLayout,
3931
+ trellisSplitBy,
3932
+ trellisSharedScale,
3933
+ stackMode,
3934
+ yAxisMin,
3935
+ yAxisMax
3936
+ } = mergedOptions;
3937
+ const colCount = trellisColumns > 0 ? trellisColumns : defaultOptions.trellisColumns;
3938
+ const pageCount = +trellisPageCount > 0 ? +trellisPageCount : defaultOptions.trellisPageCount;
3939
+ const colMinWidth = trellisMinColumnWidth > 0 ? trellisMinColumnWidth : defaultOptions.trellisMinColumnWidth;
3940
+ const rowHeight = trellisRowHeight > 0 ? trellisRowHeight : defaultOptions.trellisRowHeight;
3941
+ const [pageNum, setPageNum] = (0, react_exports.useState)(1);
3942
+ const [pagedData, setPagedData] = (0, react_exports.useState)(null);
3943
+ let splitByKeys = [];
3944
+ let totalPages = 0;
3945
+ let showPaginator = false;
3946
+ const { dataSources } = otherProps;
3947
+ const theme = {
3948
+ splunkThemeV1: useSplunkTheme_default()
3949
+ };
3950
+ const {
3951
+ family: currentThemeFamily,
3952
+ colorScheme: currentThemeColorScheme,
3953
+ density: currentThemeDensity
3954
+ } = (0, themes_exports.getSettingsFromThemedProps)({ theme });
3955
+ const trellisBackgroundColor = (0, react_exports.useMemo)(() => {
3956
+ const themeFunc = (themeVar) => {
3957
+ var _a2, _b;
3958
+ return (_b = (_a2 = Viz.config.themes)[themeVar]) == null ? void 0 : _b.call(_a2, {
3959
+ trellisBackgroundColor: mergedOptions.trellisBackgroundColor,
3960
+ theme
3961
+ });
3962
+ };
3963
+ const evaluated = Options_exports.Options.evaluate(
3964
+ {
3965
+ context: Viz.config.context,
3966
+ options: { trellisBackgroundColor: mergedOptions.trellisBackgroundColor }
3967
+ },
3968
+ {},
3969
+ themeFunc
3970
+ );
3971
+ return evaluated.trellisBackgroundColor;
3972
+ }, [
3973
+ mergedOptions.trellisBackgroundColor,
3974
+ currentThemeFamily,
3975
+ currentThemeColorScheme,
3976
+ currentThemeDensity
3977
+ ]);
3978
+ const columns = (0, lodash_exports.get)(dataSources, "primary.data.columns", void 0);
3979
+ const fields = (0, lodash_exports.get)(dataSources, "primary.data.fields", void 0);
3980
+ const noColumns = columns === void 0;
3981
+ const noFields = fields === void 0;
3982
+ const updateDataDisplay = (currPage) => {
3983
+ if (!showPaginator) {
3984
+ setPagedData(splitByKeys);
3985
+ setPageNum(1);
3986
+ } else {
3987
+ const startIdx = pageCount * (currPage - 1);
3988
+ const paged = splitByKeys.slice(startIdx, startIdx + pageCount);
3989
+ setPagedData(paged);
3990
+ }
3991
+ };
3992
+ (0, react_exports.useEffect)(() => {
3993
+ setPageNum(1);
3994
+ updateDataDisplay(1);
3995
+ }, [pageCount, trellisSplitBy]);
3996
+ (0, react_exports.useEffect)(() => {
3997
+ updateDataDisplay(pageNum);
3998
+ }, [columns, fields, trellisSplitBy, pageNum, splitByLayout]);
3999
+ const handlePageChange = (0, react_exports.useCallback)(
4000
+ (event, { page }) => {
4001
+ setPageNum(page);
4002
+ },
4003
+ [pageNum, pagedData]
4004
+ );
4005
+ const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
4006
+ const isTrellisFeatureFlagOn5 = Boolean(
4007
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
4008
+ );
4009
+ if (!isTrellisFeatureFlagOn5 || !splitByLayout || splitByLayout !== visualization_schemas_exports.LAYOUT_TYPE.Trellis) {
4010
+ return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({}, opts));
4011
+ }
4012
+ if (splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis) {
4013
+ if (noColumns || noFields) {
4014
+ return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Loading"), level: "info" });
4015
+ }
4016
+ let currTrellisSplitBy = trellisSplitBy;
4017
+ if (!trellisSplitBy || trellisSplitBy.length === 0) {
4018
+ const splitByPossibleFields = (0, trellisUtils_exports.getAllPossibleSplitByFields)(fields);
4019
+ currTrellisSplitBy = splitByPossibleFields.fields && splitByPossibleFields.fields.length ? splitByPossibleFields.fields[0] : AGGREGATIONS;
4020
+ }
4021
+ const splitMode = (0, trellisUtils_exports.getTrellisDataSplitterMode)(fields);
4022
+ const dataSplitResult = getTrellisDataSourcesBySplitMode(
4023
+ splitMode,
4024
+ dataSources,
4025
+ currTrellisSplitBy
4026
+ );
4027
+ const modifiedDataSourceBySplitBy = dataSplitResult == null ? void 0 : dataSplitResult.splitDataSources;
4028
+ const dataSplitErrorCode = dataSplitResult == null ? void 0 : dataSplitResult.errorCode;
4029
+ if (!modifiedDataSourceBySplitBy || Object.keys(modifiedDataSourceBySplitBy).length === 0 || dataSplitErrorCode) {
4030
+ return showErrorMessage(dataSplitErrorCode, width, height);
4031
+ }
4032
+ const splitByKeysModified = modifiedDataSourceBySplitBy ? Object.keys(modifiedDataSourceBySplitBy) : [];
4033
+ if (splitByKeysModified) {
4034
+ showPaginator = splitByKeysModified.length > pageCount;
4035
+ splitByKeys = splitByKeysModified;
4036
+ totalPages = splitByKeysModified ? Math.ceil(splitByKeysModified.length / pageCount) : 0;
4037
+ }
4038
+ const [calculatedMin, calculatedMax] = determineMinMax(
4039
+ modifiedDataSourceBySplitBy,
4040
+ trellisSharedScale,
4041
+ yAxisMin,
4042
+ yAxisMax,
4043
+ stackMode
4044
+ );
4045
+ return /* @__PURE__ */ react_exports.createElement(TrellisContainer, { height, width, backgroundColor: trellisBackgroundColor }, /* @__PURE__ */ react_exports.createElement(
4046
+ TrellisContainerGrid,
4047
+ {
4048
+ height,
4049
+ colCount,
4050
+ colMinWidth,
4051
+ rowHeight
4052
+ },
4053
+ pagedData == null ? void 0 : pagedData.map((splitByKey, idx) => /* @__PURE__ */ react_exports.createElement(
4054
+ "div",
4055
+ {
4056
+ className: "child",
4057
+ "data-test": "trellis-child",
4058
+ key: `div-child-${idx.toString()}`
4059
+ },
4060
+ /* @__PURE__ */ react_exports.createElement(
4061
+ SizeAwareWrapper_default,
4062
+ {
4063
+ width,
4064
+ height,
4065
+ onResize: cachedHandleResize
4066
+ }
4067
+ ),
4068
+ /* @__PURE__ */ react_exports.createElement(
4069
+ Viz,
4070
+ __spreadProps(__spreadValues({}, otherProps), {
4071
+ trellisKey: splitByKey,
4072
+ trellisSplitBy: currTrellisSplitBy,
4073
+ dataSources: modifiedDataSourceBySplitBy[splitByKey],
4074
+ options: __spreadProps(__spreadValues({}, options), {
4075
+ yAxisMin: calculatedMin,
4076
+ yAxisMax: calculatedMax
4077
+ }),
4078
+ key: `viz-${idx.toString()}`,
4079
+ height: containerHeight,
4080
+ width: containerWidth
4081
+ })
4082
+ )
4083
+ ))
4084
+ ), showPaginator && totalPages >= pageNum && /* @__PURE__ */ react_exports.createElement(
4085
+ Paginator_default,
4086
+ {
4087
+ onChange: handlePageChange,
4088
+ current: pageNum,
4089
+ alwaysShowLastPageLink: true,
4090
+ totalPages
4091
+ }
4092
+ ));
4093
+ }
4094
+ return null;
4095
+ };
4096
+ VizWithTrellis.propTypes = Viz.proptypes;
4097
+ VizWithTrellis.defaultProps = Viz.defaultProps;
4098
+ VizWithTrellis.config = Viz.config;
4099
+ return VizWithTrellis;
4100
+ };
4101
+ var withTrellis_default = withTrellis;
4102
+
3219
4103
  // src/Column/Column.tsx
3220
4104
  var validOptions = Object.keys(config_default.optionsSchema);
3221
4105
  var computeVizProps = (_a) => {
@@ -3229,7 +4113,10 @@ var computeVizProps = (_a) => {
3229
4113
  annotationX,
3230
4114
  annotationLabel,
3231
4115
  annotationColor,
3232
- visualizationApiRef
4116
+ visualizationApiRef,
4117
+ trellisKey,
4118
+ trellisSplitBy,
4119
+ themeFunc
3233
4120
  } = _b, otherOptions = __objRest(_b, [
3234
4121
  "dataSources",
3235
4122
  "onEventTrigger",
@@ -3240,9 +4127,19 @@ var computeVizProps = (_a) => {
3240
4127
  "annotationX",
3241
4128
  "annotationLabel",
3242
4129
  "annotationColor",
3243
- "visualizationApiRef"
4130
+ "visualizationApiRef",
4131
+ "trellisKey",
4132
+ "trellisSplitBy",
4133
+ "themeFunc"
3244
4134
  ]);
3245
- const computedProps = { visualizationApiRef, onEventTrigger };
4135
+ const defaultFontColor = themeFunc("defaultFontColor");
4136
+ const computedProps = {
4137
+ visualizationApiRef,
4138
+ onEventTrigger,
4139
+ trellisKey,
4140
+ trellisSplitBy,
4141
+ defaultFontColor
4142
+ };
3246
4143
  const { y2Fields, y2, hasEventHandlers, eventHandlers } = otherOptions;
3247
4144
  computedProps.options = (0, lodash_exports.chain)(otherOptions).pick(validOptions).thru(convertToColumnSCProperties).thru((options) => __spreadProps(__spreadValues({}, (0, simpleXMLOptions_exports.getSimpleXMLOptionsForProps)((0, lodash_exports.omit)(options, ["y2Fields"]))), {
3248
4145
  chart: "column"
@@ -3281,11 +4178,13 @@ var computeVizProps = (_a) => {
3281
4178
  );
3282
4179
  return computedProps;
3283
4180
  };
3284
- var Column = withDashboardViz_default({
3285
- ReactViz: Charting_default,
3286
- computeVizProps,
3287
- vizConfig: config_default
3288
- });
4181
+ var Column = withTrellis_default(
4182
+ withDashboardViz_default({
4183
+ ReactViz: Charting_default,
4184
+ computeVizProps,
4185
+ vizConfig: config_default
4186
+ })
4187
+ );
3289
4188
  var themes3 = null;
3290
4189
  var Column_default = Column;
3291
4190
  //# sourceMappingURL=Column.js.map