@splunk/visualizations 27.3.0 → 27.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +24 -3
- package/Area.config.js.map +2 -2
- package/Area.js +53 -9
- package/Area.js.map +2 -2
- package/Bar.config.js +24 -3
- package/Bar.config.js.map +3 -3
- package/Bar.js +54 -11
- package/Bar.js.map +3 -3
- package/Bubble.config.js +8 -1
- package/Bubble.config.js.map +2 -2
- package/Bubble.js +17 -6
- package/Bubble.js.map +2 -2
- package/CHANGELOG.external.md +1629 -0
- package/ChoroplethSvg.js +2 -2
- package/Column.config.js +24 -3
- package/Column.config.js.map +3 -3
- package/Column.js +53 -9
- package/Column.js.map +3 -3
- package/Ellipse.js +65 -7
- package/Ellipse.js.map +4 -4
- package/Events.js +11 -6
- package/Events.js.map +2 -2
- package/FEATUREFLAGS.md +2 -0
- package/FillerGauge.config.js +8 -28
- package/FillerGauge.config.js.map +2 -2
- package/FillerGauge.js +10 -30
- package/FillerGauge.js.map +2 -2
- package/Image.js +2 -2
- package/Line.config.js +24 -3
- package/Line.config.js.map +3 -3
- package/Line.js +53 -9
- package/Line.js.map +3 -3
- package/LinkGraph.js +2 -2
- package/Map.config.js +22 -0
- package/Map.config.js.map +2 -2
- package/Map.js +284 -121
- package/Map.js.map +4 -4
- package/Markdown.js +2 -2
- package/MarkerGauge.config.js +8 -25
- package/MarkerGauge.config.js.map +2 -2
- package/MarkerGauge.js +10 -27
- package/MarkerGauge.js.map +2 -2
- package/ParallelCoordinates.js +2 -2
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +123 -3
- package/Pie.config.js.map +3 -3
- package/Pie.js +743 -19
- package/Pie.js.map +4 -4
- package/Punchcard.js +2 -2
- package/Punchcard.js.map +1 -1
- package/Rectangle.js +64 -7
- package/Rectangle.js.map +4 -4
- package/Sankey.js +36 -35
- package/Sankey.js.map +3 -3
- package/Scatter.config.js +320 -113
- package/Scatter.config.js.map +4 -4
- package/Scatter.js +936 -128
- package/Scatter.js.map +4 -4
- package/SingleValue.js +3 -3
- package/SingleValue.js.map +2 -2
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.js +3 -3
- package/SingleValueIcon.js.map +2 -2
- package/SingleValueRadial.js +3 -3
- package/SingleValueRadial.js.map +2 -2
- package/TRELLIS.md +12 -3
- package/Table.js +2 -2
- package/Timeline.js +81 -63
- package/Timeline.js.map +4 -4
- package/common/Charting.js +7 -3
- package/common/Charting.js.map +2 -2
- package/common/chartingUtils.js +11 -0
- package/common/chartingUtils.js.map +2 -2
- package/common/shapeUtils.js +85 -3
- package/common/shapeUtils.js.map +4 -4
- package/common/utils/mapUtils.js +169 -48
- package/common/utils/mapUtils.js.map +4 -4
- package/common/utils/singleValueUtils.js +1 -1
- package/common/utils/singleValueUtils.js.map +2 -2
- package/common/withDashboardViz.js +2 -2
- package/package.json +18 -18
package/Scatter.js
CHANGED
|
@@ -652,6 +652,7 @@ var propTypes = {
|
|
|
652
652
|
onDownsamplingThresholdChange: prop_types_exports.func,
|
|
653
653
|
xField: prop_types_exports.string,
|
|
654
654
|
y2Fields: prop_types_exports.array,
|
|
655
|
+
additionalTooltipFields: prop_types_exports.array,
|
|
655
656
|
splitByLayout: prop_types_exports.oneOf(Object.values(visualization_schemas_exports.LAYOUT_TYPE)),
|
|
656
657
|
trellisKey: prop_types_exports.string,
|
|
657
658
|
trellisSplitBy: prop_types_exports.string,
|
|
@@ -697,7 +698,8 @@ var Charting = (props) => {
|
|
|
697
698
|
xField,
|
|
698
699
|
backgroundColor,
|
|
699
700
|
defaultFontColor,
|
|
700
|
-
trellisKey
|
|
701
|
+
trellisKey,
|
|
702
|
+
additionalTooltipFields
|
|
701
703
|
} = props;
|
|
702
704
|
const prevOptions = usePrevious(options);
|
|
703
705
|
const prevTimezone = usePrevious(timezone);
|
|
@@ -924,7 +926,8 @@ var Charting = (props) => {
|
|
|
924
926
|
timezone == null ? void 0 : timezone.utcOffset,
|
|
925
927
|
timezone == null ? void 0 : timezone.serializedTimezone,
|
|
926
928
|
themeKey,
|
|
927
|
-
onClick
|
|
929
|
+
onClick,
|
|
930
|
+
additionalTooltipFields
|
|
928
931
|
]);
|
|
929
932
|
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
|
|
930
933
|
TrellisTitle,
|
|
@@ -967,7 +970,8 @@ var defaultProps = {
|
|
|
967
970
|
trellisKey: void 0,
|
|
968
971
|
trellisSplitBy: void 0,
|
|
969
972
|
backgroundColor: "",
|
|
970
|
-
defaultFontColor: ""
|
|
973
|
+
defaultFontColor: "",
|
|
974
|
+
additionalTooltipFields: []
|
|
971
975
|
};
|
|
972
976
|
Charting.propTypes = propTypes;
|
|
973
977
|
Charting.defaultProps = defaultProps;
|
|
@@ -1058,7 +1062,7 @@ var insertLayout = (layout, index, ...layoutItems) => [
|
|
|
1058
1062
|
...layout.slice(index)
|
|
1059
1063
|
];
|
|
1060
1064
|
|
|
1061
|
-
// src/common/editorConfig/
|
|
1065
|
+
// src/common/editorConfig/TrellisEditors.ts
|
|
1062
1066
|
var isTrellisFeatureFlagOn = ({ featureFlags }) => {
|
|
1063
1067
|
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
|
|
1064
1068
|
};
|
|
@@ -1066,6 +1070,252 @@ var isTrellisEnabled = ({ options, featureFlags }) => {
|
|
|
1066
1070
|
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1067
1071
|
return isTrellisFeatureFlagOn({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1068
1072
|
};
|
|
1073
|
+
var TrellisEditorConfig = [
|
|
1074
|
+
[
|
|
1075
|
+
{
|
|
1076
|
+
label: (0, i18n_exports._)("Trellis layout"),
|
|
1077
|
+
option: "splitByLayout",
|
|
1078
|
+
editor: "editor.toggle",
|
|
1079
|
+
showEditor: isTrellisFeatureFlagOn
|
|
1080
|
+
}
|
|
1081
|
+
],
|
|
1082
|
+
[
|
|
1083
|
+
{
|
|
1084
|
+
label: (0, i18n_exports._)("Split by"),
|
|
1085
|
+
option: "trellisSplitBy",
|
|
1086
|
+
editor: "editor.trellisSplitBy",
|
|
1087
|
+
editorProps: {
|
|
1088
|
+
dataSourceKey: "primary"
|
|
1089
|
+
},
|
|
1090
|
+
showEditor: isTrellisEnabled
|
|
1091
|
+
}
|
|
1092
|
+
],
|
|
1093
|
+
[
|
|
1094
|
+
{
|
|
1095
|
+
label: (0, i18n_exports._)("Number of columns"),
|
|
1096
|
+
option: "trellisColumns",
|
|
1097
|
+
editor: "editor.number",
|
|
1098
|
+
editorProps: {
|
|
1099
|
+
min: 1
|
|
1100
|
+
},
|
|
1101
|
+
placeholder: (0, i18n_exports._)("Auto"),
|
|
1102
|
+
showEditor: isTrellisEnabled
|
|
1103
|
+
}
|
|
1104
|
+
],
|
|
1105
|
+
[
|
|
1106
|
+
{
|
|
1107
|
+
label: (0, i18n_exports._)("Min column width"),
|
|
1108
|
+
option: "trellisMinColumnWidth",
|
|
1109
|
+
editor: "editor.number",
|
|
1110
|
+
editorProps: {
|
|
1111
|
+
min: 1
|
|
1112
|
+
},
|
|
1113
|
+
showEditor: isTrellisEnabled
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
label: (0, i18n_exports._)("Row height"),
|
|
1117
|
+
option: "trellisRowHeight",
|
|
1118
|
+
editor: "editor.number",
|
|
1119
|
+
editorProps: {
|
|
1120
|
+
min: 1
|
|
1121
|
+
},
|
|
1122
|
+
showEditor: isTrellisEnabled
|
|
1123
|
+
}
|
|
1124
|
+
],
|
|
1125
|
+
[
|
|
1126
|
+
{
|
|
1127
|
+
label: (0, i18n_exports._)("Max number of components per page"),
|
|
1128
|
+
option: "trellisPageCount",
|
|
1129
|
+
editor: "editor.number",
|
|
1130
|
+
editorProps: {
|
|
1131
|
+
min: 1
|
|
1132
|
+
},
|
|
1133
|
+
showEditor: isTrellisEnabled
|
|
1134
|
+
}
|
|
1135
|
+
]
|
|
1136
|
+
];
|
|
1137
|
+
var TimechartTrellisEditorConfig = [
|
|
1138
|
+
[
|
|
1139
|
+
{
|
|
1140
|
+
label: (0, i18n_exports._)("Trellis layout"),
|
|
1141
|
+
option: "splitByLayout",
|
|
1142
|
+
editor: "editor.toggle",
|
|
1143
|
+
showEditor: isTrellisFeatureFlagOn,
|
|
1144
|
+
// add help text for timecharts
|
|
1145
|
+
editorProps: {
|
|
1146
|
+
help: (0, i18n_exports._)(
|
|
1147
|
+
"Y2-axis and overlay field configurations are not supported when trellis is enabled."
|
|
1148
|
+
),
|
|
1149
|
+
helpFormat: "under"
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
],
|
|
1153
|
+
...TrellisEditorConfig.slice(1),
|
|
1154
|
+
[
|
|
1155
|
+
{
|
|
1156
|
+
label: (0, i18n_exports._)("Shared y-axis scale"),
|
|
1157
|
+
option: "trellisSharedScale",
|
|
1158
|
+
editor: "editor.checkbox",
|
|
1159
|
+
showEditor: isTrellisEnabled
|
|
1160
|
+
}
|
|
1161
|
+
]
|
|
1162
|
+
];
|
|
1163
|
+
var TrellisBackgroundColorEditor = {
|
|
1164
|
+
label: (0, i18n_exports._)("Trellis background"),
|
|
1165
|
+
option: "trellisBackgroundColor",
|
|
1166
|
+
editor: "editor.color",
|
|
1167
|
+
showEditor: isTrellisEnabled
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
// src/common/editorConfig/AxesChartDataDisplay.ts
|
|
1171
|
+
var isTrellisFeatureFlagOn2 = ({ featureFlags }) => {
|
|
1172
|
+
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
|
|
1173
|
+
};
|
|
1174
|
+
var isTrellisEnabled2 = ({ options, featureFlags }) => {
|
|
1175
|
+
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1176
|
+
return isTrellisFeatureFlagOn2({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1177
|
+
};
|
|
1178
|
+
var AxesChartDataDisplayBase = {
|
|
1179
|
+
label: (0, i18n_exports._)("Data display"),
|
|
1180
|
+
layout: [
|
|
1181
|
+
[
|
|
1182
|
+
{
|
|
1183
|
+
label: (0, i18n_exports._)("Stack mode"),
|
|
1184
|
+
option: "stackMode",
|
|
1185
|
+
editor: "editor.select",
|
|
1186
|
+
editorProps: {
|
|
1187
|
+
values: [
|
|
1188
|
+
{ label: (0, i18n_exports._)("Not stacked"), value: "auto" },
|
|
1189
|
+
{ label: (0, i18n_exports._)("Stacked"), value: "stacked" },
|
|
1190
|
+
{ label: (0, i18n_exports._)("Stacked 100%"), value: "stacked100" }
|
|
1191
|
+
]
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
],
|
|
1195
|
+
[
|
|
1196
|
+
{
|
|
1197
|
+
label: (0, i18n_exports._)("Null value display"),
|
|
1198
|
+
option: "nullValueDisplay",
|
|
1199
|
+
editor: "editor.radioBar",
|
|
1200
|
+
editorProps: {
|
|
1201
|
+
values: [
|
|
1202
|
+
{ label: (0, i18n_exports._)("Gaps"), value: "gaps" },
|
|
1203
|
+
{ label: (0, i18n_exports._)("Zero"), value: "zero" },
|
|
1204
|
+
{ label: (0, i18n_exports._)("Connect"), value: "connect" }
|
|
1205
|
+
]
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
],
|
|
1209
|
+
[
|
|
1210
|
+
{
|
|
1211
|
+
label: (0, i18n_exports._)("Data value display"),
|
|
1212
|
+
option: "dataValuesDisplay",
|
|
1213
|
+
editor: "editor.radioBar",
|
|
1214
|
+
editorProps: {
|
|
1215
|
+
values: [
|
|
1216
|
+
{ label: (0, i18n_exports._)("Off"), value: "off" },
|
|
1217
|
+
{ label: (0, i18n_exports._)("All"), value: "all" },
|
|
1218
|
+
{ label: (0, i18n_exports._)("Min/Max"), value: "minmax" }
|
|
1219
|
+
]
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
],
|
|
1223
|
+
[
|
|
1224
|
+
{
|
|
1225
|
+
label: (0, i18n_exports._)("Overlay fields"),
|
|
1226
|
+
option: "overlayFields",
|
|
1227
|
+
editor: "editor.columnMultiSelectionByFieldNameEditor",
|
|
1228
|
+
editorProps: {
|
|
1229
|
+
filterByTypes: ["number"]
|
|
1230
|
+
},
|
|
1231
|
+
isDisabled: isTrellisEnabled2
|
|
1232
|
+
}
|
|
1233
|
+
],
|
|
1234
|
+
[
|
|
1235
|
+
{
|
|
1236
|
+
label: (0, i18n_exports._)("Split series"),
|
|
1237
|
+
option: "showSplitSeries",
|
|
1238
|
+
editor: "editor.toggle"
|
|
1239
|
+
}
|
|
1240
|
+
],
|
|
1241
|
+
[
|
|
1242
|
+
{
|
|
1243
|
+
label: (0, i18n_exports._)("Independent y-axis for split series"),
|
|
1244
|
+
option: "showIndependentYRanges",
|
|
1245
|
+
editor: "editor.checkbox",
|
|
1246
|
+
showEditor: ({ options }) => options.showSplitSeries
|
|
1247
|
+
}
|
|
1248
|
+
],
|
|
1249
|
+
...TimechartTrellisEditorConfig
|
|
1250
|
+
]
|
|
1251
|
+
};
|
|
1252
|
+
var AxesChartDataDisplayBar = {
|
|
1253
|
+
label: AxesChartDataDisplayBase.label,
|
|
1254
|
+
layout: [
|
|
1255
|
+
AxesChartDataDisplayBase.layout[0],
|
|
1256
|
+
// remove null value display editor at index 1
|
|
1257
|
+
...AxesChartDataDisplayBase.layout.slice(2)
|
|
1258
|
+
]
|
|
1259
|
+
};
|
|
1260
|
+
var AxesChartDataDisplayScatter = {
|
|
1261
|
+
label: AxesChartDataDisplayBase.label,
|
|
1262
|
+
layout: [
|
|
1263
|
+
...TrellisEditorConfig,
|
|
1264
|
+
[
|
|
1265
|
+
{
|
|
1266
|
+
label: (0, i18n_exports._)("Shared y-axis scale"),
|
|
1267
|
+
option: "trellisSharedScale",
|
|
1268
|
+
editor: "editor.checkbox",
|
|
1269
|
+
showEditor: isTrellisEnabled2
|
|
1270
|
+
}
|
|
1271
|
+
]
|
|
1272
|
+
]
|
|
1273
|
+
};
|
|
1274
|
+
var AxesChartDataDisplayColumn = {
|
|
1275
|
+
label: AxesChartDataDisplayBase.label,
|
|
1276
|
+
layout: [
|
|
1277
|
+
AxesChartDataDisplayBase.layout[0],
|
|
1278
|
+
// remove null value display and add data value display
|
|
1279
|
+
AxesChartDataDisplayBase.layout[2],
|
|
1280
|
+
[
|
|
1281
|
+
{
|
|
1282
|
+
label: (0, i18n_exports._)("Show tooltip on hover"),
|
|
1283
|
+
option: "showTooltip",
|
|
1284
|
+
editor: "editor.checkbox"
|
|
1285
|
+
}
|
|
1286
|
+
],
|
|
1287
|
+
...AxesChartDataDisplayBase.layout.slice(3),
|
|
1288
|
+
[
|
|
1289
|
+
{
|
|
1290
|
+
label: (0, i18n_exports._)("Column grouping mode"),
|
|
1291
|
+
option: "columnGrouping",
|
|
1292
|
+
editor: "editor.radioBar",
|
|
1293
|
+
editorProps: {
|
|
1294
|
+
values: [
|
|
1295
|
+
{ label: (0, i18n_exports._)("Auto"), value: "auto" },
|
|
1296
|
+
{ label: (0, i18n_exports._)("Overlay"), value: "overlay" }
|
|
1297
|
+
]
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
]
|
|
1301
|
+
]
|
|
1302
|
+
};
|
|
1303
|
+
var AxesChartDataDisplayLine = {
|
|
1304
|
+
label: AxesChartDataDisplayBase.label,
|
|
1305
|
+
layout: [
|
|
1306
|
+
// remove stacked mode editor
|
|
1307
|
+
...AxesChartDataDisplayBase.layout.slice(1)
|
|
1308
|
+
]
|
|
1309
|
+
};
|
|
1310
|
+
|
|
1311
|
+
// src/common/editorConfig/AxesChartDataConfig.ts
|
|
1312
|
+
var isTrellisFeatureFlagOn3 = ({ featureFlags }) => {
|
|
1313
|
+
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
|
|
1314
|
+
};
|
|
1315
|
+
var isTrellisEnabled3 = ({ options, featureFlags }) => {
|
|
1316
|
+
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1317
|
+
return isTrellisFeatureFlagOn3({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1318
|
+
};
|
|
1069
1319
|
var AxesChartDataConfig = {
|
|
1070
1320
|
label: (0, i18n_exports._)("Data configurations"),
|
|
1071
1321
|
layout: [
|
|
@@ -1094,6 +1344,13 @@ var AxesChartDataConfig = {
|
|
|
1094
1344
|
}
|
|
1095
1345
|
}
|
|
1096
1346
|
],
|
|
1347
|
+
[
|
|
1348
|
+
{
|
|
1349
|
+
label: (0, i18n_exports._)("Additional tooltip fields"),
|
|
1350
|
+
option: "additionalTooltipFields",
|
|
1351
|
+
editor: "editor.columnMultiSelectionByFieldNameEditor"
|
|
1352
|
+
}
|
|
1353
|
+
],
|
|
1097
1354
|
[
|
|
1098
1355
|
{
|
|
1099
1356
|
label: (0, i18n_exports._)("Result limit"),
|
|
@@ -1120,7 +1377,7 @@ var AxesChartDataConfigBar = {
|
|
|
1120
1377
|
supportsDSL: true,
|
|
1121
1378
|
expectedDataPrimitive: ["series", "frame"]
|
|
1122
1379
|
},
|
|
1123
|
-
isDisabled:
|
|
1380
|
+
isDisabled: isTrellisEnabled3
|
|
1124
1381
|
}
|
|
1125
1382
|
])
|
|
1126
1383
|
};
|
|
@@ -1514,111 +1771,6 @@ var background = ({
|
|
|
1514
1771
|
];
|
|
1515
1772
|
var BackgroundColor_default = background;
|
|
1516
1773
|
|
|
1517
|
-
// src/common/editorConfig/TrellisEditors.ts
|
|
1518
|
-
var isTrellisFeatureFlagOn2 = ({ featureFlags }) => {
|
|
1519
|
-
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
|
|
1520
|
-
};
|
|
1521
|
-
var isTrellisEnabled2 = ({ options, featureFlags }) => {
|
|
1522
|
-
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1523
|
-
return isTrellisFeatureFlagOn2({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1524
|
-
};
|
|
1525
|
-
var TrellisEditorConfig = [
|
|
1526
|
-
[
|
|
1527
|
-
{
|
|
1528
|
-
label: (0, i18n_exports._)("Trellis layout"),
|
|
1529
|
-
option: "splitByLayout",
|
|
1530
|
-
editor: "editor.toggle",
|
|
1531
|
-
showEditor: isTrellisFeatureFlagOn2
|
|
1532
|
-
}
|
|
1533
|
-
],
|
|
1534
|
-
[
|
|
1535
|
-
{
|
|
1536
|
-
label: (0, i18n_exports._)("Split by"),
|
|
1537
|
-
option: "trellisSplitBy",
|
|
1538
|
-
editor: "editor.trellisSplitBy",
|
|
1539
|
-
editorProps: {
|
|
1540
|
-
dataSourceKey: "primary"
|
|
1541
|
-
},
|
|
1542
|
-
showEditor: isTrellisEnabled2
|
|
1543
|
-
}
|
|
1544
|
-
],
|
|
1545
|
-
[
|
|
1546
|
-
{
|
|
1547
|
-
label: (0, i18n_exports._)("Number of columns"),
|
|
1548
|
-
option: "trellisColumns",
|
|
1549
|
-
editor: "editor.number",
|
|
1550
|
-
editorProps: {
|
|
1551
|
-
min: 1
|
|
1552
|
-
},
|
|
1553
|
-
placeholder: (0, i18n_exports._)("Auto"),
|
|
1554
|
-
showEditor: isTrellisEnabled2
|
|
1555
|
-
}
|
|
1556
|
-
],
|
|
1557
|
-
[
|
|
1558
|
-
{
|
|
1559
|
-
label: (0, i18n_exports._)("Min column width"),
|
|
1560
|
-
option: "trellisMinColumnWidth",
|
|
1561
|
-
editor: "editor.number",
|
|
1562
|
-
editorProps: {
|
|
1563
|
-
min: 1
|
|
1564
|
-
},
|
|
1565
|
-
showEditor: isTrellisEnabled2
|
|
1566
|
-
},
|
|
1567
|
-
{
|
|
1568
|
-
label: (0, i18n_exports._)("Row height"),
|
|
1569
|
-
option: "trellisRowHeight",
|
|
1570
|
-
editor: "editor.number",
|
|
1571
|
-
editorProps: {
|
|
1572
|
-
min: 1
|
|
1573
|
-
},
|
|
1574
|
-
showEditor: isTrellisEnabled2
|
|
1575
|
-
}
|
|
1576
|
-
],
|
|
1577
|
-
[
|
|
1578
|
-
{
|
|
1579
|
-
label: (0, i18n_exports._)("Max number of components per page"),
|
|
1580
|
-
option: "trellisPageCount",
|
|
1581
|
-
editor: "editor.number",
|
|
1582
|
-
editorProps: {
|
|
1583
|
-
min: 1
|
|
1584
|
-
},
|
|
1585
|
-
showEditor: isTrellisEnabled2
|
|
1586
|
-
}
|
|
1587
|
-
]
|
|
1588
|
-
];
|
|
1589
|
-
var TimechartTrellisEditorConfig = [
|
|
1590
|
-
[
|
|
1591
|
-
{
|
|
1592
|
-
label: (0, i18n_exports._)("Trellis layout"),
|
|
1593
|
-
option: "splitByLayout",
|
|
1594
|
-
editor: "editor.toggle",
|
|
1595
|
-
showEditor: isTrellisFeatureFlagOn2,
|
|
1596
|
-
// add help text for timecharts
|
|
1597
|
-
editorProps: {
|
|
1598
|
-
help: (0, i18n_exports._)(
|
|
1599
|
-
"Y2-axis and overlay field configurations are not supported when trellis is enabled."
|
|
1600
|
-
),
|
|
1601
|
-
helpFormat: "under"
|
|
1602
|
-
}
|
|
1603
|
-
}
|
|
1604
|
-
],
|
|
1605
|
-
...TrellisEditorConfig.slice(1),
|
|
1606
|
-
[
|
|
1607
|
-
{
|
|
1608
|
-
label: (0, i18n_exports._)("Shared y-axis scale"),
|
|
1609
|
-
option: "trellisSharedScale",
|
|
1610
|
-
editor: "editor.checkbox",
|
|
1611
|
-
showEditor: isTrellisEnabled2
|
|
1612
|
-
}
|
|
1613
|
-
]
|
|
1614
|
-
];
|
|
1615
|
-
var TrellisBackgroundColorEditor = {
|
|
1616
|
-
label: (0, i18n_exports._)("Trellis background"),
|
|
1617
|
-
option: "trellisBackgroundColor",
|
|
1618
|
-
editor: "editor.color",
|
|
1619
|
-
showEditor: isTrellisEnabled2
|
|
1620
|
-
};
|
|
1621
|
-
|
|
1622
1774
|
// src/common/editorConfig/AxesChartColorAndStyle.ts
|
|
1623
1775
|
var themes = {
|
|
1624
1776
|
defaultBackgroundColor: (props) => pick_default({
|
|
@@ -1649,7 +1801,7 @@ var AxesChartColorAndStyle = {
|
|
|
1649
1801
|
]
|
|
1650
1802
|
]
|
|
1651
1803
|
};
|
|
1652
|
-
var
|
|
1804
|
+
var AxesChartColorAndStyleWithTrellis = __spreadProps(__spreadValues({}, AxesChartColorAndStyle), {
|
|
1653
1805
|
layout: [
|
|
1654
1806
|
AxesChartColorAndStyle.layout[0],
|
|
1655
1807
|
[
|
|
@@ -1662,7 +1814,6 @@ var AreaAxesChartColorAndStyleWithTrellis = __spreadProps(__spreadValues({}, Axe
|
|
|
1662
1814
|
...AxesChartColorAndStyle.layout.slice(1)
|
|
1663
1815
|
]
|
|
1664
1816
|
});
|
|
1665
|
-
var AxesChartColorAndStyle_default = AxesChartColorAndStyle;
|
|
1666
1817
|
|
|
1667
1818
|
// src/common/editorConfig/AxesChartLegend.ts
|
|
1668
1819
|
var AxesChartLegend = {
|
|
@@ -1702,6 +1853,54 @@ var AxesChartLegend = {
|
|
|
1702
1853
|
]
|
|
1703
1854
|
]
|
|
1704
1855
|
};
|
|
1856
|
+
var AxesChartLegendWithTrellisAndMode = ({
|
|
1857
|
+
showLegendTooltip = false,
|
|
1858
|
+
hideModeWhenOff = false
|
|
1859
|
+
}) => ({
|
|
1860
|
+
label: AxesChartLegend.label,
|
|
1861
|
+
layout: [
|
|
1862
|
+
[
|
|
1863
|
+
{
|
|
1864
|
+
label: (0, i18n_exports._)("Legend display"),
|
|
1865
|
+
option: "legendDisplay",
|
|
1866
|
+
editor: "editor.select",
|
|
1867
|
+
editorProps: {
|
|
1868
|
+
values: [
|
|
1869
|
+
{ label: (0, i18n_exports._)("Right"), value: "right" },
|
|
1870
|
+
{ label: (0, i18n_exports._)("Left"), value: "left" },
|
|
1871
|
+
{ label: (0, i18n_exports._)("Top"), value: "top" },
|
|
1872
|
+
{ label: (0, i18n_exports._)("Bottom"), value: "bottom" },
|
|
1873
|
+
{ label: (0, i18n_exports._)("Off"), value: "off" }
|
|
1874
|
+
],
|
|
1875
|
+
tooltip: showLegendTooltip && (0, i18n_exports._)('Legend mode must be "Standard" to configure legend display')
|
|
1876
|
+
},
|
|
1877
|
+
isDisabled: showLegendTooltip ? ({ options }) => options.legendMode === "seriesCompare" : void 0,
|
|
1878
|
+
overrideDefaultValue: ({ options }) => (options == null ? void 0 : options.splitByLayout) === "trellis" ? "off" : "right"
|
|
1879
|
+
}
|
|
1880
|
+
],
|
|
1881
|
+
[
|
|
1882
|
+
__spreadProps(__spreadValues({}, AxesChartLegend.layout[1][0]), {
|
|
1883
|
+
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
|
|
1884
|
+
options.legendDisplay === void 0 && options.splitByLayout !== "trellis"
|
|
1885
|
+
})
|
|
1886
|
+
],
|
|
1887
|
+
[
|
|
1888
|
+
{
|
|
1889
|
+
label: (0, i18n_exports._)("Legend mode"),
|
|
1890
|
+
option: "legendMode",
|
|
1891
|
+
editor: "editor.radioBar",
|
|
1892
|
+
editorProps: {
|
|
1893
|
+
values: [
|
|
1894
|
+
{ label: (0, i18n_exports._)("Standard"), value: "standard" },
|
|
1895
|
+
{ label: (0, i18n_exports._)("Compare series"), value: "seriesCompare" }
|
|
1896
|
+
]
|
|
1897
|
+
},
|
|
1898
|
+
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
|
|
1899
|
+
options.legendDisplay === void 0 && options.splitByLayout !== "trellis" : true
|
|
1900
|
+
}
|
|
1901
|
+
]
|
|
1902
|
+
]
|
|
1903
|
+
});
|
|
1705
1904
|
var AxesChartLegend_default = AxesChartLegend;
|
|
1706
1905
|
|
|
1707
1906
|
// src/common/editorConfig/AxesChartYGridAndLabels.ts
|
|
@@ -1903,14 +2102,22 @@ var themes2 = {
|
|
|
1903
2102
|
light: variables_default.backgroundColor(props)
|
|
1904
2103
|
},
|
|
1905
2104
|
prisma: variables_default.backgroundColorSidebar(props)
|
|
2105
|
+
})(props),
|
|
2106
|
+
defaultFontColor: (props) => pick_default({
|
|
2107
|
+
enterprise: {
|
|
2108
|
+
dark: variables_default.textColor(props),
|
|
2109
|
+
light: variables_default.textColor(props)
|
|
2110
|
+
},
|
|
2111
|
+
prisma: variables_default.contentColorDefault(props)
|
|
1906
2112
|
})(props)
|
|
1907
2113
|
};
|
|
1908
2114
|
var editorConfig = [
|
|
1909
2115
|
AxesChartDataConfigScatter,
|
|
2116
|
+
AxesChartDataDisplayScatter,
|
|
1910
2117
|
{
|
|
1911
|
-
label:
|
|
2118
|
+
label: AxesChartColorAndStyleWithTrellis.label,
|
|
1912
2119
|
layout: [
|
|
1913
|
-
...
|
|
2120
|
+
...AxesChartColorAndStyleWithTrellis.layout.slice(0, 3),
|
|
1914
2121
|
[
|
|
1915
2122
|
{
|
|
1916
2123
|
label: (0, i18n_exports._)("Series colors by category name"),
|
|
@@ -1935,7 +2142,11 @@ var editorConfig = [
|
|
|
1935
2142
|
]
|
|
1936
2143
|
]
|
|
1937
2144
|
},
|
|
1938
|
-
|
|
2145
|
+
{
|
|
2146
|
+
label: AxesChartLegend_default.label,
|
|
2147
|
+
layout: [...AxesChartLegendWithTrellisAndMode({ showLegendTooltip: false }).layout.slice(0, 2)]
|
|
2148
|
+
// Legendmode not required hence slice
|
|
2149
|
+
},
|
|
1939
2150
|
AxesChartXGridAndLabelsBubbleScatter,
|
|
1940
2151
|
AxesChartYGridAndLabels_default
|
|
1941
2152
|
];
|
|
@@ -1967,7 +2178,7 @@ var config = {
|
|
|
1967
2178
|
description: "triggered when user clicks on a point in the scatter chart"
|
|
1968
2179
|
}
|
|
1969
2180
|
},
|
|
1970
|
-
supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "placeholder" /* PLACEHOLDER */],
|
|
2181
|
+
supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "placeholder" /* PLACEHOLDER */, "trellis" /* TRELLIS */],
|
|
1971
2182
|
themes: themes2
|
|
1972
2183
|
};
|
|
1973
2184
|
var config_default = enhanceConfig(config);
|
|
@@ -2296,7 +2507,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
2296
2507
|
FixSizeItem,
|
|
2297
2508
|
{
|
|
2298
2509
|
"data-test": "fix-size-item",
|
|
2299
|
-
"data-splunk-visualization-version": "27.
|
|
2510
|
+
"data-splunk-visualization-version": "27.5.0 - 5cfbc7064",
|
|
2300
2511
|
width,
|
|
2301
2512
|
height,
|
|
2302
2513
|
backgroundColor
|
|
@@ -2362,7 +2573,7 @@ var Cover = styled_components_default.div`
|
|
|
2362
2573
|
bottom: 0;
|
|
2363
2574
|
`;
|
|
2364
2575
|
var Blocker = styled_components_default.div.attrs({
|
|
2365
|
-
"data-splunk-visualization-version": "27.
|
|
2576
|
+
"data-splunk-visualization-version": "27.5.0 - 5cfbc7064"
|
|
2366
2577
|
})`
|
|
2367
2578
|
position: relative;
|
|
2368
2579
|
width: 100%;
|
|
@@ -2634,6 +2845,309 @@ __reExport(trellisUtils_exports, require("@splunk/visualizations-shared/trellisU
|
|
|
2634
2845
|
var trellisUtils_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
|
|
2635
2846
|
|
|
2636
2847
|
// src/common/utils/trellisUtils.ts
|
|
2848
|
+
var AGGREGATIONS = "aggregations";
|
|
2849
|
+
var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
2850
|
+
var _a, _b, _c, _d;
|
|
2851
|
+
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2852
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2853
|
+
let splitDataSources = null;
|
|
2854
|
+
let errorCode = null;
|
|
2855
|
+
if (fields && fields.length) {
|
|
2856
|
+
splitDataSources = {};
|
|
2857
|
+
for (let i = 0; i < fields.length; i += 1) {
|
|
2858
|
+
const fieldName = fields[i].name;
|
|
2859
|
+
if (!(fieldName == null ? void 0 : fieldName.startsWith("_"))) {
|
|
2860
|
+
splitDataSources[fieldName] = (0, lodash_exports.cloneDeep)(
|
|
2861
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
2862
|
+
);
|
|
2863
|
+
splitDataSources[fieldName].primary.data.fields = [fields[i]];
|
|
2864
|
+
splitDataSources[fieldName].primary.data.columns = [columns[i]];
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
} else {
|
|
2868
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
2869
|
+
}
|
|
2870
|
+
return { splitDataSources, errorCode };
|
|
2871
|
+
};
|
|
2872
|
+
var toFieldEntries = (fields) => {
|
|
2873
|
+
return fields.map((field) => {
|
|
2874
|
+
if (typeof field === "string") {
|
|
2875
|
+
return { name: field };
|
|
2876
|
+
}
|
|
2877
|
+
return field;
|
|
2878
|
+
});
|
|
2879
|
+
};
|
|
2880
|
+
var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
2881
|
+
var _a, _b, _c, _d;
|
|
2882
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
2883
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2884
|
+
let splitDataSources = null;
|
|
2885
|
+
let splitByFields = [];
|
|
2886
|
+
let errorCode = null;
|
|
2887
|
+
if (typeof fields[0] !== "string") {
|
|
2888
|
+
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
2889
|
+
}
|
|
2890
|
+
if (splitByFields && splitByFields.length > 0) {
|
|
2891
|
+
splitDataSources = {};
|
|
2892
|
+
splitByFields.forEach((splitByField) => {
|
|
2893
|
+
splitDataSources[splitByField] = (0, lodash_exports.cloneDeep)(
|
|
2894
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
2895
|
+
);
|
|
2896
|
+
splitDataSources[splitByField].primary.data.fields = [fields[0]];
|
|
2897
|
+
splitDataSources[splitByField].primary.data.columns = [columns[0]];
|
|
2898
|
+
fields.forEach((field, idx) => {
|
|
2899
|
+
const fieldName = field == null ? void 0 : field.name;
|
|
2900
|
+
if (fieldName !== "_time" && !(fieldName == null ? void 0 : fieldName.startsWith("_")) && field.data_source === splitByField) {
|
|
2901
|
+
splitDataSources[splitByField].primary.data.fields.push(field);
|
|
2902
|
+
splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
|
|
2903
|
+
}
|
|
2904
|
+
});
|
|
2905
|
+
});
|
|
2906
|
+
} else if ((!splitByFields || !splitByFields.length) && fields.length > 1) {
|
|
2907
|
+
splitDataSources = {};
|
|
2908
|
+
for (let i = 1; i < fields.length; i += 1) {
|
|
2909
|
+
const fieldName = fields[i].name;
|
|
2910
|
+
if (!(fieldName == null ? void 0 : fieldName.startsWith("_"))) {
|
|
2911
|
+
splitDataSources[fieldName] = (0, lodash_exports.cloneDeep)(
|
|
2912
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
2913
|
+
);
|
|
2914
|
+
splitDataSources[fieldName].primary.data.fields = [fields[0], fields[i]];
|
|
2915
|
+
splitDataSources[fieldName].primary.data.columns = [columns[0], columns[i]];
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
} else {
|
|
2919
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
2920
|
+
}
|
|
2921
|
+
return { splitDataSources, errorCode };
|
|
2922
|
+
};
|
|
2923
|
+
var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
2924
|
+
var _a, _b, _c, _d;
|
|
2925
|
+
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2926
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2927
|
+
let splitDataSources = null;
|
|
2928
|
+
let splitByFields = [];
|
|
2929
|
+
let errorCode = null;
|
|
2930
|
+
if (typeof fields[0] !== "string") {
|
|
2931
|
+
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
|
|
2932
|
+
}
|
|
2933
|
+
if (splitByFields && splitByFields.length > 0) {
|
|
2934
|
+
splitDataSources = {};
|
|
2935
|
+
splitByFields.forEach((splitByField) => {
|
|
2936
|
+
splitDataSources[splitByField] = (0, lodash_exports.cloneDeep)(
|
|
2937
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
2938
|
+
);
|
|
2939
|
+
splitDataSources[splitByField].primary.data.fields = [fields[0]];
|
|
2940
|
+
splitDataSources[splitByField].primary.data.columns = [columns[0]];
|
|
2941
|
+
const idx = fields.findIndex((field) => field.name === splitByField);
|
|
2942
|
+
if (idx > 0) {
|
|
2943
|
+
splitDataSources[splitByField].primary.data.fields.push(fields[idx]);
|
|
2944
|
+
splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
|
|
2945
|
+
}
|
|
2946
|
+
});
|
|
2947
|
+
} else {
|
|
2948
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
2949
|
+
}
|
|
2950
|
+
return { splitDataSources, errorCode };
|
|
2951
|
+
};
|
|
2952
|
+
var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
2953
|
+
var _a, _b, _c, _d, _e;
|
|
2954
|
+
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2955
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2956
|
+
let splitDataSources = null;
|
|
2957
|
+
let splitByFields = [];
|
|
2958
|
+
let errorCode = null;
|
|
2959
|
+
if (typeof fields[0] !== "string") {
|
|
2960
|
+
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
2961
|
+
}
|
|
2962
|
+
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
2963
|
+
splitDataSources = {};
|
|
2964
|
+
const dataSourceKeys = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
2965
|
+
const valueKeys = [];
|
|
2966
|
+
for (let i = 1; i < fields.length; i += 1) {
|
|
2967
|
+
if (!((_e = fields[i].name) == null ? void 0 : _e.startsWith("_"))) {
|
|
2968
|
+
valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
valueKeys.forEach((val) => {
|
|
2972
|
+
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
2973
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
2974
|
+
);
|
|
2975
|
+
splitDataSources[val].primary.data.fields = [
|
|
2976
|
+
{ name: fields[0].name },
|
|
2977
|
+
...dataSourceKeys.map((k) => ({
|
|
2978
|
+
name: k
|
|
2979
|
+
}))
|
|
2980
|
+
];
|
|
2981
|
+
splitDataSources[val].primary.data.columns = [[...columns[0]]];
|
|
2982
|
+
dataSourceKeys.forEach((dsKey) => {
|
|
2983
|
+
fields.forEach((field, idx) => {
|
|
2984
|
+
if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
|
|
2985
|
+
splitDataSources[val].primary.data.columns.push([...columns[idx]]);
|
|
2986
|
+
}
|
|
2987
|
+
});
|
|
2988
|
+
});
|
|
2989
|
+
});
|
|
2990
|
+
} else {
|
|
2991
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
2992
|
+
}
|
|
2993
|
+
return { splitDataSources, errorCode };
|
|
2994
|
+
};
|
|
2995
|
+
var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
2996
|
+
var _a, _b, _c, _d;
|
|
2997
|
+
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2998
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2999
|
+
let splitDataSources = null;
|
|
3000
|
+
let splitByFields = [];
|
|
3001
|
+
let errorCode = null;
|
|
3002
|
+
if (typeof fields[0] !== "string") {
|
|
3003
|
+
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
3004
|
+
}
|
|
3005
|
+
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
3006
|
+
splitDataSources = {};
|
|
3007
|
+
const splitByFieldIdx = splitByFields.findIndex((f) => f === splitBy);
|
|
3008
|
+
const otherSplitBy = splitByFields.filter((f) => f !== splitBy);
|
|
3009
|
+
const dataSourceKeys = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
3010
|
+
const nonDataSourceAggregations = [];
|
|
3011
|
+
if (!dataSourceKeys.length && fields[0].groupby_rank === "0" && fields.length && !fields[1].groupby_rank) {
|
|
3012
|
+
for (let i = 1; i < fields.length; i += 1) {
|
|
3013
|
+
nonDataSourceAggregations.push(fields[i].name);
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
if (splitByFieldIdx === 0) {
|
|
3017
|
+
const valueKeys = (0, lodash_exports.cloneDeep)(columns[0]);
|
|
3018
|
+
valueKeys.forEach((val, idx) => {
|
|
3019
|
+
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
3020
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
3021
|
+
);
|
|
3022
|
+
splitDataSources[val].primary.data.fields = [];
|
|
3023
|
+
if (otherSplitBy.length) {
|
|
3024
|
+
splitDataSources[val].primary.data.fields = [{ name: otherSplitBy[0] }];
|
|
3025
|
+
}
|
|
3026
|
+
if (dataSourceKeys.length) {
|
|
3027
|
+
const columnValues = [[]];
|
|
3028
|
+
splitDataSources[val].primary.data.fields = [
|
|
3029
|
+
...splitDataSources[val].primary.data.fields,
|
|
3030
|
+
...dataSourceKeys.map((k) => ({
|
|
3031
|
+
name: k
|
|
3032
|
+
}))
|
|
3033
|
+
];
|
|
3034
|
+
dataSourceKeys.forEach(() => {
|
|
3035
|
+
columnValues.push([]);
|
|
3036
|
+
});
|
|
3037
|
+
for (let i = 1; i <= Math.ceil((fields.length - 1) / dataSourceKeys.length); i += 1) {
|
|
3038
|
+
columnValues[0].push(
|
|
3039
|
+
fields[i].splitby_value ? fields[i].splitby_value : fields[i].name
|
|
3040
|
+
);
|
|
3041
|
+
dataSourceKeys.forEach((dskey, dsIndx) => {
|
|
3042
|
+
const mul = (fields.length - 1) / dataSourceKeys.length;
|
|
3043
|
+
columnValues[dsIndx + 1].push(columns[i + dsIndx * mul][idx]);
|
|
3044
|
+
});
|
|
3045
|
+
}
|
|
3046
|
+
splitDataSources[val].primary.data.columns = columnValues;
|
|
3047
|
+
} else if (nonDataSourceAggregations.length) {
|
|
3048
|
+
const columnValues = [];
|
|
3049
|
+
fields.forEach((aggregationField, fieldIdx) => {
|
|
3050
|
+
if (fieldIdx > 0) {
|
|
3051
|
+
splitDataSources[val].primary.data.fields.push(aggregationField);
|
|
3052
|
+
columnValues.push([columns[fieldIdx][idx]]);
|
|
3053
|
+
}
|
|
3054
|
+
});
|
|
3055
|
+
splitDataSources[val].primary.data.columns = columnValues;
|
|
3056
|
+
}
|
|
3057
|
+
});
|
|
3058
|
+
} else {
|
|
3059
|
+
const valueKeys = [];
|
|
3060
|
+
for (let i = 1; i < fields.length; i += 1) {
|
|
3061
|
+
valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
|
|
3062
|
+
}
|
|
3063
|
+
valueKeys.forEach((val) => {
|
|
3064
|
+
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
3065
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
3066
|
+
);
|
|
3067
|
+
splitDataSources[val].primary.data.fields = [
|
|
3068
|
+
{ name: otherSplitBy[0] },
|
|
3069
|
+
...dataSourceKeys.map((k) => ({
|
|
3070
|
+
name: k
|
|
3071
|
+
}))
|
|
3072
|
+
];
|
|
3073
|
+
splitDataSources[val].primary.data.columns = [[...columns[0]]];
|
|
3074
|
+
dataSourceKeys.forEach((dsKey) => {
|
|
3075
|
+
fields.forEach((field, idx) => {
|
|
3076
|
+
if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
|
|
3077
|
+
splitDataSources[val].primary.data.columns.push([...columns[idx]]);
|
|
3078
|
+
}
|
|
3079
|
+
});
|
|
3080
|
+
});
|
|
3081
|
+
});
|
|
3082
|
+
}
|
|
3083
|
+
} else {
|
|
3084
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
3085
|
+
}
|
|
3086
|
+
return { splitDataSources, errorCode };
|
|
3087
|
+
};
|
|
3088
|
+
var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
|
|
3089
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3090
|
+
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3091
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3092
|
+
let splitDataSources = null;
|
|
3093
|
+
let splitByFields = [];
|
|
3094
|
+
let errorCode = null;
|
|
3095
|
+
if (typeof fields[0] !== "string") {
|
|
3096
|
+
splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
|
|
3097
|
+
}
|
|
3098
|
+
const splitByIndex = fields == null ? void 0 : fields.findIndex(
|
|
3099
|
+
(field) => field === splitBy || field.name === splitBy
|
|
3100
|
+
);
|
|
3101
|
+
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
3102
|
+
const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
|
|
3103
|
+
splitDataSources = {};
|
|
3104
|
+
splitByColumn.forEach((val, idx) => {
|
|
3105
|
+
if (!splitDataSources[val]) {
|
|
3106
|
+
splitDataSources[val] = [idx];
|
|
3107
|
+
} else {
|
|
3108
|
+
splitDataSources[val].push(idx);
|
|
3109
|
+
}
|
|
3110
|
+
});
|
|
3111
|
+
const cloneFields = (0, lodash_exports.cloneDeep)(fields);
|
|
3112
|
+
cloneFields.splice(splitByIndex, 1);
|
|
3113
|
+
const valueKeys = Object.keys(splitDataSources);
|
|
3114
|
+
valueKeys.forEach((val) => {
|
|
3115
|
+
const valIndices = (0, lodash_exports.cloneDeep)(splitDataSources[val]);
|
|
3116
|
+
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
3117
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
3118
|
+
);
|
|
3119
|
+
splitDataSources[val].primary.data.fields = cloneFields;
|
|
3120
|
+
splitDataSources[val].primary.data.columns = [];
|
|
3121
|
+
columns.forEach((col, idx) => {
|
|
3122
|
+
if (idx !== splitByIndex) {
|
|
3123
|
+
const newCol = valIndices.map((valIdx) => col[valIdx]);
|
|
3124
|
+
splitDataSources[val].primary.data.columns.push(newCol);
|
|
3125
|
+
}
|
|
3126
|
+
});
|
|
3127
|
+
});
|
|
3128
|
+
} else {
|
|
3129
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
3130
|
+
}
|
|
3131
|
+
return { splitDataSources, errorCode };
|
|
3132
|
+
};
|
|
3133
|
+
var getTrellisDataSourcesBySplitMode = (splitMode, dataSources, trellisSplitBy) => {
|
|
3134
|
+
let result = null;
|
|
3135
|
+
try {
|
|
3136
|
+
if (splitMode === trellisUtils_exports.TIMECHART) {
|
|
3137
|
+
result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : dataSourcesSplitByModeTimechart(dataSources, trellisSplitBy);
|
|
3138
|
+
} else if (splitMode === trellisUtils_exports.STATS) {
|
|
3139
|
+
result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsStats(dataSources) : dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_exports.STATS);
|
|
3140
|
+
} else if (splitMode === trellisUtils_exports.CHART) {
|
|
3141
|
+
result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : dataSourcesSplitByModeChart(dataSources, trellisSplitBy);
|
|
3142
|
+
} else if (splitMode === trellisUtils_exports.UNKNOWN) {
|
|
3143
|
+
result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsUnknown(dataSources) : dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_exports.UNKNOWN);
|
|
3144
|
+
}
|
|
3145
|
+
} catch (ex) {
|
|
3146
|
+
console.error("getTrellisDataSourcesBySplitMode ", ex);
|
|
3147
|
+
result = { splitDataSources: null, errorCode: "UNKNOWN" };
|
|
3148
|
+
}
|
|
3149
|
+
return result;
|
|
3150
|
+
};
|
|
2637
3151
|
var turnOffLegendDisplayWhenTrellisIsOn = (isTrellisOn, options) => {
|
|
2638
3152
|
if (isTrellisOn && !options.legendDisplay) {
|
|
2639
3153
|
return {
|
|
@@ -2642,6 +3156,36 @@ var turnOffLegendDisplayWhenTrellisIsOn = (isTrellisOn, options) => {
|
|
|
2642
3156
|
}
|
|
2643
3157
|
return {};
|
|
2644
3158
|
};
|
|
3159
|
+
var calculateSharedMinMax = (splitData) => {
|
|
3160
|
+
let max = -Infinity;
|
|
3161
|
+
let min = Infinity;
|
|
3162
|
+
Object.keys(splitData).forEach((splitByKey) => {
|
|
3163
|
+
const datasources = splitData[splitByKey];
|
|
3164
|
+
Object.keys(datasources).forEach((datasourceName) => {
|
|
3165
|
+
const dataColumns = datasources[datasourceName].data.columns;
|
|
3166
|
+
dataColumns.forEach((column) => {
|
|
3167
|
+
column.forEach((point) => {
|
|
3168
|
+
const pointNumber = Number(point);
|
|
3169
|
+
if (pointNumber > max) {
|
|
3170
|
+
max = pointNumber;
|
|
3171
|
+
}
|
|
3172
|
+
if (pointNumber < min) {
|
|
3173
|
+
min = pointNumber;
|
|
3174
|
+
}
|
|
3175
|
+
});
|
|
3176
|
+
});
|
|
3177
|
+
});
|
|
3178
|
+
});
|
|
3179
|
+
return [min, max];
|
|
3180
|
+
};
|
|
3181
|
+
var determineMinMax = (splitData, trellisSharedScale, yAxisMin, yAxisMax, stackMode) => {
|
|
3182
|
+
if (!trellisSharedScale || stackMode === "stacked100" || yAxisMin !== "auto" && yAxisMax !== "auto")
|
|
3183
|
+
return [yAxisMin, yAxisMax];
|
|
3184
|
+
const [sharedMin, sharedMax] = calculateSharedMinMax(splitData);
|
|
3185
|
+
const shouldUseSharedMax = sharedMax !== -Infinity && yAxisMax === "auto";
|
|
3186
|
+
const shouldUseSharedMin = sharedMin !== Infinity && yAxisMin === "auto";
|
|
3187
|
+
return [shouldUseSharedMin ? sharedMin : yAxisMin, shouldUseSharedMax ? sharedMax : yAxisMax];
|
|
3188
|
+
};
|
|
2645
3189
|
|
|
2646
3190
|
// src/common/withDashboardViz.tsx
|
|
2647
3191
|
var withDashboardViz = (opts) => {
|
|
@@ -2701,10 +3245,10 @@ var withDashboardViz = (opts) => {
|
|
|
2701
3245
|
const isDownsamplingEnabledByFeatureFlag = Boolean(
|
|
2702
3246
|
featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableDownsampling
|
|
2703
3247
|
);
|
|
2704
|
-
const
|
|
3248
|
+
const isTrellisFeatureFlagOn4 = Boolean(
|
|
2705
3249
|
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
2706
3250
|
);
|
|
2707
|
-
const isTrellisOn =
|
|
3251
|
+
const isTrellisOn = isTrellisFeatureFlagOn4 && ((_a = vizConfig == null ? void 0 : vizConfig.supports) == null ? void 0 : _a.includes("trellis" /* TRELLIS */)) && (options == null ? void 0 : options.splitByLayout) === "trellis" /* TRELLIS */;
|
|
2708
3252
|
const isMounted = react_exports.useRef(true);
|
|
2709
3253
|
const optionsToEvaluate = react_exports.useMemo(() => {
|
|
2710
3254
|
var _a2;
|
|
@@ -2996,6 +3540,258 @@ var convertToStringValues = (options) => {
|
|
|
2996
3540
|
var mapToOldKey = (options) => (0, lodash_exports.mapKeys)(options, (val, key) => scatterOptionsSCMapping[key] ? scatterOptionsSCMapping[key] : key);
|
|
2997
3541
|
var convertToScatterSCProperties = (originalOptions) => (0, lodash_exports.chain)(mapToOldKey(originalOptions)).thru(mapToValues(scatterOptionValuesSCMapping)).thru(convertToStringValues).value();
|
|
2998
3542
|
|
|
3543
|
+
// esm-externals:@splunk/react-ui/Paginator
|
|
3544
|
+
var Paginator_exports = {};
|
|
3545
|
+
__export(Paginator_exports, {
|
|
3546
|
+
default: () => Paginator_default
|
|
3547
|
+
});
|
|
3548
|
+
var defaultImport37 = __toESM(require("@splunk/react-ui/Paginator"));
|
|
3549
|
+
__reExport(Paginator_exports, require("@splunk/react-ui/Paginator"));
|
|
3550
|
+
var Paginator_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
|
|
3551
|
+
|
|
3552
|
+
// esm-externals:@splunk/themes
|
|
3553
|
+
var themes_exports = {};
|
|
3554
|
+
__export(themes_exports, {
|
|
3555
|
+
default: () => themes_default
|
|
3556
|
+
});
|
|
3557
|
+
var defaultImport38 = __toESM(require("@splunk/themes"));
|
|
3558
|
+
__reExport(themes_exports, require("@splunk/themes"));
|
|
3559
|
+
var themes_default = "default" in defaultImport38 ? defaultImport38.default : defaultImport38;
|
|
3560
|
+
|
|
3561
|
+
// src/common/hocs/withTrellis.tsx
|
|
3562
|
+
var TrellisContainer = styled_components_default.div`
|
|
3563
|
+
overflow: hidden;
|
|
3564
|
+
display: flex;
|
|
3565
|
+
flex-direction: column;
|
|
3566
|
+
background-color: ${(props) => props.backgroundColor};
|
|
3567
|
+
${(props) => (0, style_exports.toDimension)((0, lodash_exports.pick)(props, ["width", "height"]))};
|
|
3568
|
+
> [data-test='paginator'] {
|
|
3569
|
+
align-self: flex-end;
|
|
3570
|
+
margin-bottom: 10px;
|
|
3571
|
+
}
|
|
3572
|
+
`;
|
|
3573
|
+
var TrellisContainerGrid = styled_components_default.div`
|
|
3574
|
+
display: grid;
|
|
3575
|
+
height: ${(props) => {
|
|
3576
|
+
return `${props.height}px`;
|
|
3577
|
+
}};
|
|
3578
|
+
gap: 10px 10px;
|
|
3579
|
+
grid-template-columns: ${(props) => {
|
|
3580
|
+
return props.colCount ? `repeat(${props.colCount}, minmax(${props.colMinWidth}px, 1fr))` : `repeat(auto-fit, minmax(${props.colMinWidth}px, 1fr))`;
|
|
3581
|
+
}};
|
|
3582
|
+
overflow: auto;
|
|
3583
|
+
justify-items: stretch;
|
|
3584
|
+
grid-auto-rows: ${(props) => `${props.rowHeight}px`};
|
|
3585
|
+
.child {
|
|
3586
|
+
height: ${(props) => `${props.rowHeight}px`};
|
|
3587
|
+
}
|
|
3588
|
+
`;
|
|
3589
|
+
var showErrorMessage = (errorCode, width, height) => {
|
|
3590
|
+
if (errorCode === "INVALID_SPLIT_BY_FIELD") {
|
|
3591
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
3592
|
+
Message_default,
|
|
3593
|
+
{
|
|
3594
|
+
width,
|
|
3595
|
+
height,
|
|
3596
|
+
message: (0, i18n_exports._)("Select a valid trellis split by field"),
|
|
3597
|
+
level: "info"
|
|
3598
|
+
}
|
|
3599
|
+
);
|
|
3600
|
+
}
|
|
3601
|
+
if (errorCode === "UNKNOWN_DATA_SPLIT_MODE") {
|
|
3602
|
+
return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Unknown data split mode"), level: "info" });
|
|
3603
|
+
}
|
|
3604
|
+
return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Error render in trellis"), level: "info" });
|
|
3605
|
+
};
|
|
3606
|
+
var withTrellis = (Viz) => {
|
|
3607
|
+
const VizWithTrellis = (opts) => {
|
|
3608
|
+
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
3609
|
+
setContainerWidth(w);
|
|
3610
|
+
setContainerHeight(h);
|
|
3611
|
+
}, []);
|
|
3612
|
+
const [containerWidth, setContainerWidth] = react_exports.useState(Number(opts.width));
|
|
3613
|
+
const [containerHeight, setContainerHeight] = react_exports.useState(Number(opts.height));
|
|
3614
|
+
const _a = opts, { options = {}, height, width } = _a, otherProps = __objRest(_a, ["options", "height", "width"]);
|
|
3615
|
+
const defaultOptions = (0, JSONSchemaUtils_exports.pickFieldFromJSONSchema)(Viz.config.optionsSchema, "default");
|
|
3616
|
+
const mergedOptions = (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions);
|
|
3617
|
+
const {
|
|
3618
|
+
trellisColumns,
|
|
3619
|
+
trellisPageCount,
|
|
3620
|
+
trellisMinColumnWidth,
|
|
3621
|
+
trellisRowHeight,
|
|
3622
|
+
splitByLayout,
|
|
3623
|
+
trellisSplitBy,
|
|
3624
|
+
trellisSharedScale,
|
|
3625
|
+
stackMode,
|
|
3626
|
+
yAxisMin,
|
|
3627
|
+
yAxisMax
|
|
3628
|
+
} = mergedOptions;
|
|
3629
|
+
const colCount = trellisColumns > 0 ? trellisColumns : defaultOptions.trellisColumns;
|
|
3630
|
+
const pageCount = +trellisPageCount > 0 ? +trellisPageCount : defaultOptions.trellisPageCount;
|
|
3631
|
+
const colMinWidth = trellisMinColumnWidth > 0 ? trellisMinColumnWidth : defaultOptions.trellisMinColumnWidth;
|
|
3632
|
+
const rowHeight = trellisRowHeight > 0 ? trellisRowHeight : defaultOptions.trellisRowHeight;
|
|
3633
|
+
const [pageNum, setPageNum] = (0, react_exports.useState)(1);
|
|
3634
|
+
const [pagedData, setPagedData] = (0, react_exports.useState)(null);
|
|
3635
|
+
let splitByKeys = [];
|
|
3636
|
+
let totalPages = 0;
|
|
3637
|
+
let showPaginator = false;
|
|
3638
|
+
const { dataSources } = otherProps;
|
|
3639
|
+
const theme = {
|
|
3640
|
+
splunkThemeV1: useSplunkTheme_default()
|
|
3641
|
+
};
|
|
3642
|
+
const {
|
|
3643
|
+
family: currentThemeFamily,
|
|
3644
|
+
colorScheme: currentThemeColorScheme,
|
|
3645
|
+
density: currentThemeDensity
|
|
3646
|
+
} = (0, themes_exports.getSettingsFromThemedProps)({ theme });
|
|
3647
|
+
const trellisBackgroundColor = (0, react_exports.useMemo)(() => {
|
|
3648
|
+
const themeFunc = (themeVar) => {
|
|
3649
|
+
var _a2, _b;
|
|
3650
|
+
return (_b = (_a2 = Viz.config.themes)[themeVar]) == null ? void 0 : _b.call(_a2, {
|
|
3651
|
+
trellisBackgroundColor: mergedOptions.trellisBackgroundColor,
|
|
3652
|
+
theme
|
|
3653
|
+
});
|
|
3654
|
+
};
|
|
3655
|
+
const evaluated = Options_exports.Options.evaluate(
|
|
3656
|
+
{
|
|
3657
|
+
context: Viz.config.context,
|
|
3658
|
+
options: { trellisBackgroundColor: mergedOptions.trellisBackgroundColor }
|
|
3659
|
+
},
|
|
3660
|
+
{},
|
|
3661
|
+
themeFunc
|
|
3662
|
+
);
|
|
3663
|
+
return evaluated.trellisBackgroundColor;
|
|
3664
|
+
}, [
|
|
3665
|
+
mergedOptions.trellisBackgroundColor,
|
|
3666
|
+
currentThemeFamily,
|
|
3667
|
+
currentThemeColorScheme,
|
|
3668
|
+
currentThemeDensity
|
|
3669
|
+
]);
|
|
3670
|
+
const columns = (0, lodash_exports.get)(dataSources, "primary.data.columns", void 0);
|
|
3671
|
+
const fields = (0, lodash_exports.get)(dataSources, "primary.data.fields", void 0);
|
|
3672
|
+
const noColumns = columns === void 0;
|
|
3673
|
+
const noFields = fields === void 0;
|
|
3674
|
+
const updateDataDisplay = (currPage) => {
|
|
3675
|
+
if (!showPaginator) {
|
|
3676
|
+
setPagedData(splitByKeys);
|
|
3677
|
+
setPageNum(1);
|
|
3678
|
+
} else {
|
|
3679
|
+
const startIdx = pageCount * (currPage - 1);
|
|
3680
|
+
const paged = splitByKeys.slice(startIdx, startIdx + pageCount);
|
|
3681
|
+
setPagedData(paged);
|
|
3682
|
+
}
|
|
3683
|
+
};
|
|
3684
|
+
(0, react_exports.useEffect)(() => {
|
|
3685
|
+
setPageNum(1);
|
|
3686
|
+
updateDataDisplay(1);
|
|
3687
|
+
}, [pageCount, trellisSplitBy]);
|
|
3688
|
+
(0, react_exports.useEffect)(() => {
|
|
3689
|
+
updateDataDisplay(pageNum);
|
|
3690
|
+
}, [columns, fields, trellisSplitBy, pageNum, splitByLayout]);
|
|
3691
|
+
const handlePageChange = (0, react_exports.useCallback)(
|
|
3692
|
+
(event, { page }) => {
|
|
3693
|
+
setPageNum(page);
|
|
3694
|
+
},
|
|
3695
|
+
[pageNum, pagedData]
|
|
3696
|
+
);
|
|
3697
|
+
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
3698
|
+
const isTrellisFeatureFlagOn4 = Boolean(
|
|
3699
|
+
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
3700
|
+
);
|
|
3701
|
+
if (!isTrellisFeatureFlagOn4 || !splitByLayout || splitByLayout !== visualization_schemas_exports.LAYOUT_TYPE.Trellis) {
|
|
3702
|
+
return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({}, opts));
|
|
3703
|
+
}
|
|
3704
|
+
if (splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis) {
|
|
3705
|
+
if (noColumns || noFields) {
|
|
3706
|
+
return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Loading"), level: "info" });
|
|
3707
|
+
}
|
|
3708
|
+
let currTrellisSplitBy = trellisSplitBy;
|
|
3709
|
+
if (!trellisSplitBy || trellisSplitBy.length === 0) {
|
|
3710
|
+
const splitByPossibleFields = (0, trellisUtils_exports.getAllPossibleSplitByFields)(fields);
|
|
3711
|
+
currTrellisSplitBy = splitByPossibleFields.fields && splitByPossibleFields.fields.length ? splitByPossibleFields.fields[0] : AGGREGATIONS;
|
|
3712
|
+
}
|
|
3713
|
+
const splitMode = (0, trellisUtils_exports.getTrellisDataSplitterMode)(fields);
|
|
3714
|
+
const dataSplitResult = getTrellisDataSourcesBySplitMode(
|
|
3715
|
+
splitMode,
|
|
3716
|
+
dataSources,
|
|
3717
|
+
currTrellisSplitBy
|
|
3718
|
+
);
|
|
3719
|
+
const modifiedDataSourceBySplitBy = dataSplitResult == null ? void 0 : dataSplitResult.splitDataSources;
|
|
3720
|
+
const dataSplitErrorCode = dataSplitResult == null ? void 0 : dataSplitResult.errorCode;
|
|
3721
|
+
if (!modifiedDataSourceBySplitBy || Object.keys(modifiedDataSourceBySplitBy).length === 0 || dataSplitErrorCode) {
|
|
3722
|
+
return showErrorMessage(dataSplitErrorCode, width, height);
|
|
3723
|
+
}
|
|
3724
|
+
const splitByKeysModified = modifiedDataSourceBySplitBy ? Object.keys(modifiedDataSourceBySplitBy) : [];
|
|
3725
|
+
if (splitByKeysModified) {
|
|
3726
|
+
showPaginator = splitByKeysModified.length > pageCount;
|
|
3727
|
+
splitByKeys = splitByKeysModified;
|
|
3728
|
+
totalPages = splitByKeysModified ? Math.ceil(splitByKeysModified.length / pageCount) : 0;
|
|
3729
|
+
}
|
|
3730
|
+
const [calculatedMin, calculatedMax] = determineMinMax(
|
|
3731
|
+
modifiedDataSourceBySplitBy,
|
|
3732
|
+
trellisSharedScale,
|
|
3733
|
+
yAxisMin,
|
|
3734
|
+
yAxisMax,
|
|
3735
|
+
stackMode
|
|
3736
|
+
);
|
|
3737
|
+
return /* @__PURE__ */ react_exports.createElement(TrellisContainer, { height, width, backgroundColor: trellisBackgroundColor }, /* @__PURE__ */ react_exports.createElement(
|
|
3738
|
+
TrellisContainerGrid,
|
|
3739
|
+
{
|
|
3740
|
+
height,
|
|
3741
|
+
colCount,
|
|
3742
|
+
colMinWidth,
|
|
3743
|
+
rowHeight
|
|
3744
|
+
},
|
|
3745
|
+
pagedData == null ? void 0 : pagedData.map((splitByKey, idx) => /* @__PURE__ */ react_exports.createElement(
|
|
3746
|
+
"div",
|
|
3747
|
+
{
|
|
3748
|
+
className: "child",
|
|
3749
|
+
"data-test": "trellis-child",
|
|
3750
|
+
key: `div-child-${idx.toString()}`
|
|
3751
|
+
},
|
|
3752
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
3753
|
+
SizeAwareWrapper_default,
|
|
3754
|
+
{
|
|
3755
|
+
width,
|
|
3756
|
+
height,
|
|
3757
|
+
onResize: cachedHandleResize
|
|
3758
|
+
}
|
|
3759
|
+
),
|
|
3760
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
3761
|
+
Viz,
|
|
3762
|
+
__spreadProps(__spreadValues({}, otherProps), {
|
|
3763
|
+
trellisKey: splitByKey,
|
|
3764
|
+
trellisSplitBy: currTrellisSplitBy,
|
|
3765
|
+
dataSources: modifiedDataSourceBySplitBy[splitByKey],
|
|
3766
|
+
options: __spreadProps(__spreadValues({}, options), {
|
|
3767
|
+
yAxisMin: calculatedMin,
|
|
3768
|
+
yAxisMax: calculatedMax
|
|
3769
|
+
}),
|
|
3770
|
+
key: `viz-${idx.toString()}`,
|
|
3771
|
+
height: containerHeight,
|
|
3772
|
+
width: containerWidth
|
|
3773
|
+
})
|
|
3774
|
+
)
|
|
3775
|
+
))
|
|
3776
|
+
), showPaginator && totalPages >= pageNum && /* @__PURE__ */ react_exports.createElement(
|
|
3777
|
+
Paginator_default,
|
|
3778
|
+
{
|
|
3779
|
+
onChange: handlePageChange,
|
|
3780
|
+
current: pageNum,
|
|
3781
|
+
alwaysShowLastPageLink: true,
|
|
3782
|
+
totalPages
|
|
3783
|
+
}
|
|
3784
|
+
));
|
|
3785
|
+
}
|
|
3786
|
+
return null;
|
|
3787
|
+
};
|
|
3788
|
+
VizWithTrellis.propTypes = Viz.proptypes;
|
|
3789
|
+
VizWithTrellis.defaultProps = Viz.defaultProps;
|
|
3790
|
+
VizWithTrellis.config = Viz.config;
|
|
3791
|
+
return VizWithTrellis;
|
|
3792
|
+
};
|
|
3793
|
+
var withTrellis_default = withTrellis;
|
|
3794
|
+
|
|
2999
3795
|
// src/Scatter/Scatter.tsx
|
|
3000
3796
|
var validOptions = Object.keys(config_default.optionsSchema);
|
|
3001
3797
|
var computeVizProps = (_a) => {
|
|
@@ -3008,7 +3804,9 @@ var computeVizProps = (_a) => {
|
|
|
3008
3804
|
category,
|
|
3009
3805
|
xField,
|
|
3010
3806
|
yField,
|
|
3011
|
-
categoryField
|
|
3807
|
+
categoryField,
|
|
3808
|
+
trellisKey,
|
|
3809
|
+
themeFunc
|
|
3012
3810
|
} = _b, otherOptions = __objRest(_b, [
|
|
3013
3811
|
"dataSources",
|
|
3014
3812
|
"onEventTrigger",
|
|
@@ -3018,9 +3816,17 @@ var computeVizProps = (_a) => {
|
|
|
3018
3816
|
"category",
|
|
3019
3817
|
"xField",
|
|
3020
3818
|
"yField",
|
|
3021
|
-
"categoryField"
|
|
3819
|
+
"categoryField",
|
|
3820
|
+
"trellisKey",
|
|
3821
|
+
"themeFunc"
|
|
3022
3822
|
]);
|
|
3023
|
-
const
|
|
3823
|
+
const defaultFontColor = themeFunc("defaultFontColor");
|
|
3824
|
+
const computedProps = {
|
|
3825
|
+
visualizationApiRef,
|
|
3826
|
+
trellisKey,
|
|
3827
|
+
defaultFontColor,
|
|
3828
|
+
onEventTrigger
|
|
3829
|
+
};
|
|
3024
3830
|
const { hasEventHandlers } = otherOptions;
|
|
3025
3831
|
computedProps.options = (0, lodash_exports.chain)(otherOptions).pick(validOptions).thru(convertToScatterSCProperties).thru((options) => __spreadProps(__spreadValues({}, (0, simpleXMLOptions_exports.getSimpleXMLOptionsForProps)(options)), { chart: "scatter" })).value();
|
|
3026
3832
|
let primaryData = __spreadValues({}, dataSources.primary.data);
|
|
@@ -3044,11 +3850,13 @@ var computeVizProps = (_a) => {
|
|
|
3044
3850
|
}
|
|
3045
3851
|
return computedProps;
|
|
3046
3852
|
};
|
|
3047
|
-
var Column =
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3853
|
+
var Column = withTrellis_default(
|
|
3854
|
+
withDashboardViz_default({
|
|
3855
|
+
ReactViz: Charting_default,
|
|
3856
|
+
computeVizProps,
|
|
3857
|
+
vizConfig: config_default
|
|
3858
|
+
})
|
|
3859
|
+
);
|
|
3052
3860
|
var themes3 = null;
|
|
3053
3861
|
var Scatter_default = Column;
|
|
3054
3862
|
//# sourceMappingURL=Scatter.js.map
|