@splunk/visualizations 28.3.0 → 28.4.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 +0 -1
- package/Area.config.js.map +2 -2
- package/Area.js +495 -99
- package/Area.js.map +3 -3
- package/Bar/Bar.d.ts.map +1 -1
- package/Bar.config.js +0 -1
- package/Bar.config.js.map +2 -2
- package/Bar.js +505 -99
- package/Bar.js.map +3 -3
- package/Bubble.config.js +0 -1
- package/Bubble.config.js.map +2 -2
- package/Bubble.js +494 -86
- package/Bubble.js.map +3 -3
- package/CHANGELOG.external.md +76 -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 +539 -103
- package/ChoroplethSvg.js.map +4 -4
- package/Column/Column.d.ts.map +1 -1
- package/Column.config.js +0 -1
- package/Column.config.js.map +2 -2
- package/Column.js +495 -99
- package/Column.js.map +3 -3
- package/Ellipse.js +528 -104
- package/Ellipse.js.map +4 -4
- package/Events/PureEvents/PureEvents.d.ts.map +1 -1
- package/Events.js +612 -149
- 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 +535 -140
- package/FillerGauge.js.map +4 -4
- package/Image/Image.d.ts.map +1 -1
- package/Image.js +564 -108
- 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 +59 -0
- package/Line/mockdata/LineData.d.ts.map +1 -1
- package/Line.config.js +0 -1
- package/Line.config.js.map +2 -2
- package/Line.js +601 -100
- 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 +1355 -654
- 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/LocalChoroplethLayer.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 +738 -228
- package/Map.js.map +4 -4
- package/Markdown/Markdown.d.ts.map +1 -1
- package/Markdown.js +548 -95
- 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 +1318 -142
- 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/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 +123 -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 +6793 -0
- package/NetworkGraph.js.map +7 -0
- package/ParallelCoordinates.js +532 -93
- package/ParallelCoordinates.js.map +4 -4
- package/Pie/Pie.d.ts.map +1 -1
- package/Pie/pieUtils.d.ts.map +1 -1
- package/Pie.js +510 -101
- package/Pie.js.map +3 -3
- package/Punchcard.js +523 -84
- package/Punchcard.js.map +4 -4
- package/Rectangle.js +537 -113
- package/Rectangle.js.map +4 -4
- package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
- package/Sankey.js +562 -111
- package/Sankey.js.map +4 -4
- package/Scatter/Scatter.d.ts.map +1 -1
- package/Scatter.config.js +0 -1
- package/Scatter.config.js.map +2 -2
- package/Scatter.js +505 -99
- package/Scatter.js.map +3 -3
- 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 +656 -173
- 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 +0 -1
- package/SingleValueIcon.config.js.map +2 -2
- package/SingleValueIcon.js +512 -124
- package/SingleValueIcon.js.map +3 -3
- 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 +517 -124
- 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/cells/SparklineCell.d.ts.map +1 -1
- package/Table/config.d.ts.map +1 -1
- package/Table/hooks.d.ts +4 -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 +760 -223
- package/Table.js.map +4 -4
- package/Timeline/PureTimeline/src/CursorPlugin.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/TimelineLegend.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 +649 -211
- 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/OptionsDoc.js.map +1 -1
- 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 +561 -83
- package/common/TimeSeriesChartWrapper.js.map +4 -4
- package/common/chartingUtils.d.ts +45 -5
- package/common/chartingUtils.d.ts.map +1 -1
- package/common/chartingUtils.js +102 -8
- package/common/chartingUtils.js.map +3 -3
- package/common/editorConfig/AxesChartDataConfig.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/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 +12 -14
- package/common/utils/trellisUtils.js.map +2 -2
- package/common/withDashboardViz.d.ts.map +1 -1
- package/common/withDashboardViz.js +544 -84
- package/common/withDashboardViz.js.map +4 -4
- package/package.json +33 -26
- 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/FillerGauge.js
CHANGED
|
@@ -985,7 +985,7 @@ var Cover = styled_components_default.div`
|
|
|
985
985
|
bottom: 0;
|
|
986
986
|
`;
|
|
987
987
|
var Blocker = styled_components_default.div.attrs({
|
|
988
|
-
"data-splunk-visualization-version": "28.
|
|
988
|
+
"data-splunk-visualization-version": "28.4.0 - 002bd482f"
|
|
989
989
|
})`
|
|
990
990
|
position: relative;
|
|
991
991
|
width: 100%;
|
|
@@ -1075,7 +1075,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
1075
1075
|
FixSizeItem,
|
|
1076
1076
|
{
|
|
1077
1077
|
"data-test": "fix-size-item",
|
|
1078
|
-
"data-splunk-visualization-version": "28.
|
|
1078
|
+
"data-splunk-visualization-version": "28.4.0 - 002bd482f",
|
|
1079
1079
|
width,
|
|
1080
1080
|
height,
|
|
1081
1081
|
backgroundColor
|
|
@@ -1171,6 +1171,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
|
|
|
1171
1171
|
var numberUtils_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
|
|
1172
1172
|
|
|
1173
1173
|
// src/common/utils/dataUtils.ts
|
|
1174
|
+
var getFieldName = (field) => typeof field === "string" ? field : field.name;
|
|
1174
1175
|
var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
|
|
1175
1176
|
const dataLength = data.length;
|
|
1176
1177
|
const downsampledIndices = [];
|
|
@@ -1287,9 +1288,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
|
|
|
1287
1288
|
let xColumn = [];
|
|
1288
1289
|
const yColumns = [];
|
|
1289
1290
|
const canDownsample = !ds.data.fields.some((field, index) => {
|
|
1290
|
-
var _a
|
|
1291
|
-
const fieldName = (
|
|
1292
|
-
const fieldType = (
|
|
1291
|
+
var _a;
|
|
1292
|
+
const fieldName = getFieldName(field);
|
|
1293
|
+
const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
|
|
1293
1294
|
const column = ds.data.columns[index];
|
|
1294
1295
|
let hasDisplayedColumnThatCantBeDownsampled = false;
|
|
1295
1296
|
if (fieldName === xField) {
|
|
@@ -1576,7 +1577,7 @@ var trellisUtils_default = "default" in defaultImport30 ? defaultImport30.defaul
|
|
|
1576
1577
|
var AGGREGATIONS = "aggregations";
|
|
1577
1578
|
var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
1578
1579
|
var _a, _b, _c, _d;
|
|
1579
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
1580
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
1580
1581
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
1581
1582
|
let splitDataSources = null;
|
|
1582
1583
|
let errorCode = null;
|
|
@@ -1597,7 +1598,7 @@ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
|
1597
1598
|
}
|
|
1598
1599
|
return { splitDataSources, errorCode };
|
|
1599
1600
|
};
|
|
1600
|
-
var toFieldEntries = (fields) => {
|
|
1601
|
+
var toFieldEntries = (fields = []) => {
|
|
1601
1602
|
return fields.map((field) => {
|
|
1602
1603
|
if (typeof field === "string") {
|
|
1603
1604
|
return { name: field };
|
|
@@ -1612,7 +1613,7 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
1612
1613
|
let splitDataSources = null;
|
|
1613
1614
|
let splitByFields = [];
|
|
1614
1615
|
let errorCode = null;
|
|
1615
|
-
if (
|
|
1616
|
+
if (fields.length > 0) {
|
|
1616
1617
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
1617
1618
|
}
|
|
1618
1619
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -1650,12 +1651,12 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
1650
1651
|
};
|
|
1651
1652
|
var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
1652
1653
|
var _a, _b, _c, _d;
|
|
1653
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
1654
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
1654
1655
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
1655
1656
|
let splitDataSources = null;
|
|
1656
1657
|
let splitByFields = [];
|
|
1657
1658
|
let errorCode = null;
|
|
1658
|
-
if (
|
|
1659
|
+
if (fields.length > 0) {
|
|
1659
1660
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
|
|
1660
1661
|
}
|
|
1661
1662
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -1679,12 +1680,12 @@ var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
|
1679
1680
|
};
|
|
1680
1681
|
var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
1681
1682
|
var _a, _b, _c, _d, _e;
|
|
1682
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
1683
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
1683
1684
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
1684
1685
|
let splitDataSources = null;
|
|
1685
1686
|
let splitByFields = [];
|
|
1686
1687
|
let errorCode = null;
|
|
1687
|
-
if (
|
|
1688
|
+
if (fields.length > 0) {
|
|
1688
1689
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
1689
1690
|
}
|
|
1690
1691
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -1722,12 +1723,12 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
|
1722
1723
|
};
|
|
1723
1724
|
var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
1724
1725
|
var _a, _b, _c, _d;
|
|
1725
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
1726
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
1726
1727
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
1727
1728
|
let splitDataSources = null;
|
|
1728
1729
|
let splitByFields = [];
|
|
1729
1730
|
let errorCode = null;
|
|
1730
|
-
if (
|
|
1731
|
+
if (fields.length > 0) {
|
|
1731
1732
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
1732
1733
|
}
|
|
1733
1734
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -1815,17 +1816,15 @@ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
|
1815
1816
|
};
|
|
1816
1817
|
var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
|
|
1817
1818
|
var _a, _b, _c, _d, _e, _f;
|
|
1818
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
1819
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
1819
1820
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
1820
1821
|
let splitDataSources = null;
|
|
1821
1822
|
let splitByFields = [];
|
|
1822
1823
|
let errorCode = null;
|
|
1823
|
-
if (
|
|
1824
|
+
if (fields.length > 0) {
|
|
1824
1825
|
splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
|
|
1825
1826
|
}
|
|
1826
|
-
const splitByIndex = fields
|
|
1827
|
-
(field) => field === splitBy || field.name === splitBy
|
|
1828
|
-
);
|
|
1827
|
+
const splitByIndex = fields.findIndex((field) => field.name === splitBy);
|
|
1829
1828
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
1830
1829
|
const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
|
|
1831
1830
|
splitDataSources = {};
|
|
@@ -1975,6 +1974,16 @@ var triangleEventAnnotationRenderer = ({
|
|
|
1975
1974
|
eventColor: eventWithColor.color
|
|
1976
1975
|
});
|
|
1977
1976
|
};
|
|
1977
|
+
var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
|
|
1978
|
+
const rangeSelectEventHandler = eventHandlers.find(
|
|
1979
|
+
(eventHandler) => {
|
|
1980
|
+
var _a;
|
|
1981
|
+
return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
|
|
1982
|
+
}
|
|
1983
|
+
);
|
|
1984
|
+
const xAxisIsTime = xField === "_time";
|
|
1985
|
+
return !!rangeSelectEventHandler && xAxisIsTime;
|
|
1986
|
+
};
|
|
1978
1987
|
var canvasSupportedTimeSeriesCharts = ["splunk.line"];
|
|
1979
1988
|
var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
|
|
1980
1989
|
return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
|
|
@@ -1995,16 +2004,31 @@ var filterChartDataFromInternalFields = (chartData) => {
|
|
|
1995
2004
|
var convert2DArrayToNumbers = (arr) => {
|
|
1996
2005
|
return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
|
|
1997
2006
|
};
|
|
2007
|
+
var parseAxisValue = (val) => {
|
|
2008
|
+
if (val === void 0 || val === null || val === "auto" || val === "") {
|
|
2009
|
+
return void 0;
|
|
2010
|
+
}
|
|
2011
|
+
const num = typeof val === "number" ? val : Number.parseFloat(val);
|
|
2012
|
+
return Number.isNaN(num) ? void 0 : num;
|
|
2013
|
+
};
|
|
1998
2014
|
var SideLegendWidth = 75;
|
|
1999
|
-
var
|
|
2015
|
+
var SeriesCompareLegendWidth = 200;
|
|
2000
2016
|
var getLegend = (props) => {
|
|
2001
2017
|
const legendPlacement = props == null ? void 0 : props.legendDisplay;
|
|
2018
|
+
const { isSeriesCompare } = props;
|
|
2019
|
+
const commonLegendProps = {
|
|
2020
|
+
center: true,
|
|
2021
|
+
fontSize: 12,
|
|
2022
|
+
largerTiles: true,
|
|
2023
|
+
hideSeriesValue: !isSeriesCompare
|
|
2024
|
+
// Show values if in seriesCompare mode
|
|
2025
|
+
};
|
|
2002
2026
|
switch (legendPlacement) {
|
|
2003
2027
|
case "off":
|
|
2004
2028
|
return false;
|
|
2005
2029
|
case "left":
|
|
2006
2030
|
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
|
|
2007
|
-
width: SideLegendWidth
|
|
2031
|
+
width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
|
|
2008
2032
|
}, commonLegendProps));
|
|
2009
2033
|
case "bottom":
|
|
2010
2034
|
return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
|
|
@@ -2016,7 +2040,7 @@ var getLegend = (props) => {
|
|
|
2016
2040
|
}, commonLegendProps));
|
|
2017
2041
|
default:
|
|
2018
2042
|
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
|
|
2019
|
-
width: SideLegendWidth
|
|
2043
|
+
width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
|
|
2020
2044
|
}, commonLegendProps));
|
|
2021
2045
|
}
|
|
2022
2046
|
};
|
|
@@ -2052,22 +2076,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
|
|
|
2052
2076
|
const end = axisTitle.slice(-halfChars);
|
|
2053
2077
|
return `${start}...${end}`;
|
|
2054
2078
|
};
|
|
2055
|
-
var
|
|
2079
|
+
var getFieldName2 = (field) => {
|
|
2056
2080
|
const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
|
|
2057
2081
|
return fieldName;
|
|
2058
2082
|
};
|
|
2059
2083
|
var getFieldNames = (fields) => {
|
|
2060
|
-
return fields.map((field) =>
|
|
2084
|
+
return fields.map((field) => getFieldName2(field));
|
|
2061
2085
|
};
|
|
2062
|
-
var getXScaleConfig = (label, xAxisLabelVisibility) => {
|
|
2086
|
+
var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
|
|
2063
2087
|
const xConfig = { x: {} };
|
|
2064
2088
|
xConfig.x.label = label;
|
|
2065
2089
|
if (xAxisLabelVisibility === "hide") {
|
|
2066
2090
|
xConfig.x.hideLabels = true;
|
|
2067
2091
|
}
|
|
2092
|
+
if (xAxisLabelRotation !== void 0) {
|
|
2093
|
+
xConfig.x.labelRotation = xAxisLabelRotation;
|
|
2094
|
+
}
|
|
2068
2095
|
return xConfig;
|
|
2069
2096
|
};
|
|
2070
|
-
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
|
|
2097
|
+
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
|
|
2071
2098
|
const scaleType = yAxisScale != null ? yAxisScale : "linear";
|
|
2072
2099
|
const yConfig = { y: {} };
|
|
2073
2100
|
yConfig.y.label = label;
|
|
@@ -2083,14 +2110,20 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
|
|
|
2083
2110
|
if (yAxisLabelVisibility === "hide") {
|
|
2084
2111
|
yConfig.y.hideLabels = true;
|
|
2085
2112
|
}
|
|
2113
|
+
if (yAxisMin !== void 0 || yAxisMax !== void 0) {
|
|
2114
|
+
yConfig.y.range = (u, dataMin, dataMax) => {
|
|
2115
|
+
const min = yAxisMin != null ? yAxisMin : dataMin;
|
|
2116
|
+
const max = yAxisMax != null ? yAxisMax : dataMax;
|
|
2117
|
+
return [min, max];
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2086
2120
|
return yConfig;
|
|
2087
2121
|
};
|
|
2088
|
-
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
|
|
2122
|
+
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
|
|
2089
2123
|
const y2Config = { y2: {} };
|
|
2090
2124
|
const scaleType = axisScale != null ? axisScale : "linear";
|
|
2091
2125
|
y2Config.y2.label = label;
|
|
2092
2126
|
y2Config.y2.side = "right";
|
|
2093
|
-
y2Config.y2.showGrid = false;
|
|
2094
2127
|
y2Config.y2.type = scaleType;
|
|
2095
2128
|
if (axisAbbreviation !== "none") {
|
|
2096
2129
|
y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
|
|
@@ -2100,9 +2133,16 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
|
|
|
2100
2133
|
if (y2AxisLabelVisibility === "hide") {
|
|
2101
2134
|
y2Config.y2.hideLabels = true;
|
|
2102
2135
|
}
|
|
2136
|
+
if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
|
|
2137
|
+
y2Config.y2.range = (u, dataMin, dataMax) => {
|
|
2138
|
+
const min = y2AxisMin != null ? y2AxisMin : dataMin;
|
|
2139
|
+
const max = y2AxisMax != null ? y2AxisMax : dataMax;
|
|
2140
|
+
return [min, max];
|
|
2141
|
+
};
|
|
2142
|
+
}
|
|
2103
2143
|
return y2Config;
|
|
2104
2144
|
};
|
|
2105
|
-
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
|
|
2145
|
+
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
|
|
2106
2146
|
const seriesConfig = {};
|
|
2107
2147
|
let spanGaps;
|
|
2108
2148
|
let replaceNullsWithZero;
|
|
@@ -2137,12 +2177,87 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
2137
2177
|
if (markerDisplay !== void 0) {
|
|
2138
2178
|
seriesConfig[field].markerDisplay = markerDisplay;
|
|
2139
2179
|
}
|
|
2180
|
+
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
2181
|
+
if (fieldDashStyle) {
|
|
2182
|
+
seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
2183
|
+
}
|
|
2140
2184
|
if (replaceNullsWithZero !== void 0) {
|
|
2141
2185
|
seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
|
|
2142
2186
|
}
|
|
2143
2187
|
});
|
|
2144
2188
|
return seriesConfig;
|
|
2145
2189
|
};
|
|
2190
|
+
var findRangeIndices = (xData, startValue, endValue) => {
|
|
2191
|
+
let startXIndex = -1;
|
|
2192
|
+
let endXIndex = -1;
|
|
2193
|
+
const xDataEpoch = xData.map((val) => {
|
|
2194
|
+
if (typeof val === "string") {
|
|
2195
|
+
return new Date(val).getTime() / 1e3;
|
|
2196
|
+
}
|
|
2197
|
+
return val;
|
|
2198
|
+
});
|
|
2199
|
+
for (let i = 0; i < xDataEpoch.length; i += 1) {
|
|
2200
|
+
if (xDataEpoch[i] >= startValue) {
|
|
2201
|
+
startXIndex = i;
|
|
2202
|
+
break;
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
if (startXIndex === -1 && xDataEpoch.length > 0) {
|
|
2206
|
+
startXIndex = xDataEpoch.length - 1;
|
|
2207
|
+
}
|
|
2208
|
+
for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
|
|
2209
|
+
if (xDataEpoch[i] <= endValue) {
|
|
2210
|
+
endXIndex = i;
|
|
2211
|
+
break;
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
if (endXIndex === -1 && xDataEpoch.length > 0) {
|
|
2215
|
+
endXIndex = 0;
|
|
2216
|
+
}
|
|
2217
|
+
return { startXIndex, endXIndex };
|
|
2218
|
+
};
|
|
2219
|
+
|
|
2220
|
+
// src/common/hooks/useTrellisEnabled.ts
|
|
2221
|
+
var useTrellisFeatureFlagOn = () => {
|
|
2222
|
+
const context = (0, react_exports.useContext)(FeatureFlagContext_default);
|
|
2223
|
+
return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
|
|
2224
|
+
};
|
|
2225
|
+
var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
|
|
2226
|
+
const trellisFeatureEnabled = useTrellisFeatureFlagOn();
|
|
2227
|
+
return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
2228
|
+
};
|
|
2229
|
+
|
|
2230
|
+
// src/common/components/TrellisTitle.tsx
|
|
2231
|
+
var TRELLIS_TITLE_HEIGHT = 28;
|
|
2232
|
+
var TrellisTitleText = styled_components_default.div`
|
|
2233
|
+
margin-left: 10px;
|
|
2234
|
+
margin-right: 10px;
|
|
2235
|
+
padding-top: 8px;
|
|
2236
|
+
text-overflow: ellipsis;
|
|
2237
|
+
white-space: nowrap;
|
|
2238
|
+
overflow: hidden;
|
|
2239
|
+
`;
|
|
2240
|
+
var TrellisTitleDiv = styled_components_default.div`
|
|
2241
|
+
height: ${TRELLIS_TITLE_HEIGHT}px;
|
|
2242
|
+
font-size: 14px;
|
|
2243
|
+
font-weight: 700;
|
|
2244
|
+
color: ${(props) => props.fontColor};
|
|
2245
|
+
background-color: ${(props) => props.backgroundColor};
|
|
2246
|
+
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.
|
|
2247
|
+
`;
|
|
2248
|
+
var TrellisTitle = (props) => {
|
|
2249
|
+
const titleText = String(props.trellisKey).toString();
|
|
2250
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
2251
|
+
TrellisTitleDiv,
|
|
2252
|
+
{
|
|
2253
|
+
fontColor: props.fontColor,
|
|
2254
|
+
backgroundColor: props.backgroundColor,
|
|
2255
|
+
"data-test": "trellis-title",
|
|
2256
|
+
title: titleText
|
|
2257
|
+
},
|
|
2258
|
+
/* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
|
|
2259
|
+
);
|
|
2260
|
+
};
|
|
2146
2261
|
|
|
2147
2262
|
// src/common/TimeSeriesChartWrapper.tsx
|
|
2148
2263
|
var TimeSeriesChartContainer = styled_components_default.div`
|
|
@@ -2153,38 +2268,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
|
|
|
2153
2268
|
position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
|
|
2154
2269
|
}
|
|
2155
2270
|
`;
|
|
2156
|
-
var
|
|
2271
|
+
var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
|
|
2272
|
+
const result = __spreadValues({}, payload);
|
|
2273
|
+
if (trellisSplitBy) {
|
|
2274
|
+
result["trellis.name"] = trellisSplitBy;
|
|
2275
|
+
}
|
|
2276
|
+
if (trellisKey) {
|
|
2277
|
+
result["trellis.value"] = trellisKey;
|
|
2278
|
+
}
|
|
2279
|
+
return result;
|
|
2280
|
+
};
|
|
2281
|
+
var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
|
|
2282
|
+
if (!previousPayload) {
|
|
2283
|
+
return true;
|
|
2284
|
+
}
|
|
2285
|
+
if (currentPayload.index !== previousPayload.index) {
|
|
2286
|
+
return true;
|
|
2287
|
+
}
|
|
2288
|
+
if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
|
|
2289
|
+
return true;
|
|
2290
|
+
}
|
|
2291
|
+
if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
|
|
2292
|
+
return true;
|
|
2293
|
+
}
|
|
2294
|
+
if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
|
|
2295
|
+
return true;
|
|
2296
|
+
}
|
|
2297
|
+
return false;
|
|
2298
|
+
};
|
|
2299
|
+
var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
2157
2300
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
|
|
2158
2301
|
name: chartEvent.seriesKey
|
|
2159
2302
|
});
|
|
2160
2303
|
delete payload.seriesKey;
|
|
2161
2304
|
if (chartEvent.rowContext) {
|
|
2162
|
-
Object.
|
|
2163
|
-
payload
|
|
2164
|
-
|
|
2305
|
+
Object.assign(
|
|
2306
|
+
payload,
|
|
2307
|
+
Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
|
|
2308
|
+
acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
|
|
2309
|
+
return acc;
|
|
2310
|
+
}, {})
|
|
2311
|
+
);
|
|
2165
2312
|
}
|
|
2313
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
2166
2314
|
if (onClick) {
|
|
2167
2315
|
onClick({
|
|
2168
2316
|
type: "point.click",
|
|
2169
2317
|
originalEvent: chartEvent,
|
|
2170
|
-
payload
|
|
2318
|
+
payload: updatedPayload
|
|
2171
2319
|
});
|
|
2172
2320
|
}
|
|
2173
2321
|
};
|
|
2174
|
-
var handleLegendClick = (chartEvent, onClick) => {
|
|
2322
|
+
var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
2175
2323
|
const payload = {
|
|
2176
2324
|
name: chartEvent
|
|
2177
2325
|
};
|
|
2326
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
2178
2327
|
if (onClick) {
|
|
2179
2328
|
onClick({
|
|
2180
2329
|
type: "legend.click",
|
|
2181
2330
|
originalEvent: chartEvent,
|
|
2182
|
-
payload
|
|
2331
|
+
payload: updatedPayload
|
|
2332
|
+
});
|
|
2333
|
+
}
|
|
2334
|
+
};
|
|
2335
|
+
var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
2336
|
+
var _a;
|
|
2337
|
+
if (!rangeEvent) {
|
|
2338
|
+
return;
|
|
2339
|
+
}
|
|
2340
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
2341
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
2342
|
+
const payload = {
|
|
2343
|
+
startXIndex,
|
|
2344
|
+
startXValue: rangeEvent.start,
|
|
2345
|
+
endXIndex,
|
|
2346
|
+
endXValue: rangeEvent.end
|
|
2347
|
+
};
|
|
2348
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
2349
|
+
if (onSelect) {
|
|
2350
|
+
onSelect({
|
|
2351
|
+
type: "range.selectBeforeZoom",
|
|
2352
|
+
originalEvent: rangeEvent,
|
|
2353
|
+
payload: updatedPayload
|
|
2183
2354
|
});
|
|
2184
2355
|
}
|
|
2185
2356
|
};
|
|
2357
|
+
var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
2358
|
+
var _a;
|
|
2359
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
2360
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
2361
|
+
const payload = {
|
|
2362
|
+
startXIndex,
|
|
2363
|
+
startXValue: rangeEvent.start,
|
|
2364
|
+
endXIndex,
|
|
2365
|
+
endXValue: rangeEvent.end
|
|
2366
|
+
};
|
|
2367
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
2368
|
+
if (onSelect) {
|
|
2369
|
+
onSelect({
|
|
2370
|
+
type: "range.select",
|
|
2371
|
+
originalEvent: rangeEvent,
|
|
2372
|
+
payload: updatedPayload
|
|
2373
|
+
});
|
|
2374
|
+
}
|
|
2375
|
+
};
|
|
2376
|
+
var parseArrayOption = (value) => {
|
|
2377
|
+
if (Array.isArray(value)) {
|
|
2378
|
+
return value;
|
|
2379
|
+
}
|
|
2380
|
+
if (value) {
|
|
2381
|
+
return JSON.parse(value);
|
|
2382
|
+
}
|
|
2383
|
+
return void 0;
|
|
2384
|
+
};
|
|
2186
2385
|
var TimeSeriesChartWrapper = (props) => {
|
|
2187
|
-
|
|
2386
|
+
var _b, _c, _d;
|
|
2387
|
+
const _a = props, {
|
|
2188
2388
|
width,
|
|
2189
2389
|
height,
|
|
2190
2390
|
chartData,
|
|
@@ -2197,12 +2397,49 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2197
2397
|
markerDisplay,
|
|
2198
2398
|
onClick,
|
|
2199
2399
|
onPointMouseOver,
|
|
2200
|
-
onPointMouseOut
|
|
2201
|
-
|
|
2202
|
-
|
|
2400
|
+
onPointMouseOut,
|
|
2401
|
+
onSelect,
|
|
2402
|
+
splitByLayout,
|
|
2403
|
+
trellisKey,
|
|
2404
|
+
trellisSplitBy,
|
|
2203
2405
|
backgroundColor,
|
|
2406
|
+
defaultFontColor,
|
|
2407
|
+
additionalTooltipValues,
|
|
2408
|
+
showYAxisWithZero: showYAxisWithZeroFromProps,
|
|
2409
|
+
showY2AxisWithZero: showY2AxisWithZeroFromProps
|
|
2410
|
+
} = _a, otherOptions = __objRest(_a, [
|
|
2411
|
+
"width",
|
|
2412
|
+
"height",
|
|
2413
|
+
"chartData",
|
|
2414
|
+
"options",
|
|
2415
|
+
"userLocale",
|
|
2416
|
+
"annotationX",
|
|
2417
|
+
"annotationLabel",
|
|
2418
|
+
"annotationColor",
|
|
2419
|
+
"legendDisplay",
|
|
2420
|
+
"markerDisplay",
|
|
2421
|
+
"onClick",
|
|
2422
|
+
"onPointMouseOver",
|
|
2423
|
+
"onPointMouseOut",
|
|
2424
|
+
"onSelect",
|
|
2425
|
+
"splitByLayout",
|
|
2426
|
+
"trellisKey",
|
|
2427
|
+
"trellisSplitBy",
|
|
2428
|
+
"backgroundColor",
|
|
2429
|
+
"defaultFontColor",
|
|
2430
|
+
"additionalTooltipValues",
|
|
2431
|
+
// Extract showYAxisWithZero directly from props for accelerated render mode
|
|
2432
|
+
"showYAxisWithZero",
|
|
2433
|
+
"showY2AxisWithZero"
|
|
2434
|
+
]);
|
|
2435
|
+
const { eventHandlers, xField: xFieldFromProps } = otherOptions;
|
|
2436
|
+
const trellisEnabled = useTrellisEnabled(splitByLayout);
|
|
2437
|
+
const {
|
|
2438
|
+
backgroundColor: bgColorFromOptions,
|
|
2204
2439
|
seriesColors: seriesColorsStr,
|
|
2205
2440
|
fieldColors,
|
|
2441
|
+
legendLabels: legendLabelsStr,
|
|
2442
|
+
legendMode,
|
|
2206
2443
|
"axisTitleX.text": xAxisTitleText,
|
|
2207
2444
|
"axisTitleY.text": yAxisTitleText,
|
|
2208
2445
|
"axisTitleY2.text": y2AxisTitleText,
|
|
@@ -2210,8 +2447,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2210
2447
|
"axisTitleY.visibility": yAxisTitleVisibility,
|
|
2211
2448
|
"axisTitleY2.visibility": y2AxisTitleVisibility,
|
|
2212
2449
|
"axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
|
|
2450
|
+
"axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
|
|
2213
2451
|
"axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
|
|
2452
|
+
"axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
|
|
2214
2453
|
"axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
|
|
2454
|
+
"axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
|
|
2215
2455
|
"axisY.abbreviation": yAxisAbbreviation,
|
|
2216
2456
|
"axisY.scale": yAxisScale,
|
|
2217
2457
|
"axisY2.abbreviation": y2AxisAbbreviation,
|
|
@@ -2221,10 +2461,63 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2221
2461
|
"axisLabelsY2.integerUnits": y2IntegerUnits,
|
|
2222
2462
|
"chart.overlayFields": overlayFieldsStr,
|
|
2223
2463
|
"chart.nullValueMode": nullValueMode,
|
|
2224
|
-
|
|
2464
|
+
"chart.showDataLabels": showDataLabels,
|
|
2465
|
+
lineWidth,
|
|
2466
|
+
lineDashStyle,
|
|
2467
|
+
fieldDashStyles: lineDashStylesByFieldStr,
|
|
2468
|
+
yAxisMin: yAxisMinRaw,
|
|
2469
|
+
yAxisMax: yAxisMaxRaw,
|
|
2470
|
+
y2AxisMin: y2AxisMinRaw,
|
|
2471
|
+
y2AxisMax: y2AxisMaxRaw,
|
|
2472
|
+
showXMajorGridLines,
|
|
2473
|
+
showYMajorGridLines,
|
|
2474
|
+
showY2MajorGridLines,
|
|
2475
|
+
showYMinorGridLines,
|
|
2476
|
+
showY2MinorGridLines,
|
|
2477
|
+
showLineSmoothing,
|
|
2478
|
+
yAxisMajorTickVisibility,
|
|
2479
|
+
y2AxisMajorTickVisibility,
|
|
2480
|
+
yAxisMajorTickSize,
|
|
2481
|
+
y2AxisMajorTickSize,
|
|
2482
|
+
yAxisMajorTickInterval,
|
|
2483
|
+
y2AxisMajorTickInterval,
|
|
2484
|
+
yAxisMinorTickVisibility,
|
|
2485
|
+
y2AxisMinorTickVisibility,
|
|
2486
|
+
yAxisMinorTickSize,
|
|
2487
|
+
y2AxisMinorTickSize,
|
|
2488
|
+
showYAxisWithZero: showYAxisWithZeroFromOptions,
|
|
2489
|
+
showY2AxisWithZero: showY2AxisWithZeroFromOptions
|
|
2225
2490
|
} = options;
|
|
2491
|
+
const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
|
|
2492
|
+
const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
|
|
2493
|
+
const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
|
|
2494
|
+
const showYMajorTicks = yAxisMajorTickVisibility === "show";
|
|
2495
|
+
const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
|
|
2496
|
+
const showYMinorTicks = yAxisMinorTickVisibility === "show";
|
|
2497
|
+
const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
|
|
2498
|
+
const yAxisMin = parseAxisValue(yAxisMinRaw);
|
|
2499
|
+
const yAxisMax = parseAxisValue(yAxisMaxRaw);
|
|
2500
|
+
const y2AxisMin = parseAxisValue(y2AxisMinRaw);
|
|
2501
|
+
const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
|
|
2502
|
+
const parseTickInterval = (simpleXMLValue, canvasValue) => {
|
|
2503
|
+
if (simpleXMLValue) return Number(simpleXMLValue);
|
|
2504
|
+
if (canvasValue) return Number(canvasValue);
|
|
2505
|
+
return void 0;
|
|
2506
|
+
};
|
|
2507
|
+
const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
|
|
2508
|
+
const y2AxisMajorTickIntervalNum = parseTickInterval(
|
|
2509
|
+
y2AxisMajorUnitFromSimpleXML,
|
|
2510
|
+
y2AxisMajorTickInterval
|
|
2511
|
+
);
|
|
2512
|
+
const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
|
|
2513
|
+
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
|
|
2514
|
+
const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
|
|
2515
|
+
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
|
|
2226
2516
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
2227
2517
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
2518
|
+
const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
|
|
2519
|
+
const legendLabels = parseArrayOption(legendLabelsStr);
|
|
2520
|
+
const bgColor = backgroundColor || bgColorFromOptions;
|
|
2228
2521
|
const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
|
|
2229
2522
|
const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
|
|
2230
2523
|
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
@@ -2235,31 +2528,64 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2235
2528
|
fields: chartData.fields,
|
|
2236
2529
|
columns: chartData.seriesList
|
|
2237
2530
|
});
|
|
2238
|
-
const xField =
|
|
2531
|
+
const xField = getFieldName2(filteredChartData.fields[0]);
|
|
2239
2532
|
const yFields = getFieldNames(
|
|
2240
2533
|
filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
|
|
2241
2534
|
);
|
|
2242
|
-
const y2Fields =
|
|
2243
|
-
|
|
2535
|
+
const y2Fields = (0, react_exports.useMemo)(
|
|
2536
|
+
() => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
|
|
2537
|
+
[y2FieldsStr]
|
|
2538
|
+
);
|
|
2539
|
+
const overlayFields = (0, react_exports.useMemo)(
|
|
2540
|
+
() => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
|
|
2541
|
+
[overlayFieldsStr]
|
|
2542
|
+
);
|
|
2244
2543
|
let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
|
|
2245
2544
|
xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
|
|
2246
|
-
|
|
2545
|
+
const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
|
|
2546
|
+
let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
|
|
2247
2547
|
yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
|
|
2248
2548
|
const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
|
|
2249
2549
|
let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
|
|
2250
2550
|
y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
|
|
2251
|
-
const xScaleConfig =
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2551
|
+
const xScaleConfig = (0, react_exports.useMemo)(
|
|
2552
|
+
() => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
|
|
2553
|
+
[xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
|
|
2554
|
+
);
|
|
2555
|
+
const yScaleConfig = (0, react_exports.useMemo)(
|
|
2556
|
+
() => getYScaleConfig(
|
|
2557
|
+
yAxisTitle,
|
|
2558
|
+
yAxisAbbreviation,
|
|
2559
|
+
yAxisScale,
|
|
2560
|
+
yAxisLabelVisibility,
|
|
2561
|
+
yAxisMin,
|
|
2562
|
+
yAxisMax
|
|
2563
|
+
),
|
|
2564
|
+
[yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
|
|
2565
|
+
);
|
|
2566
|
+
const y2ScaleConfig = (0, react_exports.useMemo)(() => {
|
|
2567
|
+
if (y2Enabled) {
|
|
2568
|
+
return getY2ScaleConfig(
|
|
2569
|
+
y2AxisTitle,
|
|
2570
|
+
y2AxisAbbreviation,
|
|
2571
|
+
y2AxisScale,
|
|
2572
|
+
y2IntegerUnits,
|
|
2573
|
+
y2AxisLabelVisibility,
|
|
2574
|
+
y2AxisMin,
|
|
2575
|
+
y2AxisMax
|
|
2576
|
+
);
|
|
2577
|
+
}
|
|
2578
|
+
return {};
|
|
2579
|
+
}, [
|
|
2580
|
+
y2Enabled,
|
|
2581
|
+
y2AxisTitle,
|
|
2582
|
+
y2AxisAbbreviation,
|
|
2583
|
+
y2AxisScale,
|
|
2584
|
+
y2IntegerUnits,
|
|
2585
|
+
y2AxisLabelVisibility,
|
|
2586
|
+
y2AxisMin,
|
|
2587
|
+
y2AxisMax
|
|
2588
|
+
]);
|
|
2263
2589
|
const uplotContainerElement = (0, react_exports.useRef)(null);
|
|
2264
2590
|
const seriesDataFormatted = [
|
|
2265
2591
|
filteredChartData.columns[0],
|
|
@@ -2275,9 +2601,21 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2275
2601
|
overlayFields,
|
|
2276
2602
|
y2Enabled,
|
|
2277
2603
|
nullValueMode,
|
|
2278
|
-
markerDisplay
|
|
2604
|
+
markerDisplay,
|
|
2605
|
+
lineDashStyle,
|
|
2606
|
+
lineDashStylesByField
|
|
2279
2607
|
),
|
|
2280
|
-
[
|
|
2608
|
+
[
|
|
2609
|
+
yFields,
|
|
2610
|
+
y2Fields,
|
|
2611
|
+
lineWidth,
|
|
2612
|
+
overlayFields,
|
|
2613
|
+
y2Enabled,
|
|
2614
|
+
nullValueMode,
|
|
2615
|
+
markerDisplay,
|
|
2616
|
+
lineDashStyle,
|
|
2617
|
+
lineDashStylesByField
|
|
2618
|
+
]
|
|
2281
2619
|
);
|
|
2282
2620
|
const chartingEventAnnotations = (0, react_exports.useMemo)(
|
|
2283
2621
|
() => getAnnotationsForCanvas({
|
|
@@ -2291,25 +2629,54 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2291
2629
|
() => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
|
|
2292
2630
|
[xScaleConfig, yScaleConfig, y2ScaleConfig]
|
|
2293
2631
|
);
|
|
2294
|
-
const legend = (0, react_exports.useMemo)(
|
|
2632
|
+
const legend = (0, react_exports.useMemo)(
|
|
2633
|
+
() => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
|
|
2634
|
+
[legendDisplay, legendMode]
|
|
2635
|
+
);
|
|
2295
2636
|
const handleChartClick = react_exports.useCallback(
|
|
2296
2637
|
(event) => {
|
|
2297
2638
|
if (onClick) {
|
|
2298
|
-
handleClick(event, onClick);
|
|
2639
|
+
handleClick(event, onClick, trellisKey, trellisSplitBy);
|
|
2299
2640
|
}
|
|
2300
2641
|
},
|
|
2301
|
-
[onClick]
|
|
2642
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
2302
2643
|
);
|
|
2303
2644
|
const handleChartLegendClick = react_exports.useCallback(
|
|
2304
2645
|
(event) => {
|
|
2305
2646
|
if (onClick) {
|
|
2306
|
-
handleLegendClick(event, onClick);
|
|
2647
|
+
handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
|
|
2307
2648
|
}
|
|
2308
2649
|
},
|
|
2309
|
-
[onClick]
|
|
2650
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
2651
|
+
);
|
|
2652
|
+
const handleChartRangeSelection = react_exports.useCallback(
|
|
2653
|
+
(range2) => {
|
|
2654
|
+
if (onSelect) {
|
|
2655
|
+
handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
2656
|
+
}
|
|
2657
|
+
},
|
|
2658
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
2659
|
+
);
|
|
2660
|
+
const handleChartRangeZoom = react_exports.useCallback(
|
|
2661
|
+
(range2) => {
|
|
2662
|
+
if (onSelect) {
|
|
2663
|
+
handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
2664
|
+
}
|
|
2665
|
+
},
|
|
2666
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
2667
|
+
);
|
|
2668
|
+
const xFieldToUse = xFieldFromProps || xField;
|
|
2669
|
+
const enableSearchZoom = react_exports.useMemo(
|
|
2670
|
+
() => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
|
|
2671
|
+
[eventHandlers, xFieldToUse]
|
|
2310
2672
|
);
|
|
2311
2673
|
const lastPayloadRef = react_exports.useRef(null);
|
|
2312
2674
|
const lastOriginalEventRef = react_exports.useRef(null);
|
|
2675
|
+
const previousMouseoverPayloadRef = react_exports.useRef(null);
|
|
2676
|
+
const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
|
|
2677
|
+
react_exports.useEffect(() => {
|
|
2678
|
+
additionalTooltipValuesRef.current = additionalTooltipValues;
|
|
2679
|
+
}, [additionalTooltipValues]);
|
|
2313
2680
|
const handleChartCrosshairChange = react_exports.useCallback(
|
|
2314
2681
|
(event) => {
|
|
2315
2682
|
if (onPointMouseOver || onPointMouseOut) {
|
|
@@ -2321,6 +2688,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2321
2688
|
payload: lastPayloadRef.current
|
|
2322
2689
|
});
|
|
2323
2690
|
}
|
|
2691
|
+
previousMouseoverPayloadRef.current = null;
|
|
2324
2692
|
return;
|
|
2325
2693
|
}
|
|
2326
2694
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
|
|
@@ -2328,25 +2696,36 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2328
2696
|
});
|
|
2329
2697
|
delete payload.seriesKey;
|
|
2330
2698
|
if (event.rowContext) {
|
|
2331
|
-
Object.
|
|
2332
|
-
payload
|
|
2333
|
-
|
|
2699
|
+
Object.assign(
|
|
2700
|
+
payload,
|
|
2701
|
+
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
2702
|
+
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
2703
|
+
return acc;
|
|
2704
|
+
}, {})
|
|
2705
|
+
);
|
|
2706
|
+
}
|
|
2707
|
+
const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
|
|
2708
|
+
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
2709
|
+
return;
|
|
2334
2710
|
}
|
|
2335
|
-
lastPayloadRef.current =
|
|
2711
|
+
lastPayloadRef.current = updatedPayload;
|
|
2336
2712
|
lastOriginalEventRef.current = event;
|
|
2713
|
+
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
2337
2714
|
if (onPointMouseOver) {
|
|
2338
2715
|
onPointMouseOver({
|
|
2339
2716
|
type: "point.mouseover",
|
|
2340
2717
|
originalEvent: event,
|
|
2341
|
-
payload
|
|
2718
|
+
payload: updatedPayload
|
|
2342
2719
|
});
|
|
2343
2720
|
}
|
|
2344
2721
|
}
|
|
2345
2722
|
},
|
|
2346
|
-
[onPointMouseOver, onPointMouseOut]
|
|
2723
|
+
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
|
|
2347
2724
|
);
|
|
2348
|
-
const
|
|
2349
|
-
|
|
2725
|
+
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}`;
|
|
2726
|
+
const memoizedChart = (0, react_exports.useMemo)(() => {
|
|
2727
|
+
const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
|
|
2728
|
+
return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
|
|
2350
2729
|
visualization_canvas_exports.TimeSeriesChart,
|
|
2351
2730
|
{
|
|
2352
2731
|
data: chartData,
|
|
@@ -2356,49 +2735,107 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2356
2735
|
seriesColorsByField,
|
|
2357
2736
|
seriesConfig: seriesOverrides,
|
|
2358
2737
|
legend,
|
|
2738
|
+
legendLabels,
|
|
2739
|
+
isSeriesCompare: legendMode === "seriesCompare",
|
|
2740
|
+
maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
|
|
2359
2741
|
scaleConfig,
|
|
2360
2742
|
timestampFormat: "expanded",
|
|
2361
2743
|
onCrosshairClick: onClick ? handleChartClick : void 0,
|
|
2362
2744
|
onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
|
|
2363
2745
|
onSeriesClick: onClick ? handleChartLegendClick : void 0,
|
|
2746
|
+
onRangeSelection: handleChartRangeSelection,
|
|
2747
|
+
onRangeZoom: computedOnRangeZoom,
|
|
2748
|
+
serverSideZoom: enableSearchZoom,
|
|
2364
2749
|
userLocale,
|
|
2365
2750
|
events: chartingEventAnnotations,
|
|
2366
|
-
eventsConfig: { renderer: triangleEventAnnotationRenderer }
|
|
2751
|
+
eventsConfig: { renderer: triangleEventAnnotationRenderer },
|
|
2752
|
+
additionalTooltipValuesRef,
|
|
2753
|
+
showXMajorGridLines,
|
|
2754
|
+
showYMajorGridLines,
|
|
2755
|
+
showY2MajorGridLines,
|
|
2756
|
+
showYMinorGridLines,
|
|
2757
|
+
showY2MinorGridLines,
|
|
2758
|
+
showLineSmoothing,
|
|
2759
|
+
dataValuesDisplay,
|
|
2760
|
+
showYMajorTicks,
|
|
2761
|
+
showY2MajorTicks,
|
|
2762
|
+
yAxisMajorTickSize: yAxisMajorTickSizeNum,
|
|
2763
|
+
y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
|
|
2764
|
+
yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
|
|
2765
|
+
y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
|
|
2766
|
+
showYMinorTicks,
|
|
2767
|
+
showY2MinorTicks,
|
|
2768
|
+
yAxisMinorTickSize: yAxisMinorTickSizeNum,
|
|
2769
|
+
y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
|
|
2770
|
+
showYAxisWithZero,
|
|
2771
|
+
showY2AxisWithZero
|
|
2367
2772
|
}
|
|
2368
|
-
)
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2773
|
+
));
|
|
2774
|
+
}, [
|
|
2775
|
+
onSelect,
|
|
2776
|
+
handleChartRangeZoom,
|
|
2777
|
+
dataKey,
|
|
2778
|
+
chartData,
|
|
2779
|
+
containerWidth,
|
|
2780
|
+
containerHeight,
|
|
2781
|
+
seriesColors,
|
|
2782
|
+
seriesColorsByField,
|
|
2783
|
+
seriesOverrides,
|
|
2784
|
+
legend,
|
|
2785
|
+
legendLabels,
|
|
2786
|
+
scaleConfig,
|
|
2787
|
+
onClick,
|
|
2788
|
+
handleChartClick,
|
|
2789
|
+
onPointMouseOver,
|
|
2790
|
+
onPointMouseOut,
|
|
2791
|
+
handleChartCrosshairChange,
|
|
2792
|
+
handleChartLegendClick,
|
|
2793
|
+
handleChartRangeSelection,
|
|
2794
|
+
enableSearchZoom,
|
|
2795
|
+
userLocale,
|
|
2796
|
+
chartingEventAnnotations,
|
|
2797
|
+
showXMajorGridLines,
|
|
2798
|
+
showYMajorGridLines,
|
|
2799
|
+
showY2MajorGridLines,
|
|
2800
|
+
showYMinorGridLines,
|
|
2801
|
+
showY2MinorGridLines,
|
|
2802
|
+
showLineSmoothing,
|
|
2803
|
+
dataValuesDisplay,
|
|
2804
|
+
showYMajorTicks,
|
|
2805
|
+
showY2MajorTicks,
|
|
2806
|
+
yAxisMajorTickSizeNum,
|
|
2807
|
+
y2AxisMajorTickSizeNum,
|
|
2808
|
+
yAxisMajorTickIntervalNum,
|
|
2809
|
+
y2AxisMajorTickIntervalNum,
|
|
2810
|
+
showYMinorTicks,
|
|
2811
|
+
showY2MinorTicks,
|
|
2812
|
+
yAxisMinorTickSizeNum,
|
|
2813
|
+
y2AxisMinorTickSizeNum,
|
|
2814
|
+
showYAxisWithZero,
|
|
2815
|
+
showY2AxisWithZero,
|
|
2816
|
+
legendMode
|
|
2817
|
+
]);
|
|
2388
2818
|
const memoizedVisualization = (0, react_exports.useMemo)(() => {
|
|
2389
|
-
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
|
|
2390
|
-
}, [
|
|
2391
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
2819
|
+
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
|
|
2820
|
+
}, [bgColor, memoizedChart]);
|
|
2821
|
+
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
|
|
2822
|
+
TrellisTitle,
|
|
2823
|
+
{
|
|
2824
|
+
trellisKey,
|
|
2825
|
+
backgroundColor: bgColor,
|
|
2826
|
+
fontColor: defaultFontColor
|
|
2827
|
+
}
|
|
2828
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
2392
2829
|
TimeSeriesChartContainer,
|
|
2393
2830
|
{
|
|
2394
|
-
height,
|
|
2831
|
+
height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
|
|
2395
2832
|
width,
|
|
2396
2833
|
ref: uplotContainerElement,
|
|
2397
2834
|
"data-test": "timeseries-chart-wrapper"
|
|
2398
2835
|
},
|
|
2399
2836
|
/* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
|
|
2400
2837
|
memoizedVisualization
|
|
2401
|
-
);
|
|
2838
|
+
));
|
|
2402
2839
|
};
|
|
2403
2840
|
var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
|
|
2404
2841
|
|
|
@@ -3195,48 +3632,6 @@ ValueMarker.propTypes = {
|
|
|
3195
3632
|
};
|
|
3196
3633
|
var GaugeValueMarker_default = ValueMarker;
|
|
3197
3634
|
|
|
3198
|
-
// src/common/hooks/useTrellisEnabled.ts
|
|
3199
|
-
var useTrellisFeatureFlagOn = () => {
|
|
3200
|
-
const context = (0, react_exports.useContext)(FeatureFlagContext_default);
|
|
3201
|
-
return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
|
|
3202
|
-
};
|
|
3203
|
-
var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
|
|
3204
|
-
const trellisFeatureEnabled = useTrellisFeatureFlagOn();
|
|
3205
|
-
return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
3206
|
-
};
|
|
3207
|
-
|
|
3208
|
-
// src/common/components/TrellisTitle.tsx
|
|
3209
|
-
var TRELLIS_TITLE_HEIGHT = 28;
|
|
3210
|
-
var TrellisTitleText = styled_components_default.div`
|
|
3211
|
-
margin-left: 10px;
|
|
3212
|
-
margin-right: 10px;
|
|
3213
|
-
padding-top: 8px;
|
|
3214
|
-
text-overflow: ellipsis;
|
|
3215
|
-
white-space: nowrap;
|
|
3216
|
-
overflow: hidden;
|
|
3217
|
-
`;
|
|
3218
|
-
var TrellisTitleDiv = styled_components_default.div`
|
|
3219
|
-
height: ${TRELLIS_TITLE_HEIGHT}px;
|
|
3220
|
-
font-size: 14px;
|
|
3221
|
-
font-weight: 700;
|
|
3222
|
-
color: ${(props) => props.fontColor};
|
|
3223
|
-
background-color: ${(props) => props.backgroundColor};
|
|
3224
|
-
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.
|
|
3225
|
-
`;
|
|
3226
|
-
var TrellisTitle = (props) => {
|
|
3227
|
-
const titleText = String(props.trellisKey).toString();
|
|
3228
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
3229
|
-
TrellisTitleDiv,
|
|
3230
|
-
{
|
|
3231
|
-
fontColor: props.fontColor,
|
|
3232
|
-
backgroundColor: props.backgroundColor,
|
|
3233
|
-
"data-test": "trellis-title",
|
|
3234
|
-
title: titleText
|
|
3235
|
-
},
|
|
3236
|
-
/* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
|
|
3237
|
-
);
|
|
3238
|
-
};
|
|
3239
|
-
|
|
3240
3635
|
// src/FillerGauge/PureFillerGauge/FillerGauge.tsx
|
|
3241
3636
|
var Container = styled_components_default.div`
|
|
3242
3637
|
overflow: hidden;
|