@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/Image.js
CHANGED
|
@@ -601,7 +601,7 @@ var Cover = styled_components_default.div`
|
|
|
601
601
|
bottom: 0;
|
|
602
602
|
`;
|
|
603
603
|
var Blocker = styled_components_default.div.attrs({
|
|
604
|
-
"data-splunk-visualization-version": "28.
|
|
604
|
+
"data-splunk-visualization-version": "28.5.0 - b192418b7"
|
|
605
605
|
})`
|
|
606
606
|
position: relative;
|
|
607
607
|
width: 100%;
|
|
@@ -691,7 +691,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
691
691
|
FixSizeItem,
|
|
692
692
|
{
|
|
693
693
|
"data-test": "fix-size-item",
|
|
694
|
-
"data-splunk-visualization-version": "28.
|
|
694
|
+
"data-splunk-visualization-version": "28.5.0 - b192418b7",
|
|
695
695
|
width,
|
|
696
696
|
height,
|
|
697
697
|
backgroundColor
|
|
@@ -787,6 +787,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
|
|
|
787
787
|
var numberUtils_default = "default" in defaultImport25 ? defaultImport25.default : defaultImport25;
|
|
788
788
|
|
|
789
789
|
// src/common/utils/dataUtils.ts
|
|
790
|
+
var getFieldName = (field) => typeof field === "string" ? field : field.name;
|
|
790
791
|
var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
|
|
791
792
|
const dataLength = data.length;
|
|
792
793
|
const downsampledIndices = [];
|
|
@@ -903,9 +904,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
|
|
|
903
904
|
let xColumn = [];
|
|
904
905
|
const yColumns = [];
|
|
905
906
|
const canDownsample = !ds.data.fields.some((field, index) => {
|
|
906
|
-
var _a
|
|
907
|
-
const fieldName = (
|
|
908
|
-
const fieldType = (
|
|
907
|
+
var _a;
|
|
908
|
+
const fieldName = getFieldName(field);
|
|
909
|
+
const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
|
|
909
910
|
const column = ds.data.columns[index];
|
|
910
911
|
let hasDisplayedColumnThatCantBeDownsampled = false;
|
|
911
912
|
if (fieldName === xField) {
|
|
@@ -1258,6 +1259,16 @@ var triangleEventAnnotationRenderer = ({
|
|
|
1258
1259
|
eventColor: eventWithColor.color
|
|
1259
1260
|
});
|
|
1260
1261
|
};
|
|
1262
|
+
var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
|
|
1263
|
+
const rangeSelectEventHandler = eventHandlers.find(
|
|
1264
|
+
(eventHandler) => {
|
|
1265
|
+
var _a;
|
|
1266
|
+
return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
|
|
1267
|
+
}
|
|
1268
|
+
);
|
|
1269
|
+
const xAxisIsTime = xField === "_time";
|
|
1270
|
+
return !!rangeSelectEventHandler && xAxisIsTime;
|
|
1271
|
+
};
|
|
1261
1272
|
var canvasSupportedTimeSeriesCharts = ["splunk.line"];
|
|
1262
1273
|
var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
|
|
1263
1274
|
return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
|
|
@@ -1278,17 +1289,34 @@ var filterChartDataFromInternalFields = (chartData) => {
|
|
|
1278
1289
|
var convert2DArrayToNumbers = (arr) => {
|
|
1279
1290
|
return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
|
|
1280
1291
|
};
|
|
1281
|
-
var
|
|
1282
|
-
|
|
1292
|
+
var parseAxisValue = (val) => {
|
|
1293
|
+
if (val === void 0 || val === null || val === "auto" || val === "") {
|
|
1294
|
+
return void 0;
|
|
1295
|
+
}
|
|
1296
|
+
const num = typeof val === "number" ? val : Number.parseFloat(val);
|
|
1297
|
+
return Number.isNaN(num) ? void 0 : num;
|
|
1298
|
+
};
|
|
1299
|
+
var parseXAxisLineVisibility = (visibility) => {
|
|
1300
|
+
if (visibility === "hide") return false;
|
|
1301
|
+
if (visibility === "show") return true;
|
|
1302
|
+
return void 0;
|
|
1303
|
+
};
|
|
1283
1304
|
var getLegend = (props) => {
|
|
1284
1305
|
const legendPlacement = props == null ? void 0 : props.legendDisplay;
|
|
1306
|
+
const { isSeriesCompare, legendTruncation } = props;
|
|
1307
|
+
const commonLegendProps = {
|
|
1308
|
+
center: true,
|
|
1309
|
+
fontSize: 12,
|
|
1310
|
+
largerTiles: true,
|
|
1311
|
+
hideSeriesValue: !isSeriesCompare,
|
|
1312
|
+
// Show values if in seriesCompare mode
|
|
1313
|
+
legendTruncation
|
|
1314
|
+
};
|
|
1285
1315
|
switch (legendPlacement) {
|
|
1286
1316
|
case "off":
|
|
1287
1317
|
return false;
|
|
1288
1318
|
case "left":
|
|
1289
|
-
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
|
|
1290
|
-
width: SideLegendWidth
|
|
1291
|
-
}, commonLegendProps));
|
|
1319
|
+
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
1292
1320
|
case "bottom":
|
|
1293
1321
|
return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
|
|
1294
1322
|
wrap: true
|
|
@@ -1298,9 +1326,7 @@ var getLegend = (props) => {
|
|
|
1298
1326
|
wrap: true
|
|
1299
1327
|
}, commonLegendProps));
|
|
1300
1328
|
default:
|
|
1301
|
-
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
|
|
1302
|
-
width: SideLegendWidth
|
|
1303
|
-
}, commonLegendProps));
|
|
1329
|
+
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
|
|
1304
1330
|
}
|
|
1305
1331
|
};
|
|
1306
1332
|
var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
|
|
@@ -1335,22 +1361,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
|
|
|
1335
1361
|
const end = axisTitle.slice(-halfChars);
|
|
1336
1362
|
return `${start}...${end}`;
|
|
1337
1363
|
};
|
|
1338
|
-
var
|
|
1364
|
+
var getFieldName2 = (field) => {
|
|
1339
1365
|
const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
|
|
1340
1366
|
return fieldName;
|
|
1341
1367
|
};
|
|
1342
1368
|
var getFieldNames = (fields) => {
|
|
1343
|
-
return fields.map((field) =>
|
|
1369
|
+
return fields.map((field) => getFieldName2(field));
|
|
1344
1370
|
};
|
|
1345
|
-
var getXScaleConfig = (label, xAxisLabelVisibility) => {
|
|
1371
|
+
var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
|
|
1346
1372
|
const xConfig = { x: {} };
|
|
1347
1373
|
xConfig.x.label = label;
|
|
1348
1374
|
if (xAxisLabelVisibility === "hide") {
|
|
1349
1375
|
xConfig.x.hideLabels = true;
|
|
1350
1376
|
}
|
|
1377
|
+
if (xAxisLabelRotation !== void 0) {
|
|
1378
|
+
xConfig.x.labelRotation = xAxisLabelRotation;
|
|
1379
|
+
}
|
|
1351
1380
|
return xConfig;
|
|
1352
1381
|
};
|
|
1353
|
-
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
|
|
1382
|
+
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
|
|
1354
1383
|
const scaleType = yAxisScale != null ? yAxisScale : "linear";
|
|
1355
1384
|
const yConfig = { y: {} };
|
|
1356
1385
|
yConfig.y.label = label;
|
|
@@ -1358,34 +1387,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
|
|
|
1358
1387
|
if (yAxisAbbreviation !== "none") {
|
|
1359
1388
|
yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
|
|
1360
1389
|
}
|
|
1361
|
-
if (yAxisAbbreviation
|
|
1362
|
-
yConfig.y.width = 55;
|
|
1363
|
-
} else {
|
|
1390
|
+
if (yAxisAbbreviation !== "none") {
|
|
1364
1391
|
yConfig.y.width = label && label.length > 0 ? 30 : 10;
|
|
1365
1392
|
}
|
|
1366
1393
|
if (yAxisLabelVisibility === "hide") {
|
|
1367
1394
|
yConfig.y.hideLabels = true;
|
|
1368
1395
|
}
|
|
1396
|
+
if (yAxisMin !== void 0 || yAxisMax !== void 0) {
|
|
1397
|
+
yConfig.y.range = (u, dataMin, dataMax) => {
|
|
1398
|
+
const min = yAxisMin != null ? yAxisMin : dataMin;
|
|
1399
|
+
const max = yAxisMax != null ? yAxisMax : dataMax;
|
|
1400
|
+
return [min, max];
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1369
1403
|
return yConfig;
|
|
1370
1404
|
};
|
|
1371
|
-
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
|
|
1405
|
+
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
|
|
1372
1406
|
const y2Config = { y2: {} };
|
|
1373
1407
|
const scaleType = axisScale != null ? axisScale : "linear";
|
|
1374
1408
|
y2Config.y2.label = label;
|
|
1375
1409
|
y2Config.y2.side = "right";
|
|
1376
|
-
y2Config.y2.showGrid = false;
|
|
1377
1410
|
y2Config.y2.type = scaleType;
|
|
1378
1411
|
if (axisAbbreviation !== "none") {
|
|
1379
1412
|
y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
|
|
1413
|
+
y2Config.y2.width = label && label.length > 0 ? 50 : 10;
|
|
1380
1414
|
} else if (roundAxisLabelsToInteger) {
|
|
1381
1415
|
y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
|
|
1382
1416
|
}
|
|
1383
1417
|
if (y2AxisLabelVisibility === "hide") {
|
|
1384
1418
|
y2Config.y2.hideLabels = true;
|
|
1385
1419
|
}
|
|
1420
|
+
if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
|
|
1421
|
+
y2Config.y2.range = (u, dataMin, dataMax) => {
|
|
1422
|
+
const min = y2AxisMin != null ? y2AxisMin : dataMin;
|
|
1423
|
+
const max = y2AxisMax != null ? y2AxisMax : dataMax;
|
|
1424
|
+
return [min, max];
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1386
1427
|
return y2Config;
|
|
1387
1428
|
};
|
|
1388
|
-
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
|
|
1429
|
+
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
|
|
1389
1430
|
const seriesConfig = {};
|
|
1390
1431
|
let spanGaps;
|
|
1391
1432
|
let replaceNullsWithZero;
|
|
@@ -1412,6 +1453,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
1412
1453
|
);
|
|
1413
1454
|
if (shouldAssignToY2) {
|
|
1414
1455
|
seriesConfig[field].overrides.scale = "y2";
|
|
1456
|
+
} else {
|
|
1457
|
+
seriesConfig[field].overrides.scale = "y";
|
|
1415
1458
|
}
|
|
1416
1459
|
}
|
|
1417
1460
|
if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
|
|
@@ -1420,12 +1463,92 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
1420
1463
|
if (markerDisplay !== void 0) {
|
|
1421
1464
|
seriesConfig[field].markerDisplay = markerDisplay;
|
|
1422
1465
|
}
|
|
1466
|
+
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
1467
|
+
if (fieldDashStyle) {
|
|
1468
|
+
seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
1469
|
+
}
|
|
1470
|
+
const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
|
|
1471
|
+
const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
|
|
1472
|
+
if (fieldStepPosition && fieldStepPosition !== "off") {
|
|
1473
|
+
seriesConfig[field].stepPosition = fieldStepPosition;
|
|
1474
|
+
}
|
|
1423
1475
|
if (replaceNullsWithZero !== void 0) {
|
|
1424
1476
|
seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
|
|
1425
1477
|
}
|
|
1426
1478
|
});
|
|
1427
1479
|
return seriesConfig;
|
|
1428
1480
|
};
|
|
1481
|
+
var findRangeIndices = (xData, startValue, endValue) => {
|
|
1482
|
+
let startXIndex = -1;
|
|
1483
|
+
let endXIndex = -1;
|
|
1484
|
+
const xDataEpoch = xData.map((val) => {
|
|
1485
|
+
if (typeof val === "string") {
|
|
1486
|
+
return new Date(val).getTime() / 1e3;
|
|
1487
|
+
}
|
|
1488
|
+
return val;
|
|
1489
|
+
});
|
|
1490
|
+
for (let i = 0; i < xDataEpoch.length; i += 1) {
|
|
1491
|
+
if (xDataEpoch[i] >= startValue) {
|
|
1492
|
+
startXIndex = i;
|
|
1493
|
+
break;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
if (startXIndex === -1 && xDataEpoch.length > 0) {
|
|
1497
|
+
startXIndex = xDataEpoch.length - 1;
|
|
1498
|
+
}
|
|
1499
|
+
for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
|
|
1500
|
+
if (xDataEpoch[i] <= endValue) {
|
|
1501
|
+
endXIndex = i;
|
|
1502
|
+
break;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
if (endXIndex === -1 && xDataEpoch.length > 0) {
|
|
1506
|
+
endXIndex = 0;
|
|
1507
|
+
}
|
|
1508
|
+
return { startXIndex, endXIndex };
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1511
|
+
// src/common/hooks/useTrellisEnabled.ts
|
|
1512
|
+
var useTrellisFeatureFlagOn = () => {
|
|
1513
|
+
const context = (0, react_exports.useContext)(FeatureFlagContext_default);
|
|
1514
|
+
return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
|
|
1515
|
+
};
|
|
1516
|
+
var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
|
|
1517
|
+
const trellisFeatureEnabled = useTrellisFeatureFlagOn();
|
|
1518
|
+
return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1519
|
+
};
|
|
1520
|
+
|
|
1521
|
+
// src/common/components/TrellisTitle.tsx
|
|
1522
|
+
var TRELLIS_TITLE_HEIGHT = 28;
|
|
1523
|
+
var TrellisTitleText = styled_components_default.div`
|
|
1524
|
+
margin-left: 10px;
|
|
1525
|
+
margin-right: 10px;
|
|
1526
|
+
padding-top: 8px;
|
|
1527
|
+
text-overflow: ellipsis;
|
|
1528
|
+
white-space: nowrap;
|
|
1529
|
+
overflow: hidden;
|
|
1530
|
+
`;
|
|
1531
|
+
var TrellisTitleDiv = styled_components_default.div`
|
|
1532
|
+
height: ${TRELLIS_TITLE_HEIGHT}px;
|
|
1533
|
+
font-size: 14px;
|
|
1534
|
+
font-weight: 700;
|
|
1535
|
+
color: ${(props) => props.fontColor};
|
|
1536
|
+
background-color: ${(props) => props.backgroundColor};
|
|
1537
|
+
box-shadow: 0 1px ${(props) => props.backgroundColor}; // this is added to avoid a 1px gap between title and viz divs that showed up intermittently because of pixel rounding error in chrome.
|
|
1538
|
+
`;
|
|
1539
|
+
var TrellisTitle = (props) => {
|
|
1540
|
+
const titleText = String(props.trellisKey).toString();
|
|
1541
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
1542
|
+
TrellisTitleDiv,
|
|
1543
|
+
{
|
|
1544
|
+
fontColor: props.fontColor,
|
|
1545
|
+
backgroundColor: props.backgroundColor,
|
|
1546
|
+
"data-test": "trellis-title",
|
|
1547
|
+
title: titleText
|
|
1548
|
+
},
|
|
1549
|
+
/* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
|
|
1550
|
+
);
|
|
1551
|
+
};
|
|
1429
1552
|
|
|
1430
1553
|
// src/common/TimeSeriesChartWrapper.tsx
|
|
1431
1554
|
var TimeSeriesChartContainer = styled_components_default.div`
|
|
@@ -1436,38 +1559,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
|
|
|
1436
1559
|
position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
|
|
1437
1560
|
}
|
|
1438
1561
|
`;
|
|
1439
|
-
var
|
|
1562
|
+
var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
|
|
1563
|
+
const result = __spreadValues({}, payload);
|
|
1564
|
+
if (trellisSplitBy) {
|
|
1565
|
+
result["trellis.name"] = trellisSplitBy;
|
|
1566
|
+
}
|
|
1567
|
+
if (trellisKey) {
|
|
1568
|
+
result["trellis.value"] = trellisKey;
|
|
1569
|
+
}
|
|
1570
|
+
return result;
|
|
1571
|
+
};
|
|
1572
|
+
var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
|
|
1573
|
+
if (!previousPayload) {
|
|
1574
|
+
return true;
|
|
1575
|
+
}
|
|
1576
|
+
if (currentPayload.index !== previousPayload.index) {
|
|
1577
|
+
return true;
|
|
1578
|
+
}
|
|
1579
|
+
if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
|
|
1580
|
+
return true;
|
|
1581
|
+
}
|
|
1582
|
+
if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
|
|
1583
|
+
return true;
|
|
1584
|
+
}
|
|
1585
|
+
if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
|
|
1586
|
+
return true;
|
|
1587
|
+
}
|
|
1588
|
+
return false;
|
|
1589
|
+
};
|
|
1590
|
+
var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
1440
1591
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
|
|
1441
1592
|
name: chartEvent.seriesKey
|
|
1442
1593
|
});
|
|
1443
1594
|
delete payload.seriesKey;
|
|
1444
1595
|
if (chartEvent.rowContext) {
|
|
1445
|
-
Object.
|
|
1446
|
-
payload
|
|
1447
|
-
|
|
1596
|
+
Object.assign(
|
|
1597
|
+
payload,
|
|
1598
|
+
Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
|
|
1599
|
+
acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
|
|
1600
|
+
return acc;
|
|
1601
|
+
}, {})
|
|
1602
|
+
);
|
|
1448
1603
|
}
|
|
1604
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1449
1605
|
if (onClick) {
|
|
1450
1606
|
onClick({
|
|
1451
1607
|
type: "point.click",
|
|
1452
1608
|
originalEvent: chartEvent,
|
|
1453
|
-
payload
|
|
1609
|
+
payload: updatedPayload
|
|
1454
1610
|
});
|
|
1455
1611
|
}
|
|
1456
1612
|
};
|
|
1457
|
-
var handleLegendClick = (chartEvent, onClick) => {
|
|
1613
|
+
var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
1458
1614
|
const payload = {
|
|
1459
1615
|
name: chartEvent
|
|
1460
1616
|
};
|
|
1617
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1461
1618
|
if (onClick) {
|
|
1462
1619
|
onClick({
|
|
1463
1620
|
type: "legend.click",
|
|
1464
1621
|
originalEvent: chartEvent,
|
|
1465
|
-
payload
|
|
1622
|
+
payload: updatedPayload
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1625
|
+
};
|
|
1626
|
+
var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
1627
|
+
var _a;
|
|
1628
|
+
if (!rangeEvent) {
|
|
1629
|
+
return;
|
|
1630
|
+
}
|
|
1631
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
1632
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
1633
|
+
const payload = {
|
|
1634
|
+
startXIndex,
|
|
1635
|
+
startXValue: rangeEvent.start,
|
|
1636
|
+
endXIndex,
|
|
1637
|
+
endXValue: rangeEvent.end
|
|
1638
|
+
};
|
|
1639
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1640
|
+
if (onSelect) {
|
|
1641
|
+
onSelect({
|
|
1642
|
+
type: "range.selectBeforeZoom",
|
|
1643
|
+
originalEvent: rangeEvent,
|
|
1644
|
+
payload: updatedPayload
|
|
1645
|
+
});
|
|
1646
|
+
}
|
|
1647
|
+
};
|
|
1648
|
+
var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
1649
|
+
var _a;
|
|
1650
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
1651
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
1652
|
+
const payload = {
|
|
1653
|
+
startXIndex,
|
|
1654
|
+
startXValue: rangeEvent.start,
|
|
1655
|
+
endXIndex,
|
|
1656
|
+
endXValue: rangeEvent.end
|
|
1657
|
+
};
|
|
1658
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
1659
|
+
if (onSelect) {
|
|
1660
|
+
onSelect({
|
|
1661
|
+
type: "range.select",
|
|
1662
|
+
originalEvent: rangeEvent,
|
|
1663
|
+
payload: updatedPayload
|
|
1466
1664
|
});
|
|
1467
1665
|
}
|
|
1468
1666
|
};
|
|
1667
|
+
var parseArrayOption = (value) => {
|
|
1668
|
+
if (Array.isArray(value)) {
|
|
1669
|
+
return value;
|
|
1670
|
+
}
|
|
1671
|
+
if (value) {
|
|
1672
|
+
return JSON.parse(value);
|
|
1673
|
+
}
|
|
1674
|
+
return void 0;
|
|
1675
|
+
};
|
|
1469
1676
|
var TimeSeriesChartWrapper = (props) => {
|
|
1470
|
-
|
|
1677
|
+
var _b, _c, _d;
|
|
1678
|
+
const _a = props, {
|
|
1471
1679
|
width,
|
|
1472
1680
|
height,
|
|
1473
1681
|
chartData,
|
|
@@ -1480,12 +1688,57 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1480
1688
|
markerDisplay,
|
|
1481
1689
|
onClick,
|
|
1482
1690
|
onPointMouseOver,
|
|
1483
|
-
onPointMouseOut
|
|
1484
|
-
|
|
1485
|
-
|
|
1691
|
+
onPointMouseOut,
|
|
1692
|
+
onSelect,
|
|
1693
|
+
splitByLayout,
|
|
1694
|
+
trellisKey,
|
|
1695
|
+
trellisSplitBy,
|
|
1486
1696
|
backgroundColor,
|
|
1697
|
+
defaultFontColor,
|
|
1698
|
+
additionalTooltipValues,
|
|
1699
|
+
xAxisLineVisibility: xAxisLineVisibility,
|
|
1700
|
+
yAxisLineVisibility,
|
|
1701
|
+
y2AxisLineVisibility,
|
|
1702
|
+
showYAxisWithZero: showYAxisWithZeroFromProps,
|
|
1703
|
+
showY2AxisWithZero: showY2AxisWithZeroFromProps
|
|
1704
|
+
} = _a, otherOptions = __objRest(_a, [
|
|
1705
|
+
"width",
|
|
1706
|
+
"height",
|
|
1707
|
+
"chartData",
|
|
1708
|
+
"options",
|
|
1709
|
+
"userLocale",
|
|
1710
|
+
"annotationX",
|
|
1711
|
+
"annotationLabel",
|
|
1712
|
+
"annotationColor",
|
|
1713
|
+
"legendDisplay",
|
|
1714
|
+
"markerDisplay",
|
|
1715
|
+
"onClick",
|
|
1716
|
+
"onPointMouseOver",
|
|
1717
|
+
"onPointMouseOut",
|
|
1718
|
+
"onSelect",
|
|
1719
|
+
"splitByLayout",
|
|
1720
|
+
"trellisKey",
|
|
1721
|
+
"trellisSplitBy",
|
|
1722
|
+
"backgroundColor",
|
|
1723
|
+
"defaultFontColor",
|
|
1724
|
+
"additionalTooltipValues",
|
|
1725
|
+
// Extract axis line visibility options from props
|
|
1726
|
+
"xAxisLineVisibility",
|
|
1727
|
+
"yAxisLineVisibility",
|
|
1728
|
+
"y2AxisLineVisibility",
|
|
1729
|
+
// Extract showYAxisWithZero directly from props for accelerated render mode
|
|
1730
|
+
"showYAxisWithZero",
|
|
1731
|
+
"showY2AxisWithZero"
|
|
1732
|
+
]);
|
|
1733
|
+
const { eventHandlers, xField: xFieldFromProps } = otherOptions;
|
|
1734
|
+
const trellisEnabled = useTrellisEnabled(splitByLayout);
|
|
1735
|
+
const {
|
|
1736
|
+
backgroundColor: bgColorFromOptions,
|
|
1487
1737
|
seriesColors: seriesColorsStr,
|
|
1488
1738
|
fieldColors,
|
|
1739
|
+
legendLabels: legendLabelsStr,
|
|
1740
|
+
legendMode,
|
|
1741
|
+
legendTruncation,
|
|
1489
1742
|
"axisTitleX.text": xAxisTitleText,
|
|
1490
1743
|
"axisTitleY.text": yAxisTitleText,
|
|
1491
1744
|
"axisTitleY2.text": y2AxisTitleText,
|
|
@@ -1493,8 +1746,12 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1493
1746
|
"axisTitleY.visibility": yAxisTitleVisibility,
|
|
1494
1747
|
"axisTitleY2.visibility": y2AxisTitleVisibility,
|
|
1495
1748
|
"axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
|
|
1749
|
+
"axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
|
|
1750
|
+
"axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
|
|
1496
1751
|
"axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
|
|
1752
|
+
"axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
|
|
1497
1753
|
"axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
|
|
1754
|
+
"axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
|
|
1498
1755
|
"axisY.abbreviation": yAxisAbbreviation,
|
|
1499
1756
|
"axisY.scale": yAxisScale,
|
|
1500
1757
|
"axisY2.abbreviation": y2AxisAbbreviation,
|
|
@@ -1504,10 +1761,73 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1504
1761
|
"axisLabelsY2.integerUnits": y2IntegerUnits,
|
|
1505
1762
|
"chart.overlayFields": overlayFieldsStr,
|
|
1506
1763
|
"chart.nullValueMode": nullValueMode,
|
|
1507
|
-
|
|
1764
|
+
"chart.showDataLabels": showDataLabels,
|
|
1765
|
+
lineWidth,
|
|
1766
|
+
lineDashStyle,
|
|
1767
|
+
fieldDashStyles: lineDashStylesByFieldStr,
|
|
1768
|
+
stepPosition,
|
|
1769
|
+
fieldStepPositions: stepPositionsByFieldStr,
|
|
1770
|
+
yAxisMin: yAxisMinRaw,
|
|
1771
|
+
yAxisMax: yAxisMaxRaw,
|
|
1772
|
+
y2AxisMin: y2AxisMinRaw,
|
|
1773
|
+
y2AxisMax: y2AxisMaxRaw,
|
|
1774
|
+
showXMajorGridLines,
|
|
1775
|
+
showYMajorGridLines,
|
|
1776
|
+
showY2MajorGridLines,
|
|
1777
|
+
showYMinorGridLines,
|
|
1778
|
+
showY2MinorGridLines,
|
|
1779
|
+
showLineSmoothing,
|
|
1780
|
+
xAxisMajorTickVisibility,
|
|
1781
|
+
xAxisMajorTickSize,
|
|
1782
|
+
yAxisMajorTickVisibility,
|
|
1783
|
+
y2AxisMajorTickVisibility,
|
|
1784
|
+
yAxisMajorTickSize,
|
|
1785
|
+
y2AxisMajorTickSize,
|
|
1786
|
+
yAxisMajorTickInterval,
|
|
1787
|
+
y2AxisMajorTickInterval,
|
|
1788
|
+
yAxisMinorTickVisibility,
|
|
1789
|
+
y2AxisMinorTickVisibility,
|
|
1790
|
+
yAxisMinorTickSize,
|
|
1791
|
+
y2AxisMinorTickSize,
|
|
1792
|
+
showYAxisWithZero: showYAxisWithZeroFromOptions,
|
|
1793
|
+
showY2AxisWithZero: showY2AxisWithZeroFromOptions
|
|
1508
1794
|
} = options;
|
|
1795
|
+
const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
|
|
1796
|
+
const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
|
|
1797
|
+
const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
|
|
1798
|
+
const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
|
|
1799
|
+
const showYMajorTicks = yAxisMajorTickVisibility === "show";
|
|
1800
|
+
const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
|
|
1801
|
+
const showYMinorTicks = yAxisMinorTickVisibility === "show";
|
|
1802
|
+
const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
|
|
1803
|
+
const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
|
|
1804
|
+
const showYAxisLine = yAxisLineVisibility === "show";
|
|
1805
|
+
const showY2AxisLine = y2AxisLineVisibility === "show";
|
|
1806
|
+
const yAxisMin = parseAxisValue(yAxisMinRaw);
|
|
1807
|
+
const yAxisMax = parseAxisValue(yAxisMaxRaw);
|
|
1808
|
+
const y2AxisMin = parseAxisValue(y2AxisMinRaw);
|
|
1809
|
+
const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
|
|
1810
|
+
const parseTickInterval = (simpleXMLValue, canvasValue) => {
|
|
1811
|
+
if (simpleXMLValue) return Number(simpleXMLValue);
|
|
1812
|
+
if (canvasValue) return Number(canvasValue);
|
|
1813
|
+
return void 0;
|
|
1814
|
+
};
|
|
1815
|
+
const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
|
|
1816
|
+
const y2AxisMajorTickIntervalNum = parseTickInterval(
|
|
1817
|
+
y2AxisMajorUnitFromSimpleXML,
|
|
1818
|
+
y2AxisMajorTickInterval
|
|
1819
|
+
);
|
|
1820
|
+
const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
|
|
1821
|
+
const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
|
|
1822
|
+
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
|
|
1823
|
+
const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
|
|
1824
|
+
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
|
|
1509
1825
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
1510
1826
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
1827
|
+
const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
|
|
1828
|
+
const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
|
|
1829
|
+
const legendLabels = parseArrayOption(legendLabelsStr);
|
|
1830
|
+
const bgColor = backgroundColor || bgColorFromOptions;
|
|
1511
1831
|
const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
|
|
1512
1832
|
const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
|
|
1513
1833
|
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
@@ -1518,31 +1838,64 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1518
1838
|
fields: chartData.fields,
|
|
1519
1839
|
columns: chartData.seriesList
|
|
1520
1840
|
});
|
|
1521
|
-
const xField =
|
|
1841
|
+
const xField = getFieldName2(filteredChartData.fields[0]);
|
|
1522
1842
|
const yFields = getFieldNames(
|
|
1523
1843
|
filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
|
|
1524
1844
|
);
|
|
1525
|
-
const y2Fields =
|
|
1526
|
-
|
|
1845
|
+
const y2Fields = (0, react_exports.useMemo)(
|
|
1846
|
+
() => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
|
|
1847
|
+
[y2FieldsStr]
|
|
1848
|
+
);
|
|
1849
|
+
const overlayFields = (0, react_exports.useMemo)(
|
|
1850
|
+
() => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
|
|
1851
|
+
[overlayFieldsStr]
|
|
1852
|
+
);
|
|
1527
1853
|
let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
|
|
1528
1854
|
xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
|
|
1529
|
-
|
|
1855
|
+
const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
|
|
1856
|
+
let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
|
|
1530
1857
|
yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
|
|
1531
1858
|
const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
|
|
1532
1859
|
let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
|
|
1533
1860
|
y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
|
|
1534
|
-
const xScaleConfig =
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1861
|
+
const xScaleConfig = (0, react_exports.useMemo)(
|
|
1862
|
+
() => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
|
|
1863
|
+
[xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
|
|
1864
|
+
);
|
|
1865
|
+
const yScaleConfig = (0, react_exports.useMemo)(
|
|
1866
|
+
() => getYScaleConfig(
|
|
1867
|
+
yAxisTitle,
|
|
1868
|
+
yAxisAbbreviation,
|
|
1869
|
+
yAxisScale,
|
|
1870
|
+
yAxisLabelVisibility,
|
|
1871
|
+
yAxisMin,
|
|
1872
|
+
yAxisMax
|
|
1873
|
+
),
|
|
1874
|
+
[yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
|
|
1875
|
+
);
|
|
1876
|
+
const y2ScaleConfig = (0, react_exports.useMemo)(() => {
|
|
1877
|
+
if (y2Enabled) {
|
|
1878
|
+
return getY2ScaleConfig(
|
|
1879
|
+
y2AxisTitle,
|
|
1880
|
+
y2AxisAbbreviation,
|
|
1881
|
+
y2AxisScale,
|
|
1882
|
+
y2IntegerUnits,
|
|
1883
|
+
y2AxisLabelVisibility,
|
|
1884
|
+
y2AxisMin,
|
|
1885
|
+
y2AxisMax
|
|
1886
|
+
);
|
|
1887
|
+
}
|
|
1888
|
+
return {};
|
|
1889
|
+
}, [
|
|
1890
|
+
y2Enabled,
|
|
1891
|
+
y2AxisTitle,
|
|
1892
|
+
y2AxisAbbreviation,
|
|
1893
|
+
y2AxisScale,
|
|
1894
|
+
y2IntegerUnits,
|
|
1895
|
+
y2AxisLabelVisibility,
|
|
1896
|
+
y2AxisMin,
|
|
1897
|
+
y2AxisMax
|
|
1898
|
+
]);
|
|
1546
1899
|
const uplotContainerElement = (0, react_exports.useRef)(null);
|
|
1547
1900
|
const seriesDataFormatted = [
|
|
1548
1901
|
filteredChartData.columns[0],
|
|
@@ -1558,9 +1911,25 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1558
1911
|
overlayFields,
|
|
1559
1912
|
y2Enabled,
|
|
1560
1913
|
nullValueMode,
|
|
1561
|
-
markerDisplay
|
|
1914
|
+
markerDisplay,
|
|
1915
|
+
lineDashStyle,
|
|
1916
|
+
lineDashStylesByField,
|
|
1917
|
+
stepPosition,
|
|
1918
|
+
stepPositionsByField
|
|
1562
1919
|
),
|
|
1563
|
-
[
|
|
1920
|
+
[
|
|
1921
|
+
yFields,
|
|
1922
|
+
y2Fields,
|
|
1923
|
+
lineWidth,
|
|
1924
|
+
overlayFields,
|
|
1925
|
+
y2Enabled,
|
|
1926
|
+
nullValueMode,
|
|
1927
|
+
markerDisplay,
|
|
1928
|
+
lineDashStyle,
|
|
1929
|
+
lineDashStylesByField,
|
|
1930
|
+
stepPosition,
|
|
1931
|
+
stepPositionsByField
|
|
1932
|
+
]
|
|
1564
1933
|
);
|
|
1565
1934
|
const chartingEventAnnotations = (0, react_exports.useMemo)(
|
|
1566
1935
|
() => getAnnotationsForCanvas({
|
|
@@ -1574,25 +1943,59 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1574
1943
|
() => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
|
|
1575
1944
|
[xScaleConfig, yScaleConfig, y2ScaleConfig]
|
|
1576
1945
|
);
|
|
1577
|
-
const
|
|
1946
|
+
const isSeriesCompare = legendMode === "seriesCompare";
|
|
1947
|
+
const legend = (0, react_exports.useMemo)(
|
|
1948
|
+
() => getLegend({
|
|
1949
|
+
legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
|
|
1950
|
+
isSeriesCompare,
|
|
1951
|
+
legendTruncation
|
|
1952
|
+
}),
|
|
1953
|
+
[legendDisplay, isSeriesCompare, legendTruncation]
|
|
1954
|
+
);
|
|
1578
1955
|
const handleChartClick = react_exports.useCallback(
|
|
1579
1956
|
(event) => {
|
|
1580
1957
|
if (onClick) {
|
|
1581
|
-
handleClick(event, onClick);
|
|
1958
|
+
handleClick(event, onClick, trellisKey, trellisSplitBy);
|
|
1582
1959
|
}
|
|
1583
1960
|
},
|
|
1584
|
-
[onClick]
|
|
1961
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
1585
1962
|
);
|
|
1586
1963
|
const handleChartLegendClick = react_exports.useCallback(
|
|
1587
1964
|
(event) => {
|
|
1588
1965
|
if (onClick) {
|
|
1589
|
-
handleLegendClick(event, onClick);
|
|
1966
|
+
handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
|
|
1967
|
+
}
|
|
1968
|
+
},
|
|
1969
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
1970
|
+
);
|
|
1971
|
+
const handleChartRangeSelection = react_exports.useCallback(
|
|
1972
|
+
(range2) => {
|
|
1973
|
+
if (onSelect) {
|
|
1974
|
+
handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
1590
1975
|
}
|
|
1591
1976
|
},
|
|
1592
|
-
[
|
|
1977
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
1978
|
+
);
|
|
1979
|
+
const handleChartRangeZoom = react_exports.useCallback(
|
|
1980
|
+
(range2) => {
|
|
1981
|
+
if (onSelect) {
|
|
1982
|
+
handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
1983
|
+
}
|
|
1984
|
+
},
|
|
1985
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
1986
|
+
);
|
|
1987
|
+
const xFieldToUse = xFieldFromProps || xField;
|
|
1988
|
+
const enableSearchZoom = react_exports.useMemo(
|
|
1989
|
+
() => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
|
|
1990
|
+
[eventHandlers, xFieldToUse]
|
|
1593
1991
|
);
|
|
1594
1992
|
const lastPayloadRef = react_exports.useRef(null);
|
|
1595
1993
|
const lastOriginalEventRef = react_exports.useRef(null);
|
|
1994
|
+
const previousMouseoverPayloadRef = react_exports.useRef(null);
|
|
1995
|
+
const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
|
|
1996
|
+
react_exports.useEffect(() => {
|
|
1997
|
+
additionalTooltipValuesRef.current = additionalTooltipValues;
|
|
1998
|
+
}, [additionalTooltipValues]);
|
|
1596
1999
|
const handleChartCrosshairChange = react_exports.useCallback(
|
|
1597
2000
|
(event) => {
|
|
1598
2001
|
if (onPointMouseOver || onPointMouseOut) {
|
|
@@ -1604,6 +2007,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1604
2007
|
payload: lastPayloadRef.current
|
|
1605
2008
|
});
|
|
1606
2009
|
}
|
|
2010
|
+
previousMouseoverPayloadRef.current = null;
|
|
1607
2011
|
return;
|
|
1608
2012
|
}
|
|
1609
2013
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
|
|
@@ -1611,25 +2015,36 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1611
2015
|
});
|
|
1612
2016
|
delete payload.seriesKey;
|
|
1613
2017
|
if (event.rowContext) {
|
|
1614
|
-
Object.
|
|
1615
|
-
payload
|
|
1616
|
-
|
|
2018
|
+
Object.assign(
|
|
2019
|
+
payload,
|
|
2020
|
+
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
2021
|
+
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
2022
|
+
return acc;
|
|
2023
|
+
}, {})
|
|
2024
|
+
);
|
|
1617
2025
|
}
|
|
1618
|
-
|
|
2026
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
2027
|
+
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
2028
|
+
return;
|
|
2029
|
+
}
|
|
2030
|
+
lastPayloadRef.current = updatedPayload;
|
|
1619
2031
|
lastOriginalEventRef.current = event;
|
|
2032
|
+
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
1620
2033
|
if (onPointMouseOver) {
|
|
1621
2034
|
onPointMouseOver({
|
|
1622
2035
|
type: "point.mouseover",
|
|
1623
2036
|
originalEvent: event,
|
|
1624
|
-
payload
|
|
2037
|
+
payload: updatedPayload
|
|
1625
2038
|
});
|
|
1626
2039
|
}
|
|
1627
2040
|
}
|
|
1628
2041
|
},
|
|
1629
|
-
[onPointMouseOver, onPointMouseOut]
|
|
2042
|
+
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
|
|
1630
2043
|
);
|
|
1631
|
-
const
|
|
1632
|
-
|
|
2044
|
+
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}`;
|
|
2045
|
+
const memoizedChart = (0, react_exports.useMemo)(() => {
|
|
2046
|
+
const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
|
|
2047
|
+
return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
|
|
1633
2048
|
visualization_canvas_exports.TimeSeriesChart,
|
|
1634
2049
|
{
|
|
1635
2050
|
data: chartData,
|
|
@@ -1639,49 +2054,121 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
1639
2054
|
seriesColorsByField,
|
|
1640
2055
|
seriesConfig: seriesOverrides,
|
|
1641
2056
|
legend,
|
|
2057
|
+
legendLabels,
|
|
2058
|
+
legendTruncation,
|
|
2059
|
+
isSeriesCompare: legendMode === "seriesCompare",
|
|
2060
|
+
maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
|
|
1642
2061
|
scaleConfig,
|
|
1643
2062
|
timestampFormat: "expanded",
|
|
1644
2063
|
onCrosshairClick: onClick ? handleChartClick : void 0,
|
|
1645
2064
|
onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
|
|
1646
2065
|
onSeriesClick: onClick ? handleChartLegendClick : void 0,
|
|
2066
|
+
onRangeSelection: handleChartRangeSelection,
|
|
2067
|
+
onRangeZoom: computedOnRangeZoom,
|
|
2068
|
+
serverSideZoom: enableSearchZoom,
|
|
1647
2069
|
userLocale,
|
|
1648
2070
|
events: chartingEventAnnotations,
|
|
1649
|
-
eventsConfig: { renderer: triangleEventAnnotationRenderer }
|
|
2071
|
+
eventsConfig: { renderer: triangleEventAnnotationRenderer },
|
|
2072
|
+
additionalTooltipValuesRef,
|
|
2073
|
+
showXMajorGridLines,
|
|
2074
|
+
showYMajorGridLines,
|
|
2075
|
+
showY2MajorGridLines,
|
|
2076
|
+
showYMinorGridLines,
|
|
2077
|
+
showY2MinorGridLines,
|
|
2078
|
+
showLineSmoothing,
|
|
2079
|
+
dataValuesDisplay,
|
|
2080
|
+
showXMajorTicks,
|
|
2081
|
+
xAxisMajorTickSize: xAxisMajorTickSizeNum,
|
|
2082
|
+
showYMajorTicks,
|
|
2083
|
+
showY2MajorTicks,
|
|
2084
|
+
yAxisMajorTickSize: yAxisMajorTickSizeNum,
|
|
2085
|
+
y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
|
|
2086
|
+
yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
|
|
2087
|
+
y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
|
|
2088
|
+
showYMinorTicks,
|
|
2089
|
+
showY2MinorTicks,
|
|
2090
|
+
yAxisMinorTickSize: yAxisMinorTickSizeNum,
|
|
2091
|
+
y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
|
|
2092
|
+
showYAxisWithZero,
|
|
2093
|
+
showY2AxisWithZero,
|
|
2094
|
+
showXAxisLine,
|
|
2095
|
+
showYAxisLine,
|
|
2096
|
+
showY2AxisLine,
|
|
2097
|
+
xAxisMaxLabelParts
|
|
1650
2098
|
}
|
|
1651
|
-
)
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
2099
|
+
));
|
|
2100
|
+
}, [
|
|
2101
|
+
onSelect,
|
|
2102
|
+
handleChartRangeZoom,
|
|
2103
|
+
dataKey,
|
|
2104
|
+
chartData,
|
|
2105
|
+
containerWidth,
|
|
2106
|
+
containerHeight,
|
|
2107
|
+
seriesColors,
|
|
2108
|
+
seriesColorsByField,
|
|
2109
|
+
seriesOverrides,
|
|
2110
|
+
legend,
|
|
2111
|
+
legendLabels,
|
|
2112
|
+
legendTruncation,
|
|
2113
|
+
scaleConfig,
|
|
2114
|
+
onClick,
|
|
2115
|
+
handleChartClick,
|
|
2116
|
+
onPointMouseOver,
|
|
2117
|
+
onPointMouseOut,
|
|
2118
|
+
handleChartCrosshairChange,
|
|
2119
|
+
handleChartLegendClick,
|
|
2120
|
+
handleChartRangeSelection,
|
|
2121
|
+
enableSearchZoom,
|
|
2122
|
+
userLocale,
|
|
2123
|
+
chartingEventAnnotations,
|
|
2124
|
+
showXMajorGridLines,
|
|
2125
|
+
showYMajorGridLines,
|
|
2126
|
+
showY2MajorGridLines,
|
|
2127
|
+
showYMinorGridLines,
|
|
2128
|
+
showY2MinorGridLines,
|
|
2129
|
+
showLineSmoothing,
|
|
2130
|
+
dataValuesDisplay,
|
|
2131
|
+
showXMajorTicks,
|
|
2132
|
+
xAxisMajorTickSizeNum,
|
|
2133
|
+
showYMajorTicks,
|
|
2134
|
+
showY2MajorTicks,
|
|
2135
|
+
yAxisMajorTickSizeNum,
|
|
2136
|
+
y2AxisMajorTickSizeNum,
|
|
2137
|
+
yAxisMajorTickIntervalNum,
|
|
2138
|
+
y2AxisMajorTickIntervalNum,
|
|
2139
|
+
showYMinorTicks,
|
|
2140
|
+
showY2MinorTicks,
|
|
2141
|
+
yAxisMinorTickSizeNum,
|
|
2142
|
+
y2AxisMinorTickSizeNum,
|
|
2143
|
+
showYAxisWithZero,
|
|
2144
|
+
showY2AxisWithZero,
|
|
2145
|
+
showXAxisLine,
|
|
2146
|
+
showYAxisLine,
|
|
2147
|
+
showY2AxisLine,
|
|
2148
|
+
legendMode,
|
|
2149
|
+
xAxisMaxLabelParts
|
|
2150
|
+
]);
|
|
1671
2151
|
const memoizedVisualization = (0, react_exports.useMemo)(() => {
|
|
1672
|
-
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
|
|
1673
|
-
}, [
|
|
1674
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
2152
|
+
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
|
|
2153
|
+
}, [bgColor, memoizedChart]);
|
|
2154
|
+
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
|
|
2155
|
+
TrellisTitle,
|
|
2156
|
+
{
|
|
2157
|
+
trellisKey,
|
|
2158
|
+
backgroundColor: bgColor,
|
|
2159
|
+
fontColor: defaultFontColor
|
|
2160
|
+
}
|
|
2161
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
1675
2162
|
TimeSeriesChartContainer,
|
|
1676
2163
|
{
|
|
1677
|
-
height,
|
|
2164
|
+
height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
|
|
1678
2165
|
width,
|
|
1679
2166
|
ref: uplotContainerElement,
|
|
1680
2167
|
"data-test": "timeseries-chart-wrapper"
|
|
1681
2168
|
},
|
|
1682
2169
|
/* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
|
|
1683
2170
|
memoizedVisualization
|
|
1684
|
-
);
|
|
2171
|
+
));
|
|
1685
2172
|
};
|
|
1686
2173
|
var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
|
|
1687
2174
|
|
|
@@ -1992,7 +2479,7 @@ var ImageApi = class {
|
|
|
1992
2479
|
var ImageApi_default = ImageApi;
|
|
1993
2480
|
|
|
1994
2481
|
// src/Image/Image.tsx
|
|
1995
|
-
var { useEffect:
|
|
2482
|
+
var { useEffect: useEffect5, useRef: useRef7 } = react_exports;
|
|
1996
2483
|
var validOptions = Object.keys(config_default.optionsSchema);
|
|
1997
2484
|
var Container = styled_components_default.div.attrs(() => ({
|
|
1998
2485
|
"data-test": "image-container"
|
|
@@ -2004,6 +2491,12 @@ var Container = styled_components_default.div.attrs(() => ({
|
|
|
2004
2491
|
align-items: center;
|
|
2005
2492
|
cursor: ${(props) => props.onClick ? "pointer" : "inherit"};
|
|
2006
2493
|
${(props) => (0, style_exports.toDimension)((0, lodash_exports.pick)(props, ["width", "height"]))};
|
|
2494
|
+
${(props) => props.isButton ? `
|
|
2495
|
+
background: none;
|
|
2496
|
+
border: none;
|
|
2497
|
+
padding: 0;
|
|
2498
|
+
margin: 0;
|
|
2499
|
+
` : ""}
|
|
2007
2500
|
`;
|
|
2008
2501
|
var shouldShowPlaceholder = (dataSources, loading, options = {}) => {
|
|
2009
2502
|
if (options.src) {
|
|
@@ -2049,37 +2542,48 @@ var ImageVisualization = ({
|
|
|
2049
2542
|
const remoteImage = useRef7(null);
|
|
2050
2543
|
const api = useRef7(new ImageApi_default({ options: { src, preserveAspectRatio }, remoteImage }));
|
|
2051
2544
|
const isRemote = (0, RemoteImage_exports.isRemoteImage)(src);
|
|
2052
|
-
|
|
2545
|
+
useEffect5(() => {
|
|
2053
2546
|
visualizationApiRef(api.current);
|
|
2054
2547
|
return () => {
|
|
2055
2548
|
visualizationApiRef(null);
|
|
2056
2549
|
};
|
|
2057
2550
|
}, []);
|
|
2058
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
2059
|
-
|
|
2060
|
-
{
|
|
2061
|
-
imageURL: src,
|
|
2062
|
-
title,
|
|
2063
|
-
preserveAspectRatio,
|
|
2064
|
-
width,
|
|
2065
|
-
height,
|
|
2066
|
-
ref: remoteImage
|
|
2067
|
-
}
|
|
2068
|
-
) : /* @__PURE__ */ react_exports.createElement(
|
|
2069
|
-
StyledImage,
|
|
2551
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
2552
|
+
Container,
|
|
2070
2553
|
{
|
|
2071
|
-
"
|
|
2072
|
-
|
|
2073
|
-
shouldPreserveAspectRatio: preserveAspectRatio,
|
|
2554
|
+
as: onImageClick !== lodash_exports.noop ? "button" : "div",
|
|
2555
|
+
isButton: onImageClick !== lodash_exports.noop,
|
|
2074
2556
|
width,
|
|
2075
2557
|
height,
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2558
|
+
onClick: onImageClick !== lodash_exports.noop ? onImageClick : void 0,
|
|
2559
|
+
"aria-label": title || (0, i18n_exports._)("Image visualization")
|
|
2560
|
+
},
|
|
2561
|
+
isRemote ? /* @__PURE__ */ react_exports.createElement(
|
|
2562
|
+
RemoteImage_default,
|
|
2563
|
+
{
|
|
2564
|
+
imageURL: src,
|
|
2565
|
+
title,
|
|
2566
|
+
preserveAspectRatio,
|
|
2567
|
+
width,
|
|
2568
|
+
height,
|
|
2569
|
+
ref: remoteImage
|
|
2570
|
+
}
|
|
2571
|
+
) : /* @__PURE__ */ react_exports.createElement(
|
|
2572
|
+
StyledImage,
|
|
2573
|
+
{
|
|
2574
|
+
"data-test": "image",
|
|
2575
|
+
src,
|
|
2576
|
+
shouldPreserveAspectRatio: preserveAspectRatio,
|
|
2577
|
+
width,
|
|
2578
|
+
height,
|
|
2579
|
+
alt: (0, i18n_exports._)(title),
|
|
2580
|
+
onError: (e) => {
|
|
2581
|
+
e.target.alt = (0, i18n_exports._)("Image not found");
|
|
2582
|
+
},
|
|
2583
|
+
referrerPolicy: "no-referrer"
|
|
2584
|
+
}
|
|
2585
|
+
)
|
|
2586
|
+
);
|
|
2083
2587
|
};
|
|
2084
2588
|
var Image = withDashboardViz_default({
|
|
2085
2589
|
ReactViz: ImageVisualization,
|