@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/Area.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
|
}
|
|
@@ -1011,6 +1024,9 @@ var isTrellisEnabled = ({ options, featureFlags }) => {
|
|
|
1011
1024
|
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1012
1025
|
return isTrellisFeatureFlagOn({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1013
1026
|
};
|
|
1027
|
+
var isAcceleratedRenderFeatureFlagOn = ({ featureFlags }) => {
|
|
1028
|
+
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableAcceleratedRender);
|
|
1029
|
+
};
|
|
1014
1030
|
var AxesChartDataConfig = {
|
|
1015
1031
|
label: (0, i18n_exports._)("Data configurations"),
|
|
1016
1032
|
layout: [
|
|
@@ -1144,9 +1160,6 @@ var AxesChartDataConfigBubble = {
|
|
|
1144
1160
|
}
|
|
1145
1161
|
])
|
|
1146
1162
|
};
|
|
1147
|
-
var isAcceleratedRenderFeatureFlagOn = ({ featureFlags }) => {
|
|
1148
|
-
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableAcceleratedRender);
|
|
1149
|
-
};
|
|
1150
1163
|
var AcceleratedRenderEditorLayout = [
|
|
1151
1164
|
[
|
|
1152
1165
|
{
|
|
@@ -1156,10 +1169,9 @@ var AcceleratedRenderEditorLayout = [
|
|
|
1156
1169
|
showEditor: isAcceleratedRenderFeatureFlagOn,
|
|
1157
1170
|
editorProps: {
|
|
1158
1171
|
help: (0, i18n_exports._)(
|
|
1159
|
-
"Render visualizations faster for large datasets.
|
|
1172
|
+
"Render visualizations faster for large datasets. Split series is not available in this mode."
|
|
1160
1173
|
),
|
|
1161
1174
|
helpFormat: "under"
|
|
1162
|
-
// TODO: uncomment and replace link with real link (SCP-75907)
|
|
1163
1175
|
// helpTextLink: {
|
|
1164
1176
|
// href: 'https://splunkui.splunk.com/Packages/visualizations/Overview',
|
|
1165
1177
|
// label: 'Learn More.',
|
|
@@ -1314,6 +1326,10 @@ var isTrellisEnabled3 = ({ options, featureFlags }) => {
|
|
|
1314
1326
|
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
1315
1327
|
return isTrellisFeatureFlagOn3({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1316
1328
|
};
|
|
1329
|
+
var isAcceleratedRenderEnabled = ({ options, featureFlags }) => {
|
|
1330
|
+
const { acceleratedRender } = options;
|
|
1331
|
+
return isAcceleratedRenderFeatureFlagOn({ featureFlags }) && acceleratedRender;
|
|
1332
|
+
};
|
|
1317
1333
|
var AxesChartDataDisplayBase = {
|
|
1318
1334
|
label: (0, i18n_exports._)("Data display"),
|
|
1319
1335
|
layout: [
|
|
@@ -1374,7 +1390,8 @@ var AxesChartDataDisplayBase = {
|
|
|
1374
1390
|
{
|
|
1375
1391
|
label: (0, i18n_exports._)("Split series"),
|
|
1376
1392
|
option: "showSplitSeries",
|
|
1377
|
-
editor: "editor.toggle"
|
|
1393
|
+
editor: "editor.toggle",
|
|
1394
|
+
isDisabled: isAcceleratedRenderEnabled
|
|
1378
1395
|
}
|
|
1379
1396
|
],
|
|
1380
1397
|
[
|
|
@@ -1382,7 +1399,23 @@ var AxesChartDataDisplayBase = {
|
|
|
1382
1399
|
label: (0, i18n_exports._)("Independent y-axis for split series"),
|
|
1383
1400
|
option: "showIndependentYRanges",
|
|
1384
1401
|
editor: "editor.checkbox",
|
|
1385
|
-
showEditor: ({ options }) => options.showSplitSeries
|
|
1402
|
+
showEditor: ({ options, featureFlags }) => options.showSplitSeries && !isAcceleratedRenderEnabled({ options, featureFlags })
|
|
1403
|
+
}
|
|
1404
|
+
],
|
|
1405
|
+
[
|
|
1406
|
+
{
|
|
1407
|
+
label: (0, i18n_exports._)("Step position"),
|
|
1408
|
+
option: "stepPosition",
|
|
1409
|
+
editor: "editor.radioBar",
|
|
1410
|
+
editorProps: {
|
|
1411
|
+
values: [
|
|
1412
|
+
{ label: (0, i18n_exports._)("Off"), value: "off" },
|
|
1413
|
+
{ label: (0, i18n_exports._)("Before"), value: "before" },
|
|
1414
|
+
{ label: (0, i18n_exports._)("After"), value: "after" }
|
|
1415
|
+
]
|
|
1416
|
+
},
|
|
1417
|
+
showEditor: ({ options, featureFlags }) => isAcceleratedRenderEnabled({ options, featureFlags })
|
|
1418
|
+
// step position is only supported when accelerated render is enabled
|
|
1386
1419
|
}
|
|
1387
1420
|
],
|
|
1388
1421
|
...TimechartTrellisEditorConfig
|
|
@@ -1570,7 +1603,7 @@ var AxesChartLegendWithTrellisAndMode = ({
|
|
|
1570
1603
|
{ label: (0, i18n_exports._)("Bottom"), value: "bottom" },
|
|
1571
1604
|
{ label: (0, i18n_exports._)("Off"), value: "off" }
|
|
1572
1605
|
],
|
|
1573
|
-
tooltip: showLegendTooltip
|
|
1606
|
+
tooltip: showLegendTooltip ? (0, i18n_exports._)('Legend mode must be "Standard" to configure legend display') : void 0
|
|
1574
1607
|
},
|
|
1575
1608
|
isDisabled: showLegendTooltip ? ({ options }) => options.legendMode === "seriesCompare" : void 0,
|
|
1576
1609
|
overrideDefaultValue: ({ options }) => (options == null ? void 0 : options.splitByLayout) === "trellis" ? "off" : "right"
|
|
@@ -2710,7 +2743,7 @@ var Cover = styled_components_default.div`
|
|
|
2710
2743
|
bottom: 0;
|
|
2711
2744
|
`;
|
|
2712
2745
|
var Blocker = styled_components_default.div.attrs({
|
|
2713
|
-
"data-splunk-visualization-version": "28.
|
|
2746
|
+
"data-splunk-visualization-version": "28.5.0 - b192418b7"
|
|
2714
2747
|
})`
|
|
2715
2748
|
position: relative;
|
|
2716
2749
|
width: 100%;
|
|
@@ -2791,7 +2824,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
2791
2824
|
FixSizeItem,
|
|
2792
2825
|
{
|
|
2793
2826
|
"data-test": "fix-size-item",
|
|
2794
|
-
"data-splunk-visualization-version": "28.
|
|
2827
|
+
"data-splunk-visualization-version": "28.5.0 - b192418b7",
|
|
2795
2828
|
width,
|
|
2796
2829
|
height,
|
|
2797
2830
|
backgroundColor
|
|
@@ -3067,7 +3100,7 @@ var trellisUtils_default = "default" in defaultImport33 ? defaultImport33.defaul
|
|
|
3067
3100
|
var AGGREGATIONS = "aggregations";
|
|
3068
3101
|
var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
3069
3102
|
var _a, _b, _c, _d;
|
|
3070
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3103
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3071
3104
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3072
3105
|
let splitDataSources = null;
|
|
3073
3106
|
let errorCode = null;
|
|
@@ -3088,7 +3121,7 @@ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
|
3088
3121
|
}
|
|
3089
3122
|
return { splitDataSources, errorCode };
|
|
3090
3123
|
};
|
|
3091
|
-
var toFieldEntries = (fields) => {
|
|
3124
|
+
var toFieldEntries = (fields = []) => {
|
|
3092
3125
|
return fields.map((field) => {
|
|
3093
3126
|
if (typeof field === "string") {
|
|
3094
3127
|
return { name: field };
|
|
@@ -3103,7 +3136,7 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
3103
3136
|
let splitDataSources = null;
|
|
3104
3137
|
let splitByFields = [];
|
|
3105
3138
|
let errorCode = null;
|
|
3106
|
-
if (
|
|
3139
|
+
if (fields.length > 0) {
|
|
3107
3140
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
3108
3141
|
}
|
|
3109
3142
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -3141,12 +3174,12 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
3141
3174
|
};
|
|
3142
3175
|
var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
3143
3176
|
var _a, _b, _c, _d;
|
|
3144
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3177
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3145
3178
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3146
3179
|
let splitDataSources = null;
|
|
3147
3180
|
let splitByFields = [];
|
|
3148
3181
|
let errorCode = null;
|
|
3149
|
-
if (
|
|
3182
|
+
if (fields.length > 0) {
|
|
3150
3183
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
|
|
3151
3184
|
}
|
|
3152
3185
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -3170,12 +3203,12 @@ var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
|
3170
3203
|
};
|
|
3171
3204
|
var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
3172
3205
|
var _a, _b, _c, _d, _e;
|
|
3173
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3206
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3174
3207
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3175
3208
|
let splitDataSources = null;
|
|
3176
3209
|
let splitByFields = [];
|
|
3177
3210
|
let errorCode = null;
|
|
3178
|
-
if (
|
|
3211
|
+
if (fields.length > 0) {
|
|
3179
3212
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
3180
3213
|
}
|
|
3181
3214
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -3191,16 +3224,14 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
|
3191
3224
|
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
3192
3225
|
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
3193
3226
|
);
|
|
3194
|
-
splitDataSources[val].primary.data.fields = [
|
|
3195
|
-
{ name: fields[0].name },
|
|
3196
|
-
...dataSourceKeys.map((k) => ({
|
|
3197
|
-
name: k
|
|
3198
|
-
}))
|
|
3199
|
-
];
|
|
3227
|
+
splitDataSources[val].primary.data.fields = [{ name: fields[0].name }];
|
|
3200
3228
|
splitDataSources[val].primary.data.columns = [[...columns[0]]];
|
|
3201
3229
|
dataSourceKeys.forEach((dsKey) => {
|
|
3202
3230
|
fields.forEach((field, idx) => {
|
|
3203
3231
|
if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
|
|
3232
|
+
splitDataSources[val].primary.data.fields.push({
|
|
3233
|
+
name: dsKey
|
|
3234
|
+
});
|
|
3204
3235
|
splitDataSources[val].primary.data.columns.push([...columns[idx]]);
|
|
3205
3236
|
}
|
|
3206
3237
|
});
|
|
@@ -3213,12 +3244,12 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
|
3213
3244
|
};
|
|
3214
3245
|
var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
3215
3246
|
var _a, _b, _c, _d;
|
|
3216
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3247
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3217
3248
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3218
3249
|
let splitDataSources = null;
|
|
3219
3250
|
let splitByFields = [];
|
|
3220
3251
|
let errorCode = null;
|
|
3221
|
-
if (
|
|
3252
|
+
if (fields.length > 0) {
|
|
3222
3253
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
3223
3254
|
}
|
|
3224
3255
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -3306,17 +3337,15 @@ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
|
3306
3337
|
};
|
|
3307
3338
|
var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
|
|
3308
3339
|
var _a, _b, _c, _d, _e, _f;
|
|
3309
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3340
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3310
3341
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3311
3342
|
let splitDataSources = null;
|
|
3312
3343
|
let splitByFields = [];
|
|
3313
3344
|
let errorCode = null;
|
|
3314
|
-
if (
|
|
3345
|
+
if (fields.length > 0) {
|
|
3315
3346
|
splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
|
|
3316
3347
|
}
|
|
3317
|
-
const splitByIndex = fields
|
|
3318
|
-
(field) => field === splitBy || field.name === splitBy
|
|
3319
|
-
);
|
|
3348
|
+
const splitByIndex = fields.findIndex((field) => field.name === splitBy);
|
|
3320
3349
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
3321
3350
|
const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
|
|
3322
3351
|
splitDataSources = {};
|
|
@@ -3546,17 +3575,34 @@ var filterChartDataFromInternalFields = (chartData) => {
|
|
|
3546
3575
|
var convert2DArrayToNumbers = (arr) => {
|
|
3547
3576
|
return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
|
|
3548
3577
|
};
|
|
3549
|
-
var
|
|
3550
|
-
|
|
3578
|
+
var parseAxisValue = (val) => {
|
|
3579
|
+
if (val === void 0 || val === null || val === "auto" || val === "") {
|
|
3580
|
+
return void 0;
|
|
3581
|
+
}
|
|
3582
|
+
const num = typeof val === "number" ? val : Number.parseFloat(val);
|
|
3583
|
+
return Number.isNaN(num) ? void 0 : num;
|
|
3584
|
+
};
|
|
3585
|
+
var parseXAxisLineVisibility = (visibility) => {
|
|
3586
|
+
if (visibility === "hide") return false;
|
|
3587
|
+
if (visibility === "show") return true;
|
|
3588
|
+
return void 0;
|
|
3589
|
+
};
|
|
3551
3590
|
var getLegend = (props) => {
|
|
3552
3591
|
const legendPlacement = props == null ? void 0 : props.legendDisplay;
|
|
3592
|
+
const { isSeriesCompare, legendTruncation } = props;
|
|
3593
|
+
const commonLegendProps = {
|
|
3594
|
+
center: true,
|
|
3595
|
+
fontSize: 12,
|
|
3596
|
+
largerTiles: true,
|
|
3597
|
+
hideSeriesValue: !isSeriesCompare,
|
|
3598
|
+
// Show values if in seriesCompare mode
|
|
3599
|
+
legendTruncation
|
|
3600
|
+
};
|
|
3553
3601
|
switch (legendPlacement) {
|
|
3554
3602
|
case "off":
|
|
3555
3603
|
return false;
|
|
3556
3604
|
case "left":
|
|
3557
|
-
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
|
|
3558
|
-
width: SideLegendWidth
|
|
3559
|
-
}, commonLegendProps));
|
|
3605
|
+
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
3560
3606
|
case "bottom":
|
|
3561
3607
|
return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
|
|
3562
3608
|
wrap: true
|
|
@@ -3566,9 +3612,7 @@ var getLegend = (props) => {
|
|
|
3566
3612
|
wrap: true
|
|
3567
3613
|
}, commonLegendProps));
|
|
3568
3614
|
default:
|
|
3569
|
-
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
|
|
3570
|
-
width: SideLegendWidth
|
|
3571
|
-
}, commonLegendProps));
|
|
3615
|
+
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
3572
3616
|
}
|
|
3573
3617
|
};
|
|
3574
3618
|
var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
|
|
@@ -3603,22 +3647,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
|
|
|
3603
3647
|
const end = axisTitle.slice(-halfChars);
|
|
3604
3648
|
return `${start}...${end}`;
|
|
3605
3649
|
};
|
|
3606
|
-
var
|
|
3650
|
+
var getFieldName2 = (field) => {
|
|
3607
3651
|
const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
|
|
3608
3652
|
return fieldName;
|
|
3609
3653
|
};
|
|
3610
3654
|
var getFieldNames = (fields) => {
|
|
3611
|
-
return fields.map((field) =>
|
|
3655
|
+
return fields.map((field) => getFieldName2(field));
|
|
3612
3656
|
};
|
|
3613
|
-
var getXScaleConfig = (label, xAxisLabelVisibility) => {
|
|
3657
|
+
var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
|
|
3614
3658
|
const xConfig = { x: {} };
|
|
3615
3659
|
xConfig.x.label = label;
|
|
3616
3660
|
if (xAxisLabelVisibility === "hide") {
|
|
3617
3661
|
xConfig.x.hideLabels = true;
|
|
3618
3662
|
}
|
|
3663
|
+
if (xAxisLabelRotation !== void 0) {
|
|
3664
|
+
xConfig.x.labelRotation = xAxisLabelRotation;
|
|
3665
|
+
}
|
|
3619
3666
|
return xConfig;
|
|
3620
3667
|
};
|
|
3621
|
-
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
|
|
3668
|
+
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
|
|
3622
3669
|
const scaleType = yAxisScale != null ? yAxisScale : "linear";
|
|
3623
3670
|
const yConfig = { y: {} };
|
|
3624
3671
|
yConfig.y.label = label;
|
|
@@ -3626,34 +3673,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
|
|
|
3626
3673
|
if (yAxisAbbreviation !== "none") {
|
|
3627
3674
|
yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
|
|
3628
3675
|
}
|
|
3629
|
-
if (yAxisAbbreviation
|
|
3630
|
-
yConfig.y.width = 55;
|
|
3631
|
-
} else {
|
|
3676
|
+
if (yAxisAbbreviation !== "none") {
|
|
3632
3677
|
yConfig.y.width = label && label.length > 0 ? 30 : 10;
|
|
3633
3678
|
}
|
|
3634
3679
|
if (yAxisLabelVisibility === "hide") {
|
|
3635
3680
|
yConfig.y.hideLabels = true;
|
|
3636
3681
|
}
|
|
3682
|
+
if (yAxisMin !== void 0 || yAxisMax !== void 0) {
|
|
3683
|
+
yConfig.y.range = (u, dataMin, dataMax) => {
|
|
3684
|
+
const min = yAxisMin != null ? yAxisMin : dataMin;
|
|
3685
|
+
const max = yAxisMax != null ? yAxisMax : dataMax;
|
|
3686
|
+
return [min, max];
|
|
3687
|
+
};
|
|
3688
|
+
}
|
|
3637
3689
|
return yConfig;
|
|
3638
3690
|
};
|
|
3639
|
-
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
|
|
3691
|
+
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
|
|
3640
3692
|
const y2Config = { y2: {} };
|
|
3641
3693
|
const scaleType = axisScale != null ? axisScale : "linear";
|
|
3642
3694
|
y2Config.y2.label = label;
|
|
3643
3695
|
y2Config.y2.side = "right";
|
|
3644
|
-
y2Config.y2.showGrid = false;
|
|
3645
3696
|
y2Config.y2.type = scaleType;
|
|
3646
3697
|
if (axisAbbreviation !== "none") {
|
|
3647
3698
|
y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
|
|
3699
|
+
y2Config.y2.width = label && label.length > 0 ? 50 : 10;
|
|
3648
3700
|
} else if (roundAxisLabelsToInteger) {
|
|
3649
3701
|
y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
|
|
3650
3702
|
}
|
|
3651
3703
|
if (y2AxisLabelVisibility === "hide") {
|
|
3652
3704
|
y2Config.y2.hideLabels = true;
|
|
3653
3705
|
}
|
|
3706
|
+
if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
|
|
3707
|
+
y2Config.y2.range = (u, dataMin, dataMax) => {
|
|
3708
|
+
const min = y2AxisMin != null ? y2AxisMin : dataMin;
|
|
3709
|
+
const max = y2AxisMax != null ? y2AxisMax : dataMax;
|
|
3710
|
+
return [min, max];
|
|
3711
|
+
};
|
|
3712
|
+
}
|
|
3654
3713
|
return y2Config;
|
|
3655
3714
|
};
|
|
3656
|
-
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
|
|
3715
|
+
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
|
|
3657
3716
|
const seriesConfig = {};
|
|
3658
3717
|
let spanGaps;
|
|
3659
3718
|
let replaceNullsWithZero;
|
|
@@ -3680,6 +3739,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
3680
3739
|
);
|
|
3681
3740
|
if (shouldAssignToY2) {
|
|
3682
3741
|
seriesConfig[field].overrides.scale = "y2";
|
|
3742
|
+
} else {
|
|
3743
|
+
seriesConfig[field].overrides.scale = "y";
|
|
3683
3744
|
}
|
|
3684
3745
|
}
|
|
3685
3746
|
if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
|
|
@@ -3688,12 +3749,50 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
3688
3749
|
if (markerDisplay !== void 0) {
|
|
3689
3750
|
seriesConfig[field].markerDisplay = markerDisplay;
|
|
3690
3751
|
}
|
|
3752
|
+
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
3753
|
+
if (fieldDashStyle) {
|
|
3754
|
+
seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
3755
|
+
}
|
|
3756
|
+
const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
|
|
3757
|
+
const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
|
|
3758
|
+
if (fieldStepPosition && fieldStepPosition !== "off") {
|
|
3759
|
+
seriesConfig[field].stepPosition = fieldStepPosition;
|
|
3760
|
+
}
|
|
3691
3761
|
if (replaceNullsWithZero !== void 0) {
|
|
3692
3762
|
seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
|
|
3693
3763
|
}
|
|
3694
3764
|
});
|
|
3695
3765
|
return seriesConfig;
|
|
3696
3766
|
};
|
|
3767
|
+
var findRangeIndices = (xData, startValue, endValue) => {
|
|
3768
|
+
let startXIndex = -1;
|
|
3769
|
+
let endXIndex = -1;
|
|
3770
|
+
const xDataEpoch = xData.map((val) => {
|
|
3771
|
+
if (typeof val === "string") {
|
|
3772
|
+
return new Date(val).getTime() / 1e3;
|
|
3773
|
+
}
|
|
3774
|
+
return val;
|
|
3775
|
+
});
|
|
3776
|
+
for (let i = 0; i < xDataEpoch.length; i += 1) {
|
|
3777
|
+
if (xDataEpoch[i] >= startValue) {
|
|
3778
|
+
startXIndex = i;
|
|
3779
|
+
break;
|
|
3780
|
+
}
|
|
3781
|
+
}
|
|
3782
|
+
if (startXIndex === -1 && xDataEpoch.length > 0) {
|
|
3783
|
+
startXIndex = xDataEpoch.length - 1;
|
|
3784
|
+
}
|
|
3785
|
+
for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
|
|
3786
|
+
if (xDataEpoch[i] <= endValue) {
|
|
3787
|
+
endXIndex = i;
|
|
3788
|
+
break;
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
if (endXIndex === -1 && xDataEpoch.length > 0) {
|
|
3792
|
+
endXIndex = 0;
|
|
3793
|
+
}
|
|
3794
|
+
return { startXIndex, endXIndex };
|
|
3795
|
+
};
|
|
3697
3796
|
|
|
3698
3797
|
// src/common/TimeSeriesChartWrapper.tsx
|
|
3699
3798
|
var TimeSeriesChartContainer = styled_components_default.div`
|
|
@@ -3704,38 +3803,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
|
|
|
3704
3803
|
position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
|
|
3705
3804
|
}
|
|
3706
3805
|
`;
|
|
3707
|
-
var
|
|
3806
|
+
var appendTrellisToPayload2 = (payload, trellisKey, trellisSplitBy) => {
|
|
3807
|
+
const result = __spreadValues({}, payload);
|
|
3808
|
+
if (trellisSplitBy) {
|
|
3809
|
+
result["trellis.name"] = trellisSplitBy;
|
|
3810
|
+
}
|
|
3811
|
+
if (trellisKey) {
|
|
3812
|
+
result["trellis.value"] = trellisKey;
|
|
3813
|
+
}
|
|
3814
|
+
return result;
|
|
3815
|
+
};
|
|
3816
|
+
var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
|
|
3817
|
+
if (!previousPayload) {
|
|
3818
|
+
return true;
|
|
3819
|
+
}
|
|
3820
|
+
if (currentPayload.index !== previousPayload.index) {
|
|
3821
|
+
return true;
|
|
3822
|
+
}
|
|
3823
|
+
if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
|
|
3824
|
+
return true;
|
|
3825
|
+
}
|
|
3826
|
+
if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
|
|
3827
|
+
return true;
|
|
3828
|
+
}
|
|
3829
|
+
if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
|
|
3830
|
+
return true;
|
|
3831
|
+
}
|
|
3832
|
+
return false;
|
|
3833
|
+
};
|
|
3834
|
+
var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
3708
3835
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
|
|
3709
3836
|
name: chartEvent.seriesKey
|
|
3710
3837
|
});
|
|
3711
3838
|
delete payload.seriesKey;
|
|
3712
3839
|
if (chartEvent.rowContext) {
|
|
3713
|
-
Object.
|
|
3714
|
-
payload
|
|
3715
|
-
|
|
3840
|
+
Object.assign(
|
|
3841
|
+
payload,
|
|
3842
|
+
Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
|
|
3843
|
+
acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
|
|
3844
|
+
return acc;
|
|
3845
|
+
}, {})
|
|
3846
|
+
);
|
|
3716
3847
|
}
|
|
3848
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3717
3849
|
if (onClick) {
|
|
3718
3850
|
onClick({
|
|
3719
3851
|
type: "point.click",
|
|
3720
3852
|
originalEvent: chartEvent,
|
|
3721
|
-
payload
|
|
3853
|
+
payload: updatedPayload
|
|
3722
3854
|
});
|
|
3723
3855
|
}
|
|
3724
3856
|
};
|
|
3725
|
-
var handleLegendClick = (chartEvent, onClick) => {
|
|
3857
|
+
var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
3726
3858
|
const payload = {
|
|
3727
3859
|
name: chartEvent
|
|
3728
3860
|
};
|
|
3861
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3729
3862
|
if (onClick) {
|
|
3730
3863
|
onClick({
|
|
3731
3864
|
type: "legend.click",
|
|
3732
3865
|
originalEvent: chartEvent,
|
|
3733
|
-
payload
|
|
3866
|
+
payload: updatedPayload
|
|
3867
|
+
});
|
|
3868
|
+
}
|
|
3869
|
+
};
|
|
3870
|
+
var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
3871
|
+
var _a;
|
|
3872
|
+
if (!rangeEvent) {
|
|
3873
|
+
return;
|
|
3874
|
+
}
|
|
3875
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
3876
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
3877
|
+
const payload = {
|
|
3878
|
+
startXIndex,
|
|
3879
|
+
startXValue: rangeEvent.start,
|
|
3880
|
+
endXIndex,
|
|
3881
|
+
endXValue: rangeEvent.end
|
|
3882
|
+
};
|
|
3883
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3884
|
+
if (onSelect) {
|
|
3885
|
+
onSelect({
|
|
3886
|
+
type: "range.selectBeforeZoom",
|
|
3887
|
+
originalEvent: rangeEvent,
|
|
3888
|
+
payload: updatedPayload
|
|
3889
|
+
});
|
|
3890
|
+
}
|
|
3891
|
+
};
|
|
3892
|
+
var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
3893
|
+
var _a;
|
|
3894
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
3895
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
3896
|
+
const payload = {
|
|
3897
|
+
startXIndex,
|
|
3898
|
+
startXValue: rangeEvent.start,
|
|
3899
|
+
endXIndex,
|
|
3900
|
+
endXValue: rangeEvent.end
|
|
3901
|
+
};
|
|
3902
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3903
|
+
if (onSelect) {
|
|
3904
|
+
onSelect({
|
|
3905
|
+
type: "range.select",
|
|
3906
|
+
originalEvent: rangeEvent,
|
|
3907
|
+
payload: updatedPayload
|
|
3734
3908
|
});
|
|
3735
3909
|
}
|
|
3736
3910
|
};
|
|
3911
|
+
var parseArrayOption = (value) => {
|
|
3912
|
+
if (Array.isArray(value)) {
|
|
3913
|
+
return value;
|
|
3914
|
+
}
|
|
3915
|
+
if (value) {
|
|
3916
|
+
return JSON.parse(value);
|
|
3917
|
+
}
|
|
3918
|
+
return void 0;
|
|
3919
|
+
};
|
|
3737
3920
|
var TimeSeriesChartWrapper = (props) => {
|
|
3738
|
-
|
|
3921
|
+
var _b, _c, _d;
|
|
3922
|
+
const _a = props, {
|
|
3739
3923
|
width,
|
|
3740
3924
|
height,
|
|
3741
3925
|
chartData,
|
|
@@ -3748,12 +3932,57 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3748
3932
|
markerDisplay,
|
|
3749
3933
|
onClick,
|
|
3750
3934
|
onPointMouseOver,
|
|
3751
|
-
onPointMouseOut
|
|
3752
|
-
|
|
3753
|
-
|
|
3935
|
+
onPointMouseOut,
|
|
3936
|
+
onSelect,
|
|
3937
|
+
splitByLayout,
|
|
3938
|
+
trellisKey,
|
|
3939
|
+
trellisSplitBy,
|
|
3754
3940
|
backgroundColor,
|
|
3941
|
+
defaultFontColor,
|
|
3942
|
+
additionalTooltipValues,
|
|
3943
|
+
xAxisLineVisibility: xAxisLineVisibility,
|
|
3944
|
+
yAxisLineVisibility,
|
|
3945
|
+
y2AxisLineVisibility,
|
|
3946
|
+
showYAxisWithZero: showYAxisWithZeroFromProps,
|
|
3947
|
+
showY2AxisWithZero: showY2AxisWithZeroFromProps
|
|
3948
|
+
} = _a, otherOptions = __objRest(_a, [
|
|
3949
|
+
"width",
|
|
3950
|
+
"height",
|
|
3951
|
+
"chartData",
|
|
3952
|
+
"options",
|
|
3953
|
+
"userLocale",
|
|
3954
|
+
"annotationX",
|
|
3955
|
+
"annotationLabel",
|
|
3956
|
+
"annotationColor",
|
|
3957
|
+
"legendDisplay",
|
|
3958
|
+
"markerDisplay",
|
|
3959
|
+
"onClick",
|
|
3960
|
+
"onPointMouseOver",
|
|
3961
|
+
"onPointMouseOut",
|
|
3962
|
+
"onSelect",
|
|
3963
|
+
"splitByLayout",
|
|
3964
|
+
"trellisKey",
|
|
3965
|
+
"trellisSplitBy",
|
|
3966
|
+
"backgroundColor",
|
|
3967
|
+
"defaultFontColor",
|
|
3968
|
+
"additionalTooltipValues",
|
|
3969
|
+
// Extract axis line visibility options from props
|
|
3970
|
+
"xAxisLineVisibility",
|
|
3971
|
+
"yAxisLineVisibility",
|
|
3972
|
+
"y2AxisLineVisibility",
|
|
3973
|
+
// Extract showYAxisWithZero directly from props for accelerated render mode
|
|
3974
|
+
"showYAxisWithZero",
|
|
3975
|
+
"showY2AxisWithZero"
|
|
3976
|
+
]);
|
|
3977
|
+
const { eventHandlers, xField: xFieldFromProps } = otherOptions;
|
|
3978
|
+
const trellisEnabled = useTrellisEnabled(splitByLayout);
|
|
3979
|
+
const {
|
|
3980
|
+
backgroundColor: bgColorFromOptions,
|
|
3755
3981
|
seriesColors: seriesColorsStr,
|
|
3756
3982
|
fieldColors,
|
|
3983
|
+
legendLabels: legendLabelsStr,
|
|
3984
|
+
legendMode,
|
|
3985
|
+
legendTruncation,
|
|
3757
3986
|
"axisTitleX.text": xAxisTitleText,
|
|
3758
3987
|
"axisTitleY.text": yAxisTitleText,
|
|
3759
3988
|
"axisTitleY2.text": y2AxisTitleText,
|
|
@@ -3761,8 +3990,12 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3761
3990
|
"axisTitleY.visibility": yAxisTitleVisibility,
|
|
3762
3991
|
"axisTitleY2.visibility": y2AxisTitleVisibility,
|
|
3763
3992
|
"axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
|
|
3993
|
+
"axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
|
|
3994
|
+
"axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
|
|
3764
3995
|
"axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
|
|
3996
|
+
"axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
|
|
3765
3997
|
"axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
|
|
3998
|
+
"axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
|
|
3766
3999
|
"axisY.abbreviation": yAxisAbbreviation,
|
|
3767
4000
|
"axisY.scale": yAxisScale,
|
|
3768
4001
|
"axisY2.abbreviation": y2AxisAbbreviation,
|
|
@@ -3772,10 +4005,73 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3772
4005
|
"axisLabelsY2.integerUnits": y2IntegerUnits,
|
|
3773
4006
|
"chart.overlayFields": overlayFieldsStr,
|
|
3774
4007
|
"chart.nullValueMode": nullValueMode,
|
|
3775
|
-
|
|
4008
|
+
"chart.showDataLabels": showDataLabels,
|
|
4009
|
+
lineWidth,
|
|
4010
|
+
lineDashStyle,
|
|
4011
|
+
fieldDashStyles: lineDashStylesByFieldStr,
|
|
4012
|
+
stepPosition,
|
|
4013
|
+
fieldStepPositions: stepPositionsByFieldStr,
|
|
4014
|
+
yAxisMin: yAxisMinRaw,
|
|
4015
|
+
yAxisMax: yAxisMaxRaw,
|
|
4016
|
+
y2AxisMin: y2AxisMinRaw,
|
|
4017
|
+
y2AxisMax: y2AxisMaxRaw,
|
|
4018
|
+
showXMajorGridLines,
|
|
4019
|
+
showYMajorGridLines,
|
|
4020
|
+
showY2MajorGridLines,
|
|
4021
|
+
showYMinorGridLines,
|
|
4022
|
+
showY2MinorGridLines,
|
|
4023
|
+
showLineSmoothing,
|
|
4024
|
+
xAxisMajorTickVisibility,
|
|
4025
|
+
xAxisMajorTickSize,
|
|
4026
|
+
yAxisMajorTickVisibility,
|
|
4027
|
+
y2AxisMajorTickVisibility,
|
|
4028
|
+
yAxisMajorTickSize,
|
|
4029
|
+
y2AxisMajorTickSize,
|
|
4030
|
+
yAxisMajorTickInterval,
|
|
4031
|
+
y2AxisMajorTickInterval,
|
|
4032
|
+
yAxisMinorTickVisibility,
|
|
4033
|
+
y2AxisMinorTickVisibility,
|
|
4034
|
+
yAxisMinorTickSize,
|
|
4035
|
+
y2AxisMinorTickSize,
|
|
4036
|
+
showYAxisWithZero: showYAxisWithZeroFromOptions,
|
|
4037
|
+
showY2AxisWithZero: showY2AxisWithZeroFromOptions
|
|
3776
4038
|
} = options;
|
|
4039
|
+
const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
|
|
4040
|
+
const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
|
|
4041
|
+
const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
|
|
4042
|
+
const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
|
|
4043
|
+
const showYMajorTicks = yAxisMajorTickVisibility === "show";
|
|
4044
|
+
const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
|
|
4045
|
+
const showYMinorTicks = yAxisMinorTickVisibility === "show";
|
|
4046
|
+
const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
|
|
4047
|
+
const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
|
|
4048
|
+
const showYAxisLine = yAxisLineVisibility === "show";
|
|
4049
|
+
const showY2AxisLine = y2AxisLineVisibility === "show";
|
|
4050
|
+
const yAxisMin = parseAxisValue(yAxisMinRaw);
|
|
4051
|
+
const yAxisMax = parseAxisValue(yAxisMaxRaw);
|
|
4052
|
+
const y2AxisMin = parseAxisValue(y2AxisMinRaw);
|
|
4053
|
+
const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
|
|
4054
|
+
const parseTickInterval = (simpleXMLValue, canvasValue) => {
|
|
4055
|
+
if (simpleXMLValue) return Number(simpleXMLValue);
|
|
4056
|
+
if (canvasValue) return Number(canvasValue);
|
|
4057
|
+
return void 0;
|
|
4058
|
+
};
|
|
4059
|
+
const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
|
|
4060
|
+
const y2AxisMajorTickIntervalNum = parseTickInterval(
|
|
4061
|
+
y2AxisMajorUnitFromSimpleXML,
|
|
4062
|
+
y2AxisMajorTickInterval
|
|
4063
|
+
);
|
|
4064
|
+
const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
|
|
4065
|
+
const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
|
|
4066
|
+
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
|
|
4067
|
+
const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
|
|
4068
|
+
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
|
|
3777
4069
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
3778
4070
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
4071
|
+
const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
|
|
4072
|
+
const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
|
|
4073
|
+
const legendLabels = parseArrayOption(legendLabelsStr);
|
|
4074
|
+
const bgColor = backgroundColor || bgColorFromOptions;
|
|
3779
4075
|
const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
|
|
3780
4076
|
const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
|
|
3781
4077
|
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
@@ -3786,31 +4082,64 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3786
4082
|
fields: chartData.fields,
|
|
3787
4083
|
columns: chartData.seriesList
|
|
3788
4084
|
});
|
|
3789
|
-
const xField =
|
|
4085
|
+
const xField = getFieldName2(filteredChartData.fields[0]);
|
|
3790
4086
|
const yFields = getFieldNames(
|
|
3791
4087
|
filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
|
|
3792
4088
|
);
|
|
3793
|
-
const y2Fields =
|
|
3794
|
-
|
|
4089
|
+
const y2Fields = (0, react_exports.useMemo)(
|
|
4090
|
+
() => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
|
|
4091
|
+
[y2FieldsStr]
|
|
4092
|
+
);
|
|
4093
|
+
const overlayFields = (0, react_exports.useMemo)(
|
|
4094
|
+
() => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
|
|
4095
|
+
[overlayFieldsStr]
|
|
4096
|
+
);
|
|
3795
4097
|
let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
|
|
3796
4098
|
xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
|
|
3797
|
-
|
|
4099
|
+
const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
|
|
4100
|
+
let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
|
|
3798
4101
|
yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
|
|
3799
4102
|
const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
|
|
3800
4103
|
let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
|
|
3801
4104
|
y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
|
|
3802
|
-
const xScaleConfig =
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
4105
|
+
const xScaleConfig = (0, react_exports.useMemo)(
|
|
4106
|
+
() => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
|
|
4107
|
+
[xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
|
|
4108
|
+
);
|
|
4109
|
+
const yScaleConfig = (0, react_exports.useMemo)(
|
|
4110
|
+
() => getYScaleConfig(
|
|
4111
|
+
yAxisTitle,
|
|
4112
|
+
yAxisAbbreviation,
|
|
4113
|
+
yAxisScale,
|
|
4114
|
+
yAxisLabelVisibility,
|
|
4115
|
+
yAxisMin,
|
|
4116
|
+
yAxisMax
|
|
4117
|
+
),
|
|
4118
|
+
[yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
|
|
4119
|
+
);
|
|
4120
|
+
const y2ScaleConfig = (0, react_exports.useMemo)(() => {
|
|
4121
|
+
if (y2Enabled) {
|
|
4122
|
+
return getY2ScaleConfig(
|
|
4123
|
+
y2AxisTitle,
|
|
4124
|
+
y2AxisAbbreviation,
|
|
4125
|
+
y2AxisScale,
|
|
4126
|
+
y2IntegerUnits,
|
|
4127
|
+
y2AxisLabelVisibility,
|
|
4128
|
+
y2AxisMin,
|
|
4129
|
+
y2AxisMax
|
|
4130
|
+
);
|
|
4131
|
+
}
|
|
4132
|
+
return {};
|
|
4133
|
+
}, [
|
|
4134
|
+
y2Enabled,
|
|
4135
|
+
y2AxisTitle,
|
|
4136
|
+
y2AxisAbbreviation,
|
|
4137
|
+
y2AxisScale,
|
|
4138
|
+
y2IntegerUnits,
|
|
4139
|
+
y2AxisLabelVisibility,
|
|
4140
|
+
y2AxisMin,
|
|
4141
|
+
y2AxisMax
|
|
4142
|
+
]);
|
|
3814
4143
|
const uplotContainerElement = (0, react_exports.useRef)(null);
|
|
3815
4144
|
const seriesDataFormatted = [
|
|
3816
4145
|
filteredChartData.columns[0],
|
|
@@ -3826,9 +4155,25 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3826
4155
|
overlayFields,
|
|
3827
4156
|
y2Enabled,
|
|
3828
4157
|
nullValueMode,
|
|
3829
|
-
markerDisplay
|
|
4158
|
+
markerDisplay,
|
|
4159
|
+
lineDashStyle,
|
|
4160
|
+
lineDashStylesByField,
|
|
4161
|
+
stepPosition,
|
|
4162
|
+
stepPositionsByField
|
|
3830
4163
|
),
|
|
3831
|
-
[
|
|
4164
|
+
[
|
|
4165
|
+
yFields,
|
|
4166
|
+
y2Fields,
|
|
4167
|
+
lineWidth,
|
|
4168
|
+
overlayFields,
|
|
4169
|
+
y2Enabled,
|
|
4170
|
+
nullValueMode,
|
|
4171
|
+
markerDisplay,
|
|
4172
|
+
lineDashStyle,
|
|
4173
|
+
lineDashStylesByField,
|
|
4174
|
+
stepPosition,
|
|
4175
|
+
stepPositionsByField
|
|
4176
|
+
]
|
|
3832
4177
|
);
|
|
3833
4178
|
const chartingEventAnnotations = (0, react_exports.useMemo)(
|
|
3834
4179
|
() => getAnnotationsForCanvas({
|
|
@@ -3842,25 +4187,59 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3842
4187
|
() => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
|
|
3843
4188
|
[xScaleConfig, yScaleConfig, y2ScaleConfig]
|
|
3844
4189
|
);
|
|
3845
|
-
const
|
|
4190
|
+
const isSeriesCompare = legendMode === "seriesCompare";
|
|
4191
|
+
const legend = (0, react_exports.useMemo)(
|
|
4192
|
+
() => getLegend({
|
|
4193
|
+
legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
|
|
4194
|
+
isSeriesCompare,
|
|
4195
|
+
legendTruncation
|
|
4196
|
+
}),
|
|
4197
|
+
[legendDisplay, isSeriesCompare, legendTruncation]
|
|
4198
|
+
);
|
|
3846
4199
|
const handleChartClick = react_exports.useCallback(
|
|
3847
4200
|
(event) => {
|
|
3848
4201
|
if (onClick) {
|
|
3849
|
-
handleClick(event, onClick);
|
|
4202
|
+
handleClick(event, onClick, trellisKey, trellisSplitBy);
|
|
3850
4203
|
}
|
|
3851
4204
|
},
|
|
3852
|
-
[onClick]
|
|
4205
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
3853
4206
|
);
|
|
3854
4207
|
const handleChartLegendClick = react_exports.useCallback(
|
|
3855
4208
|
(event) => {
|
|
3856
4209
|
if (onClick) {
|
|
3857
|
-
handleLegendClick(event, onClick);
|
|
4210
|
+
handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
|
|
3858
4211
|
}
|
|
3859
4212
|
},
|
|
3860
|
-
[onClick]
|
|
4213
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
4214
|
+
);
|
|
4215
|
+
const handleChartRangeSelection = react_exports.useCallback(
|
|
4216
|
+
(range2) => {
|
|
4217
|
+
if (onSelect) {
|
|
4218
|
+
handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
4219
|
+
}
|
|
4220
|
+
},
|
|
4221
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
4222
|
+
);
|
|
4223
|
+
const handleChartRangeZoom = react_exports.useCallback(
|
|
4224
|
+
(range2) => {
|
|
4225
|
+
if (onSelect) {
|
|
4226
|
+
handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
4227
|
+
}
|
|
4228
|
+
},
|
|
4229
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
4230
|
+
);
|
|
4231
|
+
const xFieldToUse = xFieldFromProps || xField;
|
|
4232
|
+
const enableSearchZoom = react_exports.useMemo(
|
|
4233
|
+
() => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
|
|
4234
|
+
[eventHandlers, xFieldToUse]
|
|
3861
4235
|
);
|
|
3862
4236
|
const lastPayloadRef = react_exports.useRef(null);
|
|
3863
4237
|
const lastOriginalEventRef = react_exports.useRef(null);
|
|
4238
|
+
const previousMouseoverPayloadRef = react_exports.useRef(null);
|
|
4239
|
+
const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
|
|
4240
|
+
react_exports.useEffect(() => {
|
|
4241
|
+
additionalTooltipValuesRef.current = additionalTooltipValues;
|
|
4242
|
+
}, [additionalTooltipValues]);
|
|
3864
4243
|
const handleChartCrosshairChange = react_exports.useCallback(
|
|
3865
4244
|
(event) => {
|
|
3866
4245
|
if (onPointMouseOver || onPointMouseOut) {
|
|
@@ -3872,6 +4251,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3872
4251
|
payload: lastPayloadRef.current
|
|
3873
4252
|
});
|
|
3874
4253
|
}
|
|
4254
|
+
previousMouseoverPayloadRef.current = null;
|
|
3875
4255
|
return;
|
|
3876
4256
|
}
|
|
3877
4257
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
|
|
@@ -3879,25 +4259,36 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3879
4259
|
});
|
|
3880
4260
|
delete payload.seriesKey;
|
|
3881
4261
|
if (event.rowContext) {
|
|
3882
|
-
Object.
|
|
3883
|
-
payload
|
|
3884
|
-
|
|
4262
|
+
Object.assign(
|
|
4263
|
+
payload,
|
|
4264
|
+
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
4265
|
+
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
4266
|
+
return acc;
|
|
4267
|
+
}, {})
|
|
4268
|
+
);
|
|
4269
|
+
}
|
|
4270
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
4271
|
+
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
4272
|
+
return;
|
|
3885
4273
|
}
|
|
3886
|
-
lastPayloadRef.current =
|
|
4274
|
+
lastPayloadRef.current = updatedPayload;
|
|
3887
4275
|
lastOriginalEventRef.current = event;
|
|
4276
|
+
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
3888
4277
|
if (onPointMouseOver) {
|
|
3889
4278
|
onPointMouseOver({
|
|
3890
4279
|
type: "point.mouseover",
|
|
3891
4280
|
originalEvent: event,
|
|
3892
|
-
payload
|
|
4281
|
+
payload: updatedPayload
|
|
3893
4282
|
});
|
|
3894
4283
|
}
|
|
3895
4284
|
}
|
|
3896
4285
|
},
|
|
3897
|
-
[onPointMouseOver, onPointMouseOut]
|
|
4286
|
+
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
|
|
3898
4287
|
);
|
|
3899
|
-
const
|
|
3900
|
-
|
|
4288
|
+
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}`;
|
|
4289
|
+
const memoizedChart = (0, react_exports.useMemo)(() => {
|
|
4290
|
+
const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
|
|
4291
|
+
return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
|
|
3901
4292
|
visualization_canvas_exports.TimeSeriesChart,
|
|
3902
4293
|
{
|
|
3903
4294
|
data: chartData,
|
|
@@ -3907,49 +4298,121 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3907
4298
|
seriesColorsByField,
|
|
3908
4299
|
seriesConfig: seriesOverrides,
|
|
3909
4300
|
legend,
|
|
4301
|
+
legendLabels,
|
|
4302
|
+
legendTruncation,
|
|
4303
|
+
isSeriesCompare: legendMode === "seriesCompare",
|
|
4304
|
+
maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
|
|
3910
4305
|
scaleConfig,
|
|
3911
4306
|
timestampFormat: "expanded",
|
|
3912
4307
|
onCrosshairClick: onClick ? handleChartClick : void 0,
|
|
3913
4308
|
onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
|
|
3914
4309
|
onSeriesClick: onClick ? handleChartLegendClick : void 0,
|
|
4310
|
+
onRangeSelection: handleChartRangeSelection,
|
|
4311
|
+
onRangeZoom: computedOnRangeZoom,
|
|
4312
|
+
serverSideZoom: enableSearchZoom,
|
|
3915
4313
|
userLocale,
|
|
3916
4314
|
events: chartingEventAnnotations,
|
|
3917
|
-
eventsConfig: { renderer: triangleEventAnnotationRenderer }
|
|
4315
|
+
eventsConfig: { renderer: triangleEventAnnotationRenderer },
|
|
4316
|
+
additionalTooltipValuesRef,
|
|
4317
|
+
showXMajorGridLines,
|
|
4318
|
+
showYMajorGridLines,
|
|
4319
|
+
showY2MajorGridLines,
|
|
4320
|
+
showYMinorGridLines,
|
|
4321
|
+
showY2MinorGridLines,
|
|
4322
|
+
showLineSmoothing,
|
|
4323
|
+
dataValuesDisplay,
|
|
4324
|
+
showXMajorTicks,
|
|
4325
|
+
xAxisMajorTickSize: xAxisMajorTickSizeNum,
|
|
4326
|
+
showYMajorTicks,
|
|
4327
|
+
showY2MajorTicks,
|
|
4328
|
+
yAxisMajorTickSize: yAxisMajorTickSizeNum,
|
|
4329
|
+
y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
|
|
4330
|
+
yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
|
|
4331
|
+
y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
|
|
4332
|
+
showYMinorTicks,
|
|
4333
|
+
showY2MinorTicks,
|
|
4334
|
+
yAxisMinorTickSize: yAxisMinorTickSizeNum,
|
|
4335
|
+
y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
|
|
4336
|
+
showYAxisWithZero,
|
|
4337
|
+
showY2AxisWithZero,
|
|
4338
|
+
showXAxisLine,
|
|
4339
|
+
showYAxisLine,
|
|
4340
|
+
showY2AxisLine,
|
|
4341
|
+
xAxisMaxLabelParts
|
|
3918
4342
|
}
|
|
3919
|
-
)
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
4343
|
+
));
|
|
4344
|
+
}, [
|
|
4345
|
+
onSelect,
|
|
4346
|
+
handleChartRangeZoom,
|
|
4347
|
+
dataKey,
|
|
4348
|
+
chartData,
|
|
4349
|
+
containerWidth,
|
|
4350
|
+
containerHeight,
|
|
4351
|
+
seriesColors,
|
|
4352
|
+
seriesColorsByField,
|
|
4353
|
+
seriesOverrides,
|
|
4354
|
+
legend,
|
|
4355
|
+
legendLabels,
|
|
4356
|
+
legendTruncation,
|
|
4357
|
+
scaleConfig,
|
|
4358
|
+
onClick,
|
|
4359
|
+
handleChartClick,
|
|
4360
|
+
onPointMouseOver,
|
|
4361
|
+
onPointMouseOut,
|
|
4362
|
+
handleChartCrosshairChange,
|
|
4363
|
+
handleChartLegendClick,
|
|
4364
|
+
handleChartRangeSelection,
|
|
4365
|
+
enableSearchZoom,
|
|
4366
|
+
userLocale,
|
|
4367
|
+
chartingEventAnnotations,
|
|
4368
|
+
showXMajorGridLines,
|
|
4369
|
+
showYMajorGridLines,
|
|
4370
|
+
showY2MajorGridLines,
|
|
4371
|
+
showYMinorGridLines,
|
|
4372
|
+
showY2MinorGridLines,
|
|
4373
|
+
showLineSmoothing,
|
|
4374
|
+
dataValuesDisplay,
|
|
4375
|
+
showXMajorTicks,
|
|
4376
|
+
xAxisMajorTickSizeNum,
|
|
4377
|
+
showYMajorTicks,
|
|
4378
|
+
showY2MajorTicks,
|
|
4379
|
+
yAxisMajorTickSizeNum,
|
|
4380
|
+
y2AxisMajorTickSizeNum,
|
|
4381
|
+
yAxisMajorTickIntervalNum,
|
|
4382
|
+
y2AxisMajorTickIntervalNum,
|
|
4383
|
+
showYMinorTicks,
|
|
4384
|
+
showY2MinorTicks,
|
|
4385
|
+
yAxisMinorTickSizeNum,
|
|
4386
|
+
y2AxisMinorTickSizeNum,
|
|
4387
|
+
showYAxisWithZero,
|
|
4388
|
+
showY2AxisWithZero,
|
|
4389
|
+
showXAxisLine,
|
|
4390
|
+
showYAxisLine,
|
|
4391
|
+
showY2AxisLine,
|
|
4392
|
+
legendMode,
|
|
4393
|
+
xAxisMaxLabelParts
|
|
4394
|
+
]);
|
|
3939
4395
|
const memoizedVisualization = (0, react_exports.useMemo)(() => {
|
|
3940
|
-
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
|
|
3941
|
-
}, [
|
|
3942
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
4396
|
+
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
|
|
4397
|
+
}, [bgColor, memoizedChart]);
|
|
4398
|
+
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
|
|
4399
|
+
TrellisTitle,
|
|
4400
|
+
{
|
|
4401
|
+
trellisKey,
|
|
4402
|
+
backgroundColor: bgColor,
|
|
4403
|
+
fontColor: defaultFontColor
|
|
4404
|
+
}
|
|
4405
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
3943
4406
|
TimeSeriesChartContainer,
|
|
3944
4407
|
{
|
|
3945
|
-
height,
|
|
4408
|
+
height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
|
|
3946
4409
|
width,
|
|
3947
4410
|
ref: uplotContainerElement,
|
|
3948
4411
|
"data-test": "timeseries-chart-wrapper"
|
|
3949
4412
|
},
|
|
3950
4413
|
/* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
|
|
3951
4414
|
memoizedVisualization
|
|
3952
|
-
);
|
|
4415
|
+
));
|
|
3953
4416
|
};
|
|
3954
4417
|
var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
|
|
3955
4418
|
|