@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/Column.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
|
|
@@ -1578,7 +1611,7 @@ var AxesChartLegendWithTrellisAndMode = ({
|
|
|
1578
1611
|
{ label: (0, i18n_exports._)("Bottom"), value: "bottom" },
|
|
1579
1612
|
{ label: (0, i18n_exports._)("Off"), value: "off" }
|
|
1580
1613
|
],
|
|
1581
|
-
tooltip: showLegendTooltip
|
|
1614
|
+
tooltip: showLegendTooltip ? (0, i18n_exports._)('Legend mode must be "Standard" to configure legend display') : void 0
|
|
1582
1615
|
},
|
|
1583
1616
|
isDisabled: showLegendTooltip ? ({ options }) => options.legendMode === "seriesCompare" : void 0,
|
|
1584
1617
|
overrideDefaultValue: ({ options }) => (options == null ? void 0 : options.splitByLayout) === "trellis" ? "off" : "right"
|
|
@@ -2709,7 +2742,7 @@ var Cover = styled_components_default.div`
|
|
|
2709
2742
|
bottom: 0;
|
|
2710
2743
|
`;
|
|
2711
2744
|
var Blocker = styled_components_default.div.attrs({
|
|
2712
|
-
"data-splunk-visualization-version": "28.
|
|
2745
|
+
"data-splunk-visualization-version": "28.5.0 - b192418b7"
|
|
2713
2746
|
})`
|
|
2714
2747
|
position: relative;
|
|
2715
2748
|
width: 100%;
|
|
@@ -2790,7 +2823,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
2790
2823
|
FixSizeItem,
|
|
2791
2824
|
{
|
|
2792
2825
|
"data-test": "fix-size-item",
|
|
2793
|
-
"data-splunk-visualization-version": "28.
|
|
2826
|
+
"data-splunk-visualization-version": "28.5.0 - b192418b7",
|
|
2794
2827
|
width,
|
|
2795
2828
|
height,
|
|
2796
2829
|
backgroundColor
|
|
@@ -3066,7 +3099,7 @@ var trellisUtils_default = "default" in defaultImport34 ? defaultImport34.defaul
|
|
|
3066
3099
|
var AGGREGATIONS = "aggregations";
|
|
3067
3100
|
var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
3068
3101
|
var _a, _b, _c, _d;
|
|
3069
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3102
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3070
3103
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3071
3104
|
let splitDataSources = null;
|
|
3072
3105
|
let errorCode = null;
|
|
@@ -3087,7 +3120,7 @@ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
|
3087
3120
|
}
|
|
3088
3121
|
return { splitDataSources, errorCode };
|
|
3089
3122
|
};
|
|
3090
|
-
var toFieldEntries = (fields) => {
|
|
3123
|
+
var toFieldEntries = (fields = []) => {
|
|
3091
3124
|
return fields.map((field) => {
|
|
3092
3125
|
if (typeof field === "string") {
|
|
3093
3126
|
return { name: field };
|
|
@@ -3102,7 +3135,7 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
3102
3135
|
let splitDataSources = null;
|
|
3103
3136
|
let splitByFields = [];
|
|
3104
3137
|
let errorCode = null;
|
|
3105
|
-
if (
|
|
3138
|
+
if (fields.length > 0) {
|
|
3106
3139
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
3107
3140
|
}
|
|
3108
3141
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -3140,12 +3173,12 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
3140
3173
|
};
|
|
3141
3174
|
var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
3142
3175
|
var _a, _b, _c, _d;
|
|
3143
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3176
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3144
3177
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3145
3178
|
let splitDataSources = null;
|
|
3146
3179
|
let splitByFields = [];
|
|
3147
3180
|
let errorCode = null;
|
|
3148
|
-
if (
|
|
3181
|
+
if (fields.length > 0) {
|
|
3149
3182
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
|
|
3150
3183
|
}
|
|
3151
3184
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -3169,12 +3202,12 @@ var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
|
3169
3202
|
};
|
|
3170
3203
|
var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
3171
3204
|
var _a, _b, _c, _d, _e;
|
|
3172
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3205
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3173
3206
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3174
3207
|
let splitDataSources = null;
|
|
3175
3208
|
let splitByFields = [];
|
|
3176
3209
|
let errorCode = null;
|
|
3177
|
-
if (
|
|
3210
|
+
if (fields.length > 0) {
|
|
3178
3211
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
3179
3212
|
}
|
|
3180
3213
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -3190,16 +3223,14 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
|
3190
3223
|
splitDataSources[val] = (0, lodash_exports.cloneDeep)(
|
|
3191
3224
|
(0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
|
|
3192
3225
|
);
|
|
3193
|
-
splitDataSources[val].primary.data.fields = [
|
|
3194
|
-
{ name: fields[0].name },
|
|
3195
|
-
...dataSourceKeys.map((k) => ({
|
|
3196
|
-
name: k
|
|
3197
|
-
}))
|
|
3198
|
-
];
|
|
3226
|
+
splitDataSources[val].primary.data.fields = [{ name: fields[0].name }];
|
|
3199
3227
|
splitDataSources[val].primary.data.columns = [[...columns[0]]];
|
|
3200
3228
|
dataSourceKeys.forEach((dsKey) => {
|
|
3201
3229
|
fields.forEach((field, idx) => {
|
|
3202
3230
|
if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
|
|
3231
|
+
splitDataSources[val].primary.data.fields.push({
|
|
3232
|
+
name: dsKey
|
|
3233
|
+
});
|
|
3203
3234
|
splitDataSources[val].primary.data.columns.push([...columns[idx]]);
|
|
3204
3235
|
}
|
|
3205
3236
|
});
|
|
@@ -3212,12 +3243,12 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
|
3212
3243
|
};
|
|
3213
3244
|
var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
3214
3245
|
var _a, _b, _c, _d;
|
|
3215
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3246
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3216
3247
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3217
3248
|
let splitDataSources = null;
|
|
3218
3249
|
let splitByFields = [];
|
|
3219
3250
|
let errorCode = null;
|
|
3220
|
-
if (
|
|
3251
|
+
if (fields.length > 0) {
|
|
3221
3252
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
3222
3253
|
}
|
|
3223
3254
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -3305,17 +3336,15 @@ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
|
3305
3336
|
};
|
|
3306
3337
|
var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
|
|
3307
3338
|
var _a, _b, _c, _d, _e, _f;
|
|
3308
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3339
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3309
3340
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3310
3341
|
let splitDataSources = null;
|
|
3311
3342
|
let splitByFields = [];
|
|
3312
3343
|
let errorCode = null;
|
|
3313
|
-
if (
|
|
3344
|
+
if (fields.length > 0) {
|
|
3314
3345
|
splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
|
|
3315
3346
|
}
|
|
3316
|
-
const splitByIndex = fields
|
|
3317
|
-
(field) => field === splitBy || field.name === splitBy
|
|
3318
|
-
);
|
|
3347
|
+
const splitByIndex = fields.findIndex((field) => field.name === splitBy);
|
|
3319
3348
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
3320
3349
|
const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
|
|
3321
3350
|
splitDataSources = {};
|
|
@@ -3592,17 +3621,34 @@ var filterChartDataFromInternalFields = (chartData) => {
|
|
|
3592
3621
|
var convert2DArrayToNumbers = (arr) => {
|
|
3593
3622
|
return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
|
|
3594
3623
|
};
|
|
3595
|
-
var
|
|
3596
|
-
|
|
3624
|
+
var parseAxisValue = (val) => {
|
|
3625
|
+
if (val === void 0 || val === null || val === "auto" || val === "") {
|
|
3626
|
+
return void 0;
|
|
3627
|
+
}
|
|
3628
|
+
const num = typeof val === "number" ? val : Number.parseFloat(val);
|
|
3629
|
+
return Number.isNaN(num) ? void 0 : num;
|
|
3630
|
+
};
|
|
3631
|
+
var parseXAxisLineVisibility = (visibility) => {
|
|
3632
|
+
if (visibility === "hide") return false;
|
|
3633
|
+
if (visibility === "show") return true;
|
|
3634
|
+
return void 0;
|
|
3635
|
+
};
|
|
3597
3636
|
var getLegend = (props) => {
|
|
3598
3637
|
const legendPlacement = props == null ? void 0 : props.legendDisplay;
|
|
3638
|
+
const { isSeriesCompare, legendTruncation } = props;
|
|
3639
|
+
const commonLegendProps = {
|
|
3640
|
+
center: true,
|
|
3641
|
+
fontSize: 12,
|
|
3642
|
+
largerTiles: true,
|
|
3643
|
+
hideSeriesValue: !isSeriesCompare,
|
|
3644
|
+
// Show values if in seriesCompare mode
|
|
3645
|
+
legendTruncation
|
|
3646
|
+
};
|
|
3599
3647
|
switch (legendPlacement) {
|
|
3600
3648
|
case "off":
|
|
3601
3649
|
return false;
|
|
3602
3650
|
case "left":
|
|
3603
|
-
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
|
|
3604
|
-
width: SideLegendWidth
|
|
3605
|
-
}, commonLegendProps));
|
|
3651
|
+
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
3606
3652
|
case "bottom":
|
|
3607
3653
|
return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
|
|
3608
3654
|
wrap: true
|
|
@@ -3612,9 +3658,7 @@ var getLegend = (props) => {
|
|
|
3612
3658
|
wrap: true
|
|
3613
3659
|
}, commonLegendProps));
|
|
3614
3660
|
default:
|
|
3615
|
-
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
|
|
3616
|
-
width: SideLegendWidth
|
|
3617
|
-
}, commonLegendProps));
|
|
3661
|
+
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
3618
3662
|
}
|
|
3619
3663
|
};
|
|
3620
3664
|
var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
|
|
@@ -3649,22 +3693,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
|
|
|
3649
3693
|
const end = axisTitle.slice(-halfChars);
|
|
3650
3694
|
return `${start}...${end}`;
|
|
3651
3695
|
};
|
|
3652
|
-
var
|
|
3696
|
+
var getFieldName2 = (field) => {
|
|
3653
3697
|
const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
|
|
3654
3698
|
return fieldName;
|
|
3655
3699
|
};
|
|
3656
3700
|
var getFieldNames = (fields) => {
|
|
3657
|
-
return fields.map((field) =>
|
|
3701
|
+
return fields.map((field) => getFieldName2(field));
|
|
3658
3702
|
};
|
|
3659
|
-
var getXScaleConfig = (label, xAxisLabelVisibility) => {
|
|
3703
|
+
var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
|
|
3660
3704
|
const xConfig = { x: {} };
|
|
3661
3705
|
xConfig.x.label = label;
|
|
3662
3706
|
if (xAxisLabelVisibility === "hide") {
|
|
3663
3707
|
xConfig.x.hideLabels = true;
|
|
3664
3708
|
}
|
|
3709
|
+
if (xAxisLabelRotation !== void 0) {
|
|
3710
|
+
xConfig.x.labelRotation = xAxisLabelRotation;
|
|
3711
|
+
}
|
|
3665
3712
|
return xConfig;
|
|
3666
3713
|
};
|
|
3667
|
-
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
|
|
3714
|
+
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
|
|
3668
3715
|
const scaleType = yAxisScale != null ? yAxisScale : "linear";
|
|
3669
3716
|
const yConfig = { y: {} };
|
|
3670
3717
|
yConfig.y.label = label;
|
|
@@ -3672,34 +3719,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
|
|
|
3672
3719
|
if (yAxisAbbreviation !== "none") {
|
|
3673
3720
|
yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
|
|
3674
3721
|
}
|
|
3675
|
-
if (yAxisAbbreviation
|
|
3676
|
-
yConfig.y.width = 55;
|
|
3677
|
-
} else {
|
|
3722
|
+
if (yAxisAbbreviation !== "none") {
|
|
3678
3723
|
yConfig.y.width = label && label.length > 0 ? 30 : 10;
|
|
3679
3724
|
}
|
|
3680
3725
|
if (yAxisLabelVisibility === "hide") {
|
|
3681
3726
|
yConfig.y.hideLabels = true;
|
|
3682
3727
|
}
|
|
3728
|
+
if (yAxisMin !== void 0 || yAxisMax !== void 0) {
|
|
3729
|
+
yConfig.y.range = (u, dataMin, dataMax) => {
|
|
3730
|
+
const min = yAxisMin != null ? yAxisMin : dataMin;
|
|
3731
|
+
const max = yAxisMax != null ? yAxisMax : dataMax;
|
|
3732
|
+
return [min, max];
|
|
3733
|
+
};
|
|
3734
|
+
}
|
|
3683
3735
|
return yConfig;
|
|
3684
3736
|
};
|
|
3685
|
-
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
|
|
3737
|
+
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
|
|
3686
3738
|
const y2Config = { y2: {} };
|
|
3687
3739
|
const scaleType = axisScale != null ? axisScale : "linear";
|
|
3688
3740
|
y2Config.y2.label = label;
|
|
3689
3741
|
y2Config.y2.side = "right";
|
|
3690
|
-
y2Config.y2.showGrid = false;
|
|
3691
3742
|
y2Config.y2.type = scaleType;
|
|
3692
3743
|
if (axisAbbreviation !== "none") {
|
|
3693
3744
|
y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
|
|
3745
|
+
y2Config.y2.width = label && label.length > 0 ? 50 : 10;
|
|
3694
3746
|
} else if (roundAxisLabelsToInteger) {
|
|
3695
3747
|
y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
|
|
3696
3748
|
}
|
|
3697
3749
|
if (y2AxisLabelVisibility === "hide") {
|
|
3698
3750
|
y2Config.y2.hideLabels = true;
|
|
3699
3751
|
}
|
|
3752
|
+
if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
|
|
3753
|
+
y2Config.y2.range = (u, dataMin, dataMax) => {
|
|
3754
|
+
const min = y2AxisMin != null ? y2AxisMin : dataMin;
|
|
3755
|
+
const max = y2AxisMax != null ? y2AxisMax : dataMax;
|
|
3756
|
+
return [min, max];
|
|
3757
|
+
};
|
|
3758
|
+
}
|
|
3700
3759
|
return y2Config;
|
|
3701
3760
|
};
|
|
3702
|
-
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
|
|
3761
|
+
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
|
|
3703
3762
|
const seriesConfig = {};
|
|
3704
3763
|
let spanGaps;
|
|
3705
3764
|
let replaceNullsWithZero;
|
|
@@ -3726,6 +3785,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
3726
3785
|
);
|
|
3727
3786
|
if (shouldAssignToY2) {
|
|
3728
3787
|
seriesConfig[field].overrides.scale = "y2";
|
|
3788
|
+
} else {
|
|
3789
|
+
seriesConfig[field].overrides.scale = "y";
|
|
3729
3790
|
}
|
|
3730
3791
|
}
|
|
3731
3792
|
if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
|
|
@@ -3734,12 +3795,50 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
3734
3795
|
if (markerDisplay !== void 0) {
|
|
3735
3796
|
seriesConfig[field].markerDisplay = markerDisplay;
|
|
3736
3797
|
}
|
|
3798
|
+
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
3799
|
+
if (fieldDashStyle) {
|
|
3800
|
+
seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
3801
|
+
}
|
|
3802
|
+
const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
|
|
3803
|
+
const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
|
|
3804
|
+
if (fieldStepPosition && fieldStepPosition !== "off") {
|
|
3805
|
+
seriesConfig[field].stepPosition = fieldStepPosition;
|
|
3806
|
+
}
|
|
3737
3807
|
if (replaceNullsWithZero !== void 0) {
|
|
3738
3808
|
seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
|
|
3739
3809
|
}
|
|
3740
3810
|
});
|
|
3741
3811
|
return seriesConfig;
|
|
3742
3812
|
};
|
|
3813
|
+
var findRangeIndices = (xData, startValue, endValue) => {
|
|
3814
|
+
let startXIndex = -1;
|
|
3815
|
+
let endXIndex = -1;
|
|
3816
|
+
const xDataEpoch = xData.map((val) => {
|
|
3817
|
+
if (typeof val === "string") {
|
|
3818
|
+
return new Date(val).getTime() / 1e3;
|
|
3819
|
+
}
|
|
3820
|
+
return val;
|
|
3821
|
+
});
|
|
3822
|
+
for (let i = 0; i < xDataEpoch.length; i += 1) {
|
|
3823
|
+
if (xDataEpoch[i] >= startValue) {
|
|
3824
|
+
startXIndex = i;
|
|
3825
|
+
break;
|
|
3826
|
+
}
|
|
3827
|
+
}
|
|
3828
|
+
if (startXIndex === -1 && xDataEpoch.length > 0) {
|
|
3829
|
+
startXIndex = xDataEpoch.length - 1;
|
|
3830
|
+
}
|
|
3831
|
+
for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
|
|
3832
|
+
if (xDataEpoch[i] <= endValue) {
|
|
3833
|
+
endXIndex = i;
|
|
3834
|
+
break;
|
|
3835
|
+
}
|
|
3836
|
+
}
|
|
3837
|
+
if (endXIndex === -1 && xDataEpoch.length > 0) {
|
|
3838
|
+
endXIndex = 0;
|
|
3839
|
+
}
|
|
3840
|
+
return { startXIndex, endXIndex };
|
|
3841
|
+
};
|
|
3743
3842
|
|
|
3744
3843
|
// src/common/TimeSeriesChartWrapper.tsx
|
|
3745
3844
|
var TimeSeriesChartContainer = styled_components_default.div`
|
|
@@ -3750,38 +3849,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
|
|
|
3750
3849
|
position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
|
|
3751
3850
|
}
|
|
3752
3851
|
`;
|
|
3753
|
-
var
|
|
3852
|
+
var appendTrellisToPayload2 = (payload, trellisKey, trellisSplitBy) => {
|
|
3853
|
+
const result = __spreadValues({}, payload);
|
|
3854
|
+
if (trellisSplitBy) {
|
|
3855
|
+
result["trellis.name"] = trellisSplitBy;
|
|
3856
|
+
}
|
|
3857
|
+
if (trellisKey) {
|
|
3858
|
+
result["trellis.value"] = trellisKey;
|
|
3859
|
+
}
|
|
3860
|
+
return result;
|
|
3861
|
+
};
|
|
3862
|
+
var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
|
|
3863
|
+
if (!previousPayload) {
|
|
3864
|
+
return true;
|
|
3865
|
+
}
|
|
3866
|
+
if (currentPayload.index !== previousPayload.index) {
|
|
3867
|
+
return true;
|
|
3868
|
+
}
|
|
3869
|
+
if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
|
|
3870
|
+
return true;
|
|
3871
|
+
}
|
|
3872
|
+
if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
|
|
3873
|
+
return true;
|
|
3874
|
+
}
|
|
3875
|
+
if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
|
|
3876
|
+
return true;
|
|
3877
|
+
}
|
|
3878
|
+
return false;
|
|
3879
|
+
};
|
|
3880
|
+
var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
3754
3881
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
|
|
3755
3882
|
name: chartEvent.seriesKey
|
|
3756
3883
|
});
|
|
3757
3884
|
delete payload.seriesKey;
|
|
3758
3885
|
if (chartEvent.rowContext) {
|
|
3759
|
-
Object.
|
|
3760
|
-
payload
|
|
3761
|
-
|
|
3886
|
+
Object.assign(
|
|
3887
|
+
payload,
|
|
3888
|
+
Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
|
|
3889
|
+
acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
|
|
3890
|
+
return acc;
|
|
3891
|
+
}, {})
|
|
3892
|
+
);
|
|
3762
3893
|
}
|
|
3894
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3763
3895
|
if (onClick) {
|
|
3764
3896
|
onClick({
|
|
3765
3897
|
type: "point.click",
|
|
3766
3898
|
originalEvent: chartEvent,
|
|
3767
|
-
payload
|
|
3899
|
+
payload: updatedPayload
|
|
3768
3900
|
});
|
|
3769
3901
|
}
|
|
3770
3902
|
};
|
|
3771
|
-
var handleLegendClick = (chartEvent, onClick) => {
|
|
3903
|
+
var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
3772
3904
|
const payload = {
|
|
3773
3905
|
name: chartEvent
|
|
3774
3906
|
};
|
|
3907
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3775
3908
|
if (onClick) {
|
|
3776
3909
|
onClick({
|
|
3777
3910
|
type: "legend.click",
|
|
3778
3911
|
originalEvent: chartEvent,
|
|
3779
|
-
payload
|
|
3912
|
+
payload: updatedPayload
|
|
3780
3913
|
});
|
|
3781
3914
|
}
|
|
3782
3915
|
};
|
|
3916
|
+
var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
3917
|
+
var _a;
|
|
3918
|
+
if (!rangeEvent) {
|
|
3919
|
+
return;
|
|
3920
|
+
}
|
|
3921
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
3922
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
3923
|
+
const payload = {
|
|
3924
|
+
startXIndex,
|
|
3925
|
+
startXValue: rangeEvent.start,
|
|
3926
|
+
endXIndex,
|
|
3927
|
+
endXValue: rangeEvent.end
|
|
3928
|
+
};
|
|
3929
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3930
|
+
if (onSelect) {
|
|
3931
|
+
onSelect({
|
|
3932
|
+
type: "range.selectBeforeZoom",
|
|
3933
|
+
originalEvent: rangeEvent,
|
|
3934
|
+
payload: updatedPayload
|
|
3935
|
+
});
|
|
3936
|
+
}
|
|
3937
|
+
};
|
|
3938
|
+
var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
3939
|
+
var _a;
|
|
3940
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
3941
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
3942
|
+
const payload = {
|
|
3943
|
+
startXIndex,
|
|
3944
|
+
startXValue: rangeEvent.start,
|
|
3945
|
+
endXIndex,
|
|
3946
|
+
endXValue: rangeEvent.end
|
|
3947
|
+
};
|
|
3948
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3949
|
+
if (onSelect) {
|
|
3950
|
+
onSelect({
|
|
3951
|
+
type: "range.select",
|
|
3952
|
+
originalEvent: rangeEvent,
|
|
3953
|
+
payload: updatedPayload
|
|
3954
|
+
});
|
|
3955
|
+
}
|
|
3956
|
+
};
|
|
3957
|
+
var parseArrayOption = (value) => {
|
|
3958
|
+
if (Array.isArray(value)) {
|
|
3959
|
+
return value;
|
|
3960
|
+
}
|
|
3961
|
+
if (value) {
|
|
3962
|
+
return JSON.parse(value);
|
|
3963
|
+
}
|
|
3964
|
+
return void 0;
|
|
3965
|
+
};
|
|
3783
3966
|
var TimeSeriesChartWrapper = (props) => {
|
|
3784
|
-
|
|
3967
|
+
var _b, _c, _d;
|
|
3968
|
+
const _a = props, {
|
|
3785
3969
|
width,
|
|
3786
3970
|
height,
|
|
3787
3971
|
chartData,
|
|
@@ -3794,12 +3978,57 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3794
3978
|
markerDisplay,
|
|
3795
3979
|
onClick,
|
|
3796
3980
|
onPointMouseOver,
|
|
3797
|
-
onPointMouseOut
|
|
3798
|
-
|
|
3799
|
-
|
|
3981
|
+
onPointMouseOut,
|
|
3982
|
+
onSelect,
|
|
3983
|
+
splitByLayout,
|
|
3984
|
+
trellisKey,
|
|
3985
|
+
trellisSplitBy,
|
|
3800
3986
|
backgroundColor,
|
|
3987
|
+
defaultFontColor,
|
|
3988
|
+
additionalTooltipValues,
|
|
3989
|
+
xAxisLineVisibility: xAxisLineVisibility,
|
|
3990
|
+
yAxisLineVisibility,
|
|
3991
|
+
y2AxisLineVisibility,
|
|
3992
|
+
showYAxisWithZero: showYAxisWithZeroFromProps,
|
|
3993
|
+
showY2AxisWithZero: showY2AxisWithZeroFromProps
|
|
3994
|
+
} = _a, otherOptions = __objRest(_a, [
|
|
3995
|
+
"width",
|
|
3996
|
+
"height",
|
|
3997
|
+
"chartData",
|
|
3998
|
+
"options",
|
|
3999
|
+
"userLocale",
|
|
4000
|
+
"annotationX",
|
|
4001
|
+
"annotationLabel",
|
|
4002
|
+
"annotationColor",
|
|
4003
|
+
"legendDisplay",
|
|
4004
|
+
"markerDisplay",
|
|
4005
|
+
"onClick",
|
|
4006
|
+
"onPointMouseOver",
|
|
4007
|
+
"onPointMouseOut",
|
|
4008
|
+
"onSelect",
|
|
4009
|
+
"splitByLayout",
|
|
4010
|
+
"trellisKey",
|
|
4011
|
+
"trellisSplitBy",
|
|
4012
|
+
"backgroundColor",
|
|
4013
|
+
"defaultFontColor",
|
|
4014
|
+
"additionalTooltipValues",
|
|
4015
|
+
// Extract axis line visibility options from props
|
|
4016
|
+
"xAxisLineVisibility",
|
|
4017
|
+
"yAxisLineVisibility",
|
|
4018
|
+
"y2AxisLineVisibility",
|
|
4019
|
+
// Extract showYAxisWithZero directly from props for accelerated render mode
|
|
4020
|
+
"showYAxisWithZero",
|
|
4021
|
+
"showY2AxisWithZero"
|
|
4022
|
+
]);
|
|
4023
|
+
const { eventHandlers, xField: xFieldFromProps } = otherOptions;
|
|
4024
|
+
const trellisEnabled = useTrellisEnabled(splitByLayout);
|
|
4025
|
+
const {
|
|
4026
|
+
backgroundColor: bgColorFromOptions,
|
|
3801
4027
|
seriesColors: seriesColorsStr,
|
|
3802
4028
|
fieldColors,
|
|
4029
|
+
legendLabels: legendLabelsStr,
|
|
4030
|
+
legendMode,
|
|
4031
|
+
legendTruncation,
|
|
3803
4032
|
"axisTitleX.text": xAxisTitleText,
|
|
3804
4033
|
"axisTitleY.text": yAxisTitleText,
|
|
3805
4034
|
"axisTitleY2.text": y2AxisTitleText,
|
|
@@ -3807,8 +4036,12 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3807
4036
|
"axisTitleY.visibility": yAxisTitleVisibility,
|
|
3808
4037
|
"axisTitleY2.visibility": y2AxisTitleVisibility,
|
|
3809
4038
|
"axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
|
|
4039
|
+
"axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
|
|
4040
|
+
"axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
|
|
3810
4041
|
"axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
|
|
4042
|
+
"axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
|
|
3811
4043
|
"axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
|
|
4044
|
+
"axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
|
|
3812
4045
|
"axisY.abbreviation": yAxisAbbreviation,
|
|
3813
4046
|
"axisY.scale": yAxisScale,
|
|
3814
4047
|
"axisY2.abbreviation": y2AxisAbbreviation,
|
|
@@ -3818,10 +4051,73 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3818
4051
|
"axisLabelsY2.integerUnits": y2IntegerUnits,
|
|
3819
4052
|
"chart.overlayFields": overlayFieldsStr,
|
|
3820
4053
|
"chart.nullValueMode": nullValueMode,
|
|
3821
|
-
|
|
4054
|
+
"chart.showDataLabels": showDataLabels,
|
|
4055
|
+
lineWidth,
|
|
4056
|
+
lineDashStyle,
|
|
4057
|
+
fieldDashStyles: lineDashStylesByFieldStr,
|
|
4058
|
+
stepPosition,
|
|
4059
|
+
fieldStepPositions: stepPositionsByFieldStr,
|
|
4060
|
+
yAxisMin: yAxisMinRaw,
|
|
4061
|
+
yAxisMax: yAxisMaxRaw,
|
|
4062
|
+
y2AxisMin: y2AxisMinRaw,
|
|
4063
|
+
y2AxisMax: y2AxisMaxRaw,
|
|
4064
|
+
showXMajorGridLines,
|
|
4065
|
+
showYMajorGridLines,
|
|
4066
|
+
showY2MajorGridLines,
|
|
4067
|
+
showYMinorGridLines,
|
|
4068
|
+
showY2MinorGridLines,
|
|
4069
|
+
showLineSmoothing,
|
|
4070
|
+
xAxisMajorTickVisibility,
|
|
4071
|
+
xAxisMajorTickSize,
|
|
4072
|
+
yAxisMajorTickVisibility,
|
|
4073
|
+
y2AxisMajorTickVisibility,
|
|
4074
|
+
yAxisMajorTickSize,
|
|
4075
|
+
y2AxisMajorTickSize,
|
|
4076
|
+
yAxisMajorTickInterval,
|
|
4077
|
+
y2AxisMajorTickInterval,
|
|
4078
|
+
yAxisMinorTickVisibility,
|
|
4079
|
+
y2AxisMinorTickVisibility,
|
|
4080
|
+
yAxisMinorTickSize,
|
|
4081
|
+
y2AxisMinorTickSize,
|
|
4082
|
+
showYAxisWithZero: showYAxisWithZeroFromOptions,
|
|
4083
|
+
showY2AxisWithZero: showY2AxisWithZeroFromOptions
|
|
3822
4084
|
} = options;
|
|
4085
|
+
const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
|
|
4086
|
+
const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
|
|
4087
|
+
const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
|
|
4088
|
+
const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
|
|
4089
|
+
const showYMajorTicks = yAxisMajorTickVisibility === "show";
|
|
4090
|
+
const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
|
|
4091
|
+
const showYMinorTicks = yAxisMinorTickVisibility === "show";
|
|
4092
|
+
const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
|
|
4093
|
+
const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
|
|
4094
|
+
const showYAxisLine = yAxisLineVisibility === "show";
|
|
4095
|
+
const showY2AxisLine = y2AxisLineVisibility === "show";
|
|
4096
|
+
const yAxisMin = parseAxisValue(yAxisMinRaw);
|
|
4097
|
+
const yAxisMax = parseAxisValue(yAxisMaxRaw);
|
|
4098
|
+
const y2AxisMin = parseAxisValue(y2AxisMinRaw);
|
|
4099
|
+
const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
|
|
4100
|
+
const parseTickInterval = (simpleXMLValue, canvasValue) => {
|
|
4101
|
+
if (simpleXMLValue) return Number(simpleXMLValue);
|
|
4102
|
+
if (canvasValue) return Number(canvasValue);
|
|
4103
|
+
return void 0;
|
|
4104
|
+
};
|
|
4105
|
+
const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
|
|
4106
|
+
const y2AxisMajorTickIntervalNum = parseTickInterval(
|
|
4107
|
+
y2AxisMajorUnitFromSimpleXML,
|
|
4108
|
+
y2AxisMajorTickInterval
|
|
4109
|
+
);
|
|
4110
|
+
const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
|
|
4111
|
+
const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
|
|
4112
|
+
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
|
|
4113
|
+
const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
|
|
4114
|
+
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
|
|
3823
4115
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
3824
4116
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
4117
|
+
const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
|
|
4118
|
+
const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
|
|
4119
|
+
const legendLabels = parseArrayOption(legendLabelsStr);
|
|
4120
|
+
const bgColor = backgroundColor || bgColorFromOptions;
|
|
3825
4121
|
const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
|
|
3826
4122
|
const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
|
|
3827
4123
|
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
@@ -3832,31 +4128,64 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3832
4128
|
fields: chartData.fields,
|
|
3833
4129
|
columns: chartData.seriesList
|
|
3834
4130
|
});
|
|
3835
|
-
const xField =
|
|
4131
|
+
const xField = getFieldName2(filteredChartData.fields[0]);
|
|
3836
4132
|
const yFields = getFieldNames(
|
|
3837
4133
|
filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
|
|
3838
4134
|
);
|
|
3839
|
-
const y2Fields =
|
|
3840
|
-
|
|
4135
|
+
const y2Fields = (0, react_exports.useMemo)(
|
|
4136
|
+
() => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
|
|
4137
|
+
[y2FieldsStr]
|
|
4138
|
+
);
|
|
4139
|
+
const overlayFields = (0, react_exports.useMemo)(
|
|
4140
|
+
() => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
|
|
4141
|
+
[overlayFieldsStr]
|
|
4142
|
+
);
|
|
3841
4143
|
let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
|
|
3842
4144
|
xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
|
|
3843
|
-
|
|
4145
|
+
const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
|
|
4146
|
+
let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
|
|
3844
4147
|
yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
|
|
3845
4148
|
const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
|
|
3846
4149
|
let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
|
|
3847
4150
|
y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
|
|
3848
|
-
const xScaleConfig =
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
4151
|
+
const xScaleConfig = (0, react_exports.useMemo)(
|
|
4152
|
+
() => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
|
|
4153
|
+
[xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
|
|
4154
|
+
);
|
|
4155
|
+
const yScaleConfig = (0, react_exports.useMemo)(
|
|
4156
|
+
() => getYScaleConfig(
|
|
4157
|
+
yAxisTitle,
|
|
4158
|
+
yAxisAbbreviation,
|
|
4159
|
+
yAxisScale,
|
|
4160
|
+
yAxisLabelVisibility,
|
|
4161
|
+
yAxisMin,
|
|
4162
|
+
yAxisMax
|
|
4163
|
+
),
|
|
4164
|
+
[yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
|
|
4165
|
+
);
|
|
4166
|
+
const y2ScaleConfig = (0, react_exports.useMemo)(() => {
|
|
4167
|
+
if (y2Enabled) {
|
|
4168
|
+
return getY2ScaleConfig(
|
|
4169
|
+
y2AxisTitle,
|
|
4170
|
+
y2AxisAbbreviation,
|
|
4171
|
+
y2AxisScale,
|
|
4172
|
+
y2IntegerUnits,
|
|
4173
|
+
y2AxisLabelVisibility,
|
|
4174
|
+
y2AxisMin,
|
|
4175
|
+
y2AxisMax
|
|
4176
|
+
);
|
|
4177
|
+
}
|
|
4178
|
+
return {};
|
|
4179
|
+
}, [
|
|
4180
|
+
y2Enabled,
|
|
4181
|
+
y2AxisTitle,
|
|
4182
|
+
y2AxisAbbreviation,
|
|
4183
|
+
y2AxisScale,
|
|
4184
|
+
y2IntegerUnits,
|
|
4185
|
+
y2AxisLabelVisibility,
|
|
4186
|
+
y2AxisMin,
|
|
4187
|
+
y2AxisMax
|
|
4188
|
+
]);
|
|
3860
4189
|
const uplotContainerElement = (0, react_exports.useRef)(null);
|
|
3861
4190
|
const seriesDataFormatted = [
|
|
3862
4191
|
filteredChartData.columns[0],
|
|
@@ -3872,9 +4201,25 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3872
4201
|
overlayFields,
|
|
3873
4202
|
y2Enabled,
|
|
3874
4203
|
nullValueMode,
|
|
3875
|
-
markerDisplay
|
|
4204
|
+
markerDisplay,
|
|
4205
|
+
lineDashStyle,
|
|
4206
|
+
lineDashStylesByField,
|
|
4207
|
+
stepPosition,
|
|
4208
|
+
stepPositionsByField
|
|
3876
4209
|
),
|
|
3877
|
-
[
|
|
4210
|
+
[
|
|
4211
|
+
yFields,
|
|
4212
|
+
y2Fields,
|
|
4213
|
+
lineWidth,
|
|
4214
|
+
overlayFields,
|
|
4215
|
+
y2Enabled,
|
|
4216
|
+
nullValueMode,
|
|
4217
|
+
markerDisplay,
|
|
4218
|
+
lineDashStyle,
|
|
4219
|
+
lineDashStylesByField,
|
|
4220
|
+
stepPosition,
|
|
4221
|
+
stepPositionsByField
|
|
4222
|
+
]
|
|
3878
4223
|
);
|
|
3879
4224
|
const chartingEventAnnotations = (0, react_exports.useMemo)(
|
|
3880
4225
|
() => getAnnotationsForCanvas({
|
|
@@ -3888,25 +4233,59 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3888
4233
|
() => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
|
|
3889
4234
|
[xScaleConfig, yScaleConfig, y2ScaleConfig]
|
|
3890
4235
|
);
|
|
3891
|
-
const
|
|
4236
|
+
const isSeriesCompare = legendMode === "seriesCompare";
|
|
4237
|
+
const legend = (0, react_exports.useMemo)(
|
|
4238
|
+
() => getLegend({
|
|
4239
|
+
legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
|
|
4240
|
+
isSeriesCompare,
|
|
4241
|
+
legendTruncation
|
|
4242
|
+
}),
|
|
4243
|
+
[legendDisplay, isSeriesCompare, legendTruncation]
|
|
4244
|
+
);
|
|
3892
4245
|
const handleChartClick = react_exports.useCallback(
|
|
3893
4246
|
(event) => {
|
|
3894
4247
|
if (onClick) {
|
|
3895
|
-
handleClick(event, onClick);
|
|
4248
|
+
handleClick(event, onClick, trellisKey, trellisSplitBy);
|
|
3896
4249
|
}
|
|
3897
4250
|
},
|
|
3898
|
-
[onClick]
|
|
4251
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
3899
4252
|
);
|
|
3900
4253
|
const handleChartLegendClick = react_exports.useCallback(
|
|
3901
4254
|
(event) => {
|
|
3902
4255
|
if (onClick) {
|
|
3903
|
-
handleLegendClick(event, onClick);
|
|
4256
|
+
handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
|
|
4257
|
+
}
|
|
4258
|
+
},
|
|
4259
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
4260
|
+
);
|
|
4261
|
+
const handleChartRangeSelection = react_exports.useCallback(
|
|
4262
|
+
(range2) => {
|
|
4263
|
+
if (onSelect) {
|
|
4264
|
+
handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
4265
|
+
}
|
|
4266
|
+
},
|
|
4267
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
4268
|
+
);
|
|
4269
|
+
const handleChartRangeZoom = react_exports.useCallback(
|
|
4270
|
+
(range2) => {
|
|
4271
|
+
if (onSelect) {
|
|
4272
|
+
handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
3904
4273
|
}
|
|
3905
4274
|
},
|
|
3906
|
-
[
|
|
4275
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
4276
|
+
);
|
|
4277
|
+
const xFieldToUse = xFieldFromProps || xField;
|
|
4278
|
+
const enableSearchZoom = react_exports.useMemo(
|
|
4279
|
+
() => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
|
|
4280
|
+
[eventHandlers, xFieldToUse]
|
|
3907
4281
|
);
|
|
3908
4282
|
const lastPayloadRef = react_exports.useRef(null);
|
|
3909
4283
|
const lastOriginalEventRef = react_exports.useRef(null);
|
|
4284
|
+
const previousMouseoverPayloadRef = react_exports.useRef(null);
|
|
4285
|
+
const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
|
|
4286
|
+
react_exports.useEffect(() => {
|
|
4287
|
+
additionalTooltipValuesRef.current = additionalTooltipValues;
|
|
4288
|
+
}, [additionalTooltipValues]);
|
|
3910
4289
|
const handleChartCrosshairChange = react_exports.useCallback(
|
|
3911
4290
|
(event) => {
|
|
3912
4291
|
if (onPointMouseOver || onPointMouseOut) {
|
|
@@ -3918,6 +4297,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3918
4297
|
payload: lastPayloadRef.current
|
|
3919
4298
|
});
|
|
3920
4299
|
}
|
|
4300
|
+
previousMouseoverPayloadRef.current = null;
|
|
3921
4301
|
return;
|
|
3922
4302
|
}
|
|
3923
4303
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
|
|
@@ -3925,25 +4305,36 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3925
4305
|
});
|
|
3926
4306
|
delete payload.seriesKey;
|
|
3927
4307
|
if (event.rowContext) {
|
|
3928
|
-
Object.
|
|
3929
|
-
payload
|
|
3930
|
-
|
|
4308
|
+
Object.assign(
|
|
4309
|
+
payload,
|
|
4310
|
+
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
4311
|
+
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
4312
|
+
return acc;
|
|
4313
|
+
}, {})
|
|
4314
|
+
);
|
|
4315
|
+
}
|
|
4316
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
4317
|
+
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
4318
|
+
return;
|
|
3931
4319
|
}
|
|
3932
|
-
lastPayloadRef.current =
|
|
4320
|
+
lastPayloadRef.current = updatedPayload;
|
|
3933
4321
|
lastOriginalEventRef.current = event;
|
|
4322
|
+
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
3934
4323
|
if (onPointMouseOver) {
|
|
3935
4324
|
onPointMouseOver({
|
|
3936
4325
|
type: "point.mouseover",
|
|
3937
4326
|
originalEvent: event,
|
|
3938
|
-
payload
|
|
4327
|
+
payload: updatedPayload
|
|
3939
4328
|
});
|
|
3940
4329
|
}
|
|
3941
4330
|
}
|
|
3942
4331
|
},
|
|
3943
|
-
[onPointMouseOver, onPointMouseOut]
|
|
4332
|
+
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
|
|
3944
4333
|
);
|
|
3945
|
-
const
|
|
3946
|
-
|
|
4334
|
+
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}`;
|
|
4335
|
+
const memoizedChart = (0, react_exports.useMemo)(() => {
|
|
4336
|
+
const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
|
|
4337
|
+
return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
|
|
3947
4338
|
visualization_canvas_exports.TimeSeriesChart,
|
|
3948
4339
|
{
|
|
3949
4340
|
data: chartData,
|
|
@@ -3953,49 +4344,121 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3953
4344
|
seriesColorsByField,
|
|
3954
4345
|
seriesConfig: seriesOverrides,
|
|
3955
4346
|
legend,
|
|
4347
|
+
legendLabels,
|
|
4348
|
+
legendTruncation,
|
|
4349
|
+
isSeriesCompare: legendMode === "seriesCompare",
|
|
4350
|
+
maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
|
|
3956
4351
|
scaleConfig,
|
|
3957
4352
|
timestampFormat: "expanded",
|
|
3958
4353
|
onCrosshairClick: onClick ? handleChartClick : void 0,
|
|
3959
4354
|
onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
|
|
3960
4355
|
onSeriesClick: onClick ? handleChartLegendClick : void 0,
|
|
4356
|
+
onRangeSelection: handleChartRangeSelection,
|
|
4357
|
+
onRangeZoom: computedOnRangeZoom,
|
|
4358
|
+
serverSideZoom: enableSearchZoom,
|
|
3961
4359
|
userLocale,
|
|
3962
4360
|
events: chartingEventAnnotations,
|
|
3963
|
-
eventsConfig: { renderer: triangleEventAnnotationRenderer }
|
|
4361
|
+
eventsConfig: { renderer: triangleEventAnnotationRenderer },
|
|
4362
|
+
additionalTooltipValuesRef,
|
|
4363
|
+
showXMajorGridLines,
|
|
4364
|
+
showYMajorGridLines,
|
|
4365
|
+
showY2MajorGridLines,
|
|
4366
|
+
showYMinorGridLines,
|
|
4367
|
+
showY2MinorGridLines,
|
|
4368
|
+
showLineSmoothing,
|
|
4369
|
+
dataValuesDisplay,
|
|
4370
|
+
showXMajorTicks,
|
|
4371
|
+
xAxisMajorTickSize: xAxisMajorTickSizeNum,
|
|
4372
|
+
showYMajorTicks,
|
|
4373
|
+
showY2MajorTicks,
|
|
4374
|
+
yAxisMajorTickSize: yAxisMajorTickSizeNum,
|
|
4375
|
+
y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
|
|
4376
|
+
yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
|
|
4377
|
+
y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
|
|
4378
|
+
showYMinorTicks,
|
|
4379
|
+
showY2MinorTicks,
|
|
4380
|
+
yAxisMinorTickSize: yAxisMinorTickSizeNum,
|
|
4381
|
+
y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
|
|
4382
|
+
showYAxisWithZero,
|
|
4383
|
+
showY2AxisWithZero,
|
|
4384
|
+
showXAxisLine,
|
|
4385
|
+
showYAxisLine,
|
|
4386
|
+
showY2AxisLine,
|
|
4387
|
+
xAxisMaxLabelParts
|
|
3964
4388
|
}
|
|
3965
|
-
)
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
4389
|
+
));
|
|
4390
|
+
}, [
|
|
4391
|
+
onSelect,
|
|
4392
|
+
handleChartRangeZoom,
|
|
4393
|
+
dataKey,
|
|
4394
|
+
chartData,
|
|
4395
|
+
containerWidth,
|
|
4396
|
+
containerHeight,
|
|
4397
|
+
seriesColors,
|
|
4398
|
+
seriesColorsByField,
|
|
4399
|
+
seriesOverrides,
|
|
4400
|
+
legend,
|
|
4401
|
+
legendLabels,
|
|
4402
|
+
legendTruncation,
|
|
4403
|
+
scaleConfig,
|
|
4404
|
+
onClick,
|
|
4405
|
+
handleChartClick,
|
|
4406
|
+
onPointMouseOver,
|
|
4407
|
+
onPointMouseOut,
|
|
4408
|
+
handleChartCrosshairChange,
|
|
4409
|
+
handleChartLegendClick,
|
|
4410
|
+
handleChartRangeSelection,
|
|
4411
|
+
enableSearchZoom,
|
|
4412
|
+
userLocale,
|
|
4413
|
+
chartingEventAnnotations,
|
|
4414
|
+
showXMajorGridLines,
|
|
4415
|
+
showYMajorGridLines,
|
|
4416
|
+
showY2MajorGridLines,
|
|
4417
|
+
showYMinorGridLines,
|
|
4418
|
+
showY2MinorGridLines,
|
|
4419
|
+
showLineSmoothing,
|
|
4420
|
+
dataValuesDisplay,
|
|
4421
|
+
showXMajorTicks,
|
|
4422
|
+
xAxisMajorTickSizeNum,
|
|
4423
|
+
showYMajorTicks,
|
|
4424
|
+
showY2MajorTicks,
|
|
4425
|
+
yAxisMajorTickSizeNum,
|
|
4426
|
+
y2AxisMajorTickSizeNum,
|
|
4427
|
+
yAxisMajorTickIntervalNum,
|
|
4428
|
+
y2AxisMajorTickIntervalNum,
|
|
4429
|
+
showYMinorTicks,
|
|
4430
|
+
showY2MinorTicks,
|
|
4431
|
+
yAxisMinorTickSizeNum,
|
|
4432
|
+
y2AxisMinorTickSizeNum,
|
|
4433
|
+
showYAxisWithZero,
|
|
4434
|
+
showY2AxisWithZero,
|
|
4435
|
+
showXAxisLine,
|
|
4436
|
+
showYAxisLine,
|
|
4437
|
+
showY2AxisLine,
|
|
4438
|
+
legendMode,
|
|
4439
|
+
xAxisMaxLabelParts
|
|
4440
|
+
]);
|
|
3985
4441
|
const memoizedVisualization = (0, react_exports.useMemo)(() => {
|
|
3986
|
-
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
|
|
3987
|
-
}, [
|
|
3988
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
4442
|
+
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
|
|
4443
|
+
}, [bgColor, memoizedChart]);
|
|
4444
|
+
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
|
|
4445
|
+
TrellisTitle,
|
|
4446
|
+
{
|
|
4447
|
+
trellisKey,
|
|
4448
|
+
backgroundColor: bgColor,
|
|
4449
|
+
fontColor: defaultFontColor
|
|
4450
|
+
}
|
|
4451
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
3989
4452
|
TimeSeriesChartContainer,
|
|
3990
4453
|
{
|
|
3991
|
-
height,
|
|
4454
|
+
height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
|
|
3992
4455
|
width,
|
|
3993
4456
|
ref: uplotContainerElement,
|
|
3994
4457
|
"data-test": "timeseries-chart-wrapper"
|
|
3995
4458
|
},
|
|
3996
4459
|
/* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
|
|
3997
4460
|
memoizedVisualization
|
|
3998
|
-
);
|
|
4461
|
+
));
|
|
3999
4462
|
};
|
|
4000
4463
|
var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
|
|
4001
4464
|
|