@splunk/visualizations 27.2.1 → 27.4.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 +17 -3
- package/Area.config.js.map +2 -2
- package/Area.js +34 -12
- package/Area.js.map +2 -2
- package/Bar.config.js +17 -3
- package/Bar.config.js.map +3 -3
- package/Bar.js +34 -12
- package/Bar.js.map +3 -3
- package/Bubble.config.js +1 -1
- package/Bubble.config.js.map +2 -2
- package/Bubble.js +9 -9
- package/Bubble.js.map +2 -2
- package/CHANGELOG.external.md +1610 -0
- package/ChoroplethSvg.js +6 -7
- package/ChoroplethSvg.js.map +2 -2
- package/Column.config.js +17 -3
- package/Column.config.js.map +3 -3
- package/Column.js +34 -12
- package/Column.js.map +3 -3
- package/Ellipse.js +6 -7
- package/Ellipse.js.map +2 -2
- package/Events.js +24 -24
- package/Events.js.map +3 -3
- package/FillerGauge.config.js +8 -28
- package/FillerGauge.config.js.map +2 -2
- package/FillerGauge.js +14 -35
- package/FillerGauge.js.map +2 -2
- package/Image.js +6 -7
- package/Image.js.map +2 -2
- package/Line.config.js +17 -3
- package/Line.config.js.map +3 -3
- package/Line.js +34 -12
- package/Line.js.map +3 -3
- package/LinkGraph.js +25 -25
- package/LinkGraph.js.map +3 -3
- package/Map.config.js +11 -0
- package/Map.config.js.map +2 -2
- package/Map.js +68 -32
- package/Map.js.map +2 -2
- package/Markdown.js +6 -7
- package/Markdown.js.map +2 -2
- package/MarkerGauge.config.js +8 -25
- package/MarkerGauge.config.js.map +2 -2
- package/MarkerGauge.js +14 -32
- package/MarkerGauge.js.map +2 -2
- package/ParallelCoordinates.js +6 -7
- package/ParallelCoordinates.js.map +2 -2
- package/Pie.config.js +123 -3
- package/Pie.config.js.map +3 -3
- package/Pie.js +742 -22
- package/Pie.js.map +4 -4
- package/Punchcard.js +6 -7
- package/Punchcard.js.map +2 -2
- package/Rectangle.js +6 -7
- package/Rectangle.js.map +2 -2
- package/Sankey.js +11 -11
- package/Sankey.js.map +2 -2
- package/Scatter.config.js +313 -113
- package/Scatter.config.js.map +4 -4
- package/Scatter.js +928 -131
- package/Scatter.js.map +4 -4
- package/SingleValue.js +15 -8
- package/SingleValue.js.map +2 -2
- package/SingleValueIcon.js +15 -8
- package/SingleValueIcon.js.map +2 -2
- package/SingleValueRadial.js +15 -8
- package/SingleValueRadial.js.map +2 -2
- package/TRELLIS.md +12 -3
- package/Table.js +6 -7
- package/Table.js.map +2 -2
- package/Timeline.js +151 -83
- package/Timeline.js.map +4 -4
- package/common/Charting.js +2 -1
- package/common/Charting.js.map +2 -2
- package/common/utils/dataUtils.js +2 -1
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/mapUtils.js +16 -8
- package/common/utils/mapUtils.js.map +2 -2
- package/common/utils/styleUtils.js +29 -0
- package/common/utils/styleUtils.js.map +7 -0
- package/common/utils/trellisUtils.js +9 -1
- package/common/utils/trellisUtils.js.map +2 -2
- package/common/withDashboardViz.js +6 -7
- package/common/withDashboardViz.js.map +2 -2
- package/package.json +21 -20
package/Scatter.js
CHANGED
|
@@ -397,7 +397,8 @@ var calculateDownsamplingThreshold = ({
|
|
|
397
397
|
const { startXIndex, endXIndex, currentTarget } = selectChartEvent;
|
|
398
398
|
try {
|
|
399
399
|
const xFieldIndex = (_a = primaryDataSource == null ? void 0 : primaryDataSource.data) == null ? void 0 : _a.fields.findIndex((field) => {
|
|
400
|
-
|
|
400
|
+
const name = typeof field === "string" ? field : field.name;
|
|
401
|
+
return name === xField;
|
|
401
402
|
});
|
|
402
403
|
const downsampledXFieldIndex = (_b = currentTarget.dataSet) == null ? void 0 : _b.fields.findIndex((field) => field === xField);
|
|
403
404
|
if (xFieldIndex === -1 || downsampledXFieldIndex === -1) {
|
|
@@ -1057,7 +1058,7 @@ var insertLayout = (layout, index, ...layoutItems) => [
|
|
|
1057
1058
|
...layout.slice(index)
|
|
1058
1059
|
];
|
|
1059
1060
|
|
|
1060
|
-
// src/common/editorConfig/
|
|
1061
|
+
// src/common/editorConfig/TrellisEditors.ts
|
|
1061
1062
|
var isTrellisFeatureFlagOn = ({ featureFlags }) => {
|
|
1062
1063
|
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
|
|
1063
1064
|
};
|
|
@@ -1065,6 +1066,252 @@ var isTrellisEnabled = ({ options, featureFlags }) => {
|
|
|
1065
1066
|
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1066
1067
|
return isTrellisFeatureFlagOn({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1067
1068
|
};
|
|
1069
|
+
var TrellisEditorConfig = [
|
|
1070
|
+
[
|
|
1071
|
+
{
|
|
1072
|
+
label: (0, i18n_exports._)("Trellis layout"),
|
|
1073
|
+
option: "splitByLayout",
|
|
1074
|
+
editor: "editor.toggle",
|
|
1075
|
+
showEditor: isTrellisFeatureFlagOn
|
|
1076
|
+
}
|
|
1077
|
+
],
|
|
1078
|
+
[
|
|
1079
|
+
{
|
|
1080
|
+
label: (0, i18n_exports._)("Split by"),
|
|
1081
|
+
option: "trellisSplitBy",
|
|
1082
|
+
editor: "editor.trellisSplitBy",
|
|
1083
|
+
editorProps: {
|
|
1084
|
+
dataSourceKey: "primary"
|
|
1085
|
+
},
|
|
1086
|
+
showEditor: isTrellisEnabled
|
|
1087
|
+
}
|
|
1088
|
+
],
|
|
1089
|
+
[
|
|
1090
|
+
{
|
|
1091
|
+
label: (0, i18n_exports._)("Number of columns"),
|
|
1092
|
+
option: "trellisColumns",
|
|
1093
|
+
editor: "editor.number",
|
|
1094
|
+
editorProps: {
|
|
1095
|
+
min: 1
|
|
1096
|
+
},
|
|
1097
|
+
placeholder: (0, i18n_exports._)("Auto"),
|
|
1098
|
+
showEditor: isTrellisEnabled
|
|
1099
|
+
}
|
|
1100
|
+
],
|
|
1101
|
+
[
|
|
1102
|
+
{
|
|
1103
|
+
label: (0, i18n_exports._)("Min column width"),
|
|
1104
|
+
option: "trellisMinColumnWidth",
|
|
1105
|
+
editor: "editor.number",
|
|
1106
|
+
editorProps: {
|
|
1107
|
+
min: 1
|
|
1108
|
+
},
|
|
1109
|
+
showEditor: isTrellisEnabled
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
label: (0, i18n_exports._)("Row height"),
|
|
1113
|
+
option: "trellisRowHeight",
|
|
1114
|
+
editor: "editor.number",
|
|
1115
|
+
editorProps: {
|
|
1116
|
+
min: 1
|
|
1117
|
+
},
|
|
1118
|
+
showEditor: isTrellisEnabled
|
|
1119
|
+
}
|
|
1120
|
+
],
|
|
1121
|
+
[
|
|
1122
|
+
{
|
|
1123
|
+
label: (0, i18n_exports._)("Max number of components per page"),
|
|
1124
|
+
option: "trellisPageCount",
|
|
1125
|
+
editor: "editor.number",
|
|
1126
|
+
editorProps: {
|
|
1127
|
+
min: 1
|
|
1128
|
+
},
|
|
1129
|
+
showEditor: isTrellisEnabled
|
|
1130
|
+
}
|
|
1131
|
+
]
|
|
1132
|
+
];
|
|
1133
|
+
var TimechartTrellisEditorConfig = [
|
|
1134
|
+
[
|
|
1135
|
+
{
|
|
1136
|
+
label: (0, i18n_exports._)("Trellis layout"),
|
|
1137
|
+
option: "splitByLayout",
|
|
1138
|
+
editor: "editor.toggle",
|
|
1139
|
+
showEditor: isTrellisFeatureFlagOn,
|
|
1140
|
+
// add help text for timecharts
|
|
1141
|
+
editorProps: {
|
|
1142
|
+
help: (0, i18n_exports._)(
|
|
1143
|
+
"Y2-axis and overlay field configurations are not supported when trellis is enabled."
|
|
1144
|
+
),
|
|
1145
|
+
helpFormat: "under"
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
],
|
|
1149
|
+
...TrellisEditorConfig.slice(1),
|
|
1150
|
+
[
|
|
1151
|
+
{
|
|
1152
|
+
label: (0, i18n_exports._)("Shared y-axis scale"),
|
|
1153
|
+
option: "trellisSharedScale",
|
|
1154
|
+
editor: "editor.checkbox",
|
|
1155
|
+
showEditor: isTrellisEnabled
|
|
1156
|
+
}
|
|
1157
|
+
]
|
|
1158
|
+
];
|
|
1159
|
+
var TrellisBackgroundColorEditor = {
|
|
1160
|
+
label: (0, i18n_exports._)("Trellis background"),
|
|
1161
|
+
option: "trellisBackgroundColor",
|
|
1162
|
+
editor: "editor.color",
|
|
1163
|
+
showEditor: isTrellisEnabled
|
|
1164
|
+
};
|
|
1165
|
+
|
|
1166
|
+
// src/common/editorConfig/AxesChartDataDisplay.ts
|
|
1167
|
+
var isTrellisFeatureFlagOn2 = ({ featureFlags }) => {
|
|
1168
|
+
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
|
|
1169
|
+
};
|
|
1170
|
+
var isTrellisEnabled2 = ({ options, featureFlags }) => {
|
|
1171
|
+
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1172
|
+
return isTrellisFeatureFlagOn2({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1173
|
+
};
|
|
1174
|
+
var AxesChartDataDisplayBase = {
|
|
1175
|
+
label: (0, i18n_exports._)("Data display"),
|
|
1176
|
+
layout: [
|
|
1177
|
+
[
|
|
1178
|
+
{
|
|
1179
|
+
label: (0, i18n_exports._)("Stack mode"),
|
|
1180
|
+
option: "stackMode",
|
|
1181
|
+
editor: "editor.select",
|
|
1182
|
+
editorProps: {
|
|
1183
|
+
values: [
|
|
1184
|
+
{ label: (0, i18n_exports._)("Not stacked"), value: "auto" },
|
|
1185
|
+
{ label: (0, i18n_exports._)("Stacked"), value: "stacked" },
|
|
1186
|
+
{ label: (0, i18n_exports._)("Stacked 100%"), value: "stacked100" }
|
|
1187
|
+
]
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
],
|
|
1191
|
+
[
|
|
1192
|
+
{
|
|
1193
|
+
label: (0, i18n_exports._)("Null value display"),
|
|
1194
|
+
option: "nullValueDisplay",
|
|
1195
|
+
editor: "editor.radioBar",
|
|
1196
|
+
editorProps: {
|
|
1197
|
+
values: [
|
|
1198
|
+
{ label: (0, i18n_exports._)("Gaps"), value: "gaps" },
|
|
1199
|
+
{ label: (0, i18n_exports._)("Zero"), value: "zero" },
|
|
1200
|
+
{ label: (0, i18n_exports._)("Connect"), value: "connect" }
|
|
1201
|
+
]
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
],
|
|
1205
|
+
[
|
|
1206
|
+
{
|
|
1207
|
+
label: (0, i18n_exports._)("Data value display"),
|
|
1208
|
+
option: "dataValuesDisplay",
|
|
1209
|
+
editor: "editor.radioBar",
|
|
1210
|
+
editorProps: {
|
|
1211
|
+
values: [
|
|
1212
|
+
{ label: (0, i18n_exports._)("Off"), value: "off" },
|
|
1213
|
+
{ label: (0, i18n_exports._)("All"), value: "all" },
|
|
1214
|
+
{ label: (0, i18n_exports._)("Min/Max"), value: "minmax" }
|
|
1215
|
+
]
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
],
|
|
1219
|
+
[
|
|
1220
|
+
{
|
|
1221
|
+
label: (0, i18n_exports._)("Overlay fields"),
|
|
1222
|
+
option: "overlayFields",
|
|
1223
|
+
editor: "editor.columnMultiSelectionByFieldNameEditor",
|
|
1224
|
+
editorProps: {
|
|
1225
|
+
filterByTypes: ["number"]
|
|
1226
|
+
},
|
|
1227
|
+
isDisabled: isTrellisEnabled2
|
|
1228
|
+
}
|
|
1229
|
+
],
|
|
1230
|
+
[
|
|
1231
|
+
{
|
|
1232
|
+
label: (0, i18n_exports._)("Split series"),
|
|
1233
|
+
option: "showSplitSeries",
|
|
1234
|
+
editor: "editor.toggle"
|
|
1235
|
+
}
|
|
1236
|
+
],
|
|
1237
|
+
[
|
|
1238
|
+
{
|
|
1239
|
+
label: (0, i18n_exports._)("Independent y-axis for split series"),
|
|
1240
|
+
option: "showIndependentYRanges",
|
|
1241
|
+
editor: "editor.checkbox",
|
|
1242
|
+
showEditor: ({ options }) => options.showSplitSeries
|
|
1243
|
+
}
|
|
1244
|
+
],
|
|
1245
|
+
...TimechartTrellisEditorConfig
|
|
1246
|
+
]
|
|
1247
|
+
};
|
|
1248
|
+
var AxesChartDataDisplayBar = {
|
|
1249
|
+
label: AxesChartDataDisplayBase.label,
|
|
1250
|
+
layout: [
|
|
1251
|
+
AxesChartDataDisplayBase.layout[0],
|
|
1252
|
+
// remove null value display editor at index 1
|
|
1253
|
+
...AxesChartDataDisplayBase.layout.slice(2)
|
|
1254
|
+
]
|
|
1255
|
+
};
|
|
1256
|
+
var AxesChartDataDisplayScatter = {
|
|
1257
|
+
label: AxesChartDataDisplayBase.label,
|
|
1258
|
+
layout: [
|
|
1259
|
+
...TrellisEditorConfig,
|
|
1260
|
+
[
|
|
1261
|
+
{
|
|
1262
|
+
label: (0, i18n_exports._)("Shared y-axis scale"),
|
|
1263
|
+
option: "trellisSharedScale",
|
|
1264
|
+
editor: "editor.checkbox",
|
|
1265
|
+
showEditor: isTrellisEnabled2
|
|
1266
|
+
}
|
|
1267
|
+
]
|
|
1268
|
+
]
|
|
1269
|
+
};
|
|
1270
|
+
var AxesChartDataDisplayColumn = {
|
|
1271
|
+
label: AxesChartDataDisplayBase.label,
|
|
1272
|
+
layout: [
|
|
1273
|
+
AxesChartDataDisplayBase.layout[0],
|
|
1274
|
+
// remove null value display and add data value display
|
|
1275
|
+
AxesChartDataDisplayBase.layout[2],
|
|
1276
|
+
[
|
|
1277
|
+
{
|
|
1278
|
+
label: (0, i18n_exports._)("Show tooltip on hover"),
|
|
1279
|
+
option: "showTooltip",
|
|
1280
|
+
editor: "editor.checkbox"
|
|
1281
|
+
}
|
|
1282
|
+
],
|
|
1283
|
+
...AxesChartDataDisplayBase.layout.slice(3),
|
|
1284
|
+
[
|
|
1285
|
+
{
|
|
1286
|
+
label: (0, i18n_exports._)("Column grouping mode"),
|
|
1287
|
+
option: "columnGrouping",
|
|
1288
|
+
editor: "editor.radioBar",
|
|
1289
|
+
editorProps: {
|
|
1290
|
+
values: [
|
|
1291
|
+
{ label: (0, i18n_exports._)("Auto"), value: "auto" },
|
|
1292
|
+
{ label: (0, i18n_exports._)("Overlay"), value: "overlay" }
|
|
1293
|
+
]
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
]
|
|
1297
|
+
]
|
|
1298
|
+
};
|
|
1299
|
+
var AxesChartDataDisplayLine = {
|
|
1300
|
+
label: AxesChartDataDisplayBase.label,
|
|
1301
|
+
layout: [
|
|
1302
|
+
// remove stacked mode editor
|
|
1303
|
+
...AxesChartDataDisplayBase.layout.slice(1)
|
|
1304
|
+
]
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
// src/common/editorConfig/AxesChartDataConfig.ts
|
|
1308
|
+
var isTrellisFeatureFlagOn3 = ({ featureFlags }) => {
|
|
1309
|
+
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
|
|
1310
|
+
};
|
|
1311
|
+
var isTrellisEnabled3 = ({ options, featureFlags }) => {
|
|
1312
|
+
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1313
|
+
return isTrellisFeatureFlagOn3({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1314
|
+
};
|
|
1068
1315
|
var AxesChartDataConfig = {
|
|
1069
1316
|
label: (0, i18n_exports._)("Data configurations"),
|
|
1070
1317
|
layout: [
|
|
@@ -1119,7 +1366,7 @@ var AxesChartDataConfigBar = {
|
|
|
1119
1366
|
supportsDSL: true,
|
|
1120
1367
|
expectedDataPrimitive: ["series", "frame"]
|
|
1121
1368
|
},
|
|
1122
|
-
isDisabled:
|
|
1369
|
+
isDisabled: isTrellisEnabled3
|
|
1123
1370
|
}
|
|
1124
1371
|
])
|
|
1125
1372
|
};
|
|
@@ -1513,111 +1760,6 @@ var background = ({
|
|
|
1513
1760
|
];
|
|
1514
1761
|
var BackgroundColor_default = background;
|
|
1515
1762
|
|
|
1516
|
-
// src/common/editorConfig/TrellisEditors.ts
|
|
1517
|
-
var isTrellisFeatureFlagOn2 = ({ featureFlags }) => {
|
|
1518
|
-
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
|
|
1519
|
-
};
|
|
1520
|
-
var isTrellisEnabled2 = ({ options, featureFlags }) => {
|
|
1521
|
-
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1522
|
-
return isTrellisFeatureFlagOn2({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1523
|
-
};
|
|
1524
|
-
var TrellisEditorConfig = [
|
|
1525
|
-
[
|
|
1526
|
-
{
|
|
1527
|
-
label: (0, i18n_exports._)("Trellis layout"),
|
|
1528
|
-
option: "splitByLayout",
|
|
1529
|
-
editor: "editor.toggle",
|
|
1530
|
-
showEditor: isTrellisFeatureFlagOn2
|
|
1531
|
-
}
|
|
1532
|
-
],
|
|
1533
|
-
[
|
|
1534
|
-
{
|
|
1535
|
-
label: (0, i18n_exports._)("Split by"),
|
|
1536
|
-
option: "trellisSplitBy",
|
|
1537
|
-
editor: "editor.trellisSplitBy",
|
|
1538
|
-
editorProps: {
|
|
1539
|
-
dataSourceKey: "primary"
|
|
1540
|
-
},
|
|
1541
|
-
showEditor: isTrellisEnabled2
|
|
1542
|
-
}
|
|
1543
|
-
],
|
|
1544
|
-
[
|
|
1545
|
-
{
|
|
1546
|
-
label: (0, i18n_exports._)("Number of columns"),
|
|
1547
|
-
option: "trellisColumns",
|
|
1548
|
-
editor: "editor.number",
|
|
1549
|
-
editorProps: {
|
|
1550
|
-
min: 1
|
|
1551
|
-
},
|
|
1552
|
-
placeholder: (0, i18n_exports._)("Auto"),
|
|
1553
|
-
showEditor: isTrellisEnabled2
|
|
1554
|
-
}
|
|
1555
|
-
],
|
|
1556
|
-
[
|
|
1557
|
-
{
|
|
1558
|
-
label: (0, i18n_exports._)("Min column width"),
|
|
1559
|
-
option: "trellisMinColumnWidth",
|
|
1560
|
-
editor: "editor.number",
|
|
1561
|
-
editorProps: {
|
|
1562
|
-
min: 1
|
|
1563
|
-
},
|
|
1564
|
-
showEditor: isTrellisEnabled2
|
|
1565
|
-
},
|
|
1566
|
-
{
|
|
1567
|
-
label: (0, i18n_exports._)("Row height"),
|
|
1568
|
-
option: "trellisRowHeight",
|
|
1569
|
-
editor: "editor.number",
|
|
1570
|
-
editorProps: {
|
|
1571
|
-
min: 1
|
|
1572
|
-
},
|
|
1573
|
-
showEditor: isTrellisEnabled2
|
|
1574
|
-
}
|
|
1575
|
-
],
|
|
1576
|
-
[
|
|
1577
|
-
{
|
|
1578
|
-
label: (0, i18n_exports._)("Max number of components per page"),
|
|
1579
|
-
option: "trellisPageCount",
|
|
1580
|
-
editor: "editor.number",
|
|
1581
|
-
editorProps: {
|
|
1582
|
-
min: 1
|
|
1583
|
-
},
|
|
1584
|
-
showEditor: isTrellisEnabled2
|
|
1585
|
-
}
|
|
1586
|
-
]
|
|
1587
|
-
];
|
|
1588
|
-
var TimechartTrellisEditorConfig = [
|
|
1589
|
-
[
|
|
1590
|
-
{
|
|
1591
|
-
label: (0, i18n_exports._)("Trellis layout"),
|
|
1592
|
-
option: "splitByLayout",
|
|
1593
|
-
editor: "editor.toggle",
|
|
1594
|
-
showEditor: isTrellisFeatureFlagOn2,
|
|
1595
|
-
// add help text for timecharts
|
|
1596
|
-
editorProps: {
|
|
1597
|
-
help: (0, i18n_exports._)(
|
|
1598
|
-
"Y2-axis and overlay field configurations are not supported when trellis is enabled."
|
|
1599
|
-
),
|
|
1600
|
-
helpFormat: "under"
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
],
|
|
1604
|
-
...TrellisEditorConfig.slice(1),
|
|
1605
|
-
[
|
|
1606
|
-
{
|
|
1607
|
-
label: (0, i18n_exports._)("Shared y-axis scale"),
|
|
1608
|
-
option: "trellisSharedScale",
|
|
1609
|
-
editor: "editor.checkbox",
|
|
1610
|
-
showEditor: isTrellisEnabled2
|
|
1611
|
-
}
|
|
1612
|
-
]
|
|
1613
|
-
];
|
|
1614
|
-
var TrellisBackgroundColorEditor = {
|
|
1615
|
-
label: (0, i18n_exports._)("Trellis background"),
|
|
1616
|
-
option: "trellisBackgroundColor",
|
|
1617
|
-
editor: "editor.color",
|
|
1618
|
-
showEditor: isTrellisEnabled2
|
|
1619
|
-
};
|
|
1620
|
-
|
|
1621
1763
|
// src/common/editorConfig/AxesChartColorAndStyle.ts
|
|
1622
1764
|
var themes = {
|
|
1623
1765
|
defaultBackgroundColor: (props) => pick_default({
|
|
@@ -1648,7 +1790,7 @@ var AxesChartColorAndStyle = {
|
|
|
1648
1790
|
]
|
|
1649
1791
|
]
|
|
1650
1792
|
};
|
|
1651
|
-
var
|
|
1793
|
+
var AxesChartColorAndStyleWithTrellis = __spreadProps(__spreadValues({}, AxesChartColorAndStyle), {
|
|
1652
1794
|
layout: [
|
|
1653
1795
|
AxesChartColorAndStyle.layout[0],
|
|
1654
1796
|
[
|
|
@@ -1661,7 +1803,6 @@ var AreaAxesChartColorAndStyleWithTrellis = __spreadProps(__spreadValues({}, Axe
|
|
|
1661
1803
|
...AxesChartColorAndStyle.layout.slice(1)
|
|
1662
1804
|
]
|
|
1663
1805
|
});
|
|
1664
|
-
var AxesChartColorAndStyle_default = AxesChartColorAndStyle;
|
|
1665
1806
|
|
|
1666
1807
|
// src/common/editorConfig/AxesChartLegend.ts
|
|
1667
1808
|
var AxesChartLegend = {
|
|
@@ -1701,6 +1842,54 @@ var AxesChartLegend = {
|
|
|
1701
1842
|
]
|
|
1702
1843
|
]
|
|
1703
1844
|
};
|
|
1845
|
+
var AxesChartLegendWithTrellisAndMode = ({
|
|
1846
|
+
showLegendTooltip = false,
|
|
1847
|
+
hideModeWhenOff = false
|
|
1848
|
+
}) => ({
|
|
1849
|
+
label: AxesChartLegend.label,
|
|
1850
|
+
layout: [
|
|
1851
|
+
[
|
|
1852
|
+
{
|
|
1853
|
+
label: (0, i18n_exports._)("Legend display"),
|
|
1854
|
+
option: "legendDisplay",
|
|
1855
|
+
editor: "editor.select",
|
|
1856
|
+
editorProps: {
|
|
1857
|
+
values: [
|
|
1858
|
+
{ label: (0, i18n_exports._)("Right"), value: "right" },
|
|
1859
|
+
{ label: (0, i18n_exports._)("Left"), value: "left" },
|
|
1860
|
+
{ label: (0, i18n_exports._)("Top"), value: "top" },
|
|
1861
|
+
{ label: (0, i18n_exports._)("Bottom"), value: "bottom" },
|
|
1862
|
+
{ label: (0, i18n_exports._)("Off"), value: "off" }
|
|
1863
|
+
],
|
|
1864
|
+
tooltip: showLegendTooltip && (0, i18n_exports._)('Legend mode must be "Standard" to configure legend display')
|
|
1865
|
+
},
|
|
1866
|
+
isDisabled: showLegendTooltip ? ({ options }) => options.legendMode === "seriesCompare" : void 0,
|
|
1867
|
+
overrideDefaultValue: ({ options }) => (options == null ? void 0 : options.splitByLayout) === "trellis" ? "off" : "right"
|
|
1868
|
+
}
|
|
1869
|
+
],
|
|
1870
|
+
[
|
|
1871
|
+
__spreadProps(__spreadValues({}, AxesChartLegend.layout[1][0]), {
|
|
1872
|
+
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
|
|
1873
|
+
options.legendDisplay === void 0 && options.splitByLayout !== "trellis"
|
|
1874
|
+
})
|
|
1875
|
+
],
|
|
1876
|
+
[
|
|
1877
|
+
{
|
|
1878
|
+
label: (0, i18n_exports._)("Legend mode"),
|
|
1879
|
+
option: "legendMode",
|
|
1880
|
+
editor: "editor.radioBar",
|
|
1881
|
+
editorProps: {
|
|
1882
|
+
values: [
|
|
1883
|
+
{ label: (0, i18n_exports._)("Standard"), value: "standard" },
|
|
1884
|
+
{ label: (0, i18n_exports._)("Compare series"), value: "seriesCompare" }
|
|
1885
|
+
]
|
|
1886
|
+
},
|
|
1887
|
+
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
|
|
1888
|
+
options.legendDisplay === void 0 && options.splitByLayout !== "trellis" : true
|
|
1889
|
+
}
|
|
1890
|
+
]
|
|
1891
|
+
]
|
|
1892
|
+
});
|
|
1704
1893
|
var AxesChartLegend_default = AxesChartLegend;
|
|
1705
1894
|
|
|
1706
1895
|
// src/common/editorConfig/AxesChartYGridAndLabels.ts
|
|
@@ -1902,14 +2091,22 @@ var themes2 = {
|
|
|
1902
2091
|
light: variables_default.backgroundColor(props)
|
|
1903
2092
|
},
|
|
1904
2093
|
prisma: variables_default.backgroundColorSidebar(props)
|
|
2094
|
+
})(props),
|
|
2095
|
+
defaultFontColor: (props) => pick_default({
|
|
2096
|
+
enterprise: {
|
|
2097
|
+
dark: variables_default.textColor(props),
|
|
2098
|
+
light: variables_default.textColor(props)
|
|
2099
|
+
},
|
|
2100
|
+
prisma: variables_default.contentColorDefault(props)
|
|
1905
2101
|
})(props)
|
|
1906
2102
|
};
|
|
1907
2103
|
var editorConfig = [
|
|
1908
2104
|
AxesChartDataConfigScatter,
|
|
2105
|
+
AxesChartDataDisplayScatter,
|
|
1909
2106
|
{
|
|
1910
|
-
label:
|
|
2107
|
+
label: AxesChartColorAndStyleWithTrellis.label,
|
|
1911
2108
|
layout: [
|
|
1912
|
-
...
|
|
2109
|
+
...AxesChartColorAndStyleWithTrellis.layout.slice(0, 3),
|
|
1913
2110
|
[
|
|
1914
2111
|
{
|
|
1915
2112
|
label: (0, i18n_exports._)("Series colors by category name"),
|
|
@@ -1934,7 +2131,11 @@ var editorConfig = [
|
|
|
1934
2131
|
]
|
|
1935
2132
|
]
|
|
1936
2133
|
},
|
|
1937
|
-
|
|
2134
|
+
{
|
|
2135
|
+
label: AxesChartLegend_default.label,
|
|
2136
|
+
layout: [...AxesChartLegendWithTrellisAndMode({ showLegendTooltip: false }).layout.slice(0, 2)]
|
|
2137
|
+
// Legendmode not required hence slice
|
|
2138
|
+
},
|
|
1938
2139
|
AxesChartXGridAndLabelsBubbleScatter,
|
|
1939
2140
|
AxesChartYGridAndLabels_default
|
|
1940
2141
|
];
|
|
@@ -1966,7 +2167,7 @@ var config = {
|
|
|
1966
2167
|
description: "triggered when user clicks on a point in the scatter chart"
|
|
1967
2168
|
}
|
|
1968
2169
|
},
|
|
1969
|
-
supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "placeholder" /* PLACEHOLDER */],
|
|
2170
|
+
supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "placeholder" /* PLACEHOLDER */, "trellis" /* TRELLIS */],
|
|
1970
2171
|
themes: themes2
|
|
1971
2172
|
};
|
|
1972
2173
|
var config_default = enhanceConfig(config);
|
|
@@ -2295,7 +2496,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
2295
2496
|
FixSizeItem,
|
|
2296
2497
|
{
|
|
2297
2498
|
"data-test": "fix-size-item",
|
|
2298
|
-
"data-splunk-visualization-version": "27.
|
|
2499
|
+
"data-splunk-visualization-version": "27.4.0 - 92ef39d5c",
|
|
2299
2500
|
width,
|
|
2300
2501
|
height,
|
|
2301
2502
|
backgroundColor
|
|
@@ -2361,7 +2562,7 @@ var Cover = styled_components_default.div`
|
|
|
2361
2562
|
bottom: 0;
|
|
2362
2563
|
`;
|
|
2363
2564
|
var Blocker = styled_components_default.div.attrs({
|
|
2364
|
-
"data-splunk-visualization-version": "27.
|
|
2565
|
+
"data-splunk-visualization-version": "27.4.0 - 92ef39d5c"
|
|
2365
2566
|
})`
|
|
2366
2567
|
position: relative;
|
|
2367
2568
|
width: 100%;
|
|
@@ -2633,6 +2834,309 @@ __reExport(trellisUtils_exports, require("@splunk/visualizations-shared/trellisU
|
|
|
2633
2834
|
var trellisUtils_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
|
|
2634
2835
|
|
|
2635
2836
|
// src/common/utils/trellisUtils.ts
|
|
2837
|
+
var AGGREGATIONS = "aggregations";
|
|
2838
|
+
var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
2839
|
+
var _a, _b, _c, _d;
|
|
2840
|
+
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2841
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2842
|
+
let splitDataSources = null;
|
|
2843
|
+
let errorCode = null;
|
|
2844
|
+
if (fields && fields.length) {
|
|
2845
|
+
splitDataSources = {};
|
|
2846
|
+
for (let i = 0; i < fields.length; i += 1) {
|
|
2847
|
+
const fieldName = fields[i].name;
|
|
2848
|
+
if (!(fieldName == null ? void 0 : fieldName.startsWith("_"))) {
|
|
2849
|
+
splitDataSources[fieldName] = (0, lodash_exports.cloneDeep)(
|
|
2850
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
2851
|
+
);
|
|
2852
|
+
splitDataSources[fieldName].primary.data.fields = [fields[i]];
|
|
2853
|
+
splitDataSources[fieldName].primary.data.columns = [columns[i]];
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
} else {
|
|
2857
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
2858
|
+
}
|
|
2859
|
+
return { splitDataSources, errorCode };
|
|
2860
|
+
};
|
|
2861
|
+
var toFieldEntries = (fields) => {
|
|
2862
|
+
return fields.map((field) => {
|
|
2863
|
+
if (typeof field === "string") {
|
|
2864
|
+
return { name: field };
|
|
2865
|
+
}
|
|
2866
|
+
return field;
|
|
2867
|
+
});
|
|
2868
|
+
};
|
|
2869
|
+
var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
2870
|
+
var _a, _b, _c, _d;
|
|
2871
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
2872
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2873
|
+
let splitDataSources = null;
|
|
2874
|
+
let splitByFields = [];
|
|
2875
|
+
let errorCode = null;
|
|
2876
|
+
if (typeof fields[0] !== "string") {
|
|
2877
|
+
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
2878
|
+
}
|
|
2879
|
+
if (splitByFields && splitByFields.length > 0) {
|
|
2880
|
+
splitDataSources = {};
|
|
2881
|
+
splitByFields.forEach((splitByField) => {
|
|
2882
|
+
splitDataSources[splitByField] = (0, lodash_exports.cloneDeep)(
|
|
2883
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
2884
|
+
);
|
|
2885
|
+
splitDataSources[splitByField].primary.data.fields = [fields[0]];
|
|
2886
|
+
splitDataSources[splitByField].primary.data.columns = [columns[0]];
|
|
2887
|
+
fields.forEach((field, idx) => {
|
|
2888
|
+
const fieldName = field == null ? void 0 : field.name;
|
|
2889
|
+
if (fieldName !== "_time" && !(fieldName == null ? void 0 : fieldName.startsWith("_")) && field.data_source === splitByField) {
|
|
2890
|
+
splitDataSources[splitByField].primary.data.fields.push(field);
|
|
2891
|
+
splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
|
|
2892
|
+
}
|
|
2893
|
+
});
|
|
2894
|
+
});
|
|
2895
|
+
} else if ((!splitByFields || !splitByFields.length) && fields.length > 1) {
|
|
2896
|
+
splitDataSources = {};
|
|
2897
|
+
for (let i = 1; i < fields.length; i += 1) {
|
|
2898
|
+
const fieldName = fields[i].name;
|
|
2899
|
+
if (!(fieldName == null ? void 0 : fieldName.startsWith("_"))) {
|
|
2900
|
+
splitDataSources[fieldName] = (0, lodash_exports.cloneDeep)(
|
|
2901
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
2902
|
+
);
|
|
2903
|
+
splitDataSources[fieldName].primary.data.fields = [fields[0], fields[i]];
|
|
2904
|
+
splitDataSources[fieldName].primary.data.columns = [columns[0], columns[i]];
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
} else {
|
|
2908
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
2909
|
+
}
|
|
2910
|
+
return { splitDataSources, errorCode };
|
|
2911
|
+
};
|
|
2912
|
+
var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
2913
|
+
var _a, _b, _c, _d;
|
|
2914
|
+
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2915
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2916
|
+
let splitDataSources = null;
|
|
2917
|
+
let splitByFields = [];
|
|
2918
|
+
let errorCode = null;
|
|
2919
|
+
if (typeof fields[0] !== "string") {
|
|
2920
|
+
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
|
|
2921
|
+
}
|
|
2922
|
+
if (splitByFields && splitByFields.length > 0) {
|
|
2923
|
+
splitDataSources = {};
|
|
2924
|
+
splitByFields.forEach((splitByField) => {
|
|
2925
|
+
splitDataSources[splitByField] = (0, lodash_exports.cloneDeep)(
|
|
2926
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
2927
|
+
);
|
|
2928
|
+
splitDataSources[splitByField].primary.data.fields = [fields[0]];
|
|
2929
|
+
splitDataSources[splitByField].primary.data.columns = [columns[0]];
|
|
2930
|
+
const idx = fields.findIndex((field) => field.name === splitByField);
|
|
2931
|
+
if (idx > 0) {
|
|
2932
|
+
splitDataSources[splitByField].primary.data.fields.push(fields[idx]);
|
|
2933
|
+
splitDataSources[splitByField].primary.data.columns.push(columns[idx]);
|
|
2934
|
+
}
|
|
2935
|
+
});
|
|
2936
|
+
} else {
|
|
2937
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
2938
|
+
}
|
|
2939
|
+
return { splitDataSources, errorCode };
|
|
2940
|
+
};
|
|
2941
|
+
var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
2942
|
+
var _a, _b, _c, _d, _e;
|
|
2943
|
+
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2944
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2945
|
+
let splitDataSources = null;
|
|
2946
|
+
let splitByFields = [];
|
|
2947
|
+
let errorCode = null;
|
|
2948
|
+
if (typeof fields[0] !== "string") {
|
|
2949
|
+
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
2950
|
+
}
|
|
2951
|
+
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
2952
|
+
splitDataSources = {};
|
|
2953
|
+
const dataSourceKeys = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
2954
|
+
const valueKeys = [];
|
|
2955
|
+
for (let i = 1; i < fields.length; i += 1) {
|
|
2956
|
+
if (!((_e = fields[i].name) == null ? void 0 : _e.startsWith("_"))) {
|
|
2957
|
+
valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
valueKeys.forEach((val) => {
|
|
2961
|
+
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
2962
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
2963
|
+
);
|
|
2964
|
+
splitDataSources[val].primary.data.fields = [
|
|
2965
|
+
{ name: fields[0].name },
|
|
2966
|
+
...dataSourceKeys.map((k) => ({
|
|
2967
|
+
name: k
|
|
2968
|
+
}))
|
|
2969
|
+
];
|
|
2970
|
+
splitDataSources[val].primary.data.columns = [[...columns[0]]];
|
|
2971
|
+
dataSourceKeys.forEach((dsKey) => {
|
|
2972
|
+
fields.forEach((field, idx) => {
|
|
2973
|
+
if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
|
|
2974
|
+
splitDataSources[val].primary.data.columns.push([...columns[idx]]);
|
|
2975
|
+
}
|
|
2976
|
+
});
|
|
2977
|
+
});
|
|
2978
|
+
});
|
|
2979
|
+
} else {
|
|
2980
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
2981
|
+
}
|
|
2982
|
+
return { splitDataSources, errorCode };
|
|
2983
|
+
};
|
|
2984
|
+
var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
2985
|
+
var _a, _b, _c, _d;
|
|
2986
|
+
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2987
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2988
|
+
let splitDataSources = null;
|
|
2989
|
+
let splitByFields = [];
|
|
2990
|
+
let errorCode = null;
|
|
2991
|
+
if (typeof fields[0] !== "string") {
|
|
2992
|
+
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
2993
|
+
}
|
|
2994
|
+
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
2995
|
+
splitDataSources = {};
|
|
2996
|
+
const splitByFieldIdx = splitByFields.findIndex((f) => f === splitBy);
|
|
2997
|
+
const otherSplitBy = splitByFields.filter((f) => f !== splitBy);
|
|
2998
|
+
const dataSourceKeys = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
2999
|
+
const nonDataSourceAggregations = [];
|
|
3000
|
+
if (!dataSourceKeys.length && fields[0].groupby_rank === "0" && fields.length && !fields[1].groupby_rank) {
|
|
3001
|
+
for (let i = 1; i < fields.length; i += 1) {
|
|
3002
|
+
nonDataSourceAggregations.push(fields[i].name);
|
|
3003
|
+
}
|
|
3004
|
+
}
|
|
3005
|
+
if (splitByFieldIdx === 0) {
|
|
3006
|
+
const valueKeys = (0, lodash_exports.cloneDeep)(columns[0]);
|
|
3007
|
+
valueKeys.forEach((val, idx) => {
|
|
3008
|
+
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
3009
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
3010
|
+
);
|
|
3011
|
+
splitDataSources[val].primary.data.fields = [];
|
|
3012
|
+
if (otherSplitBy.length) {
|
|
3013
|
+
splitDataSources[val].primary.data.fields = [{ name: otherSplitBy[0] }];
|
|
3014
|
+
}
|
|
3015
|
+
if (dataSourceKeys.length) {
|
|
3016
|
+
const columnValues = [[]];
|
|
3017
|
+
splitDataSources[val].primary.data.fields = [
|
|
3018
|
+
...splitDataSources[val].primary.data.fields,
|
|
3019
|
+
...dataSourceKeys.map((k) => ({
|
|
3020
|
+
name: k
|
|
3021
|
+
}))
|
|
3022
|
+
];
|
|
3023
|
+
dataSourceKeys.forEach(() => {
|
|
3024
|
+
columnValues.push([]);
|
|
3025
|
+
});
|
|
3026
|
+
for (let i = 1; i <= Math.ceil((fields.length - 1) / dataSourceKeys.length); i += 1) {
|
|
3027
|
+
columnValues[0].push(
|
|
3028
|
+
fields[i].splitby_value ? fields[i].splitby_value : fields[i].name
|
|
3029
|
+
);
|
|
3030
|
+
dataSourceKeys.forEach((dskey, dsIndx) => {
|
|
3031
|
+
const mul = (fields.length - 1) / dataSourceKeys.length;
|
|
3032
|
+
columnValues[dsIndx + 1].push(columns[i + dsIndx * mul][idx]);
|
|
3033
|
+
});
|
|
3034
|
+
}
|
|
3035
|
+
splitDataSources[val].primary.data.columns = columnValues;
|
|
3036
|
+
} else if (nonDataSourceAggregations.length) {
|
|
3037
|
+
const columnValues = [];
|
|
3038
|
+
fields.forEach((aggregationField, fieldIdx) => {
|
|
3039
|
+
if (fieldIdx > 0) {
|
|
3040
|
+
splitDataSources[val].primary.data.fields.push(aggregationField);
|
|
3041
|
+
columnValues.push([columns[fieldIdx][idx]]);
|
|
3042
|
+
}
|
|
3043
|
+
});
|
|
3044
|
+
splitDataSources[val].primary.data.columns = columnValues;
|
|
3045
|
+
}
|
|
3046
|
+
});
|
|
3047
|
+
} else {
|
|
3048
|
+
const valueKeys = [];
|
|
3049
|
+
for (let i = 1; i < fields.length; i += 1) {
|
|
3050
|
+
valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
|
|
3051
|
+
}
|
|
3052
|
+
valueKeys.forEach((val) => {
|
|
3053
|
+
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
3054
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
3055
|
+
);
|
|
3056
|
+
splitDataSources[val].primary.data.fields = [
|
|
3057
|
+
{ name: otherSplitBy[0] },
|
|
3058
|
+
...dataSourceKeys.map((k) => ({
|
|
3059
|
+
name: k
|
|
3060
|
+
}))
|
|
3061
|
+
];
|
|
3062
|
+
splitDataSources[val].primary.data.columns = [[...columns[0]]];
|
|
3063
|
+
dataSourceKeys.forEach((dsKey) => {
|
|
3064
|
+
fields.forEach((field, idx) => {
|
|
3065
|
+
if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
|
|
3066
|
+
splitDataSources[val].primary.data.columns.push([...columns[idx]]);
|
|
3067
|
+
}
|
|
3068
|
+
});
|
|
3069
|
+
});
|
|
3070
|
+
});
|
|
3071
|
+
}
|
|
3072
|
+
} else {
|
|
3073
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
3074
|
+
}
|
|
3075
|
+
return { splitDataSources, errorCode };
|
|
3076
|
+
};
|
|
3077
|
+
var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
|
|
3078
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3079
|
+
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3080
|
+
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3081
|
+
let splitDataSources = null;
|
|
3082
|
+
let splitByFields = [];
|
|
3083
|
+
let errorCode = null;
|
|
3084
|
+
if (typeof fields[0] !== "string") {
|
|
3085
|
+
splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
|
|
3086
|
+
}
|
|
3087
|
+
const splitByIndex = fields == null ? void 0 : fields.findIndex(
|
|
3088
|
+
(field) => field === splitBy || field.name === splitBy
|
|
3089
|
+
);
|
|
3090
|
+
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
3091
|
+
const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
|
|
3092
|
+
splitDataSources = {};
|
|
3093
|
+
splitByColumn.forEach((val, idx) => {
|
|
3094
|
+
if (!splitDataSources[val]) {
|
|
3095
|
+
splitDataSources[val] = [idx];
|
|
3096
|
+
} else {
|
|
3097
|
+
splitDataSources[val].push(idx);
|
|
3098
|
+
}
|
|
3099
|
+
});
|
|
3100
|
+
const cloneFields = (0, lodash_exports.cloneDeep)(fields);
|
|
3101
|
+
cloneFields.splice(splitByIndex, 1);
|
|
3102
|
+
const valueKeys = Object.keys(splitDataSources);
|
|
3103
|
+
valueKeys.forEach((val) => {
|
|
3104
|
+
const valIndices = (0, lodash_exports.cloneDeep)(splitDataSources[val]);
|
|
3105
|
+
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
3106
|
+
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
3107
|
+
);
|
|
3108
|
+
splitDataSources[val].primary.data.fields = cloneFields;
|
|
3109
|
+
splitDataSources[val].primary.data.columns = [];
|
|
3110
|
+
columns.forEach((col, idx) => {
|
|
3111
|
+
if (idx !== splitByIndex) {
|
|
3112
|
+
const newCol = valIndices.map((valIdx) => col[valIdx]);
|
|
3113
|
+
splitDataSources[val].primary.data.columns.push(newCol);
|
|
3114
|
+
}
|
|
3115
|
+
});
|
|
3116
|
+
});
|
|
3117
|
+
} else {
|
|
3118
|
+
errorCode = "INVALID_SPLIT_BY_FIELD";
|
|
3119
|
+
}
|
|
3120
|
+
return { splitDataSources, errorCode };
|
|
3121
|
+
};
|
|
3122
|
+
var getTrellisDataSourcesBySplitMode = (splitMode, dataSources, trellisSplitBy) => {
|
|
3123
|
+
let result = null;
|
|
3124
|
+
try {
|
|
3125
|
+
if (splitMode === trellisUtils_exports.TIMECHART) {
|
|
3126
|
+
result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : dataSourcesSplitByModeTimechart(dataSources, trellisSplitBy);
|
|
3127
|
+
} else if (splitMode === trellisUtils_exports.STATS) {
|
|
3128
|
+
result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsStats(dataSources) : dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_exports.STATS);
|
|
3129
|
+
} else if (splitMode === trellisUtils_exports.CHART) {
|
|
3130
|
+
result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : dataSourcesSplitByModeChart(dataSources, trellisSplitBy);
|
|
3131
|
+
} else if (splitMode === trellisUtils_exports.UNKNOWN) {
|
|
3132
|
+
result = trellisSplitBy === AGGREGATIONS ? dataSourcesSplitByAggregationsUnknown(dataSources) : dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_exports.UNKNOWN);
|
|
3133
|
+
}
|
|
3134
|
+
} catch (ex) {
|
|
3135
|
+
console.error("getTrellisDataSourcesBySplitMode ", ex);
|
|
3136
|
+
result = { splitDataSources: null, errorCode: "UNKNOWN" };
|
|
3137
|
+
}
|
|
3138
|
+
return result;
|
|
3139
|
+
};
|
|
2636
3140
|
var turnOffLegendDisplayWhenTrellisIsOn = (isTrellisOn, options) => {
|
|
2637
3141
|
if (isTrellisOn && !options.legendDisplay) {
|
|
2638
3142
|
return {
|
|
@@ -2641,6 +3145,36 @@ var turnOffLegendDisplayWhenTrellisIsOn = (isTrellisOn, options) => {
|
|
|
2641
3145
|
}
|
|
2642
3146
|
return {};
|
|
2643
3147
|
};
|
|
3148
|
+
var calculateSharedMinMax = (splitData) => {
|
|
3149
|
+
let max = -Infinity;
|
|
3150
|
+
let min = Infinity;
|
|
3151
|
+
Object.keys(splitData).forEach((splitByKey) => {
|
|
3152
|
+
const datasources = splitData[splitByKey];
|
|
3153
|
+
Object.keys(datasources).forEach((datasourceName) => {
|
|
3154
|
+
const dataColumns = datasources[datasourceName].data.columns;
|
|
3155
|
+
dataColumns.forEach((column) => {
|
|
3156
|
+
column.forEach((point) => {
|
|
3157
|
+
const pointNumber = Number(point);
|
|
3158
|
+
if (pointNumber > max) {
|
|
3159
|
+
max = pointNumber;
|
|
3160
|
+
}
|
|
3161
|
+
if (pointNumber < min) {
|
|
3162
|
+
min = pointNumber;
|
|
3163
|
+
}
|
|
3164
|
+
});
|
|
3165
|
+
});
|
|
3166
|
+
});
|
|
3167
|
+
});
|
|
3168
|
+
return [min, max];
|
|
3169
|
+
};
|
|
3170
|
+
var determineMinMax = (splitData, trellisSharedScale, yAxisMin, yAxisMax, stackMode) => {
|
|
3171
|
+
if (!trellisSharedScale || stackMode === "stacked100" || yAxisMin !== "auto" && yAxisMax !== "auto")
|
|
3172
|
+
return [yAxisMin, yAxisMax];
|
|
3173
|
+
const [sharedMin, sharedMax] = calculateSharedMinMax(splitData);
|
|
3174
|
+
const shouldUseSharedMax = sharedMax !== -Infinity && yAxisMax === "auto";
|
|
3175
|
+
const shouldUseSharedMin = sharedMin !== Infinity && yAxisMin === "auto";
|
|
3176
|
+
return [shouldUseSharedMin ? sharedMin : yAxisMin, shouldUseSharedMax ? sharedMax : yAxisMax];
|
|
3177
|
+
};
|
|
2644
3178
|
|
|
2645
3179
|
// src/common/withDashboardViz.tsx
|
|
2646
3180
|
var withDashboardViz = (opts) => {
|
|
@@ -2700,10 +3234,10 @@ var withDashboardViz = (opts) => {
|
|
|
2700
3234
|
const isDownsamplingEnabledByFeatureFlag = Boolean(
|
|
2701
3235
|
featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableDownsampling
|
|
2702
3236
|
);
|
|
2703
|
-
const
|
|
3237
|
+
const isTrellisFeatureFlagOn4 = Boolean(
|
|
2704
3238
|
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
2705
3239
|
);
|
|
2706
|
-
const isTrellisOn =
|
|
3240
|
+
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 */;
|
|
2707
3241
|
const isMounted = react_exports.useRef(true);
|
|
2708
3242
|
const optionsToEvaluate = react_exports.useMemo(() => {
|
|
2709
3243
|
var _a2;
|
|
@@ -2800,11 +3334,9 @@ var withDashboardViz = (opts) => {
|
|
|
2800
3334
|
useAsyncEvaluatedOptions
|
|
2801
3335
|
]);
|
|
2802
3336
|
const evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
2803
|
-
|
|
3337
|
+
const clonedEvaluatedOptions = __spreadValues({}, evaluatedOptionsToUse);
|
|
2804
3338
|
if (isTrellisOn) {
|
|
2805
|
-
clonedEvaluatedOptions =
|
|
2806
|
-
backgroundColor: clonedEvaluatedOptions == null ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
2807
|
-
});
|
|
3339
|
+
clonedEvaluatedOptions.backgroundColor = clonedEvaluatedOptions == null ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor;
|
|
2808
3340
|
}
|
|
2809
3341
|
react_exports.useEffect(() => {
|
|
2810
3342
|
onComputedProps(clonedEvaluatedOptions);
|
|
@@ -2863,7 +3395,8 @@ var withDashboardViz = (opts) => {
|
|
|
2863
3395
|
}));
|
|
2864
3396
|
let dataSourceMetadata = {};
|
|
2865
3397
|
const OptionKey = "paginateDataSourceKey";
|
|
2866
|
-
const
|
|
3398
|
+
const optsKey = (0, lodash_exports.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey];
|
|
3399
|
+
const paginateDataSourceKey = typeof optsKey === "string" ? optsKey : "primary";
|
|
2867
3400
|
if (vizConfig.supports.indexOf("page-and-sort" /* PAGE_AND_SORT */) > -1 && (0, lodash_exports.has)(dataSources, paginateDataSourceKey)) {
|
|
2868
3401
|
const requestParams = (0, lodash_exports.get)(dataSources, [paginateDataSourceKey, "requestParams"], {});
|
|
2869
3402
|
const meta = (0, lodash_exports.get)(dataSources, [paginateDataSourceKey, "meta"], {});
|
|
@@ -2996,6 +3529,258 @@ var convertToStringValues = (options) => {
|
|
|
2996
3529
|
var mapToOldKey = (options) => (0, lodash_exports.mapKeys)(options, (val, key) => scatterOptionsSCMapping[key] ? scatterOptionsSCMapping[key] : key);
|
|
2997
3530
|
var convertToScatterSCProperties = (originalOptions) => (0, lodash_exports.chain)(mapToOldKey(originalOptions)).thru(mapToValues(scatterOptionValuesSCMapping)).thru(convertToStringValues).value();
|
|
2998
3531
|
|
|
3532
|
+
// esm-externals:@splunk/react-ui/Paginator
|
|
3533
|
+
var Paginator_exports = {};
|
|
3534
|
+
__export(Paginator_exports, {
|
|
3535
|
+
default: () => Paginator_default
|
|
3536
|
+
});
|
|
3537
|
+
var defaultImport37 = __toESM(require("@splunk/react-ui/Paginator"));
|
|
3538
|
+
__reExport(Paginator_exports, require("@splunk/react-ui/Paginator"));
|
|
3539
|
+
var Paginator_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
|
|
3540
|
+
|
|
3541
|
+
// esm-externals:@splunk/themes
|
|
3542
|
+
var themes_exports = {};
|
|
3543
|
+
__export(themes_exports, {
|
|
3544
|
+
default: () => themes_default
|
|
3545
|
+
});
|
|
3546
|
+
var defaultImport38 = __toESM(require("@splunk/themes"));
|
|
3547
|
+
__reExport(themes_exports, require("@splunk/themes"));
|
|
3548
|
+
var themes_default = "default" in defaultImport38 ? defaultImport38.default : defaultImport38;
|
|
3549
|
+
|
|
3550
|
+
// src/common/hocs/withTrellis.tsx
|
|
3551
|
+
var TrellisContainer = styled_components_default.div`
|
|
3552
|
+
overflow: hidden;
|
|
3553
|
+
display: flex;
|
|
3554
|
+
flex-direction: column;
|
|
3555
|
+
background-color: ${(props) => props.backgroundColor};
|
|
3556
|
+
${(props) => (0, style_exports.toDimension)((0, lodash_exports.pick)(props, ["width", "height"]))};
|
|
3557
|
+
> [data-test='paginator'] {
|
|
3558
|
+
align-self: flex-end;
|
|
3559
|
+
margin-bottom: 10px;
|
|
3560
|
+
}
|
|
3561
|
+
`;
|
|
3562
|
+
var TrellisContainerGrid = styled_components_default.div`
|
|
3563
|
+
display: grid;
|
|
3564
|
+
height: ${(props) => {
|
|
3565
|
+
return `${props.height}px`;
|
|
3566
|
+
}};
|
|
3567
|
+
gap: 10px 10px;
|
|
3568
|
+
grid-template-columns: ${(props) => {
|
|
3569
|
+
return props.colCount ? `repeat(${props.colCount}, minmax(${props.colMinWidth}px, 1fr))` : `repeat(auto-fit, minmax(${props.colMinWidth}px, 1fr))`;
|
|
3570
|
+
}};
|
|
3571
|
+
overflow: auto;
|
|
3572
|
+
justify-items: stretch;
|
|
3573
|
+
grid-auto-rows: ${(props) => `${props.rowHeight}px`};
|
|
3574
|
+
.child {
|
|
3575
|
+
height: ${(props) => `${props.rowHeight}px`};
|
|
3576
|
+
}
|
|
3577
|
+
`;
|
|
3578
|
+
var showErrorMessage = (errorCode, width, height) => {
|
|
3579
|
+
if (errorCode === "INVALID_SPLIT_BY_FIELD") {
|
|
3580
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
3581
|
+
Message_default,
|
|
3582
|
+
{
|
|
3583
|
+
width,
|
|
3584
|
+
height,
|
|
3585
|
+
message: (0, i18n_exports._)("Select a valid trellis split by field"),
|
|
3586
|
+
level: "info"
|
|
3587
|
+
}
|
|
3588
|
+
);
|
|
3589
|
+
}
|
|
3590
|
+
if (errorCode === "UNKNOWN_DATA_SPLIT_MODE") {
|
|
3591
|
+
return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Unknown data split mode"), level: "info" });
|
|
3592
|
+
}
|
|
3593
|
+
return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Error render in trellis"), level: "info" });
|
|
3594
|
+
};
|
|
3595
|
+
var withTrellis = (Viz) => {
|
|
3596
|
+
const VizWithTrellis = (opts) => {
|
|
3597
|
+
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
3598
|
+
setContainerWidth(w);
|
|
3599
|
+
setContainerHeight(h);
|
|
3600
|
+
}, []);
|
|
3601
|
+
const [containerWidth, setContainerWidth] = react_exports.useState(Number(opts.width));
|
|
3602
|
+
const [containerHeight, setContainerHeight] = react_exports.useState(Number(opts.height));
|
|
3603
|
+
const _a = opts, { options = {}, height, width } = _a, otherProps = __objRest(_a, ["options", "height", "width"]);
|
|
3604
|
+
const defaultOptions = (0, JSONSchemaUtils_exports.pickFieldFromJSONSchema)(Viz.config.optionsSchema, "default");
|
|
3605
|
+
const mergedOptions = (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions);
|
|
3606
|
+
const {
|
|
3607
|
+
trellisColumns,
|
|
3608
|
+
trellisPageCount,
|
|
3609
|
+
trellisMinColumnWidth,
|
|
3610
|
+
trellisRowHeight,
|
|
3611
|
+
splitByLayout,
|
|
3612
|
+
trellisSplitBy,
|
|
3613
|
+
trellisSharedScale,
|
|
3614
|
+
stackMode,
|
|
3615
|
+
yAxisMin,
|
|
3616
|
+
yAxisMax
|
|
3617
|
+
} = mergedOptions;
|
|
3618
|
+
const colCount = trellisColumns > 0 ? trellisColumns : defaultOptions.trellisColumns;
|
|
3619
|
+
const pageCount = +trellisPageCount > 0 ? +trellisPageCount : defaultOptions.trellisPageCount;
|
|
3620
|
+
const colMinWidth = trellisMinColumnWidth > 0 ? trellisMinColumnWidth : defaultOptions.trellisMinColumnWidth;
|
|
3621
|
+
const rowHeight = trellisRowHeight > 0 ? trellisRowHeight : defaultOptions.trellisRowHeight;
|
|
3622
|
+
const [pageNum, setPageNum] = (0, react_exports.useState)(1);
|
|
3623
|
+
const [pagedData, setPagedData] = (0, react_exports.useState)(null);
|
|
3624
|
+
let splitByKeys = [];
|
|
3625
|
+
let totalPages = 0;
|
|
3626
|
+
let showPaginator = false;
|
|
3627
|
+
const { dataSources } = otherProps;
|
|
3628
|
+
const theme = {
|
|
3629
|
+
splunkThemeV1: useSplunkTheme_default()
|
|
3630
|
+
};
|
|
3631
|
+
const {
|
|
3632
|
+
family: currentThemeFamily,
|
|
3633
|
+
colorScheme: currentThemeColorScheme,
|
|
3634
|
+
density: currentThemeDensity
|
|
3635
|
+
} = (0, themes_exports.getSettingsFromThemedProps)({ theme });
|
|
3636
|
+
const trellisBackgroundColor = (0, react_exports.useMemo)(() => {
|
|
3637
|
+
const themeFunc = (themeVar) => {
|
|
3638
|
+
var _a2, _b;
|
|
3639
|
+
return (_b = (_a2 = Viz.config.themes)[themeVar]) == null ? void 0 : _b.call(_a2, {
|
|
3640
|
+
trellisBackgroundColor: mergedOptions.trellisBackgroundColor,
|
|
3641
|
+
theme
|
|
3642
|
+
});
|
|
3643
|
+
};
|
|
3644
|
+
const evaluated = Options_exports.Options.evaluate(
|
|
3645
|
+
{
|
|
3646
|
+
context: Viz.config.context,
|
|
3647
|
+
options: { trellisBackgroundColor: mergedOptions.trellisBackgroundColor }
|
|
3648
|
+
},
|
|
3649
|
+
{},
|
|
3650
|
+
themeFunc
|
|
3651
|
+
);
|
|
3652
|
+
return evaluated.trellisBackgroundColor;
|
|
3653
|
+
}, [
|
|
3654
|
+
mergedOptions.trellisBackgroundColor,
|
|
3655
|
+
currentThemeFamily,
|
|
3656
|
+
currentThemeColorScheme,
|
|
3657
|
+
currentThemeDensity
|
|
3658
|
+
]);
|
|
3659
|
+
const columns = (0, lodash_exports.get)(dataSources, "primary.data.columns", void 0);
|
|
3660
|
+
const fields = (0, lodash_exports.get)(dataSources, "primary.data.fields", void 0);
|
|
3661
|
+
const noColumns = columns === void 0;
|
|
3662
|
+
const noFields = fields === void 0;
|
|
3663
|
+
const updateDataDisplay = (currPage) => {
|
|
3664
|
+
if (!showPaginator) {
|
|
3665
|
+
setPagedData(splitByKeys);
|
|
3666
|
+
setPageNum(1);
|
|
3667
|
+
} else {
|
|
3668
|
+
const startIdx = pageCount * (currPage - 1);
|
|
3669
|
+
const paged = splitByKeys.slice(startIdx, startIdx + pageCount);
|
|
3670
|
+
setPagedData(paged);
|
|
3671
|
+
}
|
|
3672
|
+
};
|
|
3673
|
+
(0, react_exports.useEffect)(() => {
|
|
3674
|
+
setPageNum(1);
|
|
3675
|
+
updateDataDisplay(1);
|
|
3676
|
+
}, [pageCount, trellisSplitBy]);
|
|
3677
|
+
(0, react_exports.useEffect)(() => {
|
|
3678
|
+
updateDataDisplay(pageNum);
|
|
3679
|
+
}, [columns, fields, trellisSplitBy, pageNum, splitByLayout]);
|
|
3680
|
+
const handlePageChange = (0, react_exports.useCallback)(
|
|
3681
|
+
(event, { page }) => {
|
|
3682
|
+
setPageNum(page);
|
|
3683
|
+
},
|
|
3684
|
+
[pageNum, pagedData]
|
|
3685
|
+
);
|
|
3686
|
+
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
3687
|
+
const isTrellisFeatureFlagOn4 = Boolean(
|
|
3688
|
+
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
3689
|
+
);
|
|
3690
|
+
if (!isTrellisFeatureFlagOn4 || !splitByLayout || splitByLayout !== visualization_schemas_exports.LAYOUT_TYPE.Trellis) {
|
|
3691
|
+
return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({}, opts));
|
|
3692
|
+
}
|
|
3693
|
+
if (splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis) {
|
|
3694
|
+
if (noColumns || noFields) {
|
|
3695
|
+
return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Loading"), level: "info" });
|
|
3696
|
+
}
|
|
3697
|
+
let currTrellisSplitBy = trellisSplitBy;
|
|
3698
|
+
if (!trellisSplitBy || trellisSplitBy.length === 0) {
|
|
3699
|
+
const splitByPossibleFields = (0, trellisUtils_exports.getAllPossibleSplitByFields)(fields);
|
|
3700
|
+
currTrellisSplitBy = splitByPossibleFields.fields && splitByPossibleFields.fields.length ? splitByPossibleFields.fields[0] : AGGREGATIONS;
|
|
3701
|
+
}
|
|
3702
|
+
const splitMode = (0, trellisUtils_exports.getTrellisDataSplitterMode)(fields);
|
|
3703
|
+
const dataSplitResult = getTrellisDataSourcesBySplitMode(
|
|
3704
|
+
splitMode,
|
|
3705
|
+
dataSources,
|
|
3706
|
+
currTrellisSplitBy
|
|
3707
|
+
);
|
|
3708
|
+
const modifiedDataSourceBySplitBy = dataSplitResult == null ? void 0 : dataSplitResult.splitDataSources;
|
|
3709
|
+
const dataSplitErrorCode = dataSplitResult == null ? void 0 : dataSplitResult.errorCode;
|
|
3710
|
+
if (!modifiedDataSourceBySplitBy || Object.keys(modifiedDataSourceBySplitBy).length === 0 || dataSplitErrorCode) {
|
|
3711
|
+
return showErrorMessage(dataSplitErrorCode, width, height);
|
|
3712
|
+
}
|
|
3713
|
+
const splitByKeysModified = modifiedDataSourceBySplitBy ? Object.keys(modifiedDataSourceBySplitBy) : [];
|
|
3714
|
+
if (splitByKeysModified) {
|
|
3715
|
+
showPaginator = splitByKeysModified.length > pageCount;
|
|
3716
|
+
splitByKeys = splitByKeysModified;
|
|
3717
|
+
totalPages = splitByKeysModified ? Math.ceil(splitByKeysModified.length / pageCount) : 0;
|
|
3718
|
+
}
|
|
3719
|
+
const [calculatedMin, calculatedMax] = determineMinMax(
|
|
3720
|
+
modifiedDataSourceBySplitBy,
|
|
3721
|
+
trellisSharedScale,
|
|
3722
|
+
yAxisMin,
|
|
3723
|
+
yAxisMax,
|
|
3724
|
+
stackMode
|
|
3725
|
+
);
|
|
3726
|
+
return /* @__PURE__ */ react_exports.createElement(TrellisContainer, { height, width, backgroundColor: trellisBackgroundColor }, /* @__PURE__ */ react_exports.createElement(
|
|
3727
|
+
TrellisContainerGrid,
|
|
3728
|
+
{
|
|
3729
|
+
height,
|
|
3730
|
+
colCount,
|
|
3731
|
+
colMinWidth,
|
|
3732
|
+
rowHeight
|
|
3733
|
+
},
|
|
3734
|
+
pagedData == null ? void 0 : pagedData.map((splitByKey, idx) => /* @__PURE__ */ react_exports.createElement(
|
|
3735
|
+
"div",
|
|
3736
|
+
{
|
|
3737
|
+
className: "child",
|
|
3738
|
+
"data-test": "trellis-child",
|
|
3739
|
+
key: `div-child-${idx.toString()}`
|
|
3740
|
+
},
|
|
3741
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
3742
|
+
SizeAwareWrapper_default,
|
|
3743
|
+
{
|
|
3744
|
+
width,
|
|
3745
|
+
height,
|
|
3746
|
+
onResize: cachedHandleResize
|
|
3747
|
+
}
|
|
3748
|
+
),
|
|
3749
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
3750
|
+
Viz,
|
|
3751
|
+
__spreadProps(__spreadValues({}, otherProps), {
|
|
3752
|
+
trellisKey: splitByKey,
|
|
3753
|
+
trellisSplitBy: currTrellisSplitBy,
|
|
3754
|
+
dataSources: modifiedDataSourceBySplitBy[splitByKey],
|
|
3755
|
+
options: __spreadProps(__spreadValues({}, options), {
|
|
3756
|
+
yAxisMin: calculatedMin,
|
|
3757
|
+
yAxisMax: calculatedMax
|
|
3758
|
+
}),
|
|
3759
|
+
key: `viz-${idx.toString()}`,
|
|
3760
|
+
height: containerHeight,
|
|
3761
|
+
width: containerWidth
|
|
3762
|
+
})
|
|
3763
|
+
)
|
|
3764
|
+
))
|
|
3765
|
+
), showPaginator && totalPages >= pageNum && /* @__PURE__ */ react_exports.createElement(
|
|
3766
|
+
Paginator_default,
|
|
3767
|
+
{
|
|
3768
|
+
onChange: handlePageChange,
|
|
3769
|
+
current: pageNum,
|
|
3770
|
+
alwaysShowLastPageLink: true,
|
|
3771
|
+
totalPages
|
|
3772
|
+
}
|
|
3773
|
+
));
|
|
3774
|
+
}
|
|
3775
|
+
return null;
|
|
3776
|
+
};
|
|
3777
|
+
VizWithTrellis.propTypes = Viz.proptypes;
|
|
3778
|
+
VizWithTrellis.defaultProps = Viz.defaultProps;
|
|
3779
|
+
VizWithTrellis.config = Viz.config;
|
|
3780
|
+
return VizWithTrellis;
|
|
3781
|
+
};
|
|
3782
|
+
var withTrellis_default = withTrellis;
|
|
3783
|
+
|
|
2999
3784
|
// src/Scatter/Scatter.tsx
|
|
3000
3785
|
var validOptions = Object.keys(config_default.optionsSchema);
|
|
3001
3786
|
var computeVizProps = (_a) => {
|
|
@@ -3008,7 +3793,9 @@ var computeVizProps = (_a) => {
|
|
|
3008
3793
|
category,
|
|
3009
3794
|
xField,
|
|
3010
3795
|
yField,
|
|
3011
|
-
categoryField
|
|
3796
|
+
categoryField,
|
|
3797
|
+
trellisKey,
|
|
3798
|
+
themeFunc
|
|
3012
3799
|
} = _b, otherOptions = __objRest(_b, [
|
|
3013
3800
|
"dataSources",
|
|
3014
3801
|
"onEventTrigger",
|
|
@@ -3018,9 +3805,17 @@ var computeVizProps = (_a) => {
|
|
|
3018
3805
|
"category",
|
|
3019
3806
|
"xField",
|
|
3020
3807
|
"yField",
|
|
3021
|
-
"categoryField"
|
|
3808
|
+
"categoryField",
|
|
3809
|
+
"trellisKey",
|
|
3810
|
+
"themeFunc"
|
|
3022
3811
|
]);
|
|
3023
|
-
const
|
|
3812
|
+
const defaultFontColor = themeFunc("defaultFontColor");
|
|
3813
|
+
const computedProps = {
|
|
3814
|
+
visualizationApiRef,
|
|
3815
|
+
trellisKey,
|
|
3816
|
+
defaultFontColor,
|
|
3817
|
+
onEventTrigger
|
|
3818
|
+
};
|
|
3024
3819
|
const { hasEventHandlers } = otherOptions;
|
|
3025
3820
|
computedProps.options = (0, lodash_exports.chain)(otherOptions).pick(validOptions).thru(convertToScatterSCProperties).thru((options) => __spreadProps(__spreadValues({}, (0, simpleXMLOptions_exports.getSimpleXMLOptionsForProps)(options)), { chart: "scatter" })).value();
|
|
3026
3821
|
let primaryData = __spreadValues({}, dataSources.primary.data);
|
|
@@ -3044,11 +3839,13 @@ var computeVizProps = (_a) => {
|
|
|
3044
3839
|
}
|
|
3045
3840
|
return computedProps;
|
|
3046
3841
|
};
|
|
3047
|
-
var Column =
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3842
|
+
var Column = withTrellis_default(
|
|
3843
|
+
withDashboardViz_default({
|
|
3844
|
+
ReactViz: Charting_default,
|
|
3845
|
+
computeVizProps,
|
|
3846
|
+
vizConfig: config_default
|
|
3847
|
+
})
|
|
3848
|
+
);
|
|
3052
3849
|
var themes3 = null;
|
|
3053
3850
|
var Scatter_default = Column;
|
|
3054
3851
|
//# sourceMappingURL=Scatter.js.map
|