@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/Bar.js
CHANGED
|
@@ -248,6 +248,7 @@ var DefaultVizActionHandler = class {
|
|
|
248
248
|
};
|
|
249
249
|
|
|
250
250
|
// src/common/utils/dataUtils.ts
|
|
251
|
+
var getFieldName = (field) => typeof field === "string" ? field : field.name;
|
|
251
252
|
var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
|
|
252
253
|
const dataLength = data.length;
|
|
253
254
|
const downsampledIndices = [];
|
|
@@ -421,9 +422,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
|
|
|
421
422
|
let xColumn = [];
|
|
422
423
|
const yColumns = [];
|
|
423
424
|
const canDownsample = !ds.data.fields.some((field, index) => {
|
|
424
|
-
var _a
|
|
425
|
-
const fieldName = (
|
|
426
|
-
const fieldType = (
|
|
425
|
+
var _a;
|
|
426
|
+
const fieldName = getFieldName(field);
|
|
427
|
+
const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
|
|
427
428
|
const column = ds.data.columns[index];
|
|
428
429
|
let hasDisplayedColumnThatCantBeDownsampled = false;
|
|
429
430
|
if (fieldName === xField) {
|
|
@@ -627,6 +628,7 @@ var Charting = (props) => {
|
|
|
627
628
|
const timezone = (0, react_exports.useContext)(TimezoneContext_default);
|
|
628
629
|
const selectChartEvent = (0, react_exports.useRef)(null);
|
|
629
630
|
const trellisEnabled = useTrellisEnabled(props.splitByLayout);
|
|
631
|
+
const isResizing = (0, react_exports.useRef)(false);
|
|
630
632
|
const drawChartRef = (0, react_exports.useRef)(() => {
|
|
631
633
|
});
|
|
632
634
|
const debouncedDrawChart = (0, react_exports.useMemo)(
|
|
@@ -725,6 +727,9 @@ var Charting = (props) => {
|
|
|
725
727
|
recalculateDownsamplingThreshold();
|
|
726
728
|
}, [recalculateDownsamplingThreshold]);
|
|
727
729
|
const handleSelect = useEventCallback_default((chartEvent) => {
|
|
730
|
+
if (isResizing.current) {
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
728
733
|
selectChartEvent.current = chartEvent;
|
|
729
734
|
recalculateDownsamplingThreshold();
|
|
730
735
|
const payload = appendTrellisToPayload(
|
|
@@ -859,6 +864,14 @@ var Charting = (props) => {
|
|
|
859
864
|
}
|
|
860
865
|
if (chart.current) {
|
|
861
866
|
if (Math.round(chart.current.height) !== Math.round(computedHeight) || Math.round(chart.current.width) !== Math.round(computedWidth)) {
|
|
867
|
+
isResizing.current = true;
|
|
868
|
+
queueMicrotask(() => {
|
|
869
|
+
try {
|
|
870
|
+
isResizing.current = false;
|
|
871
|
+
} catch (e) {
|
|
872
|
+
(0, lodash_exports.noop)(e);
|
|
873
|
+
}
|
|
874
|
+
});
|
|
862
875
|
chart.current.resize(computedWidth, computedHeight);
|
|
863
876
|
}
|
|
864
877
|
}
|
|
@@ -1020,6 +1033,9 @@ var isTrellisEnabled = ({ options, featureFlags }) => {
|
|
|
1020
1033
|
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1021
1034
|
return isTrellisFeatureFlagOn({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1022
1035
|
};
|
|
1036
|
+
var isAcceleratedRenderFeatureFlagOn = ({ featureFlags }) => {
|
|
1037
|
+
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableAcceleratedRender);
|
|
1038
|
+
};
|
|
1023
1039
|
var AxesChartDataConfig = {
|
|
1024
1040
|
label: (0, i18n_exports._)("Data configurations"),
|
|
1025
1041
|
layout: [
|
|
@@ -1153,9 +1169,6 @@ var AxesChartDataConfigBubble = {
|
|
|
1153
1169
|
}
|
|
1154
1170
|
])
|
|
1155
1171
|
};
|
|
1156
|
-
var isAcceleratedRenderFeatureFlagOn = ({ featureFlags }) => {
|
|
1157
|
-
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableAcceleratedRender);
|
|
1158
|
-
};
|
|
1159
1172
|
var AcceleratedRenderEditorLayout = [
|
|
1160
1173
|
[
|
|
1161
1174
|
{
|
|
@@ -1165,10 +1178,9 @@ var AcceleratedRenderEditorLayout = [
|
|
|
1165
1178
|
showEditor: isAcceleratedRenderFeatureFlagOn,
|
|
1166
1179
|
editorProps: {
|
|
1167
1180
|
help: (0, i18n_exports._)(
|
|
1168
|
-
"Render visualizations faster for large datasets.
|
|
1181
|
+
"Render visualizations faster for large datasets. Split series is not available in this mode."
|
|
1169
1182
|
),
|
|
1170
1183
|
helpFormat: "under"
|
|
1171
|
-
// TODO: uncomment and replace link with real link (SCP-75907)
|
|
1172
1184
|
// helpTextLink: {
|
|
1173
1185
|
// href: 'https://splunkui.splunk.com/Packages/visualizations/Overview',
|
|
1174
1186
|
// label: 'Learn More.',
|
|
@@ -1323,6 +1335,10 @@ var isTrellisEnabled3 = ({ options, featureFlags }) => {
|
|
|
1323
1335
|
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1324
1336
|
return isTrellisFeatureFlagOn3({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1325
1337
|
};
|
|
1338
|
+
var isAcceleratedRenderEnabled = ({ options, featureFlags }) => {
|
|
1339
|
+
const { acceleratedRender } = options;
|
|
1340
|
+
return isAcceleratedRenderFeatureFlagOn({ featureFlags }) && acceleratedRender;
|
|
1341
|
+
};
|
|
1326
1342
|
var AxesChartDataDisplayBase = {
|
|
1327
1343
|
label: (0, i18n_exports._)("Data display"),
|
|
1328
1344
|
layout: [
|
|
@@ -1383,7 +1399,8 @@ var AxesChartDataDisplayBase = {
|
|
|
1383
1399
|
{
|
|
1384
1400
|
label: (0, i18n_exports._)("Split series"),
|
|
1385
1401
|
option: "showSplitSeries",
|
|
1386
|
-
editor: "editor.toggle"
|
|
1402
|
+
editor: "editor.toggle",
|
|
1403
|
+
isDisabled: isAcceleratedRenderEnabled
|
|
1387
1404
|
}
|
|
1388
1405
|
],
|
|
1389
1406
|
[
|
|
@@ -1391,7 +1408,23 @@ var AxesChartDataDisplayBase = {
|
|
|
1391
1408
|
label: (0, i18n_exports._)("Independent y-axis for split series"),
|
|
1392
1409
|
option: "showIndependentYRanges",
|
|
1393
1410
|
editor: "editor.checkbox",
|
|
1394
|
-
showEditor: ({ options }) => options.showSplitSeries
|
|
1411
|
+
showEditor: ({ options, featureFlags }) => options.showSplitSeries && !isAcceleratedRenderEnabled({ options, featureFlags })
|
|
1412
|
+
}
|
|
1413
|
+
],
|
|
1414
|
+
[
|
|
1415
|
+
{
|
|
1416
|
+
label: (0, i18n_exports._)("Step position"),
|
|
1417
|
+
option: "stepPosition",
|
|
1418
|
+
editor: "editor.radioBar",
|
|
1419
|
+
editorProps: {
|
|
1420
|
+
values: [
|
|
1421
|
+
{ label: (0, i18n_exports._)("Off"), value: "off" },
|
|
1422
|
+
{ label: (0, i18n_exports._)("Before"), value: "before" },
|
|
1423
|
+
{ label: (0, i18n_exports._)("After"), value: "after" }
|
|
1424
|
+
]
|
|
1425
|
+
},
|
|
1426
|
+
showEditor: ({ options, featureFlags }) => isAcceleratedRenderEnabled({ options, featureFlags })
|
|
1427
|
+
// step position is only supported when accelerated render is enabled
|
|
1395
1428
|
}
|
|
1396
1429
|
],
|
|
1397
1430
|
...TimechartTrellisEditorConfig
|
|
@@ -1851,7 +1884,7 @@ var AxesChartLegendWithTrellisAndMode = ({
|
|
|
1851
1884
|
{ label: (0, i18n_exports._)("Bottom"), value: "bottom" },
|
|
1852
1885
|
{ label: (0, i18n_exports._)("Off"), value: "off" }
|
|
1853
1886
|
],
|
|
1854
|
-
tooltip: showLegendTooltip
|
|
1887
|
+
tooltip: showLegendTooltip ? (0, i18n_exports._)('Legend mode must be "Standard" to configure legend display') : void 0
|
|
1855
1888
|
},
|
|
1856
1889
|
isDisabled: showLegendTooltip ? ({ options }) => options.legendMode === "seriesCompare" : void 0,
|
|
1857
1890
|
overrideDefaultValue: ({ options }) => (options == null ? void 0 : options.splitByLayout) === "trellis" ? "off" : "right"
|
|
@@ -2749,7 +2782,7 @@ var Cover = styled_components_default.div`
|
|
|
2749
2782
|
bottom: 0;
|
|
2750
2783
|
`;
|
|
2751
2784
|
var Blocker = styled_components_default.div.attrs({
|
|
2752
|
-
"data-splunk-visualization-version": "28.
|
|
2785
|
+
"data-splunk-visualization-version": "28.5.0 - b192418b7"
|
|
2753
2786
|
})`
|
|
2754
2787
|
position: relative;
|
|
2755
2788
|
width: 100%;
|
|
@@ -2830,7 +2863,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
2830
2863
|
FixSizeItem,
|
|
2831
2864
|
{
|
|
2832
2865
|
"data-test": "fix-size-item",
|
|
2833
|
-
"data-splunk-visualization-version": "28.
|
|
2866
|
+
"data-splunk-visualization-version": "28.5.0 - b192418b7",
|
|
2834
2867
|
width,
|
|
2835
2868
|
height,
|
|
2836
2869
|
backgroundColor
|
|
@@ -3106,7 +3139,7 @@ var trellisUtils_default = "default" in defaultImport34 ? defaultImport34.defaul
|
|
|
3106
3139
|
var AGGREGATIONS = "aggregations";
|
|
3107
3140
|
var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
3108
3141
|
var _a, _b, _c, _d;
|
|
3109
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3142
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3110
3143
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3111
3144
|
let splitDataSources = null;
|
|
3112
3145
|
let errorCode = null;
|
|
@@ -3127,7 +3160,7 @@ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
|
3127
3160
|
}
|
|
3128
3161
|
return { splitDataSources, errorCode };
|
|
3129
3162
|
};
|
|
3130
|
-
var toFieldEntries = (fields) => {
|
|
3163
|
+
var toFieldEntries = (fields = []) => {
|
|
3131
3164
|
return fields.map((field) => {
|
|
3132
3165
|
if (typeof field === "string") {
|
|
3133
3166
|
return { name: field };
|
|
@@ -3142,7 +3175,7 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
3142
3175
|
let splitDataSources = null;
|
|
3143
3176
|
let splitByFields = [];
|
|
3144
3177
|
let errorCode = null;
|
|
3145
|
-
if (
|
|
3178
|
+
if (fields.length > 0) {
|
|
3146
3179
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
3147
3180
|
}
|
|
3148
3181
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -3180,12 +3213,12 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
3180
3213
|
};
|
|
3181
3214
|
var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
3182
3215
|
var _a, _b, _c, _d;
|
|
3183
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3216
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3184
3217
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3185
3218
|
let splitDataSources = null;
|
|
3186
3219
|
let splitByFields = [];
|
|
3187
3220
|
let errorCode = null;
|
|
3188
|
-
if (
|
|
3221
|
+
if (fields.length > 0) {
|
|
3189
3222
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
|
|
3190
3223
|
}
|
|
3191
3224
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -3209,12 +3242,12 @@ var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
|
3209
3242
|
};
|
|
3210
3243
|
var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
3211
3244
|
var _a, _b, _c, _d, _e;
|
|
3212
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3245
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3213
3246
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3214
3247
|
let splitDataSources = null;
|
|
3215
3248
|
let splitByFields = [];
|
|
3216
3249
|
let errorCode = null;
|
|
3217
|
-
if (
|
|
3250
|
+
if (fields.length > 0) {
|
|
3218
3251
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
3219
3252
|
}
|
|
3220
3253
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -3230,16 +3263,14 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
|
3230
3263
|
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
3231
3264
|
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
3232
3265
|
);
|
|
3233
|
-
splitDataSources[val].primary.data.fields = [
|
|
3234
|
-
{ name: fields[0].name },
|
|
3235
|
-
...dataSourceKeys.map((k) => ({
|
|
3236
|
-
name: k
|
|
3237
|
-
}))
|
|
3238
|
-
];
|
|
3266
|
+
splitDataSources[val].primary.data.fields = [{ name: fields[0].name }];
|
|
3239
3267
|
splitDataSources[val].primary.data.columns = [[...columns[0]]];
|
|
3240
3268
|
dataSourceKeys.forEach((dsKey) => {
|
|
3241
3269
|
fields.forEach((field, idx) => {
|
|
3242
3270
|
if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
|
|
3271
|
+
splitDataSources[val].primary.data.fields.push({
|
|
3272
|
+
name: dsKey
|
|
3273
|
+
});
|
|
3243
3274
|
splitDataSources[val].primary.data.columns.push([...columns[idx]]);
|
|
3244
3275
|
}
|
|
3245
3276
|
});
|
|
@@ -3252,12 +3283,12 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
|
3252
3283
|
};
|
|
3253
3284
|
var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
3254
3285
|
var _a, _b, _c, _d;
|
|
3255
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3286
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3256
3287
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3257
3288
|
let splitDataSources = null;
|
|
3258
3289
|
let splitByFields = [];
|
|
3259
3290
|
let errorCode = null;
|
|
3260
|
-
if (
|
|
3291
|
+
if (fields.length > 0) {
|
|
3261
3292
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
3262
3293
|
}
|
|
3263
3294
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -3345,17 +3376,15 @@ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
|
3345
3376
|
};
|
|
3346
3377
|
var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
|
|
3347
3378
|
var _a, _b, _c, _d, _e, _f;
|
|
3348
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3379
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3349
3380
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3350
3381
|
let splitDataSources = null;
|
|
3351
3382
|
let splitByFields = [];
|
|
3352
3383
|
let errorCode = null;
|
|
3353
|
-
if (
|
|
3384
|
+
if (fields.length > 0) {
|
|
3354
3385
|
splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
|
|
3355
3386
|
}
|
|
3356
|
-
const splitByIndex = fields
|
|
3357
|
-
(field) => field === splitBy || field.name === splitBy
|
|
3358
|
-
);
|
|
3387
|
+
const splitByIndex = fields.findIndex((field) => field.name === splitBy);
|
|
3359
3388
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
3360
3389
|
const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
|
|
3361
3390
|
splitDataSources = {};
|
|
@@ -3597,6 +3626,16 @@ function constructAdditionalTooltipFieldsMap({ fields, columns, additionalToolti
|
|
|
3597
3626
|
});
|
|
3598
3627
|
return map;
|
|
3599
3628
|
}
|
|
3629
|
+
var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
|
|
3630
|
+
const rangeSelectEventHandler = eventHandlers.find(
|
|
3631
|
+
(eventHandler) => {
|
|
3632
|
+
var _a;
|
|
3633
|
+
return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
|
|
3634
|
+
}
|
|
3635
|
+
);
|
|
3636
|
+
const xAxisIsTime = xField === "_time";
|
|
3637
|
+
return !!rangeSelectEventHandler && xAxisIsTime;
|
|
3638
|
+
};
|
|
3600
3639
|
var canvasSupportedTimeSeriesCharts = ["splunk.line"];
|
|
3601
3640
|
var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
|
|
3602
3641
|
return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
|
|
@@ -3617,17 +3656,34 @@ var filterChartDataFromInternalFields = (chartData) => {
|
|
|
3617
3656
|
var convert2DArrayToNumbers = (arr) => {
|
|
3618
3657
|
return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
|
|
3619
3658
|
};
|
|
3620
|
-
var
|
|
3621
|
-
|
|
3659
|
+
var parseAxisValue = (val) => {
|
|
3660
|
+
if (val === void 0 || val === null || val === "auto" || val === "") {
|
|
3661
|
+
return void 0;
|
|
3662
|
+
}
|
|
3663
|
+
const num = typeof val === "number" ? val : Number.parseFloat(val);
|
|
3664
|
+
return Number.isNaN(num) ? void 0 : num;
|
|
3665
|
+
};
|
|
3666
|
+
var parseXAxisLineVisibility = (visibility) => {
|
|
3667
|
+
if (visibility === "hide") return false;
|
|
3668
|
+
if (visibility === "show") return true;
|
|
3669
|
+
return void 0;
|
|
3670
|
+
};
|
|
3622
3671
|
var getLegend = (props) => {
|
|
3623
3672
|
const legendPlacement = props == null ? void 0 : props.legendDisplay;
|
|
3673
|
+
const { isSeriesCompare, legendTruncation } = props;
|
|
3674
|
+
const commonLegendProps = {
|
|
3675
|
+
center: true,
|
|
3676
|
+
fontSize: 12,
|
|
3677
|
+
largerTiles: true,
|
|
3678
|
+
hideSeriesValue: !isSeriesCompare,
|
|
3679
|
+
// Show values if in seriesCompare mode
|
|
3680
|
+
legendTruncation
|
|
3681
|
+
};
|
|
3624
3682
|
switch (legendPlacement) {
|
|
3625
3683
|
case "off":
|
|
3626
3684
|
return false;
|
|
3627
3685
|
case "left":
|
|
3628
|
-
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
|
|
3629
|
-
width: SideLegendWidth
|
|
3630
|
-
}, commonLegendProps));
|
|
3686
|
+
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
3631
3687
|
case "bottom":
|
|
3632
3688
|
return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
|
|
3633
3689
|
wrap: true
|
|
@@ -3637,9 +3693,7 @@ var getLegend = (props) => {
|
|
|
3637
3693
|
wrap: true
|
|
3638
3694
|
}, commonLegendProps));
|
|
3639
3695
|
default:
|
|
3640
|
-
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
|
|
3641
|
-
width: SideLegendWidth
|
|
3642
|
-
}, commonLegendProps));
|
|
3696
|
+
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
3643
3697
|
}
|
|
3644
3698
|
};
|
|
3645
3699
|
var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
|
|
@@ -3674,22 +3728,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
|
|
|
3674
3728
|
const end = axisTitle.slice(-halfChars);
|
|
3675
3729
|
return `${start}...${end}`;
|
|
3676
3730
|
};
|
|
3677
|
-
var
|
|
3731
|
+
var getFieldName2 = (field) => {
|
|
3678
3732
|
const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
|
|
3679
3733
|
return fieldName;
|
|
3680
3734
|
};
|
|
3681
3735
|
var getFieldNames = (fields) => {
|
|
3682
|
-
return fields.map((field) =>
|
|
3736
|
+
return fields.map((field) => getFieldName2(field));
|
|
3683
3737
|
};
|
|
3684
|
-
var getXScaleConfig = (label, xAxisLabelVisibility) => {
|
|
3738
|
+
var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
|
|
3685
3739
|
const xConfig = { x: {} };
|
|
3686
3740
|
xConfig.x.label = label;
|
|
3687
3741
|
if (xAxisLabelVisibility === "hide") {
|
|
3688
3742
|
xConfig.x.hideLabels = true;
|
|
3689
3743
|
}
|
|
3744
|
+
if (xAxisLabelRotation !== void 0) {
|
|
3745
|
+
xConfig.x.labelRotation = xAxisLabelRotation;
|
|
3746
|
+
}
|
|
3690
3747
|
return xConfig;
|
|
3691
3748
|
};
|
|
3692
|
-
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
|
|
3749
|
+
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
|
|
3693
3750
|
const scaleType = yAxisScale != null ? yAxisScale : "linear";
|
|
3694
3751
|
const yConfig = { y: {} };
|
|
3695
3752
|
yConfig.y.label = label;
|
|
@@ -3697,34 +3754,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
|
|
|
3697
3754
|
if (yAxisAbbreviation !== "none") {
|
|
3698
3755
|
yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
|
|
3699
3756
|
}
|
|
3700
|
-
if (yAxisAbbreviation
|
|
3701
|
-
yConfig.y.width = 55;
|
|
3702
|
-
} else {
|
|
3757
|
+
if (yAxisAbbreviation !== "none") {
|
|
3703
3758
|
yConfig.y.width = label && label.length > 0 ? 30 : 10;
|
|
3704
3759
|
}
|
|
3705
3760
|
if (yAxisLabelVisibility === "hide") {
|
|
3706
3761
|
yConfig.y.hideLabels = true;
|
|
3707
3762
|
}
|
|
3763
|
+
if (yAxisMin !== void 0 || yAxisMax !== void 0) {
|
|
3764
|
+
yConfig.y.range = (u, dataMin, dataMax) => {
|
|
3765
|
+
const min = yAxisMin != null ? yAxisMin : dataMin;
|
|
3766
|
+
const max = yAxisMax != null ? yAxisMax : dataMax;
|
|
3767
|
+
return [min, max];
|
|
3768
|
+
};
|
|
3769
|
+
}
|
|
3708
3770
|
return yConfig;
|
|
3709
3771
|
};
|
|
3710
|
-
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
|
|
3772
|
+
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
|
|
3711
3773
|
const y2Config = { y2: {} };
|
|
3712
3774
|
const scaleType = axisScale != null ? axisScale : "linear";
|
|
3713
3775
|
y2Config.y2.label = label;
|
|
3714
3776
|
y2Config.y2.side = "right";
|
|
3715
|
-
y2Config.y2.showGrid = false;
|
|
3716
3777
|
y2Config.y2.type = scaleType;
|
|
3717
3778
|
if (axisAbbreviation !== "none") {
|
|
3718
3779
|
y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
|
|
3780
|
+
y2Config.y2.width = label && label.length > 0 ? 50 : 10;
|
|
3719
3781
|
} else if (roundAxisLabelsToInteger) {
|
|
3720
3782
|
y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
|
|
3721
3783
|
}
|
|
3722
3784
|
if (y2AxisLabelVisibility === "hide") {
|
|
3723
3785
|
y2Config.y2.hideLabels = true;
|
|
3724
3786
|
}
|
|
3787
|
+
if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
|
|
3788
|
+
y2Config.y2.range = (u, dataMin, dataMax) => {
|
|
3789
|
+
const min = y2AxisMin != null ? y2AxisMin : dataMin;
|
|
3790
|
+
const max = y2AxisMax != null ? y2AxisMax : dataMax;
|
|
3791
|
+
return [min, max];
|
|
3792
|
+
};
|
|
3793
|
+
}
|
|
3725
3794
|
return y2Config;
|
|
3726
3795
|
};
|
|
3727
|
-
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
|
|
3796
|
+
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
|
|
3728
3797
|
const seriesConfig = {};
|
|
3729
3798
|
let spanGaps;
|
|
3730
3799
|
let replaceNullsWithZero;
|
|
@@ -3751,6 +3820,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
3751
3820
|
);
|
|
3752
3821
|
if (shouldAssignToY2) {
|
|
3753
3822
|
seriesConfig[field].overrides.scale = "y2";
|
|
3823
|
+
} else {
|
|
3824
|
+
seriesConfig[field].overrides.scale = "y";
|
|
3754
3825
|
}
|
|
3755
3826
|
}
|
|
3756
3827
|
if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
|
|
@@ -3759,12 +3830,50 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
3759
3830
|
if (markerDisplay !== void 0) {
|
|
3760
3831
|
seriesConfig[field].markerDisplay = markerDisplay;
|
|
3761
3832
|
}
|
|
3833
|
+
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
3834
|
+
if (fieldDashStyle) {
|
|
3835
|
+
seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
3836
|
+
}
|
|
3837
|
+
const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
|
|
3838
|
+
const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
|
|
3839
|
+
if (fieldStepPosition && fieldStepPosition !== "off") {
|
|
3840
|
+
seriesConfig[field].stepPosition = fieldStepPosition;
|
|
3841
|
+
}
|
|
3762
3842
|
if (replaceNullsWithZero !== void 0) {
|
|
3763
3843
|
seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
|
|
3764
3844
|
}
|
|
3765
3845
|
});
|
|
3766
3846
|
return seriesConfig;
|
|
3767
3847
|
};
|
|
3848
|
+
var findRangeIndices = (xData, startValue, endValue) => {
|
|
3849
|
+
let startXIndex = -1;
|
|
3850
|
+
let endXIndex = -1;
|
|
3851
|
+
const xDataEpoch = xData.map((val) => {
|
|
3852
|
+
if (typeof val === "string") {
|
|
3853
|
+
return new Date(val).getTime() / 1e3;
|
|
3854
|
+
}
|
|
3855
|
+
return val;
|
|
3856
|
+
});
|
|
3857
|
+
for (let i = 0; i < xDataEpoch.length; i += 1) {
|
|
3858
|
+
if (xDataEpoch[i] >= startValue) {
|
|
3859
|
+
startXIndex = i;
|
|
3860
|
+
break;
|
|
3861
|
+
}
|
|
3862
|
+
}
|
|
3863
|
+
if (startXIndex === -1 && xDataEpoch.length > 0) {
|
|
3864
|
+
startXIndex = xDataEpoch.length - 1;
|
|
3865
|
+
}
|
|
3866
|
+
for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
|
|
3867
|
+
if (xDataEpoch[i] <= endValue) {
|
|
3868
|
+
endXIndex = i;
|
|
3869
|
+
break;
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
if (endXIndex === -1 && xDataEpoch.length > 0) {
|
|
3873
|
+
endXIndex = 0;
|
|
3874
|
+
}
|
|
3875
|
+
return { startXIndex, endXIndex };
|
|
3876
|
+
};
|
|
3768
3877
|
|
|
3769
3878
|
// src/common/TimeSeriesChartWrapper.tsx
|
|
3770
3879
|
var TimeSeriesChartContainer = styled_components_default.div`
|
|
@@ -3775,38 +3884,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
|
|
|
3775
3884
|
position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
|
|
3776
3885
|
}
|
|
3777
3886
|
`;
|
|
3778
|
-
var
|
|
3887
|
+
var appendTrellisToPayload2 = (payload, trellisKey, trellisSplitBy) => {
|
|
3888
|
+
const result = __spreadValues({}, payload);
|
|
3889
|
+
if (trellisSplitBy) {
|
|
3890
|
+
result["trellis.name"] = trellisSplitBy;
|
|
3891
|
+
}
|
|
3892
|
+
if (trellisKey) {
|
|
3893
|
+
result["trellis.value"] = trellisKey;
|
|
3894
|
+
}
|
|
3895
|
+
return result;
|
|
3896
|
+
};
|
|
3897
|
+
var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
|
|
3898
|
+
if (!previousPayload) {
|
|
3899
|
+
return true;
|
|
3900
|
+
}
|
|
3901
|
+
if (currentPayload.index !== previousPayload.index) {
|
|
3902
|
+
return true;
|
|
3903
|
+
}
|
|
3904
|
+
if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
|
|
3905
|
+
return true;
|
|
3906
|
+
}
|
|
3907
|
+
if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
|
|
3908
|
+
return true;
|
|
3909
|
+
}
|
|
3910
|
+
if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
|
|
3911
|
+
return true;
|
|
3912
|
+
}
|
|
3913
|
+
return false;
|
|
3914
|
+
};
|
|
3915
|
+
var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
3779
3916
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
|
|
3780
3917
|
name: chartEvent.seriesKey
|
|
3781
3918
|
});
|
|
3782
3919
|
delete payload.seriesKey;
|
|
3783
3920
|
if (chartEvent.rowContext) {
|
|
3784
|
-
Object.
|
|
3785
|
-
payload
|
|
3786
|
-
|
|
3921
|
+
Object.assign(
|
|
3922
|
+
payload,
|
|
3923
|
+
Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
|
|
3924
|
+
acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
|
|
3925
|
+
return acc;
|
|
3926
|
+
}, {})
|
|
3927
|
+
);
|
|
3787
3928
|
}
|
|
3929
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3788
3930
|
if (onClick) {
|
|
3789
3931
|
onClick({
|
|
3790
3932
|
type: "point.click",
|
|
3791
3933
|
originalEvent: chartEvent,
|
|
3792
|
-
payload
|
|
3934
|
+
payload: updatedPayload
|
|
3793
3935
|
});
|
|
3794
3936
|
}
|
|
3795
3937
|
};
|
|
3796
|
-
var handleLegendClick = (chartEvent, onClick) => {
|
|
3938
|
+
var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
3797
3939
|
const payload = {
|
|
3798
3940
|
name: chartEvent
|
|
3799
3941
|
};
|
|
3942
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3800
3943
|
if (onClick) {
|
|
3801
3944
|
onClick({
|
|
3802
3945
|
type: "legend.click",
|
|
3803
3946
|
originalEvent: chartEvent,
|
|
3804
|
-
payload
|
|
3947
|
+
payload: updatedPayload
|
|
3948
|
+
});
|
|
3949
|
+
}
|
|
3950
|
+
};
|
|
3951
|
+
var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
3952
|
+
var _a;
|
|
3953
|
+
if (!rangeEvent) {
|
|
3954
|
+
return;
|
|
3955
|
+
}
|
|
3956
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
3957
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
3958
|
+
const payload = {
|
|
3959
|
+
startXIndex,
|
|
3960
|
+
startXValue: rangeEvent.start,
|
|
3961
|
+
endXIndex,
|
|
3962
|
+
endXValue: rangeEvent.end
|
|
3963
|
+
};
|
|
3964
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3965
|
+
if (onSelect) {
|
|
3966
|
+
onSelect({
|
|
3967
|
+
type: "range.selectBeforeZoom",
|
|
3968
|
+
originalEvent: rangeEvent,
|
|
3969
|
+
payload: updatedPayload
|
|
3805
3970
|
});
|
|
3806
3971
|
}
|
|
3807
3972
|
};
|
|
3973
|
+
var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
3974
|
+
var _a;
|
|
3975
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
3976
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
3977
|
+
const payload = {
|
|
3978
|
+
startXIndex,
|
|
3979
|
+
startXValue: rangeEvent.start,
|
|
3980
|
+
endXIndex,
|
|
3981
|
+
endXValue: rangeEvent.end
|
|
3982
|
+
};
|
|
3983
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3984
|
+
if (onSelect) {
|
|
3985
|
+
onSelect({
|
|
3986
|
+
type: "range.select",
|
|
3987
|
+
originalEvent: rangeEvent,
|
|
3988
|
+
payload: updatedPayload
|
|
3989
|
+
});
|
|
3990
|
+
}
|
|
3991
|
+
};
|
|
3992
|
+
var parseArrayOption = (value) => {
|
|
3993
|
+
if (Array.isArray(value)) {
|
|
3994
|
+
return value;
|
|
3995
|
+
}
|
|
3996
|
+
if (value) {
|
|
3997
|
+
return JSON.parse(value);
|
|
3998
|
+
}
|
|
3999
|
+
return void 0;
|
|
4000
|
+
};
|
|
3808
4001
|
var TimeSeriesChartWrapper = (props) => {
|
|
3809
|
-
|
|
4002
|
+
var _b, _c, _d;
|
|
4003
|
+
const _a = props, {
|
|
3810
4004
|
width,
|
|
3811
4005
|
height,
|
|
3812
4006
|
chartData,
|
|
@@ -3819,12 +4013,57 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3819
4013
|
markerDisplay,
|
|
3820
4014
|
onClick,
|
|
3821
4015
|
onPointMouseOver,
|
|
3822
|
-
onPointMouseOut
|
|
3823
|
-
|
|
3824
|
-
|
|
4016
|
+
onPointMouseOut,
|
|
4017
|
+
onSelect,
|
|
4018
|
+
splitByLayout,
|
|
4019
|
+
trellisKey,
|
|
4020
|
+
trellisSplitBy,
|
|
3825
4021
|
backgroundColor,
|
|
4022
|
+
defaultFontColor,
|
|
4023
|
+
additionalTooltipValues,
|
|
4024
|
+
xAxisLineVisibility: xAxisLineVisibility,
|
|
4025
|
+
yAxisLineVisibility,
|
|
4026
|
+
y2AxisLineVisibility,
|
|
4027
|
+
showYAxisWithZero: showYAxisWithZeroFromProps,
|
|
4028
|
+
showY2AxisWithZero: showY2AxisWithZeroFromProps
|
|
4029
|
+
} = _a, otherOptions = __objRest(_a, [
|
|
4030
|
+
"width",
|
|
4031
|
+
"height",
|
|
4032
|
+
"chartData",
|
|
4033
|
+
"options",
|
|
4034
|
+
"userLocale",
|
|
4035
|
+
"annotationX",
|
|
4036
|
+
"annotationLabel",
|
|
4037
|
+
"annotationColor",
|
|
4038
|
+
"legendDisplay",
|
|
4039
|
+
"markerDisplay",
|
|
4040
|
+
"onClick",
|
|
4041
|
+
"onPointMouseOver",
|
|
4042
|
+
"onPointMouseOut",
|
|
4043
|
+
"onSelect",
|
|
4044
|
+
"splitByLayout",
|
|
4045
|
+
"trellisKey",
|
|
4046
|
+
"trellisSplitBy",
|
|
4047
|
+
"backgroundColor",
|
|
4048
|
+
"defaultFontColor",
|
|
4049
|
+
"additionalTooltipValues",
|
|
4050
|
+
// Extract axis line visibility options from props
|
|
4051
|
+
"xAxisLineVisibility",
|
|
4052
|
+
"yAxisLineVisibility",
|
|
4053
|
+
"y2AxisLineVisibility",
|
|
4054
|
+
// Extract showYAxisWithZero directly from props for accelerated render mode
|
|
4055
|
+
"showYAxisWithZero",
|
|
4056
|
+
"showY2AxisWithZero"
|
|
4057
|
+
]);
|
|
4058
|
+
const { eventHandlers, xField: xFieldFromProps } = otherOptions;
|
|
4059
|
+
const trellisEnabled = useTrellisEnabled(splitByLayout);
|
|
4060
|
+
const {
|
|
4061
|
+
backgroundColor: bgColorFromOptions,
|
|
3826
4062
|
seriesColors: seriesColorsStr,
|
|
3827
4063
|
fieldColors,
|
|
4064
|
+
legendLabels: legendLabelsStr,
|
|
4065
|
+
legendMode,
|
|
4066
|
+
legendTruncation,
|
|
3828
4067
|
"axisTitleX.text": xAxisTitleText,
|
|
3829
4068
|
"axisTitleY.text": yAxisTitleText,
|
|
3830
4069
|
"axisTitleY2.text": y2AxisTitleText,
|
|
@@ -3832,8 +4071,12 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3832
4071
|
"axisTitleY.visibility": yAxisTitleVisibility,
|
|
3833
4072
|
"axisTitleY2.visibility": y2AxisTitleVisibility,
|
|
3834
4073
|
"axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
|
|
4074
|
+
"axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
|
|
4075
|
+
"axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
|
|
3835
4076
|
"axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
|
|
4077
|
+
"axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
|
|
3836
4078
|
"axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
|
|
4079
|
+
"axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
|
|
3837
4080
|
"axisY.abbreviation": yAxisAbbreviation,
|
|
3838
4081
|
"axisY.scale": yAxisScale,
|
|
3839
4082
|
"axisY2.abbreviation": y2AxisAbbreviation,
|
|
@@ -3843,10 +4086,73 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3843
4086
|
"axisLabelsY2.integerUnits": y2IntegerUnits,
|
|
3844
4087
|
"chart.overlayFields": overlayFieldsStr,
|
|
3845
4088
|
"chart.nullValueMode": nullValueMode,
|
|
3846
|
-
|
|
4089
|
+
"chart.showDataLabels": showDataLabels,
|
|
4090
|
+
lineWidth,
|
|
4091
|
+
lineDashStyle,
|
|
4092
|
+
fieldDashStyles: lineDashStylesByFieldStr,
|
|
4093
|
+
stepPosition,
|
|
4094
|
+
fieldStepPositions: stepPositionsByFieldStr,
|
|
4095
|
+
yAxisMin: yAxisMinRaw,
|
|
4096
|
+
yAxisMax: yAxisMaxRaw,
|
|
4097
|
+
y2AxisMin: y2AxisMinRaw,
|
|
4098
|
+
y2AxisMax: y2AxisMaxRaw,
|
|
4099
|
+
showXMajorGridLines,
|
|
4100
|
+
showYMajorGridLines,
|
|
4101
|
+
showY2MajorGridLines,
|
|
4102
|
+
showYMinorGridLines,
|
|
4103
|
+
showY2MinorGridLines,
|
|
4104
|
+
showLineSmoothing,
|
|
4105
|
+
xAxisMajorTickVisibility,
|
|
4106
|
+
xAxisMajorTickSize,
|
|
4107
|
+
yAxisMajorTickVisibility,
|
|
4108
|
+
y2AxisMajorTickVisibility,
|
|
4109
|
+
yAxisMajorTickSize,
|
|
4110
|
+
y2AxisMajorTickSize,
|
|
4111
|
+
yAxisMajorTickInterval,
|
|
4112
|
+
y2AxisMajorTickInterval,
|
|
4113
|
+
yAxisMinorTickVisibility,
|
|
4114
|
+
y2AxisMinorTickVisibility,
|
|
4115
|
+
yAxisMinorTickSize,
|
|
4116
|
+
y2AxisMinorTickSize,
|
|
4117
|
+
showYAxisWithZero: showYAxisWithZeroFromOptions,
|
|
4118
|
+
showY2AxisWithZero: showY2AxisWithZeroFromOptions
|
|
3847
4119
|
} = options;
|
|
4120
|
+
const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
|
|
4121
|
+
const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
|
|
4122
|
+
const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
|
|
4123
|
+
const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
|
|
4124
|
+
const showYMajorTicks = yAxisMajorTickVisibility === "show";
|
|
4125
|
+
const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
|
|
4126
|
+
const showYMinorTicks = yAxisMinorTickVisibility === "show";
|
|
4127
|
+
const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
|
|
4128
|
+
const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
|
|
4129
|
+
const showYAxisLine = yAxisLineVisibility === "show";
|
|
4130
|
+
const showY2AxisLine = y2AxisLineVisibility === "show";
|
|
4131
|
+
const yAxisMin = parseAxisValue(yAxisMinRaw);
|
|
4132
|
+
const yAxisMax = parseAxisValue(yAxisMaxRaw);
|
|
4133
|
+
const y2AxisMin = parseAxisValue(y2AxisMinRaw);
|
|
4134
|
+
const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
|
|
4135
|
+
const parseTickInterval = (simpleXMLValue, canvasValue) => {
|
|
4136
|
+
if (simpleXMLValue) return Number(simpleXMLValue);
|
|
4137
|
+
if (canvasValue) return Number(canvasValue);
|
|
4138
|
+
return void 0;
|
|
4139
|
+
};
|
|
4140
|
+
const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
|
|
4141
|
+
const y2AxisMajorTickIntervalNum = parseTickInterval(
|
|
4142
|
+
y2AxisMajorUnitFromSimpleXML,
|
|
4143
|
+
y2AxisMajorTickInterval
|
|
4144
|
+
);
|
|
4145
|
+
const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
|
|
4146
|
+
const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
|
|
4147
|
+
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
|
|
4148
|
+
const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
|
|
4149
|
+
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
|
|
3848
4150
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
3849
4151
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
4152
|
+
const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
|
|
4153
|
+
const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
|
|
4154
|
+
const legendLabels = parseArrayOption(legendLabelsStr);
|
|
4155
|
+
const bgColor = backgroundColor || bgColorFromOptions;
|
|
3850
4156
|
const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
|
|
3851
4157
|
const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
|
|
3852
4158
|
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
@@ -3857,31 +4163,64 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3857
4163
|
fields: chartData.fields,
|
|
3858
4164
|
columns: chartData.seriesList
|
|
3859
4165
|
});
|
|
3860
|
-
const xField =
|
|
4166
|
+
const xField = getFieldName2(filteredChartData.fields[0]);
|
|
3861
4167
|
const yFields = getFieldNames(
|
|
3862
4168
|
filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
|
|
3863
4169
|
);
|
|
3864
|
-
const y2Fields =
|
|
3865
|
-
|
|
4170
|
+
const y2Fields = (0, react_exports.useMemo)(
|
|
4171
|
+
() => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
|
|
4172
|
+
[y2FieldsStr]
|
|
4173
|
+
);
|
|
4174
|
+
const overlayFields = (0, react_exports.useMemo)(
|
|
4175
|
+
() => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
|
|
4176
|
+
[overlayFieldsStr]
|
|
4177
|
+
);
|
|
3866
4178
|
let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
|
|
3867
4179
|
xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
|
|
3868
|
-
|
|
4180
|
+
const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
|
|
4181
|
+
let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
|
|
3869
4182
|
yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
|
|
3870
4183
|
const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
|
|
3871
4184
|
let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
|
|
3872
4185
|
y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
|
|
3873
|
-
const xScaleConfig =
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
4186
|
+
const xScaleConfig = (0, react_exports.useMemo)(
|
|
4187
|
+
() => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
|
|
4188
|
+
[xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
|
|
4189
|
+
);
|
|
4190
|
+
const yScaleConfig = (0, react_exports.useMemo)(
|
|
4191
|
+
() => getYScaleConfig(
|
|
4192
|
+
yAxisTitle,
|
|
4193
|
+
yAxisAbbreviation,
|
|
4194
|
+
yAxisScale,
|
|
4195
|
+
yAxisLabelVisibility,
|
|
4196
|
+
yAxisMin,
|
|
4197
|
+
yAxisMax
|
|
4198
|
+
),
|
|
4199
|
+
[yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
|
|
4200
|
+
);
|
|
4201
|
+
const y2ScaleConfig = (0, react_exports.useMemo)(() => {
|
|
4202
|
+
if (y2Enabled) {
|
|
4203
|
+
return getY2ScaleConfig(
|
|
4204
|
+
y2AxisTitle,
|
|
4205
|
+
y2AxisAbbreviation,
|
|
4206
|
+
y2AxisScale,
|
|
4207
|
+
y2IntegerUnits,
|
|
4208
|
+
y2AxisLabelVisibility,
|
|
4209
|
+
y2AxisMin,
|
|
4210
|
+
y2AxisMax
|
|
4211
|
+
);
|
|
4212
|
+
}
|
|
4213
|
+
return {};
|
|
4214
|
+
}, [
|
|
4215
|
+
y2Enabled,
|
|
4216
|
+
y2AxisTitle,
|
|
4217
|
+
y2AxisAbbreviation,
|
|
4218
|
+
y2AxisScale,
|
|
4219
|
+
y2IntegerUnits,
|
|
4220
|
+
y2AxisLabelVisibility,
|
|
4221
|
+
y2AxisMin,
|
|
4222
|
+
y2AxisMax
|
|
4223
|
+
]);
|
|
3885
4224
|
const uplotContainerElement = (0, react_exports.useRef)(null);
|
|
3886
4225
|
const seriesDataFormatted = [
|
|
3887
4226
|
filteredChartData.columns[0],
|
|
@@ -3897,9 +4236,25 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3897
4236
|
overlayFields,
|
|
3898
4237
|
y2Enabled,
|
|
3899
4238
|
nullValueMode,
|
|
3900
|
-
markerDisplay
|
|
4239
|
+
markerDisplay,
|
|
4240
|
+
lineDashStyle,
|
|
4241
|
+
lineDashStylesByField,
|
|
4242
|
+
stepPosition,
|
|
4243
|
+
stepPositionsByField
|
|
3901
4244
|
),
|
|
3902
|
-
[
|
|
4245
|
+
[
|
|
4246
|
+
yFields,
|
|
4247
|
+
y2Fields,
|
|
4248
|
+
lineWidth,
|
|
4249
|
+
overlayFields,
|
|
4250
|
+
y2Enabled,
|
|
4251
|
+
nullValueMode,
|
|
4252
|
+
markerDisplay,
|
|
4253
|
+
lineDashStyle,
|
|
4254
|
+
lineDashStylesByField,
|
|
4255
|
+
stepPosition,
|
|
4256
|
+
stepPositionsByField
|
|
4257
|
+
]
|
|
3903
4258
|
);
|
|
3904
4259
|
const chartingEventAnnotations = (0, react_exports.useMemo)(
|
|
3905
4260
|
() => getAnnotationsForCanvas({
|
|
@@ -3913,25 +4268,59 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3913
4268
|
() => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
|
|
3914
4269
|
[xScaleConfig, yScaleConfig, y2ScaleConfig]
|
|
3915
4270
|
);
|
|
3916
|
-
const
|
|
4271
|
+
const isSeriesCompare = legendMode === "seriesCompare";
|
|
4272
|
+
const legend = (0, react_exports.useMemo)(
|
|
4273
|
+
() => getLegend({
|
|
4274
|
+
legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
|
|
4275
|
+
isSeriesCompare,
|
|
4276
|
+
legendTruncation
|
|
4277
|
+
}),
|
|
4278
|
+
[legendDisplay, isSeriesCompare, legendTruncation]
|
|
4279
|
+
);
|
|
3917
4280
|
const handleChartClick = react_exports.useCallback(
|
|
3918
4281
|
(event) => {
|
|
3919
4282
|
if (onClick) {
|
|
3920
|
-
handleClick(event, onClick);
|
|
4283
|
+
handleClick(event, onClick, trellisKey, trellisSplitBy);
|
|
3921
4284
|
}
|
|
3922
4285
|
},
|
|
3923
|
-
[onClick]
|
|
4286
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
3924
4287
|
);
|
|
3925
4288
|
const handleChartLegendClick = react_exports.useCallback(
|
|
3926
4289
|
(event) => {
|
|
3927
4290
|
if (onClick) {
|
|
3928
|
-
handleLegendClick(event, onClick);
|
|
4291
|
+
handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
|
|
4292
|
+
}
|
|
4293
|
+
},
|
|
4294
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
4295
|
+
);
|
|
4296
|
+
const handleChartRangeSelection = react_exports.useCallback(
|
|
4297
|
+
(range2) => {
|
|
4298
|
+
if (onSelect) {
|
|
4299
|
+
handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
4300
|
+
}
|
|
4301
|
+
},
|
|
4302
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
4303
|
+
);
|
|
4304
|
+
const handleChartRangeZoom = react_exports.useCallback(
|
|
4305
|
+
(range2) => {
|
|
4306
|
+
if (onSelect) {
|
|
4307
|
+
handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
3929
4308
|
}
|
|
3930
4309
|
},
|
|
3931
|
-
[
|
|
4310
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
4311
|
+
);
|
|
4312
|
+
const xFieldToUse = xFieldFromProps || xField;
|
|
4313
|
+
const enableSearchZoom = react_exports.useMemo(
|
|
4314
|
+
() => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
|
|
4315
|
+
[eventHandlers, xFieldToUse]
|
|
3932
4316
|
);
|
|
3933
4317
|
const lastPayloadRef = react_exports.useRef(null);
|
|
3934
4318
|
const lastOriginalEventRef = react_exports.useRef(null);
|
|
4319
|
+
const previousMouseoverPayloadRef = react_exports.useRef(null);
|
|
4320
|
+
const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
|
|
4321
|
+
react_exports.useEffect(() => {
|
|
4322
|
+
additionalTooltipValuesRef.current = additionalTooltipValues;
|
|
4323
|
+
}, [additionalTooltipValues]);
|
|
3935
4324
|
const handleChartCrosshairChange = react_exports.useCallback(
|
|
3936
4325
|
(event) => {
|
|
3937
4326
|
if (onPointMouseOver || onPointMouseOut) {
|
|
@@ -3943,6 +4332,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3943
4332
|
payload: lastPayloadRef.current
|
|
3944
4333
|
});
|
|
3945
4334
|
}
|
|
4335
|
+
previousMouseoverPayloadRef.current = null;
|
|
3946
4336
|
return;
|
|
3947
4337
|
}
|
|
3948
4338
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
|
|
@@ -3950,25 +4340,36 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3950
4340
|
});
|
|
3951
4341
|
delete payload.seriesKey;
|
|
3952
4342
|
if (event.rowContext) {
|
|
3953
|
-
Object.
|
|
3954
|
-
payload
|
|
3955
|
-
|
|
4343
|
+
Object.assign(
|
|
4344
|
+
payload,
|
|
4345
|
+
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
4346
|
+
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
4347
|
+
return acc;
|
|
4348
|
+
}, {})
|
|
4349
|
+
);
|
|
4350
|
+
}
|
|
4351
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
4352
|
+
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
4353
|
+
return;
|
|
3956
4354
|
}
|
|
3957
|
-
lastPayloadRef.current =
|
|
4355
|
+
lastPayloadRef.current = updatedPayload;
|
|
3958
4356
|
lastOriginalEventRef.current = event;
|
|
4357
|
+
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
3959
4358
|
if (onPointMouseOver) {
|
|
3960
4359
|
onPointMouseOver({
|
|
3961
4360
|
type: "point.mouseover",
|
|
3962
4361
|
originalEvent: event,
|
|
3963
|
-
payload
|
|
4362
|
+
payload: updatedPayload
|
|
3964
4363
|
});
|
|
3965
4364
|
}
|
|
3966
4365
|
}
|
|
3967
4366
|
},
|
|
3968
|
-
[onPointMouseOver, onPointMouseOut]
|
|
4367
|
+
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
|
|
3969
4368
|
);
|
|
3970
|
-
const
|
|
3971
|
-
|
|
4369
|
+
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}`;
|
|
4370
|
+
const memoizedChart = (0, react_exports.useMemo)(() => {
|
|
4371
|
+
const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
|
|
4372
|
+
return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
|
|
3972
4373
|
visualization_canvas_exports.TimeSeriesChart,
|
|
3973
4374
|
{
|
|
3974
4375
|
data: chartData,
|
|
@@ -3978,49 +4379,121 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3978
4379
|
seriesColorsByField,
|
|
3979
4380
|
seriesConfig: seriesOverrides,
|
|
3980
4381
|
legend,
|
|
4382
|
+
legendLabels,
|
|
4383
|
+
legendTruncation,
|
|
4384
|
+
isSeriesCompare: legendMode === "seriesCompare",
|
|
4385
|
+
maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
|
|
3981
4386
|
scaleConfig,
|
|
3982
4387
|
timestampFormat: "expanded",
|
|
3983
4388
|
onCrosshairClick: onClick ? handleChartClick : void 0,
|
|
3984
4389
|
onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
|
|
3985
4390
|
onSeriesClick: onClick ? handleChartLegendClick : void 0,
|
|
4391
|
+
onRangeSelection: handleChartRangeSelection,
|
|
4392
|
+
onRangeZoom: computedOnRangeZoom,
|
|
4393
|
+
serverSideZoom: enableSearchZoom,
|
|
3986
4394
|
userLocale,
|
|
3987
4395
|
events: chartingEventAnnotations,
|
|
3988
|
-
eventsConfig: { renderer: triangleEventAnnotationRenderer }
|
|
4396
|
+
eventsConfig: { renderer: triangleEventAnnotationRenderer },
|
|
4397
|
+
additionalTooltipValuesRef,
|
|
4398
|
+
showXMajorGridLines,
|
|
4399
|
+
showYMajorGridLines,
|
|
4400
|
+
showY2MajorGridLines,
|
|
4401
|
+
showYMinorGridLines,
|
|
4402
|
+
showY2MinorGridLines,
|
|
4403
|
+
showLineSmoothing,
|
|
4404
|
+
dataValuesDisplay,
|
|
4405
|
+
showXMajorTicks,
|
|
4406
|
+
xAxisMajorTickSize: xAxisMajorTickSizeNum,
|
|
4407
|
+
showYMajorTicks,
|
|
4408
|
+
showY2MajorTicks,
|
|
4409
|
+
yAxisMajorTickSize: yAxisMajorTickSizeNum,
|
|
4410
|
+
y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
|
|
4411
|
+
yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
|
|
4412
|
+
y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
|
|
4413
|
+
showYMinorTicks,
|
|
4414
|
+
showY2MinorTicks,
|
|
4415
|
+
yAxisMinorTickSize: yAxisMinorTickSizeNum,
|
|
4416
|
+
y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
|
|
4417
|
+
showYAxisWithZero,
|
|
4418
|
+
showY2AxisWithZero,
|
|
4419
|
+
showXAxisLine,
|
|
4420
|
+
showYAxisLine,
|
|
4421
|
+
showY2AxisLine,
|
|
4422
|
+
xAxisMaxLabelParts
|
|
3989
4423
|
}
|
|
3990
|
-
)
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4424
|
+
));
|
|
4425
|
+
}, [
|
|
4426
|
+
onSelect,
|
|
4427
|
+
handleChartRangeZoom,
|
|
4428
|
+
dataKey,
|
|
4429
|
+
chartData,
|
|
4430
|
+
containerWidth,
|
|
4431
|
+
containerHeight,
|
|
4432
|
+
seriesColors,
|
|
4433
|
+
seriesColorsByField,
|
|
4434
|
+
seriesOverrides,
|
|
4435
|
+
legend,
|
|
4436
|
+
legendLabels,
|
|
4437
|
+
legendTruncation,
|
|
4438
|
+
scaleConfig,
|
|
4439
|
+
onClick,
|
|
4440
|
+
handleChartClick,
|
|
4441
|
+
onPointMouseOver,
|
|
4442
|
+
onPointMouseOut,
|
|
4443
|
+
handleChartCrosshairChange,
|
|
4444
|
+
handleChartLegendClick,
|
|
4445
|
+
handleChartRangeSelection,
|
|
4446
|
+
enableSearchZoom,
|
|
4447
|
+
userLocale,
|
|
4448
|
+
chartingEventAnnotations,
|
|
4449
|
+
showXMajorGridLines,
|
|
4450
|
+
showYMajorGridLines,
|
|
4451
|
+
showY2MajorGridLines,
|
|
4452
|
+
showYMinorGridLines,
|
|
4453
|
+
showY2MinorGridLines,
|
|
4454
|
+
showLineSmoothing,
|
|
4455
|
+
dataValuesDisplay,
|
|
4456
|
+
showXMajorTicks,
|
|
4457
|
+
xAxisMajorTickSizeNum,
|
|
4458
|
+
showYMajorTicks,
|
|
4459
|
+
showY2MajorTicks,
|
|
4460
|
+
yAxisMajorTickSizeNum,
|
|
4461
|
+
y2AxisMajorTickSizeNum,
|
|
4462
|
+
yAxisMajorTickIntervalNum,
|
|
4463
|
+
y2AxisMajorTickIntervalNum,
|
|
4464
|
+
showYMinorTicks,
|
|
4465
|
+
showY2MinorTicks,
|
|
4466
|
+
yAxisMinorTickSizeNum,
|
|
4467
|
+
y2AxisMinorTickSizeNum,
|
|
4468
|
+
showYAxisWithZero,
|
|
4469
|
+
showY2AxisWithZero,
|
|
4470
|
+
showXAxisLine,
|
|
4471
|
+
showYAxisLine,
|
|
4472
|
+
showY2AxisLine,
|
|
4473
|
+
legendMode,
|
|
4474
|
+
xAxisMaxLabelParts
|
|
4475
|
+
]);
|
|
4010
4476
|
const memoizedVisualization = (0, react_exports.useMemo)(() => {
|
|
4011
|
-
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
|
|
4012
|
-
}, [
|
|
4013
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
4477
|
+
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
|
|
4478
|
+
}, [bgColor, memoizedChart]);
|
|
4479
|
+
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
|
|
4480
|
+
TrellisTitle,
|
|
4481
|
+
{
|
|
4482
|
+
trellisKey,
|
|
4483
|
+
backgroundColor: bgColor,
|
|
4484
|
+
fontColor: defaultFontColor
|
|
4485
|
+
}
|
|
4486
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
4014
4487
|
TimeSeriesChartContainer,
|
|
4015
4488
|
{
|
|
4016
|
-
height,
|
|
4489
|
+
height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
|
|
4017
4490
|
width,
|
|
4018
4491
|
ref: uplotContainerElement,
|
|
4019
4492
|
"data-test": "timeseries-chart-wrapper"
|
|
4020
4493
|
},
|
|
4021
4494
|
/* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
|
|
4022
4495
|
memoizedVisualization
|
|
4023
|
-
);
|
|
4496
|
+
));
|
|
4024
4497
|
};
|
|
4025
4498
|
var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
|
|
4026
4499
|
|