@splunk/visualizations 28.3.0 → 28.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/Area.d.ts.map +1 -1
- package/Area.config.js +28 -8
- package/Area.config.js.map +2 -2
- package/Area.js +583 -120
- package/Area.js.map +3 -3
- package/Bar/Bar.d.ts.map +1 -1
- package/Bar.config.js +28 -8
- package/Bar.config.js.map +2 -2
- package/Bar.js +593 -120
- package/Bar.js.map +3 -3
- package/Bubble.config.js +4 -5
- package/Bubble.config.js.map +2 -2
- package/Bubble.js +554 -98
- package/Bubble.js.map +3 -3
- package/CHANGELOG.external.md +165 -0
- package/ChoroplethSvg/ChoroplethSvg.d.ts +4 -3
- package/ChoroplethSvg/ChoroplethSvg.d.ts.map +1 -1
- package/ChoroplethSvg.config.js +1 -3
- package/ChoroplethSvg.config.js.map +2 -2
- package/ChoroplethSvg.js +595 -111
- package/ChoroplethSvg.js.map +4 -4
- package/Column/Column.d.ts.map +1 -1
- package/Column.config.js +28 -8
- package/Column.config.js.map +2 -2
- package/Column.js +583 -120
- package/Column.js.map +3 -3
- package/Ellipse/config.d.ts.map +1 -1
- package/Ellipse.config.js +14 -5
- package/Ellipse.config.js.map +4 -4
- package/Ellipse.js +640 -159
- package/Ellipse.js.map +4 -4
- package/Events/PureEvents/PureEvents.d.ts.map +1 -1
- package/Events.js +668 -157
- package/Events.js.map +4 -4
- package/FillerGauge/FillerGauge.d.ts.map +1 -1
- package/FillerGauge/PureFillerGauge/FillerGauge.d.ts.map +1 -1
- package/FillerGauge.js +751 -169
- package/FillerGauge.js.map +4 -4
- package/Image/Image.d.ts.map +1 -1
- package/Image.js +620 -116
- package/Image.js.map +4 -4
- package/Line/Line.d.ts.map +1 -1
- package/Line/lineUtils.d.ts.map +1 -1
- package/Line/mockdata/LineData.d.ts +154 -0
- package/Line/mockdata/LineData.d.ts.map +1 -1
- package/Line.config.js +28 -8
- package/Line.config.js.map +2 -2
- package/Line.js +704 -122
- package/Line.js.map +3 -3
- package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts +5 -0
- package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/components/Graph.d.ts +9 -1
- package/LinkGraph/PureLinkGraph/components/Graph.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/components/GraphStyles.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/components/Node.d.ts +1 -0
- package/LinkGraph/PureLinkGraph/components/Node.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/components/Nodes.d.ts +1 -0
- package/LinkGraph/PureLinkGraph/components/Nodes.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/measurementUtils.d.ts +16 -0
- package/LinkGraph/PureLinkGraph/measurementUtils.d.ts.map +1 -0
- package/LinkGraph/PureLinkGraph/utils/iconLoader.d.ts.map +1 -1
- package/LinkGraph/config.d.ts.map +1 -1
- package/LinkGraph.config.js +15 -1
- package/LinkGraph.config.js.map +2 -2
- package/LinkGraph.js +1411 -662
- package/LinkGraph.js.map +4 -4
- package/Map/Map.d.ts +2 -2
- package/Map/Map.d.ts.map +1 -1
- package/Map/PureMap/BubbleLayer.d.ts +5 -0
- package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
- package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
- package/Map/PureMap/LocalChoroplethLayer.d.ts.map +1 -1
- package/Map/PureMap/MapUtils.d.ts +2 -2
- package/Map/PureMap/MapUtils.d.ts.map +1 -1
- package/Map/PureMap/PureMap.d.ts.map +1 -1
- package/Map/PureMap/PureMapContainer.d.ts.map +1 -1
- package/Map/PureMap/Tooltip.d.ts.map +1 -1
- package/Map/config.d.ts.map +1 -1
- package/Map.config.js +0 -1
- package/Map.config.js.map +2 -2
- package/Map.js +831 -247
- package/Map.js.map +4 -4
- package/Markdown/Markdown.d.ts.map +1 -1
- package/Markdown/config.d.ts.map +1 -1
- package/Markdown.config.js +14 -5
- package/Markdown.config.js.map +4 -4
- package/Markdown.js +619 -109
- package/Markdown.js.map +4 -4
- package/MarkerGauge/MarkerGauge.d.ts +5 -1
- package/MarkerGauge/MarkerGauge.d.ts.map +1 -1
- package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts +4 -0
- package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts.map +1 -1
- package/MarkerGauge/config.d.ts.map +1 -1
- package/MarkerGauge.config.js +121 -3
- package/MarkerGauge.config.js.map +3 -3
- package/MarkerGauge.js +1535 -172
- package/MarkerGauge.js.map +4 -4
- package/NetworkGraph/NetworkGraph.d.ts +22 -0
- package/NetworkGraph/NetworkGraph.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts +60 -0
- package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/components/Link.d.ts +19 -0
- package/NetworkGraph/PureNetworkGraph/components/Link.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts +29 -0
- package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/components/Node.d.ts +27 -0
- package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts +12 -0
- package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts +13 -0
- package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/mockdata/data.d.ts +140 -0
- package/NetworkGraph/PureNetworkGraph/mockdata/data.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/mockdata/datasource.d.ts +89 -0
- package/NetworkGraph/PureNetworkGraph/mockdata/datasource.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/utils/dragUtils.d.ts +78 -0
- package/NetworkGraph/PureNetworkGraph/utils/dragUtils.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/utils/forceLayout.d.ts +47 -0
- package/NetworkGraph/PureNetworkGraph/utils/forceLayout.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/utils/iconLoader.d.ts +78 -0
- package/NetworkGraph/PureNetworkGraph/utils/iconLoader.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphShared.d.ts +111 -0
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphShared.d.ts.map +1 -0
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +122 -0
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -0
- package/NetworkGraph/config.d.ts +4 -0
- package/NetworkGraph/config.d.ts.map +1 -0
- package/NetworkGraph/index.d.ts +3 -0
- package/NetworkGraph/index.d.ts.map +1 -0
- package/NetworkGraph.config.js +938 -0
- package/NetworkGraph.config.js.map +7 -0
- package/NetworkGraph.js +7053 -0
- package/NetworkGraph.js.map +7 -0
- package/PERFORMANCE.md +23 -0
- package/ParallelCoordinates/ParallelCoordinates.d.ts +1 -46
- package/ParallelCoordinates/ParallelCoordinates.d.ts.map +1 -1
- package/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts +12 -58
- package/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts.map +1 -1
- package/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts +1 -0
- package/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts.map +1 -1
- package/ParallelCoordinates.js +664 -228
- package/ParallelCoordinates.js.map +4 -4
- package/Pie/Pie.d.ts.map +1 -1
- package/Pie/config.d.ts.map +1 -1
- package/Pie/pieUtils.d.ts +4 -0
- package/Pie/pieUtils.d.ts.map +1 -1
- package/Pie.config.js +16 -0
- package/Pie.config.js.map +2 -2
- package/Pie.js +610 -118
- package/Pie.js.map +3 -3
- package/Punchcard.js +579 -92
- package/Punchcard.js.map +4 -4
- package/Rectangle/config.d.ts.map +1 -1
- package/Rectangle.config.js +14 -5
- package/Rectangle.config.js.map +4 -4
- package/Rectangle.js +611 -130
- package/Rectangle.js.map +4 -4
- package/Sankey/PureSankey/PureSankey.d.ts +26 -72
- package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyLink.d.ts +3 -19
- package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyNode.d.ts +3 -20
- package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyTooltip.d.ts +3 -24
- package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
- package/Sankey.js +814 -429
- package/Sankey.js.map +4 -4
- package/Scatter/Scatter.d.ts.map +1 -1
- package/Scatter.config.js +168 -148
- package/Scatter.config.js.map +4 -4
- package/Scatter.js +733 -260
- package/Scatter.js.map +4 -4
- package/SingleValue/SingleValue.d.ts.map +1 -1
- package/SingleValue/config.d.ts.map +1 -1
- package/SingleValue.config.js +15 -2
- package/SingleValue.config.js.map +2 -2
- package/SingleValue.js +733 -229
- package/SingleValue.js.map +3 -3
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon/SingleValueIcon.d.ts.map +1 -1
- package/SingleValueIcon/config.d.ts.map +1 -1
- package/SingleValueIcon.config.js +14 -6
- package/SingleValueIcon.config.js.map +4 -4
- package/SingleValueIcon.js +612 -182
- package/SingleValueIcon.js.map +4 -4
- package/SingleValueRadial/PureSingleValueRadial/GaugeGraph.d.ts.map +1 -1
- package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts +0 -8
- package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts.map +1 -1
- package/SingleValueRadial/SingleValueRadial.d.ts.map +1 -1
- package/SingleValueRadial.config.js +0 -1
- package/SingleValueRadial.config.js.map +2 -2
- package/SingleValueRadial.js +594 -182
- package/SingleValueRadial.js.map +4 -4
- package/SparkLine.js +46 -8
- package/SparkLine.js.map +2 -2
- package/Table/PureTable.d.ts +10 -0
- package/Table/PureTable.d.ts.map +1 -1
- package/Table/Table.d.ts.map +1 -1
- package/Table/cells/SparklineCell.d.ts.map +1 -1
- package/Table/config.d.ts.map +1 -1
- package/Table/hooks.d.ts +6 -0
- package/Table/hooks.d.ts.map +1 -1
- package/Table.config.js +1 -1
- package/Table.config.js.map +2 -2
- package/Table.js +836 -253
- package/Table.js.map +4 -4
- package/Timeline/PureTimeline/PureTimeline.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/CursorPlugin.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/TimelineLegend.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/TimelinePlugin.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +2 -1
- package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
- package/Timeline/config.d.ts.map +1 -1
- package/Timeline.config.js +31 -12
- package/Timeline.config.js.map +4 -4
- package/Timeline.js +785 -247
- package/Timeline.js.map +4 -4
- package/common/Charting.d.ts +5 -0
- package/common/Charting.d.ts.map +1 -1
- package/common/Charting.js +12 -0
- package/common/Charting.js.map +2 -2
- package/common/GaugeMajorTicks.js +150 -13
- package/common/GaugeMajorTicks.js.map +4 -4
- package/common/GaugeValueMarker.js +84 -17
- package/common/GaugeValueMarker.js.map +4 -4
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.d.ts.map +1 -1
- package/common/OverviewDoc.js +2 -2
- package/common/OverviewDoc.js.map +2 -2
- package/common/ThemesDoc.js +0 -1
- package/common/ThemesDoc.js.map +2 -2
- package/common/TimeSeriesChartWrapper.d.ts +24 -11
- package/common/TimeSeriesChartWrapper.d.ts.map +1 -1
- package/common/TimeSeriesChartWrapper.js +617 -91
- package/common/TimeSeriesChartWrapper.js.map +4 -4
- package/common/chartingUtils.d.ts +52 -6
- package/common/chartingUtils.d.ts.map +1 -1
- package/common/chartingUtils.js +116 -17
- package/common/chartingUtils.js.map +3 -3
- package/common/editorConfig/AxesChartDataConfig.d.ts +3 -3
- package/common/editorConfig/AxesChartDataConfig.d.ts.map +1 -1
- package/common/editorConfig/AxesChartDataDisplay.d.ts +4 -0
- package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
- package/common/editorConfig/AxesChartLegend.d.ts.map +1 -1
- package/common/gaugeUtils.d.ts +37 -0
- package/common/gaugeUtils.d.ts.map +1 -1
- package/common/gaugeUtils.js +152 -2
- package/common/gaugeUtils.js.map +4 -4
- package/common/hocs/mockdata/trellisData.d.ts +119 -0
- package/common/hocs/mockdata/trellisData.d.ts.map +1 -1
- package/common/hocs/withTrellis.d.ts.map +1 -1
- package/common/interfaces/DashboardVizProps.d.ts +0 -3
- package/common/interfaces/DashboardVizProps.d.ts.map +1 -1
- package/common/interfaces/DataSource.d.ts +1 -1
- package/common/interfaces/DataSource.d.ts.map +1 -1
- package/common/interfaces/Overview.d.ts +1 -0
- package/common/interfaces/Overview.d.ts.map +1 -1
- package/common/interfaces/VizConfig.d.ts +2 -1
- package/common/interfaces/VizConfig.d.ts.map +1 -1
- package/common/shapeUtils.js +5 -20
- package/common/shapeUtils.js.map +2 -2
- package/common/utils/dataUtils.d.ts.map +1 -1
- package/common/utils/dataUtils.js +5 -4
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/mapUtils.js +16 -9
- package/common/utils/mapUtils.js.map +2 -2
- package/common/utils/singleValueUtils.js +17 -18
- package/common/utils/singleValueUtils.js.map +2 -2
- package/common/utils/textUtils.d.ts +20 -0
- package/common/utils/textUtils.d.ts.map +1 -0
- package/common/utils/textUtils.js +76 -0
- package/common/utils/textUtils.js.map +7 -0
- package/common/utils/trellisUtils.d.ts.map +1 -1
- package/common/utils/trellisUtils.js +16 -20
- package/common/utils/trellisUtils.js.map +2 -2
- package/common/withDashboardViz.d.ts.map +1 -1
- package/common/withDashboardViz.js +600 -92
- package/common/withDashboardViz.js.map +4 -4
- package/package.json +46 -39
- package/common/utils/styleUtils.d.ts +0 -2
- package/common/utils/styleUtils.d.ts.map +0 -1
- package/common/utils/styleUtils.js +0 -30
- package/common/utils/styleUtils.js.map +0 -7
package/Events.js
CHANGED
|
@@ -489,7 +489,7 @@ var Cover = styled_components_default.div`
|
|
|
489
489
|
bottom: 0;
|
|
490
490
|
`;
|
|
491
491
|
var Blocker = styled_components_default.div.attrs({
|
|
492
|
-
"data-splunk-visualization-version": "28.
|
|
492
|
+
"data-splunk-visualization-version": "28.5.0 - b192418b7"
|
|
493
493
|
})`
|
|
494
494
|
position: relative;
|
|
495
495
|
width: 100%;
|
|
@@ -588,7 +588,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
588
588
|
FixSizeItem,
|
|
589
589
|
{
|
|
590
590
|
"data-test": "fix-size-item",
|
|
591
|
-
"data-splunk-visualization-version": "28.
|
|
591
|
+
"data-splunk-visualization-version": "28.5.0 - b192418b7",
|
|
592
592
|
width,
|
|
593
593
|
height,
|
|
594
594
|
backgroundColor
|
|
@@ -690,7 +690,7 @@ var convertToArrOfObjects = (columns, fields) => {
|
|
|
690
690
|
for (let i = 0; i < columns[0].length; i += 1) {
|
|
691
691
|
const newObj = {};
|
|
692
692
|
fields.forEach((field, index) => {
|
|
693
|
-
const fieldName =
|
|
693
|
+
const fieldName = getFieldName(field);
|
|
694
694
|
if (columns[index][i] === "") {
|
|
695
695
|
newObj[fieldName] = null;
|
|
696
696
|
} else {
|
|
@@ -701,6 +701,7 @@ var convertToArrOfObjects = (columns, fields) => {
|
|
|
701
701
|
}
|
|
702
702
|
return data;
|
|
703
703
|
};
|
|
704
|
+
var getFieldName = (field) => typeof field === "string" ? field : field.name;
|
|
704
705
|
var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
|
|
705
706
|
const dataLength = data.length;
|
|
706
707
|
const downsampledIndices = [];
|
|
@@ -817,9 +818,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
|
|
|
817
818
|
let xColumn = [];
|
|
818
819
|
const yColumns = [];
|
|
819
820
|
const canDownsample = !ds.data.fields.some((field, index) => {
|
|
820
|
-
var _a
|
|
821
|
-
const fieldName = (
|
|
822
|
-
const fieldType = (
|
|
821
|
+
var _a;
|
|
822
|
+
const fieldName = getFieldName(field);
|
|
823
|
+
const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
|
|
823
824
|
const column = ds.data.columns[index];
|
|
824
825
|
let hasDisplayedColumnThatCantBeDownsampled = false;
|
|
825
826
|
if (fieldName === xField) {
|
|
@@ -1172,6 +1173,16 @@ var triangleEventAnnotationRenderer = ({
|
|
|
1172
1173
|
eventColor: eventWithColor.color
|
|
1173
1174
|
});
|
|
1174
1175
|
};
|
|
1176
|
+
var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
|
|
1177
|
+
const rangeSelectEventHandler = eventHandlers.find(
|
|
1178
|
+
(eventHandler) => {
|
|
1179
|
+
var _a;
|
|
1180
|
+
return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
|
|
1181
|
+
}
|
|
1182
|
+
);
|
|
1183
|
+
const xAxisIsTime = xField === "_time";
|
|
1184
|
+
return !!rangeSelectEventHandler && xAxisIsTime;
|
|
1185
|
+
};
|
|
1175
1186
|
var canvasSupportedTimeSeriesCharts = ["splunk.line"];
|
|
1176
1187
|
var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
|
|
1177
1188
|
return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
|
|
@@ -1192,17 +1203,34 @@ var filterChartDataFromInternalFields = (chartData) => {
|
|
|
1192
1203
|
var convert2DArrayToNumbers = (arr) => {
|
|
1193
1204
|
return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
|
|
1194
1205
|
};
|
|
1195
|
-
var
|
|
1196
|
-
|
|
1206
|
+
var parseAxisValue = (val) => {
|
|
1207
|
+
if (val === void 0 || val === null || val === "auto" || val === "") {
|
|
1208
|
+
return void 0;
|
|
1209
|
+
}
|
|
1210
|
+
const num = typeof val === "number" ? val : Number.parseFloat(val);
|
|
1211
|
+
return Number.isNaN(num) ? void 0 : num;
|
|
1212
|
+
};
|
|
1213
|
+
var parseXAxisLineVisibility = (visibility) => {
|
|
1214
|
+
if (visibility === "hide") return false;
|
|
1215
|
+
if (visibility === "show") return true;
|
|
1216
|
+
return void 0;
|
|
1217
|
+
};
|
|
1197
1218
|
var getLegend = (props) => {
|
|
1198
1219
|
const legendPlacement = props == null ? void 0 : props.legendDisplay;
|
|
1220
|
+
const { isSeriesCompare, legendTruncation } = props;
|
|
1221
|
+
const commonLegendProps = {
|
|
1222
|
+
center: true,
|
|
1223
|
+
fontSize: 12,
|
|
1224
|
+
largerTiles: true,
|
|
1225
|
+
hideSeriesValue: !isSeriesCompare,
|
|
1226
|
+
// Show values if in seriesCompare mode
|
|
1227
|
+
legendTruncation
|
|
1228
|
+
};
|
|
1199
1229
|
switch (legendPlacement) {
|
|
1200
1230
|
case "off":
|
|
1201
1231
|
return false;
|
|
1202
1232
|
case "left":
|
|
1203
|
-
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
|
|
1204
|
-
width: SideLegendWidth
|
|
1205
|
-
}, commonLegendProps));
|
|
1233
|
+
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
1206
1234
|
case "bottom":
|
|
1207
1235
|
return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
|
|
1208
1236
|
wrap: true
|
|
@@ -1212,9 +1240,7 @@ var getLegend = (props) => {
|
|
|
1212
1240
|
wrap: true
|
|
1213
1241
|
}, commonLegendProps));
|
|
1214
1242
|
default:
|
|
1215
|
-
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
|
|
1216
|
-
width: SideLegendWidth
|
|
1217
|
-
}, commonLegendProps));
|
|
1243
|
+
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
1218
1244
|
}
|
|
1219
1245
|
};
|
|
1220
1246
|
var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
|
|
@@ -1249,22 +1275,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
|
|
|
1249
1275
|
const end = axisTitle.slice(-halfChars);
|
|
1250
1276
|
return `${start}...${end}`;
|
|
1251
1277
|
};
|
|
1252
|
-
var
|
|
1278
|
+
var getFieldName2 = (field) => {
|
|
1253
1279
|
const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
|
|
1254
1280
|
return fieldName;
|
|
1255
1281
|
};
|
|
1256
1282
|
var getFieldNames = (fields) => {
|
|
1257
|
-
return fields.map((field) =>
|
|
1283
|
+
return fields.map((field) => getFieldName2(field));
|
|
1258
1284
|
};
|
|
1259
|
-
var getXScaleConfig = (label, xAxisLabelVisibility) => {
|
|
1285
|
+
var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
|
|
1260
1286
|
const xConfig = { x: {} };
|
|
1261
1287
|
xConfig.x.label = label;
|
|
1262
1288
|
if (xAxisLabelVisibility === "hide") {
|
|
1263
1289
|
xConfig.x.hideLabels = true;
|
|
1264
1290
|
}
|
|
1291
|
+
if (xAxisLabelRotation !== void 0) {
|
|
1292
|
+
xConfig.x.labelRotation = xAxisLabelRotation;
|
|
1293
|
+
}
|
|
1265
1294
|
return xConfig;
|
|
1266
1295
|
};
|
|
1267
|
-
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
|
|
1296
|
+
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
|
|
1268
1297
|
const scaleType = yAxisScale != null ? yAxisScale : "linear";
|
|
1269
1298
|
const yConfig = { y: {} };
|
|
1270
1299
|
yConfig.y.label = label;
|
|
@@ -1272,34 +1301,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
|
|
|
1272
1301
|
if (yAxisAbbreviation !== "none") {
|
|
1273
1302
|
yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
|
|
1274
1303
|
}
|
|
1275
|
-
if (yAxisAbbreviation
|
|
1276
|
-
yConfig.y.width = 55;
|
|
1277
|
-
} else {
|
|
1304
|
+
if (yAxisAbbreviation !== "none") {
|
|
1278
1305
|
yConfig.y.width = label && label.length > 0 ? 30 : 10;
|
|
1279
1306
|
}
|
|
1280
1307
|
if (yAxisLabelVisibility === "hide") {
|
|
1281
1308
|
yConfig.y.hideLabels = true;
|
|
1282
1309
|
}
|
|
1310
|
+
if (yAxisMin !== void 0 || yAxisMax !== void 0) {
|
|
1311
|
+
yConfig.y.range = (u, dataMin, dataMax) => {
|
|
1312
|
+
const min = yAxisMin != null ? yAxisMin : dataMin;
|
|
1313
|
+
const max = yAxisMax != null ? yAxisMax : dataMax;
|
|
1314
|
+
return [min, max];
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1283
1317
|
return yConfig;
|
|
1284
1318
|
};
|
|
1285
|
-
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
|
|
1319
|
+
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
|
|
1286
1320
|
const y2Config = { y2: {} };
|
|
1287
1321
|
const scaleType = axisScale != null ? axisScale : "linear";
|
|
1288
1322
|
y2Config.y2.label = label;
|
|
1289
1323
|
y2Config.y2.side = "right";
|
|
1290
|
-
y2Config.y2.showGrid = false;
|
|
1291
1324
|
y2Config.y2.type = scaleType;
|
|
1292
1325
|
if (axisAbbreviation !== "none") {
|
|
1293
1326
|
y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
|
|
1327
|
+
y2Config.y2.width = label && label.length > 0 ? 50 : 10;
|
|
1294
1328
|
} else if (roundAxisLabelsToInteger) {
|
|
1295
1329
|
y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
|
|
1296
1330
|
}
|
|
1297
1331
|
if (y2AxisLabelVisibility === "hide") {
|
|
1298
1332
|
y2Config.y2.hideLabels = true;
|
|
1299
1333
|
}
|
|
1334
|
+
if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
|
|
1335
|
+
y2Config.y2.range = (u, dataMin, dataMax) => {
|
|
1336
|
+
const min = y2AxisMin != null ? y2AxisMin : dataMin;
|
|
1337
|
+
const max = y2AxisMax != null ? y2AxisMax : dataMax;
|
|
1338
|
+
return [min, max];
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1300
1341
|
return y2Config;
|
|
1301
1342
|
};
|
|
1302
|
-
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
|
|
1343
|
+
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
|
|
1303
1344
|
const seriesConfig = {};
|
|
1304
1345
|
let spanGaps;
|
|
1305
1346
|
let replaceNullsWithZero;
|
|
@@ -1326,6 +1367,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
1326
1367
|
);
|
|
1327
1368
|
if (shouldAssignToY2) {
|
|
1328
1369
|
seriesConfig[field].overrides.scale = "y2";
|
|
1370
|
+
} else {
|
|
1371
|
+
seriesConfig[field].overrides.scale = "y";
|
|
1329
1372
|
}
|
|
1330
1373
|
}
|
|
1331
1374
|
if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
|
|
@@ -1334,12 +1377,101 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
1334
1377
|
if (markerDisplay !== void 0) {
|
|
1335
1378
|
seriesConfig[field].markerDisplay = markerDisplay;
|
|
1336
1379
|
}
|
|
1380
|
+
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
1381
|
+
if (fieldDashStyle) {
|
|
1382
|
+
seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
1383
|
+
}
|
|
1384
|
+
const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
|
|
1385
|
+
const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
|
|
1386
|
+
if (fieldStepPosition && fieldStepPosition !== "off") {
|
|
1387
|
+
seriesConfig[field].stepPosition = fieldStepPosition;
|
|
1388
|
+
}
|
|
1337
1389
|
if (replaceNullsWithZero !== void 0) {
|
|
1338
1390
|
seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
|
|
1339
1391
|
}
|
|
1340
1392
|
});
|
|
1341
1393
|
return seriesConfig;
|
|
1342
1394
|
};
|
|
1395
|
+
var findRangeIndices = (xData, startValue, endValue) => {
|
|
1396
|
+
let startXIndex = -1;
|
|
1397
|
+
let endXIndex = -1;
|
|
1398
|
+
const xDataEpoch = xData.map((val) => {
|
|
1399
|
+
if (typeof val === "string") {
|
|
1400
|
+
return new Date(val).getTime() / 1e3;
|
|
1401
|
+
}
|
|
1402
|
+
return val;
|
|
1403
|
+
});
|
|
1404
|
+
for (let i = 0; i < xDataEpoch.length; i += 1) {
|
|
1405
|
+
if (xDataEpoch[i] >= startValue) {
|
|
1406
|
+
startXIndex = i;
|
|
1407
|
+
break;
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
if (startXIndex === -1 && xDataEpoch.length > 0) {
|
|
1411
|
+
startXIndex = xDataEpoch.length - 1;
|
|
1412
|
+
}
|
|
1413
|
+
for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
|
|
1414
|
+
if (xDataEpoch[i] <= endValue) {
|
|
1415
|
+
endXIndex = i;
|
|
1416
|
+
break;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
if (endXIndex === -1 && xDataEpoch.length > 0) {
|
|
1420
|
+
endXIndex = 0;
|
|
1421
|
+
}
|
|
1422
|
+
return { startXIndex, endXIndex };
|
|
1423
|
+
};
|
|
1424
|
+
|
|
1425
|
+
// esm-externals:@splunk/visualization-schemas
|
|
1426
|
+
var visualization_schemas_exports = {};
|
|
1427
|
+
__export(visualization_schemas_exports, {
|
|
1428
|
+
default: () => visualization_schemas_default
|
|
1429
|
+
});
|
|
1430
|
+
var defaultImport27 = __toESM(require("@splunk/visualization-schemas"));
|
|
1431
|
+
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
1432
|
+
var visualization_schemas_default = "default" in defaultImport27 ? defaultImport27.default : defaultImport27;
|
|
1433
|
+
|
|
1434
|
+
// src/common/hooks/useTrellisEnabled.ts
|
|
1435
|
+
var useTrellisFeatureFlagOn = () => {
|
|
1436
|
+
const context = (0, react_exports.useContext)(FeatureFlagContext_default);
|
|
1437
|
+
return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
|
|
1438
|
+
};
|
|
1439
|
+
var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
|
|
1440
|
+
const trellisFeatureEnabled = useTrellisFeatureFlagOn();
|
|
1441
|
+
return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1444
|
+
// src/common/components/TrellisTitle.tsx
|
|
1445
|
+
var TRELLIS_TITLE_HEIGHT = 28;
|
|
1446
|
+
var TrellisTitleText = styled_components_default.div`
|
|
1447
|
+
margin-left: 10px;
|
|
1448
|
+
margin-right: 10px;
|
|
1449
|
+
padding-top: 8px;
|
|
1450
|
+
text-overflow: ellipsis;
|
|
1451
|
+
white-space: nowrap;
|
|
1452
|
+
overflow: hidden;
|
|
1453
|
+
`;
|
|
1454
|
+
var TrellisTitleDiv = styled_components_default.div`
|
|
1455
|
+
height: ${TRELLIS_TITLE_HEIGHT}px;
|
|
1456
|
+
font-size: 14px;
|
|
1457
|
+
font-weight: 700;
|
|
1458
|
+
color: ${(props) => props.fontColor};
|
|
1459
|
+
background-color: ${(props) => props.backgroundColor};
|
|
1460
|
+
box-shadow: 0 1px ${(props) => props.backgroundColor}; // this is added to avoid a 1px gap between title and viz divs that showed up intermittently because of pixel rounding error in chrome.
|
|
1461
|
+
`;
|
|
1462
|
+
var TrellisTitle = (props) => {
|
|
1463
|
+
const titleText = String(props.trellisKey).toString();
|
|
1464
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
1465
|
+
TrellisTitleDiv,
|
|
1466
|
+
{
|
|
1467
|
+
fontColor: props.fontColor,
|
|
1468
|
+
backgroundColor: props.backgroundColor,
|
|
1469
|
+
"data-test": "trellis-title",
|
|
1470
|
+
title: titleText
|
|
1471
|
+
},
|
|
1472
|
+
/* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
|
|
1473
|
+
);
|
|
1474
|
+
};
|
|
1343
1475
|
|
|
1344
1476
|
// src/common/TimeSeriesChartWrapper.tsx
|
|
1345
1477
|
var TimeSeriesChartContainer = styled_components_default.div`
|
|
@@ -1350,38 +1482,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
|
|
|
1350
1482
|
position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
|
|
1351
1483
|
}
|
|
1352
1484
|
`;
|
|
1353
|
-
var
|
|
1485
|
+
var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
|
|
1486
|
+
const result = __spreadValues({}, payload);
|
|
1487
|
+
if (trellisSplitBy) {
|
|
1488
|
+
result["trellis.name"] = trellisSplitBy;
|
|
1489
|
+
}
|
|
1490
|
+
if (trellisKey) {
|
|
1491
|
+
result["trellis.value"] = trellisKey;
|
|
1492
|
+
}
|
|
1493
|
+
return result;
|
|
1494
|
+
};
|
|
1495
|
+
var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
|
|
1496
|
+
if (!previousPayload) {
|
|
1497
|
+
return true;
|
|
1498
|
+
}
|
|
1499
|
+
if (currentPayload.index !== previousPayload.index) {
|
|
1500
|
+
return true;
|
|
1501
|
+
}
|
|
1502
|
+
if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
|
|
1503
|
+
return true;
|
|
1504
|
+
}
|
|
1505
|
+
if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
|
|
1506
|
+
return true;
|
|
1507
|
+
}
|
|
1508
|
+
if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
|
|
1509
|
+
return true;
|
|
1510
|
+
}
|
|
1511
|
+
return false;
|
|
1512
|
+
};
|
|
1513
|
+
var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
1354
1514
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
|
|
1355
1515
|
name: chartEvent.seriesKey
|
|
1356
1516
|
});
|
|
1357
1517
|
delete payload.seriesKey;
|
|
1358
1518
|
if (chartEvent.rowContext) {
|
|
1359
|
-
Object.
|
|
1360
|
-
payload
|
|
1361
|
-
|
|
1519
|
+
Object.assign(
|
|
1520
|
+
payload,
|
|
1521
|
+
Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
|
|
1522
|
+
acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
|
|
1523
|
+
return acc;
|
|
1524
|
+
}, {})
|
|
1525
|
+
);
|
|
1362
1526
|
}
|
|
1527
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1363
1528
|
if (onClick) {
|
|
1364
1529
|
onClick({
|
|
1365
1530
|
type: "point.click",
|
|
1366
1531
|
originalEvent: chartEvent,
|
|
1367
|
-
payload
|
|
1532
|
+
payload: updatedPayload
|
|
1368
1533
|
});
|
|
1369
1534
|
}
|
|
1370
1535
|
};
|
|
1371
|
-
var handleLegendClick = (chartEvent, onClick) => {
|
|
1536
|
+
var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
1372
1537
|
const payload = {
|
|
1373
1538
|
name: chartEvent
|
|
1374
1539
|
};
|
|
1540
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1375
1541
|
if (onClick) {
|
|
1376
1542
|
onClick({
|
|
1377
1543
|
type: "legend.click",
|
|
1378
1544
|
originalEvent: chartEvent,
|
|
1379
|
-
payload
|
|
1545
|
+
payload: updatedPayload
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
};
|
|
1549
|
+
var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
1550
|
+
var _a;
|
|
1551
|
+
if (!rangeEvent) {
|
|
1552
|
+
return;
|
|
1553
|
+
}
|
|
1554
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
1555
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
1556
|
+
const payload = {
|
|
1557
|
+
startXIndex,
|
|
1558
|
+
startXValue: rangeEvent.start,
|
|
1559
|
+
endXIndex,
|
|
1560
|
+
endXValue: rangeEvent.end
|
|
1561
|
+
};
|
|
1562
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1563
|
+
if (onSelect) {
|
|
1564
|
+
onSelect({
|
|
1565
|
+
type: "range.selectBeforeZoom",
|
|
1566
|
+
originalEvent: rangeEvent,
|
|
1567
|
+
payload: updatedPayload
|
|
1568
|
+
});
|
|
1569
|
+
}
|
|
1570
|
+
};
|
|
1571
|
+
var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
1572
|
+
var _a;
|
|
1573
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
1574
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
1575
|
+
const payload = {
|
|
1576
|
+
startXIndex,
|
|
1577
|
+
startXValue: rangeEvent.start,
|
|
1578
|
+
endXIndex,
|
|
1579
|
+
endXValue: rangeEvent.end
|
|
1580
|
+
};
|
|
1581
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1582
|
+
if (onSelect) {
|
|
1583
|
+
onSelect({
|
|
1584
|
+
type: "range.select",
|
|
1585
|
+
originalEvent: rangeEvent,
|
|
1586
|
+
payload: updatedPayload
|
|
1380
1587
|
});
|
|
1381
1588
|
}
|
|
1382
1589
|
};
|
|
1590
|
+
var parseArrayOption = (value) => {
|
|
1591
|
+
if (Array.isArray(value)) {
|
|
1592
|
+
return value;
|
|
1593
|
+
}
|
|
1594
|
+
if (value) {
|
|
1595
|
+
return JSON.parse(value);
|
|
1596
|
+
}
|
|
1597
|
+
return void 0;
|
|
1598
|
+
};
|
|
1383
1599
|
var TimeSeriesChartWrapper = (props) => {
|
|
1384
|
-
|
|
1600
|
+
var _b, _c, _d;
|
|
1601
|
+
const _a = props, {
|
|
1385
1602
|
width,
|
|
1386
1603
|
height,
|
|
1387
1604
|
chartData,
|
|
@@ -1394,12 +1611,57 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1394
1611
|
markerDisplay,
|
|
1395
1612
|
onClick,
|
|
1396
1613
|
onPointMouseOver,
|
|
1397
|
-
onPointMouseOut
|
|
1398
|
-
|
|
1399
|
-
|
|
1614
|
+
onPointMouseOut,
|
|
1615
|
+
onSelect,
|
|
1616
|
+
splitByLayout,
|
|
1617
|
+
trellisKey,
|
|
1618
|
+
trellisSplitBy,
|
|
1400
1619
|
backgroundColor,
|
|
1620
|
+
defaultFontColor,
|
|
1621
|
+
additionalTooltipValues,
|
|
1622
|
+
xAxisLineVisibility: xAxisLineVisibility,
|
|
1623
|
+
yAxisLineVisibility,
|
|
1624
|
+
y2AxisLineVisibility,
|
|
1625
|
+
showYAxisWithZero: showYAxisWithZeroFromProps,
|
|
1626
|
+
showY2AxisWithZero: showY2AxisWithZeroFromProps
|
|
1627
|
+
} = _a, otherOptions = __objRest(_a, [
|
|
1628
|
+
"width",
|
|
1629
|
+
"height",
|
|
1630
|
+
"chartData",
|
|
1631
|
+
"options",
|
|
1632
|
+
"userLocale",
|
|
1633
|
+
"annotationX",
|
|
1634
|
+
"annotationLabel",
|
|
1635
|
+
"annotationColor",
|
|
1636
|
+
"legendDisplay",
|
|
1637
|
+
"markerDisplay",
|
|
1638
|
+
"onClick",
|
|
1639
|
+
"onPointMouseOver",
|
|
1640
|
+
"onPointMouseOut",
|
|
1641
|
+
"onSelect",
|
|
1642
|
+
"splitByLayout",
|
|
1643
|
+
"trellisKey",
|
|
1644
|
+
"trellisSplitBy",
|
|
1645
|
+
"backgroundColor",
|
|
1646
|
+
"defaultFontColor",
|
|
1647
|
+
"additionalTooltipValues",
|
|
1648
|
+
// Extract axis line visibility options from props
|
|
1649
|
+
"xAxisLineVisibility",
|
|
1650
|
+
"yAxisLineVisibility",
|
|
1651
|
+
"y2AxisLineVisibility",
|
|
1652
|
+
// Extract showYAxisWithZero directly from props for accelerated render mode
|
|
1653
|
+
"showYAxisWithZero",
|
|
1654
|
+
"showY2AxisWithZero"
|
|
1655
|
+
]);
|
|
1656
|
+
const { eventHandlers, xField: xFieldFromProps } = otherOptions;
|
|
1657
|
+
const trellisEnabled = useTrellisEnabled(splitByLayout);
|
|
1658
|
+
const {
|
|
1659
|
+
backgroundColor: bgColorFromOptions,
|
|
1401
1660
|
seriesColors: seriesColorsStr,
|
|
1402
1661
|
fieldColors,
|
|
1662
|
+
legendLabels: legendLabelsStr,
|
|
1663
|
+
legendMode,
|
|
1664
|
+
legendTruncation,
|
|
1403
1665
|
"axisTitleX.text": xAxisTitleText,
|
|
1404
1666
|
"axisTitleY.text": yAxisTitleText,
|
|
1405
1667
|
"axisTitleY2.text": y2AxisTitleText,
|
|
@@ -1407,8 +1669,12 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1407
1669
|
"axisTitleY.visibility": yAxisTitleVisibility,
|
|
1408
1670
|
"axisTitleY2.visibility": y2AxisTitleVisibility,
|
|
1409
1671
|
"axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
|
|
1672
|
+
"axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
|
|
1673
|
+
"axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
|
|
1410
1674
|
"axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
|
|
1675
|
+
"axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
|
|
1411
1676
|
"axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
|
|
1677
|
+
"axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
|
|
1412
1678
|
"axisY.abbreviation": yAxisAbbreviation,
|
|
1413
1679
|
"axisY.scale": yAxisScale,
|
|
1414
1680
|
"axisY2.abbreviation": y2AxisAbbreviation,
|
|
@@ -1418,10 +1684,73 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1418
1684
|
"axisLabelsY2.integerUnits": y2IntegerUnits,
|
|
1419
1685
|
"chart.overlayFields": overlayFieldsStr,
|
|
1420
1686
|
"chart.nullValueMode": nullValueMode,
|
|
1421
|
-
|
|
1687
|
+
"chart.showDataLabels": showDataLabels,
|
|
1688
|
+
lineWidth,
|
|
1689
|
+
lineDashStyle,
|
|
1690
|
+
fieldDashStyles: lineDashStylesByFieldStr,
|
|
1691
|
+
stepPosition,
|
|
1692
|
+
fieldStepPositions: stepPositionsByFieldStr,
|
|
1693
|
+
yAxisMin: yAxisMinRaw,
|
|
1694
|
+
yAxisMax: yAxisMaxRaw,
|
|
1695
|
+
y2AxisMin: y2AxisMinRaw,
|
|
1696
|
+
y2AxisMax: y2AxisMaxRaw,
|
|
1697
|
+
showXMajorGridLines,
|
|
1698
|
+
showYMajorGridLines,
|
|
1699
|
+
showY2MajorGridLines,
|
|
1700
|
+
showYMinorGridLines,
|
|
1701
|
+
showY2MinorGridLines,
|
|
1702
|
+
showLineSmoothing,
|
|
1703
|
+
xAxisMajorTickVisibility,
|
|
1704
|
+
xAxisMajorTickSize,
|
|
1705
|
+
yAxisMajorTickVisibility,
|
|
1706
|
+
y2AxisMajorTickVisibility,
|
|
1707
|
+
yAxisMajorTickSize,
|
|
1708
|
+
y2AxisMajorTickSize,
|
|
1709
|
+
yAxisMajorTickInterval,
|
|
1710
|
+
y2AxisMajorTickInterval,
|
|
1711
|
+
yAxisMinorTickVisibility,
|
|
1712
|
+
y2AxisMinorTickVisibility,
|
|
1713
|
+
yAxisMinorTickSize,
|
|
1714
|
+
y2AxisMinorTickSize,
|
|
1715
|
+
showYAxisWithZero: showYAxisWithZeroFromOptions,
|
|
1716
|
+
showY2AxisWithZero: showY2AxisWithZeroFromOptions
|
|
1422
1717
|
} = options;
|
|
1718
|
+
const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
|
|
1719
|
+
const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
|
|
1720
|
+
const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
|
|
1721
|
+
const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
|
|
1722
|
+
const showYMajorTicks = yAxisMajorTickVisibility === "show";
|
|
1723
|
+
const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
|
|
1724
|
+
const showYMinorTicks = yAxisMinorTickVisibility === "show";
|
|
1725
|
+
const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
|
|
1726
|
+
const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
|
|
1727
|
+
const showYAxisLine = yAxisLineVisibility === "show";
|
|
1728
|
+
const showY2AxisLine = y2AxisLineVisibility === "show";
|
|
1729
|
+
const yAxisMin = parseAxisValue(yAxisMinRaw);
|
|
1730
|
+
const yAxisMax = parseAxisValue(yAxisMaxRaw);
|
|
1731
|
+
const y2AxisMin = parseAxisValue(y2AxisMinRaw);
|
|
1732
|
+
const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
|
|
1733
|
+
const parseTickInterval = (simpleXMLValue, canvasValue) => {
|
|
1734
|
+
if (simpleXMLValue) return Number(simpleXMLValue);
|
|
1735
|
+
if (canvasValue) return Number(canvasValue);
|
|
1736
|
+
return void 0;
|
|
1737
|
+
};
|
|
1738
|
+
const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
|
|
1739
|
+
const y2AxisMajorTickIntervalNum = parseTickInterval(
|
|
1740
|
+
y2AxisMajorUnitFromSimpleXML,
|
|
1741
|
+
y2AxisMajorTickInterval
|
|
1742
|
+
);
|
|
1743
|
+
const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
|
|
1744
|
+
const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
|
|
1745
|
+
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
|
|
1746
|
+
const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
|
|
1747
|
+
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
|
|
1423
1748
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
1424
1749
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
1750
|
+
const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
|
|
1751
|
+
const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
|
|
1752
|
+
const legendLabels = parseArrayOption(legendLabelsStr);
|
|
1753
|
+
const bgColor = backgroundColor || bgColorFromOptions;
|
|
1425
1754
|
const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
|
|
1426
1755
|
const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
|
|
1427
1756
|
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
@@ -1432,31 +1761,64 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1432
1761
|
fields: chartData.fields,
|
|
1433
1762
|
columns: chartData.seriesList
|
|
1434
1763
|
});
|
|
1435
|
-
const xField =
|
|
1764
|
+
const xField = getFieldName2(filteredChartData.fields[0]);
|
|
1436
1765
|
const yFields = getFieldNames(
|
|
1437
1766
|
filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
|
|
1438
1767
|
);
|
|
1439
|
-
const y2Fields =
|
|
1440
|
-
|
|
1768
|
+
const y2Fields = (0, react_exports.useMemo)(
|
|
1769
|
+
() => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
|
|
1770
|
+
[y2FieldsStr]
|
|
1771
|
+
);
|
|
1772
|
+
const overlayFields = (0, react_exports.useMemo)(
|
|
1773
|
+
() => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
|
|
1774
|
+
[overlayFieldsStr]
|
|
1775
|
+
);
|
|
1441
1776
|
let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
|
|
1442
1777
|
xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
|
|
1443
|
-
|
|
1778
|
+
const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
|
|
1779
|
+
let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
|
|
1444
1780
|
yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
|
|
1445
1781
|
const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
|
|
1446
1782
|
let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
|
|
1447
1783
|
y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
|
|
1448
|
-
const xScaleConfig =
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1784
|
+
const xScaleConfig = (0, react_exports.useMemo)(
|
|
1785
|
+
() => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
|
|
1786
|
+
[xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
|
|
1787
|
+
);
|
|
1788
|
+
const yScaleConfig = (0, react_exports.useMemo)(
|
|
1789
|
+
() => getYScaleConfig(
|
|
1790
|
+
yAxisTitle,
|
|
1791
|
+
yAxisAbbreviation,
|
|
1792
|
+
yAxisScale,
|
|
1793
|
+
yAxisLabelVisibility,
|
|
1794
|
+
yAxisMin,
|
|
1795
|
+
yAxisMax
|
|
1796
|
+
),
|
|
1797
|
+
[yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
|
|
1798
|
+
);
|
|
1799
|
+
const y2ScaleConfig = (0, react_exports.useMemo)(() => {
|
|
1800
|
+
if (y2Enabled) {
|
|
1801
|
+
return getY2ScaleConfig(
|
|
1802
|
+
y2AxisTitle,
|
|
1803
|
+
y2AxisAbbreviation,
|
|
1804
|
+
y2AxisScale,
|
|
1805
|
+
y2IntegerUnits,
|
|
1806
|
+
y2AxisLabelVisibility,
|
|
1807
|
+
y2AxisMin,
|
|
1808
|
+
y2AxisMax
|
|
1809
|
+
);
|
|
1810
|
+
}
|
|
1811
|
+
return {};
|
|
1812
|
+
}, [
|
|
1813
|
+
y2Enabled,
|
|
1814
|
+
y2AxisTitle,
|
|
1815
|
+
y2AxisAbbreviation,
|
|
1816
|
+
y2AxisScale,
|
|
1817
|
+
y2IntegerUnits,
|
|
1818
|
+
y2AxisLabelVisibility,
|
|
1819
|
+
y2AxisMin,
|
|
1820
|
+
y2AxisMax
|
|
1821
|
+
]);
|
|
1460
1822
|
const uplotContainerElement = (0, react_exports.useRef)(null);
|
|
1461
1823
|
const seriesDataFormatted = [
|
|
1462
1824
|
filteredChartData.columns[0],
|
|
@@ -1472,9 +1834,25 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1472
1834
|
overlayFields,
|
|
1473
1835
|
y2Enabled,
|
|
1474
1836
|
nullValueMode,
|
|
1475
|
-
markerDisplay
|
|
1837
|
+
markerDisplay,
|
|
1838
|
+
lineDashStyle,
|
|
1839
|
+
lineDashStylesByField,
|
|
1840
|
+
stepPosition,
|
|
1841
|
+
stepPositionsByField
|
|
1476
1842
|
),
|
|
1477
|
-
[
|
|
1843
|
+
[
|
|
1844
|
+
yFields,
|
|
1845
|
+
y2Fields,
|
|
1846
|
+
lineWidth,
|
|
1847
|
+
overlayFields,
|
|
1848
|
+
y2Enabled,
|
|
1849
|
+
nullValueMode,
|
|
1850
|
+
markerDisplay,
|
|
1851
|
+
lineDashStyle,
|
|
1852
|
+
lineDashStylesByField,
|
|
1853
|
+
stepPosition,
|
|
1854
|
+
stepPositionsByField
|
|
1855
|
+
]
|
|
1478
1856
|
);
|
|
1479
1857
|
const chartingEventAnnotations = (0, react_exports.useMemo)(
|
|
1480
1858
|
() => getAnnotationsForCanvas({
|
|
@@ -1488,25 +1866,59 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1488
1866
|
() => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
|
|
1489
1867
|
[xScaleConfig, yScaleConfig, y2ScaleConfig]
|
|
1490
1868
|
);
|
|
1491
|
-
const
|
|
1869
|
+
const isSeriesCompare = legendMode === "seriesCompare";
|
|
1870
|
+
const legend = (0, react_exports.useMemo)(
|
|
1871
|
+
() => getLegend({
|
|
1872
|
+
legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
|
|
1873
|
+
isSeriesCompare,
|
|
1874
|
+
legendTruncation
|
|
1875
|
+
}),
|
|
1876
|
+
[legendDisplay, isSeriesCompare, legendTruncation]
|
|
1877
|
+
);
|
|
1492
1878
|
const handleChartClick = react_exports.useCallback(
|
|
1493
1879
|
(event) => {
|
|
1494
1880
|
if (onClick) {
|
|
1495
|
-
handleClick(event, onClick);
|
|
1881
|
+
handleClick(event, onClick, trellisKey, trellisSplitBy);
|
|
1496
1882
|
}
|
|
1497
1883
|
},
|
|
1498
|
-
[onClick]
|
|
1884
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
1499
1885
|
);
|
|
1500
1886
|
const handleChartLegendClick = react_exports.useCallback(
|
|
1501
1887
|
(event) => {
|
|
1502
1888
|
if (onClick) {
|
|
1503
|
-
handleLegendClick(event, onClick);
|
|
1889
|
+
handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
|
|
1504
1890
|
}
|
|
1505
1891
|
},
|
|
1506
|
-
[onClick]
|
|
1892
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
1893
|
+
);
|
|
1894
|
+
const handleChartRangeSelection = react_exports.useCallback(
|
|
1895
|
+
(range2) => {
|
|
1896
|
+
if (onSelect) {
|
|
1897
|
+
handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
1898
|
+
}
|
|
1899
|
+
},
|
|
1900
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
1901
|
+
);
|
|
1902
|
+
const handleChartRangeZoom = react_exports.useCallback(
|
|
1903
|
+
(range2) => {
|
|
1904
|
+
if (onSelect) {
|
|
1905
|
+
handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
1906
|
+
}
|
|
1907
|
+
},
|
|
1908
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
1909
|
+
);
|
|
1910
|
+
const xFieldToUse = xFieldFromProps || xField;
|
|
1911
|
+
const enableSearchZoom = react_exports.useMemo(
|
|
1912
|
+
() => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
|
|
1913
|
+
[eventHandlers, xFieldToUse]
|
|
1507
1914
|
);
|
|
1508
1915
|
const lastPayloadRef = react_exports.useRef(null);
|
|
1509
1916
|
const lastOriginalEventRef = react_exports.useRef(null);
|
|
1917
|
+
const previousMouseoverPayloadRef = react_exports.useRef(null);
|
|
1918
|
+
const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
|
|
1919
|
+
react_exports.useEffect(() => {
|
|
1920
|
+
additionalTooltipValuesRef.current = additionalTooltipValues;
|
|
1921
|
+
}, [additionalTooltipValues]);
|
|
1510
1922
|
const handleChartCrosshairChange = react_exports.useCallback(
|
|
1511
1923
|
(event) => {
|
|
1512
1924
|
if (onPointMouseOver || onPointMouseOut) {
|
|
@@ -1518,6 +1930,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1518
1930
|
payload: lastPayloadRef.current
|
|
1519
1931
|
});
|
|
1520
1932
|
}
|
|
1933
|
+
previousMouseoverPayloadRef.current = null;
|
|
1521
1934
|
return;
|
|
1522
1935
|
}
|
|
1523
1936
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
|
|
@@ -1525,25 +1938,36 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1525
1938
|
});
|
|
1526
1939
|
delete payload.seriesKey;
|
|
1527
1940
|
if (event.rowContext) {
|
|
1528
|
-
Object.
|
|
1529
|
-
payload
|
|
1530
|
-
|
|
1941
|
+
Object.assign(
|
|
1942
|
+
payload,
|
|
1943
|
+
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
1944
|
+
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
1945
|
+
return acc;
|
|
1946
|
+
}, {})
|
|
1947
|
+
);
|
|
1948
|
+
}
|
|
1949
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1950
|
+
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
1951
|
+
return;
|
|
1531
1952
|
}
|
|
1532
|
-
lastPayloadRef.current =
|
|
1953
|
+
lastPayloadRef.current = updatedPayload;
|
|
1533
1954
|
lastOriginalEventRef.current = event;
|
|
1955
|
+
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
1534
1956
|
if (onPointMouseOver) {
|
|
1535
1957
|
onPointMouseOver({
|
|
1536
1958
|
type: "point.mouseover",
|
|
1537
1959
|
originalEvent: event,
|
|
1538
|
-
payload
|
|
1960
|
+
payload: updatedPayload
|
|
1539
1961
|
});
|
|
1540
1962
|
}
|
|
1541
1963
|
}
|
|
1542
1964
|
},
|
|
1543
|
-
[onPointMouseOver, onPointMouseOut]
|
|
1965
|
+
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
|
|
1544
1966
|
);
|
|
1545
|
-
const
|
|
1546
|
-
|
|
1967
|
+
const dataKey = `${(_b = chartData.columns[0]) == null ? void 0 : _b[0]}-${(_c = chartData.columns[0]) == null ? void 0 : _c[chartData.columns[0].length - 1]}-${(_d = chartData.columns[0]) == null ? void 0 : _d.length}`;
|
|
1968
|
+
const memoizedChart = (0, react_exports.useMemo)(() => {
|
|
1969
|
+
const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
|
|
1970
|
+
return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
|
|
1547
1971
|
visualization_canvas_exports.TimeSeriesChart,
|
|
1548
1972
|
{
|
|
1549
1973
|
data: chartData,
|
|
@@ -1553,49 +1977,121 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1553
1977
|
seriesColorsByField,
|
|
1554
1978
|
seriesConfig: seriesOverrides,
|
|
1555
1979
|
legend,
|
|
1980
|
+
legendLabels,
|
|
1981
|
+
legendTruncation,
|
|
1982
|
+
isSeriesCompare: legendMode === "seriesCompare",
|
|
1983
|
+
maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
|
|
1556
1984
|
scaleConfig,
|
|
1557
1985
|
timestampFormat: "expanded",
|
|
1558
1986
|
onCrosshairClick: onClick ? handleChartClick : void 0,
|
|
1559
1987
|
onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
|
|
1560
1988
|
onSeriesClick: onClick ? handleChartLegendClick : void 0,
|
|
1989
|
+
onRangeSelection: handleChartRangeSelection,
|
|
1990
|
+
onRangeZoom: computedOnRangeZoom,
|
|
1991
|
+
serverSideZoom: enableSearchZoom,
|
|
1561
1992
|
userLocale,
|
|
1562
1993
|
events: chartingEventAnnotations,
|
|
1563
|
-
eventsConfig: { renderer: triangleEventAnnotationRenderer }
|
|
1994
|
+
eventsConfig: { renderer: triangleEventAnnotationRenderer },
|
|
1995
|
+
additionalTooltipValuesRef,
|
|
1996
|
+
showXMajorGridLines,
|
|
1997
|
+
showYMajorGridLines,
|
|
1998
|
+
showY2MajorGridLines,
|
|
1999
|
+
showYMinorGridLines,
|
|
2000
|
+
showY2MinorGridLines,
|
|
2001
|
+
showLineSmoothing,
|
|
2002
|
+
dataValuesDisplay,
|
|
2003
|
+
showXMajorTicks,
|
|
2004
|
+
xAxisMajorTickSize: xAxisMajorTickSizeNum,
|
|
2005
|
+
showYMajorTicks,
|
|
2006
|
+
showY2MajorTicks,
|
|
2007
|
+
yAxisMajorTickSize: yAxisMajorTickSizeNum,
|
|
2008
|
+
y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
|
|
2009
|
+
yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
|
|
2010
|
+
y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
|
|
2011
|
+
showYMinorTicks,
|
|
2012
|
+
showY2MinorTicks,
|
|
2013
|
+
yAxisMinorTickSize: yAxisMinorTickSizeNum,
|
|
2014
|
+
y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
|
|
2015
|
+
showYAxisWithZero,
|
|
2016
|
+
showY2AxisWithZero,
|
|
2017
|
+
showXAxisLine,
|
|
2018
|
+
showYAxisLine,
|
|
2019
|
+
showY2AxisLine,
|
|
2020
|
+
xAxisMaxLabelParts
|
|
1564
2021
|
}
|
|
1565
|
-
)
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
2022
|
+
));
|
|
2023
|
+
}, [
|
|
2024
|
+
onSelect,
|
|
2025
|
+
handleChartRangeZoom,
|
|
2026
|
+
dataKey,
|
|
2027
|
+
chartData,
|
|
2028
|
+
containerWidth,
|
|
2029
|
+
containerHeight,
|
|
2030
|
+
seriesColors,
|
|
2031
|
+
seriesColorsByField,
|
|
2032
|
+
seriesOverrides,
|
|
2033
|
+
legend,
|
|
2034
|
+
legendLabels,
|
|
2035
|
+
legendTruncation,
|
|
2036
|
+
scaleConfig,
|
|
2037
|
+
onClick,
|
|
2038
|
+
handleChartClick,
|
|
2039
|
+
onPointMouseOver,
|
|
2040
|
+
onPointMouseOut,
|
|
2041
|
+
handleChartCrosshairChange,
|
|
2042
|
+
handleChartLegendClick,
|
|
2043
|
+
handleChartRangeSelection,
|
|
2044
|
+
enableSearchZoom,
|
|
2045
|
+
userLocale,
|
|
2046
|
+
chartingEventAnnotations,
|
|
2047
|
+
showXMajorGridLines,
|
|
2048
|
+
showYMajorGridLines,
|
|
2049
|
+
showY2MajorGridLines,
|
|
2050
|
+
showYMinorGridLines,
|
|
2051
|
+
showY2MinorGridLines,
|
|
2052
|
+
showLineSmoothing,
|
|
2053
|
+
dataValuesDisplay,
|
|
2054
|
+
showXMajorTicks,
|
|
2055
|
+
xAxisMajorTickSizeNum,
|
|
2056
|
+
showYMajorTicks,
|
|
2057
|
+
showY2MajorTicks,
|
|
2058
|
+
yAxisMajorTickSizeNum,
|
|
2059
|
+
y2AxisMajorTickSizeNum,
|
|
2060
|
+
yAxisMajorTickIntervalNum,
|
|
2061
|
+
y2AxisMajorTickIntervalNum,
|
|
2062
|
+
showYMinorTicks,
|
|
2063
|
+
showY2MinorTicks,
|
|
2064
|
+
yAxisMinorTickSizeNum,
|
|
2065
|
+
y2AxisMinorTickSizeNum,
|
|
2066
|
+
showYAxisWithZero,
|
|
2067
|
+
showY2AxisWithZero,
|
|
2068
|
+
showXAxisLine,
|
|
2069
|
+
showYAxisLine,
|
|
2070
|
+
showY2AxisLine,
|
|
2071
|
+
legendMode,
|
|
2072
|
+
xAxisMaxLabelParts
|
|
2073
|
+
]);
|
|
1585
2074
|
const memoizedVisualization = (0, react_exports.useMemo)(() => {
|
|
1586
|
-
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
|
|
1587
|
-
}, [
|
|
1588
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
2075
|
+
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
|
|
2076
|
+
}, [bgColor, memoizedChart]);
|
|
2077
|
+
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
|
|
2078
|
+
TrellisTitle,
|
|
2079
|
+
{
|
|
2080
|
+
trellisKey,
|
|
2081
|
+
backgroundColor: bgColor,
|
|
2082
|
+
fontColor: defaultFontColor
|
|
2083
|
+
}
|
|
2084
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
1589
2085
|
TimeSeriesChartContainer,
|
|
1590
2086
|
{
|
|
1591
|
-
height,
|
|
2087
|
+
height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
|
|
1592
2088
|
width,
|
|
1593
2089
|
ref: uplotContainerElement,
|
|
1594
2090
|
"data-test": "timeseries-chart-wrapper"
|
|
1595
2091
|
},
|
|
1596
2092
|
/* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
|
|
1597
2093
|
memoizedVisualization
|
|
1598
|
-
);
|
|
2094
|
+
));
|
|
1599
2095
|
};
|
|
1600
2096
|
var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
|
|
1601
2097
|
|
|
@@ -1890,27 +2386,18 @@ var visualization_icons_exports = {};
|
|
|
1890
2386
|
__export(visualization_icons_exports, {
|
|
1891
2387
|
default: () => visualization_icons_default
|
|
1892
2388
|
});
|
|
1893
|
-
var
|
|
2389
|
+
var defaultImport28 = __toESM(require("@splunk/visualization-icons"));
|
|
1894
2390
|
__reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
|
|
1895
|
-
var visualization_icons_default = "default" in
|
|
2391
|
+
var visualization_icons_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
|
|
1896
2392
|
|
|
1897
2393
|
// esm-externals:@splunk/visualization-icons/placeholders
|
|
1898
2394
|
var placeholders_exports = {};
|
|
1899
2395
|
__export(placeholders_exports, {
|
|
1900
2396
|
default: () => placeholders_default
|
|
1901
2397
|
});
|
|
1902
|
-
var
|
|
2398
|
+
var defaultImport29 = __toESM(require("@splunk/visualization-icons/placeholders"));
|
|
1903
2399
|
__reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
|
|
1904
|
-
var placeholders_default = "default" in
|
|
1905
|
-
|
|
1906
|
-
// esm-externals:@splunk/visualization-schemas
|
|
1907
|
-
var visualization_schemas_exports = {};
|
|
1908
|
-
__export(visualization_schemas_exports, {
|
|
1909
|
-
default: () => visualization_schemas_default
|
|
1910
|
-
});
|
|
1911
|
-
var defaultImport29 = __toESM(require("@splunk/visualization-schemas"));
|
|
1912
|
-
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
1913
|
-
var visualization_schemas_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
|
|
2400
|
+
var placeholders_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
|
|
1914
2401
|
|
|
1915
2402
|
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
1916
2403
|
var configUtils_exports = {};
|
|
@@ -2829,30 +3316,51 @@ var PureEvents = (props) => {
|
|
|
2829
3316
|
const [fieldSummaryAnchor, setFieldSummaryAnchor] = react_exports.useState(null);
|
|
2830
3317
|
const [timeValue, setTimeValue] = react_exports.useState(null);
|
|
2831
3318
|
const [timeFieldAnchor, setTimeFieldAnchor] = react_exports.useState(null);
|
|
2832
|
-
|
|
2833
|
-
const
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
});
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
}
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
3319
|
+
react_exports.useEffect(() => {
|
|
3320
|
+
const isPopoverOpen = fieldSummaryAnchor || timeFieldAnchor;
|
|
3321
|
+
if (!isPopoverOpen) return void 0;
|
|
3322
|
+
const handleScroll = () => {
|
|
3323
|
+
if (fieldSummaryAnchor) {
|
|
3324
|
+
setFieldSummaryField(null);
|
|
3325
|
+
setFieldSummaryAnchor(null);
|
|
3326
|
+
}
|
|
3327
|
+
if (timeFieldAnchor) {
|
|
3328
|
+
setTimeValue(null);
|
|
3329
|
+
setTimeFieldAnchor(null);
|
|
3330
|
+
}
|
|
3331
|
+
};
|
|
3332
|
+
window.addEventListener("scroll", handleScroll, { capture: true, passive: true });
|
|
3333
|
+
return () => {
|
|
3334
|
+
window.removeEventListener("scroll", handleScroll, { capture: true });
|
|
3335
|
+
};
|
|
3336
|
+
}, [fieldSummaryAnchor, timeFieldAnchor]);
|
|
3337
|
+
const createEventActionComponent = react_exports.useCallback(
|
|
3338
|
+
(eventActionProps, onMenuItemClick, label) => {
|
|
3339
|
+
const { rowIndex, pageNumber, event } = eventActionProps;
|
|
3340
|
+
const tokenReplacementMap = generateTokenReplacementMap({
|
|
3341
|
+
dataSources,
|
|
3342
|
+
rowIndex,
|
|
3343
|
+
pageNumber,
|
|
3344
|
+
event
|
|
3345
|
+
});
|
|
3346
|
+
const replacedLabel = replaceTokens({
|
|
3347
|
+
text: label,
|
|
3348
|
+
tokenReplacementMap,
|
|
3349
|
+
allowSpecialParametersEscape: false,
|
|
3350
|
+
allowFieldValuesEscape: false
|
|
3351
|
+
});
|
|
3352
|
+
const truncatedLabel = truncateString(replacedLabel);
|
|
3353
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
3354
|
+
Menu_default.Item,
|
|
3355
|
+
{
|
|
3356
|
+
key: `event-action-${truncatedLabel}`,
|
|
3357
|
+
onClick: (e) => onMenuItemClick(e, eventActionProps, tokenReplacementMap)
|
|
3358
|
+
},
|
|
3359
|
+
truncatedLabel
|
|
3360
|
+
);
|
|
3361
|
+
},
|
|
3362
|
+
[dataSources]
|
|
3363
|
+
);
|
|
2856
3364
|
const renderEventActions = react_exports.useMemo(
|
|
2857
3365
|
() => !Array.isArray(eventActions) ? [] : eventActions.map(({ eventType, label, eventtypeValues = [], fieldFilters = [] }) => {
|
|
2858
3366
|
const onMenuItemClick = (e, eventActionProps, tokenReplacementMap) => {
|
|
@@ -2872,33 +3380,36 @@ var PureEvents = (props) => {
|
|
|
2872
3380
|
eventActionComponent
|
|
2873
3381
|
};
|
|
2874
3382
|
}),
|
|
2875
|
-
[eventActions]
|
|
3383
|
+
[eventActions, createEventActionComponent, onEventTrigger]
|
|
3384
|
+
);
|
|
3385
|
+
const setFieldActionsMapItem = react_exports.useCallback(
|
|
3386
|
+
(currentFieldActions, currentFieldName) => currentFieldActions.map(({ eventType, label, eventtypeValues = [] }) => {
|
|
3387
|
+
const onMenuItemClick = (e, fieldActionProps, tokenReplacementMap) => {
|
|
3388
|
+
const payload = convertToPayloadFormat(fieldActionProps.event, {
|
|
3389
|
+
name: fieldActionProps.field,
|
|
3390
|
+
value: fieldActionProps.value,
|
|
3391
|
+
tokenReplacementMap
|
|
3392
|
+
});
|
|
3393
|
+
onEventTrigger({
|
|
3394
|
+
originalEvent: e,
|
|
3395
|
+
type: eventType,
|
|
3396
|
+
payload
|
|
3397
|
+
});
|
|
3398
|
+
};
|
|
3399
|
+
const fieldActionComponent = (fieldActionProps) => createFieldActionComponent(
|
|
3400
|
+
fieldActionProps,
|
|
3401
|
+
dataSources,
|
|
3402
|
+
label,
|
|
3403
|
+
currentFieldName,
|
|
3404
|
+
onMenuItemClick
|
|
3405
|
+
);
|
|
3406
|
+
return {
|
|
3407
|
+
eventtypeValues,
|
|
3408
|
+
fieldActionComponent
|
|
3409
|
+
};
|
|
3410
|
+
}),
|
|
3411
|
+
[dataSources, onEventTrigger]
|
|
2876
3412
|
);
|
|
2877
|
-
const setFieldActionsMapItem = (currentFieldActions, currentFieldName) => currentFieldActions.map(({ eventType, label, eventtypeValues = [] }) => {
|
|
2878
|
-
const onMenuItemClick = (e, fieldActionProps, tokenReplacementMap) => {
|
|
2879
|
-
const payload = convertToPayloadFormat(fieldActionProps.event, {
|
|
2880
|
-
name: fieldActionProps.field,
|
|
2881
|
-
value: fieldActionProps.value,
|
|
2882
|
-
tokenReplacementMap
|
|
2883
|
-
});
|
|
2884
|
-
onEventTrigger({
|
|
2885
|
-
originalEvent: e,
|
|
2886
|
-
type: eventType,
|
|
2887
|
-
payload
|
|
2888
|
-
});
|
|
2889
|
-
};
|
|
2890
|
-
const fieldActionComponent = (fieldActionProps) => createFieldActionComponent(
|
|
2891
|
-
fieldActionProps,
|
|
2892
|
-
dataSources,
|
|
2893
|
-
label,
|
|
2894
|
-
currentFieldName,
|
|
2895
|
-
onMenuItemClick
|
|
2896
|
-
);
|
|
2897
|
-
return {
|
|
2898
|
-
eventtypeValues,
|
|
2899
|
-
fieldActionComponent
|
|
2900
|
-
};
|
|
2901
|
-
});
|
|
2902
3413
|
const renderFieldActions = react_exports.useMemo(() => {
|
|
2903
3414
|
const fieldActionsMap = {};
|
|
2904
3415
|
Object.entries(fieldActions).forEach(
|
|
@@ -2910,7 +3421,7 @@ var PureEvents = (props) => {
|
|
|
2910
3421
|
}
|
|
2911
3422
|
);
|
|
2912
3423
|
return fieldActionsMap;
|
|
2913
|
-
}, [fieldActions]);
|
|
3424
|
+
}, [fieldActions, setFieldActionsMapItem]);
|
|
2914
3425
|
const suiEventsViewerOptions = {
|
|
2915
3426
|
renderEventActions,
|
|
2916
3427
|
renderFieldActions,
|