@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/Pie.js
CHANGED
|
@@ -250,6 +250,7 @@ var DefaultVizActionHandler = class {
|
|
|
250
250
|
};
|
|
251
251
|
|
|
252
252
|
// src/common/utils/dataUtils.ts
|
|
253
|
+
var getFieldName = (field) => typeof field === "string" ? field : field.name;
|
|
253
254
|
var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
|
|
254
255
|
const dataLength = data.length;
|
|
255
256
|
const downsampledIndices = [];
|
|
@@ -423,9 +424,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
|
|
|
423
424
|
let xColumn = [];
|
|
424
425
|
const yColumns = [];
|
|
425
426
|
const canDownsample = !ds.data.fields.some((field, index) => {
|
|
426
|
-
var _a
|
|
427
|
-
const fieldName = (
|
|
428
|
-
const fieldType = (
|
|
427
|
+
var _a;
|
|
428
|
+
const fieldName = getFieldName(field);
|
|
429
|
+
const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
|
|
429
430
|
const column = ds.data.columns[index];
|
|
430
431
|
let hasDisplayedColumnThatCantBeDownsampled = false;
|
|
431
432
|
if (fieldName === xField) {
|
|
@@ -629,6 +630,7 @@ var Charting = (props) => {
|
|
|
629
630
|
const timezone = (0, react_exports.useContext)(TimezoneContext_default);
|
|
630
631
|
const selectChartEvent = (0, react_exports.useRef)(null);
|
|
631
632
|
const trellisEnabled = useTrellisEnabled(props.splitByLayout);
|
|
633
|
+
const isResizing = (0, react_exports.useRef)(false);
|
|
632
634
|
const drawChartRef = (0, react_exports.useRef)(() => {
|
|
633
635
|
});
|
|
634
636
|
const debouncedDrawChart = (0, react_exports.useMemo)(
|
|
@@ -727,6 +729,9 @@ var Charting = (props) => {
|
|
|
727
729
|
recalculateDownsamplingThreshold();
|
|
728
730
|
}, [recalculateDownsamplingThreshold]);
|
|
729
731
|
const handleSelect = useEventCallback_default((chartEvent) => {
|
|
732
|
+
if (isResizing.current) {
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
730
735
|
selectChartEvent.current = chartEvent;
|
|
731
736
|
recalculateDownsamplingThreshold();
|
|
732
737
|
const payload = appendTrellisToPayload(
|
|
@@ -861,6 +866,14 @@ var Charting = (props) => {
|
|
|
861
866
|
}
|
|
862
867
|
if (chart.current) {
|
|
863
868
|
if (Math.round(chart.current.height) !== Math.round(computedHeight) || Math.round(chart.current.width) !== Math.round(computedWidth)) {
|
|
869
|
+
isResizing.current = true;
|
|
870
|
+
queueMicrotask(() => {
|
|
871
|
+
try {
|
|
872
|
+
isResizing.current = false;
|
|
873
|
+
} catch (e) {
|
|
874
|
+
(0, lodash_exports.noop)(e);
|
|
875
|
+
}
|
|
876
|
+
});
|
|
864
877
|
chart.current.resize(computedWidth, computedHeight);
|
|
865
878
|
}
|
|
866
879
|
}
|
|
@@ -1666,7 +1679,7 @@ var Cover = styled_components_default.div`
|
|
|
1666
1679
|
bottom: 0;
|
|
1667
1680
|
`;
|
|
1668
1681
|
var Blocker = styled_components_default.div.attrs({
|
|
1669
|
-
"data-splunk-visualization-version": "28.
|
|
1682
|
+
"data-splunk-visualization-version": "28.4.0 - 002bd482f"
|
|
1670
1683
|
})`
|
|
1671
1684
|
position: relative;
|
|
1672
1685
|
width: 100%;
|
|
@@ -1747,7 +1760,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
1747
1760
|
FixSizeItem,
|
|
1748
1761
|
{
|
|
1749
1762
|
"data-test": "fix-size-item",
|
|
1750
|
-
"data-splunk-visualization-version": "28.
|
|
1763
|
+
"data-splunk-visualization-version": "28.4.0 - 002bd482f",
|
|
1751
1764
|
width,
|
|
1752
1765
|
height,
|
|
1753
1766
|
backgroundColor
|
|
@@ -2023,7 +2036,7 @@ var trellisUtils_default = "default" in defaultImport35 ? defaultImport35.defaul
|
|
|
2023
2036
|
var AGGREGATIONS = "aggregations";
|
|
2024
2037
|
var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
2025
2038
|
var _a, _b, _c, _d;
|
|
2026
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2039
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
2027
2040
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2028
2041
|
let splitDataSources = null;
|
|
2029
2042
|
let errorCode = null;
|
|
@@ -2044,7 +2057,7 @@ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
|
2044
2057
|
}
|
|
2045
2058
|
return { splitDataSources, errorCode };
|
|
2046
2059
|
};
|
|
2047
|
-
var toFieldEntries = (fields) => {
|
|
2060
|
+
var toFieldEntries = (fields = []) => {
|
|
2048
2061
|
return fields.map((field) => {
|
|
2049
2062
|
if (typeof field === "string") {
|
|
2050
2063
|
return { name: field };
|
|
@@ -2059,7 +2072,7 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
2059
2072
|
let splitDataSources = null;
|
|
2060
2073
|
let splitByFields = [];
|
|
2061
2074
|
let errorCode = null;
|
|
2062
|
-
if (
|
|
2075
|
+
if (fields.length > 0) {
|
|
2063
2076
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
2064
2077
|
}
|
|
2065
2078
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -2097,12 +2110,12 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
2097
2110
|
};
|
|
2098
2111
|
var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
2099
2112
|
var _a, _b, _c, _d;
|
|
2100
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2113
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
2101
2114
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2102
2115
|
let splitDataSources = null;
|
|
2103
2116
|
let splitByFields = [];
|
|
2104
2117
|
let errorCode = null;
|
|
2105
|
-
if (
|
|
2118
|
+
if (fields.length > 0) {
|
|
2106
2119
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
|
|
2107
2120
|
}
|
|
2108
2121
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -2126,12 +2139,12 @@ var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
|
2126
2139
|
};
|
|
2127
2140
|
var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
2128
2141
|
var _a, _b, _c, _d, _e;
|
|
2129
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2142
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
2130
2143
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2131
2144
|
let splitDataSources = null;
|
|
2132
2145
|
let splitByFields = [];
|
|
2133
2146
|
let errorCode = null;
|
|
2134
|
-
if (
|
|
2147
|
+
if (fields.length > 0) {
|
|
2135
2148
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
2136
2149
|
}
|
|
2137
2150
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -2169,12 +2182,12 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
|
2169
2182
|
};
|
|
2170
2183
|
var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
2171
2184
|
var _a, _b, _c, _d;
|
|
2172
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2185
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
2173
2186
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2174
2187
|
let splitDataSources = null;
|
|
2175
2188
|
let splitByFields = [];
|
|
2176
2189
|
let errorCode = null;
|
|
2177
|
-
if (
|
|
2190
|
+
if (fields.length > 0) {
|
|
2178
2191
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
2179
2192
|
}
|
|
2180
2193
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -2262,17 +2275,15 @@ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
|
2262
2275
|
};
|
|
2263
2276
|
var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
|
|
2264
2277
|
var _a, _b, _c, _d, _e, _f;
|
|
2265
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
2278
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
2266
2279
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
2267
2280
|
let splitDataSources = null;
|
|
2268
2281
|
let splitByFields = [];
|
|
2269
2282
|
let errorCode = null;
|
|
2270
|
-
if (
|
|
2283
|
+
if (fields.length > 0) {
|
|
2271
2284
|
splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
|
|
2272
2285
|
}
|
|
2273
|
-
const splitByIndex = fields
|
|
2274
|
-
(field) => field === splitBy || field.name === splitBy
|
|
2275
|
-
);
|
|
2286
|
+
const splitByIndex = fields.findIndex((field) => field.name === splitBy);
|
|
2276
2287
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
2277
2288
|
const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
|
|
2278
2289
|
splitDataSources = {};
|
|
@@ -2436,6 +2447,16 @@ var truncateData = (dataSet, truncationLimit) => {
|
|
|
2436
2447
|
);
|
|
2437
2448
|
return truncatedData;
|
|
2438
2449
|
};
|
|
2450
|
+
var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
|
|
2451
|
+
const rangeSelectEventHandler = eventHandlers.find(
|
|
2452
|
+
(eventHandler) => {
|
|
2453
|
+
var _a;
|
|
2454
|
+
return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
|
|
2455
|
+
}
|
|
2456
|
+
);
|
|
2457
|
+
const xAxisIsTime = xField === "_time";
|
|
2458
|
+
return !!rangeSelectEventHandler && xAxisIsTime;
|
|
2459
|
+
};
|
|
2439
2460
|
var canvasSupportedTimeSeriesCharts = ["splunk.line"];
|
|
2440
2461
|
var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
|
|
2441
2462
|
return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
|
|
@@ -2456,16 +2477,31 @@ var filterChartDataFromInternalFields = (chartData) => {
|
|
|
2456
2477
|
var convert2DArrayToNumbers = (arr) => {
|
|
2457
2478
|
return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
|
|
2458
2479
|
};
|
|
2480
|
+
var parseAxisValue = (val) => {
|
|
2481
|
+
if (val === void 0 || val === null || val === "auto" || val === "") {
|
|
2482
|
+
return void 0;
|
|
2483
|
+
}
|
|
2484
|
+
const num = typeof val === "number" ? val : Number.parseFloat(val);
|
|
2485
|
+
return Number.isNaN(num) ? void 0 : num;
|
|
2486
|
+
};
|
|
2459
2487
|
var SideLegendWidth = 75;
|
|
2460
|
-
var
|
|
2488
|
+
var SeriesCompareLegendWidth = 200;
|
|
2461
2489
|
var getLegend = (props) => {
|
|
2462
2490
|
const legendPlacement = props == null ? void 0 : props.legendDisplay;
|
|
2491
|
+
const { isSeriesCompare } = props;
|
|
2492
|
+
const commonLegendProps = {
|
|
2493
|
+
center: true,
|
|
2494
|
+
fontSize: 12,
|
|
2495
|
+
largerTiles: true,
|
|
2496
|
+
hideSeriesValue: !isSeriesCompare
|
|
2497
|
+
// Show values if in seriesCompare mode
|
|
2498
|
+
};
|
|
2463
2499
|
switch (legendPlacement) {
|
|
2464
2500
|
case "off":
|
|
2465
2501
|
return false;
|
|
2466
2502
|
case "left":
|
|
2467
2503
|
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
|
|
2468
|
-
width: SideLegendWidth
|
|
2504
|
+
width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
|
|
2469
2505
|
}, commonLegendProps));
|
|
2470
2506
|
case "bottom":
|
|
2471
2507
|
return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
|
|
@@ -2477,7 +2513,7 @@ var getLegend = (props) => {
|
|
|
2477
2513
|
}, commonLegendProps));
|
|
2478
2514
|
default:
|
|
2479
2515
|
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
|
|
2480
|
-
width: SideLegendWidth
|
|
2516
|
+
width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
|
|
2481
2517
|
}, commonLegendProps));
|
|
2482
2518
|
}
|
|
2483
2519
|
};
|
|
@@ -2513,22 +2549,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
|
|
|
2513
2549
|
const end = axisTitle.slice(-halfChars);
|
|
2514
2550
|
return `${start}...${end}`;
|
|
2515
2551
|
};
|
|
2516
|
-
var
|
|
2552
|
+
var getFieldName2 = (field) => {
|
|
2517
2553
|
const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
|
|
2518
2554
|
return fieldName;
|
|
2519
2555
|
};
|
|
2520
2556
|
var getFieldNames = (fields) => {
|
|
2521
|
-
return fields.map((field) =>
|
|
2557
|
+
return fields.map((field) => getFieldName2(field));
|
|
2522
2558
|
};
|
|
2523
|
-
var getXScaleConfig = (label, xAxisLabelVisibility) => {
|
|
2559
|
+
var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
|
|
2524
2560
|
const xConfig = { x: {} };
|
|
2525
2561
|
xConfig.x.label = label;
|
|
2526
2562
|
if (xAxisLabelVisibility === "hide") {
|
|
2527
2563
|
xConfig.x.hideLabels = true;
|
|
2528
2564
|
}
|
|
2565
|
+
if (xAxisLabelRotation !== void 0) {
|
|
2566
|
+
xConfig.x.labelRotation = xAxisLabelRotation;
|
|
2567
|
+
}
|
|
2529
2568
|
return xConfig;
|
|
2530
2569
|
};
|
|
2531
|
-
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
|
|
2570
|
+
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
|
|
2532
2571
|
const scaleType = yAxisScale != null ? yAxisScale : "linear";
|
|
2533
2572
|
const yConfig = { y: {} };
|
|
2534
2573
|
yConfig.y.label = label;
|
|
@@ -2544,14 +2583,20 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
|
|
|
2544
2583
|
if (yAxisLabelVisibility === "hide") {
|
|
2545
2584
|
yConfig.y.hideLabels = true;
|
|
2546
2585
|
}
|
|
2586
|
+
if (yAxisMin !== void 0 || yAxisMax !== void 0) {
|
|
2587
|
+
yConfig.y.range = (u, dataMin, dataMax) => {
|
|
2588
|
+
const min = yAxisMin != null ? yAxisMin : dataMin;
|
|
2589
|
+
const max = yAxisMax != null ? yAxisMax : dataMax;
|
|
2590
|
+
return [min, max];
|
|
2591
|
+
};
|
|
2592
|
+
}
|
|
2547
2593
|
return yConfig;
|
|
2548
2594
|
};
|
|
2549
|
-
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
|
|
2595
|
+
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
|
|
2550
2596
|
const y2Config = { y2: {} };
|
|
2551
2597
|
const scaleType = axisScale != null ? axisScale : "linear";
|
|
2552
2598
|
y2Config.y2.label = label;
|
|
2553
2599
|
y2Config.y2.side = "right";
|
|
2554
|
-
y2Config.y2.showGrid = false;
|
|
2555
2600
|
y2Config.y2.type = scaleType;
|
|
2556
2601
|
if (axisAbbreviation !== "none") {
|
|
2557
2602
|
y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
|
|
@@ -2561,9 +2606,16 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
|
|
|
2561
2606
|
if (y2AxisLabelVisibility === "hide") {
|
|
2562
2607
|
y2Config.y2.hideLabels = true;
|
|
2563
2608
|
}
|
|
2609
|
+
if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
|
|
2610
|
+
y2Config.y2.range = (u, dataMin, dataMax) => {
|
|
2611
|
+
const min = y2AxisMin != null ? y2AxisMin : dataMin;
|
|
2612
|
+
const max = y2AxisMax != null ? y2AxisMax : dataMax;
|
|
2613
|
+
return [min, max];
|
|
2614
|
+
};
|
|
2615
|
+
}
|
|
2564
2616
|
return y2Config;
|
|
2565
2617
|
};
|
|
2566
|
-
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
|
|
2618
|
+
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
|
|
2567
2619
|
const seriesConfig = {};
|
|
2568
2620
|
let spanGaps;
|
|
2569
2621
|
let replaceNullsWithZero;
|
|
@@ -2598,12 +2650,45 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
2598
2650
|
if (markerDisplay !== void 0) {
|
|
2599
2651
|
seriesConfig[field].markerDisplay = markerDisplay;
|
|
2600
2652
|
}
|
|
2653
|
+
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
2654
|
+
if (fieldDashStyle) {
|
|
2655
|
+
seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
2656
|
+
}
|
|
2601
2657
|
if (replaceNullsWithZero !== void 0) {
|
|
2602
2658
|
seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
|
|
2603
2659
|
}
|
|
2604
2660
|
});
|
|
2605
2661
|
return seriesConfig;
|
|
2606
2662
|
};
|
|
2663
|
+
var findRangeIndices = (xData, startValue, endValue) => {
|
|
2664
|
+
let startXIndex = -1;
|
|
2665
|
+
let endXIndex = -1;
|
|
2666
|
+
const xDataEpoch = xData.map((val) => {
|
|
2667
|
+
if (typeof val === "string") {
|
|
2668
|
+
return new Date(val).getTime() / 1e3;
|
|
2669
|
+
}
|
|
2670
|
+
return val;
|
|
2671
|
+
});
|
|
2672
|
+
for (let i = 0; i < xDataEpoch.length; i += 1) {
|
|
2673
|
+
if (xDataEpoch[i] >= startValue) {
|
|
2674
|
+
startXIndex = i;
|
|
2675
|
+
break;
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
if (startXIndex === -1 && xDataEpoch.length > 0) {
|
|
2679
|
+
startXIndex = xDataEpoch.length - 1;
|
|
2680
|
+
}
|
|
2681
|
+
for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
|
|
2682
|
+
if (xDataEpoch[i] <= endValue) {
|
|
2683
|
+
endXIndex = i;
|
|
2684
|
+
break;
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
if (endXIndex === -1 && xDataEpoch.length > 0) {
|
|
2688
|
+
endXIndex = 0;
|
|
2689
|
+
}
|
|
2690
|
+
return { startXIndex, endXIndex };
|
|
2691
|
+
};
|
|
2607
2692
|
|
|
2608
2693
|
// src/common/TimeSeriesChartWrapper.tsx
|
|
2609
2694
|
var TimeSeriesChartContainer = styled_components_default.div`
|
|
@@ -2614,38 +2699,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
|
|
|
2614
2699
|
position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
|
|
2615
2700
|
}
|
|
2616
2701
|
`;
|
|
2617
|
-
var
|
|
2702
|
+
var appendTrellisToPayload2 = (payload, trellisKey, trellisSplitBy) => {
|
|
2703
|
+
const result = __spreadValues({}, payload);
|
|
2704
|
+
if (trellisSplitBy) {
|
|
2705
|
+
result["trellis.name"] = trellisSplitBy;
|
|
2706
|
+
}
|
|
2707
|
+
if (trellisKey) {
|
|
2708
|
+
result["trellis.value"] = trellisKey;
|
|
2709
|
+
}
|
|
2710
|
+
return result;
|
|
2711
|
+
};
|
|
2712
|
+
var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
|
|
2713
|
+
if (!previousPayload) {
|
|
2714
|
+
return true;
|
|
2715
|
+
}
|
|
2716
|
+
if (currentPayload.index !== previousPayload.index) {
|
|
2717
|
+
return true;
|
|
2718
|
+
}
|
|
2719
|
+
if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
|
|
2720
|
+
return true;
|
|
2721
|
+
}
|
|
2722
|
+
if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
|
|
2723
|
+
return true;
|
|
2724
|
+
}
|
|
2725
|
+
if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
|
|
2726
|
+
return true;
|
|
2727
|
+
}
|
|
2728
|
+
return false;
|
|
2729
|
+
};
|
|
2730
|
+
var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
2618
2731
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
|
|
2619
2732
|
name: chartEvent.seriesKey
|
|
2620
2733
|
});
|
|
2621
2734
|
delete payload.seriesKey;
|
|
2622
2735
|
if (chartEvent.rowContext) {
|
|
2623
|
-
Object.
|
|
2624
|
-
payload
|
|
2625
|
-
|
|
2736
|
+
Object.assign(
|
|
2737
|
+
payload,
|
|
2738
|
+
Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
|
|
2739
|
+
acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
|
|
2740
|
+
return acc;
|
|
2741
|
+
}, {})
|
|
2742
|
+
);
|
|
2626
2743
|
}
|
|
2744
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
2627
2745
|
if (onClick) {
|
|
2628
2746
|
onClick({
|
|
2629
2747
|
type: "point.click",
|
|
2630
2748
|
originalEvent: chartEvent,
|
|
2631
|
-
payload
|
|
2749
|
+
payload: updatedPayload
|
|
2632
2750
|
});
|
|
2633
2751
|
}
|
|
2634
2752
|
};
|
|
2635
|
-
var handleLegendClick = (chartEvent, onClick) => {
|
|
2753
|
+
var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
2636
2754
|
const payload = {
|
|
2637
2755
|
name: chartEvent
|
|
2638
2756
|
};
|
|
2757
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
2639
2758
|
if (onClick) {
|
|
2640
2759
|
onClick({
|
|
2641
2760
|
type: "legend.click",
|
|
2642
2761
|
originalEvent: chartEvent,
|
|
2643
|
-
payload
|
|
2762
|
+
payload: updatedPayload
|
|
2763
|
+
});
|
|
2764
|
+
}
|
|
2765
|
+
};
|
|
2766
|
+
var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
2767
|
+
var _a;
|
|
2768
|
+
if (!rangeEvent) {
|
|
2769
|
+
return;
|
|
2770
|
+
}
|
|
2771
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
2772
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
2773
|
+
const payload = {
|
|
2774
|
+
startXIndex,
|
|
2775
|
+
startXValue: rangeEvent.start,
|
|
2776
|
+
endXIndex,
|
|
2777
|
+
endXValue: rangeEvent.end
|
|
2778
|
+
};
|
|
2779
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
2780
|
+
if (onSelect) {
|
|
2781
|
+
onSelect({
|
|
2782
|
+
type: "range.selectBeforeZoom",
|
|
2783
|
+
originalEvent: rangeEvent,
|
|
2784
|
+
payload: updatedPayload
|
|
2785
|
+
});
|
|
2786
|
+
}
|
|
2787
|
+
};
|
|
2788
|
+
var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
2789
|
+
var _a;
|
|
2790
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
2791
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
2792
|
+
const payload = {
|
|
2793
|
+
startXIndex,
|
|
2794
|
+
startXValue: rangeEvent.start,
|
|
2795
|
+
endXIndex,
|
|
2796
|
+
endXValue: rangeEvent.end
|
|
2797
|
+
};
|
|
2798
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
2799
|
+
if (onSelect) {
|
|
2800
|
+
onSelect({
|
|
2801
|
+
type: "range.select",
|
|
2802
|
+
originalEvent: rangeEvent,
|
|
2803
|
+
payload: updatedPayload
|
|
2644
2804
|
});
|
|
2645
2805
|
}
|
|
2646
2806
|
};
|
|
2807
|
+
var parseArrayOption = (value) => {
|
|
2808
|
+
if (Array.isArray(value)) {
|
|
2809
|
+
return value;
|
|
2810
|
+
}
|
|
2811
|
+
if (value) {
|
|
2812
|
+
return JSON.parse(value);
|
|
2813
|
+
}
|
|
2814
|
+
return void 0;
|
|
2815
|
+
};
|
|
2647
2816
|
var TimeSeriesChartWrapper = (props) => {
|
|
2648
|
-
|
|
2817
|
+
var _b, _c, _d;
|
|
2818
|
+
const _a = props, {
|
|
2649
2819
|
width,
|
|
2650
2820
|
height,
|
|
2651
2821
|
chartData,
|
|
@@ -2658,12 +2828,49 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2658
2828
|
markerDisplay,
|
|
2659
2829
|
onClick,
|
|
2660
2830
|
onPointMouseOver,
|
|
2661
|
-
onPointMouseOut
|
|
2662
|
-
|
|
2663
|
-
|
|
2831
|
+
onPointMouseOut,
|
|
2832
|
+
onSelect,
|
|
2833
|
+
splitByLayout,
|
|
2834
|
+
trellisKey,
|
|
2835
|
+
trellisSplitBy,
|
|
2664
2836
|
backgroundColor,
|
|
2837
|
+
defaultFontColor,
|
|
2838
|
+
additionalTooltipValues,
|
|
2839
|
+
showYAxisWithZero: showYAxisWithZeroFromProps,
|
|
2840
|
+
showY2AxisWithZero: showY2AxisWithZeroFromProps
|
|
2841
|
+
} = _a, otherOptions = __objRest(_a, [
|
|
2842
|
+
"width",
|
|
2843
|
+
"height",
|
|
2844
|
+
"chartData",
|
|
2845
|
+
"options",
|
|
2846
|
+
"userLocale",
|
|
2847
|
+
"annotationX",
|
|
2848
|
+
"annotationLabel",
|
|
2849
|
+
"annotationColor",
|
|
2850
|
+
"legendDisplay",
|
|
2851
|
+
"markerDisplay",
|
|
2852
|
+
"onClick",
|
|
2853
|
+
"onPointMouseOver",
|
|
2854
|
+
"onPointMouseOut",
|
|
2855
|
+
"onSelect",
|
|
2856
|
+
"splitByLayout",
|
|
2857
|
+
"trellisKey",
|
|
2858
|
+
"trellisSplitBy",
|
|
2859
|
+
"backgroundColor",
|
|
2860
|
+
"defaultFontColor",
|
|
2861
|
+
"additionalTooltipValues",
|
|
2862
|
+
// Extract showYAxisWithZero directly from props for accelerated render mode
|
|
2863
|
+
"showYAxisWithZero",
|
|
2864
|
+
"showY2AxisWithZero"
|
|
2865
|
+
]);
|
|
2866
|
+
const { eventHandlers, xField: xFieldFromProps } = otherOptions;
|
|
2867
|
+
const trellisEnabled = useTrellisEnabled(splitByLayout);
|
|
2868
|
+
const {
|
|
2869
|
+
backgroundColor: bgColorFromOptions,
|
|
2665
2870
|
seriesColors: seriesColorsStr,
|
|
2666
2871
|
fieldColors,
|
|
2872
|
+
legendLabels: legendLabelsStr,
|
|
2873
|
+
legendMode,
|
|
2667
2874
|
"axisTitleX.text": xAxisTitleText,
|
|
2668
2875
|
"axisTitleY.text": yAxisTitleText,
|
|
2669
2876
|
"axisTitleY2.text": y2AxisTitleText,
|
|
@@ -2671,8 +2878,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2671
2878
|
"axisTitleY.visibility": yAxisTitleVisibility,
|
|
2672
2879
|
"axisTitleY2.visibility": y2AxisTitleVisibility,
|
|
2673
2880
|
"axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
|
|
2881
|
+
"axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
|
|
2674
2882
|
"axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
|
|
2883
|
+
"axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
|
|
2675
2884
|
"axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
|
|
2885
|
+
"axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
|
|
2676
2886
|
"axisY.abbreviation": yAxisAbbreviation,
|
|
2677
2887
|
"axisY.scale": yAxisScale,
|
|
2678
2888
|
"axisY2.abbreviation": y2AxisAbbreviation,
|
|
@@ -2682,10 +2892,63 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2682
2892
|
"axisLabelsY2.integerUnits": y2IntegerUnits,
|
|
2683
2893
|
"chart.overlayFields": overlayFieldsStr,
|
|
2684
2894
|
"chart.nullValueMode": nullValueMode,
|
|
2685
|
-
|
|
2895
|
+
"chart.showDataLabels": showDataLabels,
|
|
2896
|
+
lineWidth,
|
|
2897
|
+
lineDashStyle,
|
|
2898
|
+
fieldDashStyles: lineDashStylesByFieldStr,
|
|
2899
|
+
yAxisMin: yAxisMinRaw,
|
|
2900
|
+
yAxisMax: yAxisMaxRaw,
|
|
2901
|
+
y2AxisMin: y2AxisMinRaw,
|
|
2902
|
+
y2AxisMax: y2AxisMaxRaw,
|
|
2903
|
+
showXMajorGridLines,
|
|
2904
|
+
showYMajorGridLines,
|
|
2905
|
+
showY2MajorGridLines,
|
|
2906
|
+
showYMinorGridLines,
|
|
2907
|
+
showY2MinorGridLines,
|
|
2908
|
+
showLineSmoothing,
|
|
2909
|
+
yAxisMajorTickVisibility,
|
|
2910
|
+
y2AxisMajorTickVisibility,
|
|
2911
|
+
yAxisMajorTickSize,
|
|
2912
|
+
y2AxisMajorTickSize,
|
|
2913
|
+
yAxisMajorTickInterval,
|
|
2914
|
+
y2AxisMajorTickInterval,
|
|
2915
|
+
yAxisMinorTickVisibility,
|
|
2916
|
+
y2AxisMinorTickVisibility,
|
|
2917
|
+
yAxisMinorTickSize,
|
|
2918
|
+
y2AxisMinorTickSize,
|
|
2919
|
+
showYAxisWithZero: showYAxisWithZeroFromOptions,
|
|
2920
|
+
showY2AxisWithZero: showY2AxisWithZeroFromOptions
|
|
2686
2921
|
} = options;
|
|
2922
|
+
const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
|
|
2923
|
+
const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
|
|
2924
|
+
const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
|
|
2925
|
+
const showYMajorTicks = yAxisMajorTickVisibility === "show";
|
|
2926
|
+
const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
|
|
2927
|
+
const showYMinorTicks = yAxisMinorTickVisibility === "show";
|
|
2928
|
+
const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
|
|
2929
|
+
const yAxisMin = parseAxisValue(yAxisMinRaw);
|
|
2930
|
+
const yAxisMax = parseAxisValue(yAxisMaxRaw);
|
|
2931
|
+
const y2AxisMin = parseAxisValue(y2AxisMinRaw);
|
|
2932
|
+
const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
|
|
2933
|
+
const parseTickInterval = (simpleXMLValue, canvasValue) => {
|
|
2934
|
+
if (simpleXMLValue) return Number(simpleXMLValue);
|
|
2935
|
+
if (canvasValue) return Number(canvasValue);
|
|
2936
|
+
return void 0;
|
|
2937
|
+
};
|
|
2938
|
+
const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
|
|
2939
|
+
const y2AxisMajorTickIntervalNum = parseTickInterval(
|
|
2940
|
+
y2AxisMajorUnitFromSimpleXML,
|
|
2941
|
+
y2AxisMajorTickInterval
|
|
2942
|
+
);
|
|
2943
|
+
const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
|
|
2944
|
+
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
|
|
2945
|
+
const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
|
|
2946
|
+
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
|
|
2687
2947
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
2688
2948
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
2949
|
+
const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
|
|
2950
|
+
const legendLabels = parseArrayOption(legendLabelsStr);
|
|
2951
|
+
const bgColor = backgroundColor || bgColorFromOptions;
|
|
2689
2952
|
const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
|
|
2690
2953
|
const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
|
|
2691
2954
|
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
@@ -2696,31 +2959,64 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2696
2959
|
fields: chartData.fields,
|
|
2697
2960
|
columns: chartData.seriesList
|
|
2698
2961
|
});
|
|
2699
|
-
const xField =
|
|
2962
|
+
const xField = getFieldName2(filteredChartData.fields[0]);
|
|
2700
2963
|
const yFields = getFieldNames(
|
|
2701
2964
|
filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
|
|
2702
2965
|
);
|
|
2703
|
-
const y2Fields =
|
|
2704
|
-
|
|
2966
|
+
const y2Fields = (0, react_exports.useMemo)(
|
|
2967
|
+
() => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
|
|
2968
|
+
[y2FieldsStr]
|
|
2969
|
+
);
|
|
2970
|
+
const overlayFields = (0, react_exports.useMemo)(
|
|
2971
|
+
() => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
|
|
2972
|
+
[overlayFieldsStr]
|
|
2973
|
+
);
|
|
2705
2974
|
let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
|
|
2706
2975
|
xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
|
|
2707
|
-
|
|
2976
|
+
const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
|
|
2977
|
+
let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
|
|
2708
2978
|
yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
|
|
2709
2979
|
const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
|
|
2710
2980
|
let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
|
|
2711
2981
|
y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
|
|
2712
|
-
const xScaleConfig =
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2982
|
+
const xScaleConfig = (0, react_exports.useMemo)(
|
|
2983
|
+
() => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
|
|
2984
|
+
[xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
|
|
2985
|
+
);
|
|
2986
|
+
const yScaleConfig = (0, react_exports.useMemo)(
|
|
2987
|
+
() => getYScaleConfig(
|
|
2988
|
+
yAxisTitle,
|
|
2989
|
+
yAxisAbbreviation,
|
|
2990
|
+
yAxisScale,
|
|
2991
|
+
yAxisLabelVisibility,
|
|
2992
|
+
yAxisMin,
|
|
2993
|
+
yAxisMax
|
|
2994
|
+
),
|
|
2995
|
+
[yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
|
|
2996
|
+
);
|
|
2997
|
+
const y2ScaleConfig = (0, react_exports.useMemo)(() => {
|
|
2998
|
+
if (y2Enabled) {
|
|
2999
|
+
return getY2ScaleConfig(
|
|
3000
|
+
y2AxisTitle,
|
|
3001
|
+
y2AxisAbbreviation,
|
|
3002
|
+
y2AxisScale,
|
|
3003
|
+
y2IntegerUnits,
|
|
3004
|
+
y2AxisLabelVisibility,
|
|
3005
|
+
y2AxisMin,
|
|
3006
|
+
y2AxisMax
|
|
3007
|
+
);
|
|
3008
|
+
}
|
|
3009
|
+
return {};
|
|
3010
|
+
}, [
|
|
3011
|
+
y2Enabled,
|
|
3012
|
+
y2AxisTitle,
|
|
3013
|
+
y2AxisAbbreviation,
|
|
3014
|
+
y2AxisScale,
|
|
3015
|
+
y2IntegerUnits,
|
|
3016
|
+
y2AxisLabelVisibility,
|
|
3017
|
+
y2AxisMin,
|
|
3018
|
+
y2AxisMax
|
|
3019
|
+
]);
|
|
2724
3020
|
const uplotContainerElement = (0, react_exports.useRef)(null);
|
|
2725
3021
|
const seriesDataFormatted = [
|
|
2726
3022
|
filteredChartData.columns[0],
|
|
@@ -2736,9 +3032,21 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2736
3032
|
overlayFields,
|
|
2737
3033
|
y2Enabled,
|
|
2738
3034
|
nullValueMode,
|
|
2739
|
-
markerDisplay
|
|
3035
|
+
markerDisplay,
|
|
3036
|
+
lineDashStyle,
|
|
3037
|
+
lineDashStylesByField
|
|
2740
3038
|
),
|
|
2741
|
-
[
|
|
3039
|
+
[
|
|
3040
|
+
yFields,
|
|
3041
|
+
y2Fields,
|
|
3042
|
+
lineWidth,
|
|
3043
|
+
overlayFields,
|
|
3044
|
+
y2Enabled,
|
|
3045
|
+
nullValueMode,
|
|
3046
|
+
markerDisplay,
|
|
3047
|
+
lineDashStyle,
|
|
3048
|
+
lineDashStylesByField
|
|
3049
|
+
]
|
|
2742
3050
|
);
|
|
2743
3051
|
const chartingEventAnnotations = (0, react_exports.useMemo)(
|
|
2744
3052
|
() => getAnnotationsForCanvas({
|
|
@@ -2752,25 +3060,54 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2752
3060
|
() => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
|
|
2753
3061
|
[xScaleConfig, yScaleConfig, y2ScaleConfig]
|
|
2754
3062
|
);
|
|
2755
|
-
const legend = (0, react_exports.useMemo)(
|
|
3063
|
+
const legend = (0, react_exports.useMemo)(
|
|
3064
|
+
() => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
|
|
3065
|
+
[legendDisplay, legendMode]
|
|
3066
|
+
);
|
|
2756
3067
|
const handleChartClick = react_exports.useCallback(
|
|
2757
3068
|
(event) => {
|
|
2758
3069
|
if (onClick) {
|
|
2759
|
-
handleClick(event, onClick);
|
|
3070
|
+
handleClick(event, onClick, trellisKey, trellisSplitBy);
|
|
2760
3071
|
}
|
|
2761
3072
|
},
|
|
2762
|
-
[onClick]
|
|
3073
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
2763
3074
|
);
|
|
2764
3075
|
const handleChartLegendClick = react_exports.useCallback(
|
|
2765
3076
|
(event) => {
|
|
2766
3077
|
if (onClick) {
|
|
2767
|
-
handleLegendClick(event, onClick);
|
|
3078
|
+
handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
|
|
3079
|
+
}
|
|
3080
|
+
},
|
|
3081
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
3082
|
+
);
|
|
3083
|
+
const handleChartRangeSelection = react_exports.useCallback(
|
|
3084
|
+
(range2) => {
|
|
3085
|
+
if (onSelect) {
|
|
3086
|
+
handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
2768
3087
|
}
|
|
2769
3088
|
},
|
|
2770
|
-
[
|
|
3089
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
3090
|
+
);
|
|
3091
|
+
const handleChartRangeZoom = react_exports.useCallback(
|
|
3092
|
+
(range2) => {
|
|
3093
|
+
if (onSelect) {
|
|
3094
|
+
handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
3095
|
+
}
|
|
3096
|
+
},
|
|
3097
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
3098
|
+
);
|
|
3099
|
+
const xFieldToUse = xFieldFromProps || xField;
|
|
3100
|
+
const enableSearchZoom = react_exports.useMemo(
|
|
3101
|
+
() => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
|
|
3102
|
+
[eventHandlers, xFieldToUse]
|
|
2771
3103
|
);
|
|
2772
3104
|
const lastPayloadRef = react_exports.useRef(null);
|
|
2773
3105
|
const lastOriginalEventRef = react_exports.useRef(null);
|
|
3106
|
+
const previousMouseoverPayloadRef = react_exports.useRef(null);
|
|
3107
|
+
const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
|
|
3108
|
+
react_exports.useEffect(() => {
|
|
3109
|
+
additionalTooltipValuesRef.current = additionalTooltipValues;
|
|
3110
|
+
}, [additionalTooltipValues]);
|
|
2774
3111
|
const handleChartCrosshairChange = react_exports.useCallback(
|
|
2775
3112
|
(event) => {
|
|
2776
3113
|
if (onPointMouseOver || onPointMouseOut) {
|
|
@@ -2782,6 +3119,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2782
3119
|
payload: lastPayloadRef.current
|
|
2783
3120
|
});
|
|
2784
3121
|
}
|
|
3122
|
+
previousMouseoverPayloadRef.current = null;
|
|
2785
3123
|
return;
|
|
2786
3124
|
}
|
|
2787
3125
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
|
|
@@ -2789,25 +3127,36 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2789
3127
|
});
|
|
2790
3128
|
delete payload.seriesKey;
|
|
2791
3129
|
if (event.rowContext) {
|
|
2792
|
-
Object.
|
|
2793
|
-
payload
|
|
2794
|
-
|
|
3130
|
+
Object.assign(
|
|
3131
|
+
payload,
|
|
3132
|
+
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
3133
|
+
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
3134
|
+
return acc;
|
|
3135
|
+
}, {})
|
|
3136
|
+
);
|
|
3137
|
+
}
|
|
3138
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3139
|
+
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
3140
|
+
return;
|
|
2795
3141
|
}
|
|
2796
|
-
lastPayloadRef.current =
|
|
3142
|
+
lastPayloadRef.current = updatedPayload;
|
|
2797
3143
|
lastOriginalEventRef.current = event;
|
|
3144
|
+
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
2798
3145
|
if (onPointMouseOver) {
|
|
2799
3146
|
onPointMouseOver({
|
|
2800
3147
|
type: "point.mouseover",
|
|
2801
3148
|
originalEvent: event,
|
|
2802
|
-
payload
|
|
3149
|
+
payload: updatedPayload
|
|
2803
3150
|
});
|
|
2804
3151
|
}
|
|
2805
3152
|
}
|
|
2806
3153
|
},
|
|
2807
|
-
[onPointMouseOver, onPointMouseOut]
|
|
3154
|
+
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
|
|
2808
3155
|
);
|
|
2809
|
-
const
|
|
2810
|
-
|
|
3156
|
+
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}`;
|
|
3157
|
+
const memoizedChart = (0, react_exports.useMemo)(() => {
|
|
3158
|
+
const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
|
|
3159
|
+
return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
|
|
2811
3160
|
visualization_canvas_exports.TimeSeriesChart,
|
|
2812
3161
|
{
|
|
2813
3162
|
data: chartData,
|
|
@@ -2817,49 +3166,107 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
2817
3166
|
seriesColorsByField,
|
|
2818
3167
|
seriesConfig: seriesOverrides,
|
|
2819
3168
|
legend,
|
|
3169
|
+
legendLabels,
|
|
3170
|
+
isSeriesCompare: legendMode === "seriesCompare",
|
|
3171
|
+
maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
|
|
2820
3172
|
scaleConfig,
|
|
2821
3173
|
timestampFormat: "expanded",
|
|
2822
3174
|
onCrosshairClick: onClick ? handleChartClick : void 0,
|
|
2823
3175
|
onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
|
|
2824
3176
|
onSeriesClick: onClick ? handleChartLegendClick : void 0,
|
|
3177
|
+
onRangeSelection: handleChartRangeSelection,
|
|
3178
|
+
onRangeZoom: computedOnRangeZoom,
|
|
3179
|
+
serverSideZoom: enableSearchZoom,
|
|
2825
3180
|
userLocale,
|
|
2826
3181
|
events: chartingEventAnnotations,
|
|
2827
|
-
eventsConfig: { renderer: triangleEventAnnotationRenderer }
|
|
3182
|
+
eventsConfig: { renderer: triangleEventAnnotationRenderer },
|
|
3183
|
+
additionalTooltipValuesRef,
|
|
3184
|
+
showXMajorGridLines,
|
|
3185
|
+
showYMajorGridLines,
|
|
3186
|
+
showY2MajorGridLines,
|
|
3187
|
+
showYMinorGridLines,
|
|
3188
|
+
showY2MinorGridLines,
|
|
3189
|
+
showLineSmoothing,
|
|
3190
|
+
dataValuesDisplay,
|
|
3191
|
+
showYMajorTicks,
|
|
3192
|
+
showY2MajorTicks,
|
|
3193
|
+
yAxisMajorTickSize: yAxisMajorTickSizeNum,
|
|
3194
|
+
y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
|
|
3195
|
+
yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
|
|
3196
|
+
y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
|
|
3197
|
+
showYMinorTicks,
|
|
3198
|
+
showY2MinorTicks,
|
|
3199
|
+
yAxisMinorTickSize: yAxisMinorTickSizeNum,
|
|
3200
|
+
y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
|
|
3201
|
+
showYAxisWithZero,
|
|
3202
|
+
showY2AxisWithZero
|
|
2828
3203
|
}
|
|
2829
|
-
)
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
3204
|
+
));
|
|
3205
|
+
}, [
|
|
3206
|
+
onSelect,
|
|
3207
|
+
handleChartRangeZoom,
|
|
3208
|
+
dataKey,
|
|
3209
|
+
chartData,
|
|
3210
|
+
containerWidth,
|
|
3211
|
+
containerHeight,
|
|
3212
|
+
seriesColors,
|
|
3213
|
+
seriesColorsByField,
|
|
3214
|
+
seriesOverrides,
|
|
3215
|
+
legend,
|
|
3216
|
+
legendLabels,
|
|
3217
|
+
scaleConfig,
|
|
3218
|
+
onClick,
|
|
3219
|
+
handleChartClick,
|
|
3220
|
+
onPointMouseOver,
|
|
3221
|
+
onPointMouseOut,
|
|
3222
|
+
handleChartCrosshairChange,
|
|
3223
|
+
handleChartLegendClick,
|
|
3224
|
+
handleChartRangeSelection,
|
|
3225
|
+
enableSearchZoom,
|
|
3226
|
+
userLocale,
|
|
3227
|
+
chartingEventAnnotations,
|
|
3228
|
+
showXMajorGridLines,
|
|
3229
|
+
showYMajorGridLines,
|
|
3230
|
+
showY2MajorGridLines,
|
|
3231
|
+
showYMinorGridLines,
|
|
3232
|
+
showY2MinorGridLines,
|
|
3233
|
+
showLineSmoothing,
|
|
3234
|
+
dataValuesDisplay,
|
|
3235
|
+
showYMajorTicks,
|
|
3236
|
+
showY2MajorTicks,
|
|
3237
|
+
yAxisMajorTickSizeNum,
|
|
3238
|
+
y2AxisMajorTickSizeNum,
|
|
3239
|
+
yAxisMajorTickIntervalNum,
|
|
3240
|
+
y2AxisMajorTickIntervalNum,
|
|
3241
|
+
showYMinorTicks,
|
|
3242
|
+
showY2MinorTicks,
|
|
3243
|
+
yAxisMinorTickSizeNum,
|
|
3244
|
+
y2AxisMinorTickSizeNum,
|
|
3245
|
+
showYAxisWithZero,
|
|
3246
|
+
showY2AxisWithZero,
|
|
3247
|
+
legendMode
|
|
3248
|
+
]);
|
|
2849
3249
|
const memoizedVisualization = (0, react_exports.useMemo)(() => {
|
|
2850
|
-
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
|
|
2851
|
-
}, [
|
|
2852
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
3250
|
+
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
|
|
3251
|
+
}, [bgColor, memoizedChart]);
|
|
3252
|
+
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
|
|
3253
|
+
TrellisTitle,
|
|
3254
|
+
{
|
|
3255
|
+
trellisKey,
|
|
3256
|
+
backgroundColor: bgColor,
|
|
3257
|
+
fontColor: defaultFontColor
|
|
3258
|
+
}
|
|
3259
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
2853
3260
|
TimeSeriesChartContainer,
|
|
2854
3261
|
{
|
|
2855
|
-
height,
|
|
3262
|
+
height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
|
|
2856
3263
|
width,
|
|
2857
3264
|
ref: uplotContainerElement,
|
|
2858
3265
|
"data-test": "timeseries-chart-wrapper"
|
|
2859
3266
|
},
|
|
2860
3267
|
/* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
|
|
2861
3268
|
memoizedVisualization
|
|
2862
|
-
);
|
|
3269
|
+
));
|
|
2863
3270
|
};
|
|
2864
3271
|
var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
|
|
2865
3272
|
|
|
@@ -3174,6 +3581,10 @@ var pieOptionsSCMapping = {
|
|
|
3174
3581
|
collapseThreshold: "chart.sliceCollapsingThreshold",
|
|
3175
3582
|
collapseLabel: "chart.sliceCollapsingLabel"
|
|
3176
3583
|
};
|
|
3584
|
+
var getFieldName3 = (field) => {
|
|
3585
|
+
var _a, _b;
|
|
3586
|
+
return typeof field === "string" ? field : (_b = (_a = field.name) == null ? void 0 : _a.toString()) != null ? _b : "";
|
|
3587
|
+
};
|
|
3177
3588
|
var convertToStringValues = (options) => {
|
|
3178
3589
|
const updatedOptions = (0, propUtils_exports.convertPropsToString)({
|
|
3179
3590
|
vizProps: options,
|
|
@@ -3206,9 +3617,7 @@ var getPieOptionFieldIndex = (optionName, dataSources, options, vizConfig) => {
|
|
|
3206
3617
|
const mergedOptions = getPieMergedOptions(options, vizConfig);
|
|
3207
3618
|
const fieldName = (0, dsl_exports.getFieldsFromDSL)(mergedOptions[optionName], dataSources)[0];
|
|
3208
3619
|
const { fields } = dataSources.primary.data;
|
|
3209
|
-
const fieldIndex = fields.findIndex(
|
|
3210
|
-
(field) => (typeof field === "string" ? field : field.name.toString()) === fieldName
|
|
3211
|
-
);
|
|
3620
|
+
const fieldIndex = fields.findIndex((field) => getFieldName3(field) === fieldName);
|
|
3212
3621
|
return fieldIndex;
|
|
3213
3622
|
};
|
|
3214
3623
|
var invalidOptionField = (optionName, dataSources, options, vizConfig) => {
|