@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/Area.js
CHANGED
|
@@ -248,6 +248,7 @@ var DefaultVizActionHandler = class {
|
|
|
248
248
|
};
|
|
249
249
|
|
|
250
250
|
// src/common/utils/dataUtils.ts
|
|
251
|
+
var getFieldName = (field) => typeof field === "string" ? field : field.name;
|
|
251
252
|
var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
|
|
252
253
|
const dataLength = data.length;
|
|
253
254
|
const downsampledIndices = [];
|
|
@@ -421,9 +422,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
|
|
|
421
422
|
let xColumn = [];
|
|
422
423
|
const yColumns = [];
|
|
423
424
|
const canDownsample = !ds.data.fields.some((field, index) => {
|
|
424
|
-
var _a
|
|
425
|
-
const fieldName = (
|
|
426
|
-
const fieldType = (
|
|
425
|
+
var _a;
|
|
426
|
+
const fieldName = getFieldName(field);
|
|
427
|
+
const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
|
|
427
428
|
const column = ds.data.columns[index];
|
|
428
429
|
let hasDisplayedColumnThatCantBeDownsampled = false;
|
|
429
430
|
if (fieldName === xField) {
|
|
@@ -627,6 +628,7 @@ var Charting = (props) => {
|
|
|
627
628
|
const timezone = (0, react_exports.useContext)(TimezoneContext_default);
|
|
628
629
|
const selectChartEvent = (0, react_exports.useRef)(null);
|
|
629
630
|
const trellisEnabled = useTrellisEnabled(props.splitByLayout);
|
|
631
|
+
const isResizing = (0, react_exports.useRef)(false);
|
|
630
632
|
const drawChartRef = (0, react_exports.useRef)(() => {
|
|
631
633
|
});
|
|
632
634
|
const debouncedDrawChart = (0, react_exports.useMemo)(
|
|
@@ -725,6 +727,9 @@ var Charting = (props) => {
|
|
|
725
727
|
recalculateDownsamplingThreshold();
|
|
726
728
|
}, [recalculateDownsamplingThreshold]);
|
|
727
729
|
const handleSelect = useEventCallback_default((chartEvent) => {
|
|
730
|
+
if (isResizing.current) {
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
728
733
|
selectChartEvent.current = chartEvent;
|
|
729
734
|
recalculateDownsamplingThreshold();
|
|
730
735
|
const payload = appendTrellisToPayload(
|
|
@@ -859,6 +864,14 @@ var Charting = (props) => {
|
|
|
859
864
|
}
|
|
860
865
|
if (chart.current) {
|
|
861
866
|
if (Math.round(chart.current.height) !== Math.round(computedHeight) || Math.round(chart.current.width) !== Math.round(computedWidth)) {
|
|
867
|
+
isResizing.current = true;
|
|
868
|
+
queueMicrotask(() => {
|
|
869
|
+
try {
|
|
870
|
+
isResizing.current = false;
|
|
871
|
+
} catch (e) {
|
|
872
|
+
(0, lodash_exports.noop)(e);
|
|
873
|
+
}
|
|
874
|
+
});
|
|
862
875
|
chart.current.resize(computedWidth, computedHeight);
|
|
863
876
|
}
|
|
864
877
|
}
|
|
@@ -1159,7 +1172,6 @@ var AcceleratedRenderEditorLayout = [
|
|
|
1159
1172
|
"Render visualizations faster for large datasets. Some functionalities might not be available in this mode."
|
|
1160
1173
|
),
|
|
1161
1174
|
helpFormat: "under"
|
|
1162
|
-
// TODO: uncomment and replace link with real link (SCP-75907)
|
|
1163
1175
|
// helpTextLink: {
|
|
1164
1176
|
// href: 'https://splunkui.splunk.com/Packages/visualizations/Overview',
|
|
1165
1177
|
// label: 'Learn More.',
|
|
@@ -2710,7 +2722,7 @@ var Cover = styled_components_default.div`
|
|
|
2710
2722
|
bottom: 0;
|
|
2711
2723
|
`;
|
|
2712
2724
|
var Blocker = styled_components_default.div.attrs({
|
|
2713
|
-
"data-splunk-visualization-version": "28.
|
|
2725
|
+
"data-splunk-visualization-version": "28.4.0 - 002bd482f"
|
|
2714
2726
|
})`
|
|
2715
2727
|
position: relative;
|
|
2716
2728
|
width: 100%;
|
|
@@ -2791,7 +2803,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
2791
2803
|
FixSizeItem,
|
|
2792
2804
|
{
|
|
2793
2805
|
"data-test": "fix-size-item",
|
|
2794
|
-
"data-splunk-visualization-version": "28.
|
|
2806
|
+
"data-splunk-visualization-version": "28.4.0 - 002bd482f",
|
|
2795
2807
|
width,
|
|
2796
2808
|
height,
|
|
2797
2809
|
backgroundColor
|
|
@@ -3067,7 +3079,7 @@ var trellisUtils_default = "default" in defaultImport33 ? defaultImport33.defaul
|
|
|
3067
3079
|
var AGGREGATIONS = "aggregations";
|
|
3068
3080
|
var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
3069
3081
|
var _a, _b, _c, _d;
|
|
3070
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3082
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3071
3083
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3072
3084
|
let splitDataSources = null;
|
|
3073
3085
|
let errorCode = null;
|
|
@@ -3088,7 +3100,7 @@ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
|
|
|
3088
3100
|
}
|
|
3089
3101
|
return { splitDataSources, errorCode };
|
|
3090
3102
|
};
|
|
3091
|
-
var toFieldEntries = (fields) => {
|
|
3103
|
+
var toFieldEntries = (fields = []) => {
|
|
3092
3104
|
return fields.map((field) => {
|
|
3093
3105
|
if (typeof field === "string") {
|
|
3094
3106
|
return { name: field };
|
|
@@ -3103,7 +3115,7 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
3103
3115
|
let splitDataSources = null;
|
|
3104
3116
|
let splitByFields = [];
|
|
3105
3117
|
let errorCode = null;
|
|
3106
|
-
if (
|
|
3118
|
+
if (fields.length > 0) {
|
|
3107
3119
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
|
|
3108
3120
|
}
|
|
3109
3121
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -3141,12 +3153,12 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
|
|
|
3141
3153
|
};
|
|
3142
3154
|
var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
3143
3155
|
var _a, _b, _c, _d;
|
|
3144
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3156
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3145
3157
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3146
3158
|
let splitDataSources = null;
|
|
3147
3159
|
let splitByFields = [];
|
|
3148
3160
|
let errorCode = null;
|
|
3149
|
-
if (
|
|
3161
|
+
if (fields.length > 0) {
|
|
3150
3162
|
splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
|
|
3151
3163
|
}
|
|
3152
3164
|
if (splitByFields && splitByFields.length > 0) {
|
|
@@ -3170,12 +3182,12 @@ var dataSourcesSplitByAggregationsStats = (dataSource) => {
|
|
|
3170
3182
|
};
|
|
3171
3183
|
var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
3172
3184
|
var _a, _b, _c, _d, _e;
|
|
3173
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3185
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3174
3186
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3175
3187
|
let splitDataSources = null;
|
|
3176
3188
|
let splitByFields = [];
|
|
3177
3189
|
let errorCode = null;
|
|
3178
|
-
if (
|
|
3190
|
+
if (fields.length > 0) {
|
|
3179
3191
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
3180
3192
|
}
|
|
3181
3193
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -3213,12 +3225,12 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
|
|
|
3213
3225
|
};
|
|
3214
3226
|
var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
3215
3227
|
var _a, _b, _c, _d;
|
|
3216
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3228
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3217
3229
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3218
3230
|
let splitDataSources = null;
|
|
3219
3231
|
let splitByFields = [];
|
|
3220
3232
|
let errorCode = null;
|
|
3221
|
-
if (
|
|
3233
|
+
if (fields.length > 0) {
|
|
3222
3234
|
splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
|
|
3223
3235
|
}
|
|
3224
3236
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
@@ -3306,17 +3318,15 @@ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
|
|
|
3306
3318
|
};
|
|
3307
3319
|
var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
|
|
3308
3320
|
var _a, _b, _c, _d, _e, _f;
|
|
3309
|
-
const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
|
|
3321
|
+
const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
|
|
3310
3322
|
const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
|
|
3311
3323
|
let splitDataSources = null;
|
|
3312
3324
|
let splitByFields = [];
|
|
3313
3325
|
let errorCode = null;
|
|
3314
|
-
if (
|
|
3326
|
+
if (fields.length > 0) {
|
|
3315
3327
|
splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
|
|
3316
3328
|
}
|
|
3317
|
-
const splitByIndex = fields
|
|
3318
|
-
(field) => field === splitBy || field.name === splitBy
|
|
3319
|
-
);
|
|
3329
|
+
const splitByIndex = fields.findIndex((field) => field.name === splitBy);
|
|
3320
3330
|
if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
|
|
3321
3331
|
const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
|
|
3322
3332
|
splitDataSources = {};
|
|
@@ -3546,16 +3556,31 @@ var filterChartDataFromInternalFields = (chartData) => {
|
|
|
3546
3556
|
var convert2DArrayToNumbers = (arr) => {
|
|
3547
3557
|
return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
|
|
3548
3558
|
};
|
|
3559
|
+
var parseAxisValue = (val) => {
|
|
3560
|
+
if (val === void 0 || val === null || val === "auto" || val === "") {
|
|
3561
|
+
return void 0;
|
|
3562
|
+
}
|
|
3563
|
+
const num = typeof val === "number" ? val : Number.parseFloat(val);
|
|
3564
|
+
return Number.isNaN(num) ? void 0 : num;
|
|
3565
|
+
};
|
|
3549
3566
|
var SideLegendWidth = 75;
|
|
3550
|
-
var
|
|
3567
|
+
var SeriesCompareLegendWidth = 200;
|
|
3551
3568
|
var getLegend = (props) => {
|
|
3552
3569
|
const legendPlacement = props == null ? void 0 : props.legendDisplay;
|
|
3570
|
+
const { isSeriesCompare } = props;
|
|
3571
|
+
const commonLegendProps = {
|
|
3572
|
+
center: true,
|
|
3573
|
+
fontSize: 12,
|
|
3574
|
+
largerTiles: true,
|
|
3575
|
+
hideSeriesValue: !isSeriesCompare
|
|
3576
|
+
// Show values if in seriesCompare mode
|
|
3577
|
+
};
|
|
3553
3578
|
switch (legendPlacement) {
|
|
3554
3579
|
case "off":
|
|
3555
3580
|
return false;
|
|
3556
3581
|
case "left":
|
|
3557
3582
|
return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
|
|
3558
|
-
width: SideLegendWidth
|
|
3583
|
+
width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
|
|
3559
3584
|
}, commonLegendProps));
|
|
3560
3585
|
case "bottom":
|
|
3561
3586
|
return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
|
|
@@ -3567,7 +3592,7 @@ var getLegend = (props) => {
|
|
|
3567
3592
|
}, commonLegendProps));
|
|
3568
3593
|
default:
|
|
3569
3594
|
return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
|
|
3570
|
-
width: SideLegendWidth
|
|
3595
|
+
width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
|
|
3571
3596
|
}, commonLegendProps));
|
|
3572
3597
|
}
|
|
3573
3598
|
};
|
|
@@ -3603,22 +3628,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
|
|
|
3603
3628
|
const end = axisTitle.slice(-halfChars);
|
|
3604
3629
|
return `${start}...${end}`;
|
|
3605
3630
|
};
|
|
3606
|
-
var
|
|
3631
|
+
var getFieldName2 = (field) => {
|
|
3607
3632
|
const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
|
|
3608
3633
|
return fieldName;
|
|
3609
3634
|
};
|
|
3610
3635
|
var getFieldNames = (fields) => {
|
|
3611
|
-
return fields.map((field) =>
|
|
3636
|
+
return fields.map((field) => getFieldName2(field));
|
|
3612
3637
|
};
|
|
3613
|
-
var getXScaleConfig = (label, xAxisLabelVisibility) => {
|
|
3638
|
+
var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
|
|
3614
3639
|
const xConfig = { x: {} };
|
|
3615
3640
|
xConfig.x.label = label;
|
|
3616
3641
|
if (xAxisLabelVisibility === "hide") {
|
|
3617
3642
|
xConfig.x.hideLabels = true;
|
|
3618
3643
|
}
|
|
3644
|
+
if (xAxisLabelRotation !== void 0) {
|
|
3645
|
+
xConfig.x.labelRotation = xAxisLabelRotation;
|
|
3646
|
+
}
|
|
3619
3647
|
return xConfig;
|
|
3620
3648
|
};
|
|
3621
|
-
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
|
|
3649
|
+
var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
|
|
3622
3650
|
const scaleType = yAxisScale != null ? yAxisScale : "linear";
|
|
3623
3651
|
const yConfig = { y: {} };
|
|
3624
3652
|
yConfig.y.label = label;
|
|
@@ -3634,14 +3662,20 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
|
|
|
3634
3662
|
if (yAxisLabelVisibility === "hide") {
|
|
3635
3663
|
yConfig.y.hideLabels = true;
|
|
3636
3664
|
}
|
|
3665
|
+
if (yAxisMin !== void 0 || yAxisMax !== void 0) {
|
|
3666
|
+
yConfig.y.range = (u, dataMin, dataMax) => {
|
|
3667
|
+
const min = yAxisMin != null ? yAxisMin : dataMin;
|
|
3668
|
+
const max = yAxisMax != null ? yAxisMax : dataMax;
|
|
3669
|
+
return [min, max];
|
|
3670
|
+
};
|
|
3671
|
+
}
|
|
3637
3672
|
return yConfig;
|
|
3638
3673
|
};
|
|
3639
|
-
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
|
|
3674
|
+
var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
|
|
3640
3675
|
const y2Config = { y2: {} };
|
|
3641
3676
|
const scaleType = axisScale != null ? axisScale : "linear";
|
|
3642
3677
|
y2Config.y2.label = label;
|
|
3643
3678
|
y2Config.y2.side = "right";
|
|
3644
|
-
y2Config.y2.showGrid = false;
|
|
3645
3679
|
y2Config.y2.type = scaleType;
|
|
3646
3680
|
if (axisAbbreviation !== "none") {
|
|
3647
3681
|
y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
|
|
@@ -3651,9 +3685,16 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
|
|
|
3651
3685
|
if (y2AxisLabelVisibility === "hide") {
|
|
3652
3686
|
y2Config.y2.hideLabels = true;
|
|
3653
3687
|
}
|
|
3688
|
+
if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
|
|
3689
|
+
y2Config.y2.range = (u, dataMin, dataMax) => {
|
|
3690
|
+
const min = y2AxisMin != null ? y2AxisMin : dataMin;
|
|
3691
|
+
const max = y2AxisMax != null ? y2AxisMax : dataMax;
|
|
3692
|
+
return [min, max];
|
|
3693
|
+
};
|
|
3694
|
+
}
|
|
3654
3695
|
return y2Config;
|
|
3655
3696
|
};
|
|
3656
|
-
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
|
|
3697
|
+
var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
|
|
3657
3698
|
const seriesConfig = {};
|
|
3658
3699
|
let spanGaps;
|
|
3659
3700
|
let replaceNullsWithZero;
|
|
@@ -3688,12 +3729,45 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
|
|
|
3688
3729
|
if (markerDisplay !== void 0) {
|
|
3689
3730
|
seriesConfig[field].markerDisplay = markerDisplay;
|
|
3690
3731
|
}
|
|
3732
|
+
const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
|
|
3733
|
+
if (fieldDashStyle) {
|
|
3734
|
+
seriesConfig[field].lineDashStyle = fieldDashStyle;
|
|
3735
|
+
}
|
|
3691
3736
|
if (replaceNullsWithZero !== void 0) {
|
|
3692
3737
|
seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
|
|
3693
3738
|
}
|
|
3694
3739
|
});
|
|
3695
3740
|
return seriesConfig;
|
|
3696
3741
|
};
|
|
3742
|
+
var findRangeIndices = (xData, startValue, endValue) => {
|
|
3743
|
+
let startXIndex = -1;
|
|
3744
|
+
let endXIndex = -1;
|
|
3745
|
+
const xDataEpoch = xData.map((val) => {
|
|
3746
|
+
if (typeof val === "string") {
|
|
3747
|
+
return new Date(val).getTime() / 1e3;
|
|
3748
|
+
}
|
|
3749
|
+
return val;
|
|
3750
|
+
});
|
|
3751
|
+
for (let i = 0; i < xDataEpoch.length; i += 1) {
|
|
3752
|
+
if (xDataEpoch[i] >= startValue) {
|
|
3753
|
+
startXIndex = i;
|
|
3754
|
+
break;
|
|
3755
|
+
}
|
|
3756
|
+
}
|
|
3757
|
+
if (startXIndex === -1 && xDataEpoch.length > 0) {
|
|
3758
|
+
startXIndex = xDataEpoch.length - 1;
|
|
3759
|
+
}
|
|
3760
|
+
for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
|
|
3761
|
+
if (xDataEpoch[i] <= endValue) {
|
|
3762
|
+
endXIndex = i;
|
|
3763
|
+
break;
|
|
3764
|
+
}
|
|
3765
|
+
}
|
|
3766
|
+
if (endXIndex === -1 && xDataEpoch.length > 0) {
|
|
3767
|
+
endXIndex = 0;
|
|
3768
|
+
}
|
|
3769
|
+
return { startXIndex, endXIndex };
|
|
3770
|
+
};
|
|
3697
3771
|
|
|
3698
3772
|
// src/common/TimeSeriesChartWrapper.tsx
|
|
3699
3773
|
var TimeSeriesChartContainer = styled_components_default.div`
|
|
@@ -3704,38 +3778,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
|
|
|
3704
3778
|
position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
|
|
3705
3779
|
}
|
|
3706
3780
|
`;
|
|
3707
|
-
var
|
|
3781
|
+
var appendTrellisToPayload2 = (payload, trellisKey, trellisSplitBy) => {
|
|
3782
|
+
const result = __spreadValues({}, payload);
|
|
3783
|
+
if (trellisSplitBy) {
|
|
3784
|
+
result["trellis.name"] = trellisSplitBy;
|
|
3785
|
+
}
|
|
3786
|
+
if (trellisKey) {
|
|
3787
|
+
result["trellis.value"] = trellisKey;
|
|
3788
|
+
}
|
|
3789
|
+
return result;
|
|
3790
|
+
};
|
|
3791
|
+
var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
|
|
3792
|
+
if (!previousPayload) {
|
|
3793
|
+
return true;
|
|
3794
|
+
}
|
|
3795
|
+
if (currentPayload.index !== previousPayload.index) {
|
|
3796
|
+
return true;
|
|
3797
|
+
}
|
|
3798
|
+
if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
|
|
3799
|
+
return true;
|
|
3800
|
+
}
|
|
3801
|
+
if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
|
|
3802
|
+
return true;
|
|
3803
|
+
}
|
|
3804
|
+
if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
|
|
3805
|
+
return true;
|
|
3806
|
+
}
|
|
3807
|
+
return false;
|
|
3808
|
+
};
|
|
3809
|
+
var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
3708
3810
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
|
|
3709
3811
|
name: chartEvent.seriesKey
|
|
3710
3812
|
});
|
|
3711
3813
|
delete payload.seriesKey;
|
|
3712
3814
|
if (chartEvent.rowContext) {
|
|
3713
|
-
Object.
|
|
3714
|
-
payload
|
|
3715
|
-
|
|
3815
|
+
Object.assign(
|
|
3816
|
+
payload,
|
|
3817
|
+
Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
|
|
3818
|
+
acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
|
|
3819
|
+
return acc;
|
|
3820
|
+
}, {})
|
|
3821
|
+
);
|
|
3716
3822
|
}
|
|
3823
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3717
3824
|
if (onClick) {
|
|
3718
3825
|
onClick({
|
|
3719
3826
|
type: "point.click",
|
|
3720
3827
|
originalEvent: chartEvent,
|
|
3721
|
-
payload
|
|
3828
|
+
payload: updatedPayload
|
|
3722
3829
|
});
|
|
3723
3830
|
}
|
|
3724
3831
|
};
|
|
3725
|
-
var handleLegendClick = (chartEvent, onClick) => {
|
|
3832
|
+
var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
|
|
3726
3833
|
const payload = {
|
|
3727
3834
|
name: chartEvent
|
|
3728
3835
|
};
|
|
3836
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3729
3837
|
if (onClick) {
|
|
3730
3838
|
onClick({
|
|
3731
3839
|
type: "legend.click",
|
|
3732
3840
|
originalEvent: chartEvent,
|
|
3733
|
-
payload
|
|
3841
|
+
payload: updatedPayload
|
|
3842
|
+
});
|
|
3843
|
+
}
|
|
3844
|
+
};
|
|
3845
|
+
var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
3846
|
+
var _a;
|
|
3847
|
+
if (!rangeEvent) {
|
|
3848
|
+
return;
|
|
3849
|
+
}
|
|
3850
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
3851
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
3852
|
+
const payload = {
|
|
3853
|
+
startXIndex,
|
|
3854
|
+
startXValue: rangeEvent.start,
|
|
3855
|
+
endXIndex,
|
|
3856
|
+
endXValue: rangeEvent.end
|
|
3857
|
+
};
|
|
3858
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3859
|
+
if (onSelect) {
|
|
3860
|
+
onSelect({
|
|
3861
|
+
type: "range.selectBeforeZoom",
|
|
3862
|
+
originalEvent: rangeEvent,
|
|
3863
|
+
payload: updatedPayload
|
|
3734
3864
|
});
|
|
3735
3865
|
}
|
|
3736
3866
|
};
|
|
3867
|
+
var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
|
|
3868
|
+
var _a;
|
|
3869
|
+
const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
|
|
3870
|
+
const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
|
|
3871
|
+
const payload = {
|
|
3872
|
+
startXIndex,
|
|
3873
|
+
startXValue: rangeEvent.start,
|
|
3874
|
+
endXIndex,
|
|
3875
|
+
endXValue: rangeEvent.end
|
|
3876
|
+
};
|
|
3877
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
3878
|
+
if (onSelect) {
|
|
3879
|
+
onSelect({
|
|
3880
|
+
type: "range.select",
|
|
3881
|
+
originalEvent: rangeEvent,
|
|
3882
|
+
payload: updatedPayload
|
|
3883
|
+
});
|
|
3884
|
+
}
|
|
3885
|
+
};
|
|
3886
|
+
var parseArrayOption = (value) => {
|
|
3887
|
+
if (Array.isArray(value)) {
|
|
3888
|
+
return value;
|
|
3889
|
+
}
|
|
3890
|
+
if (value) {
|
|
3891
|
+
return JSON.parse(value);
|
|
3892
|
+
}
|
|
3893
|
+
return void 0;
|
|
3894
|
+
};
|
|
3737
3895
|
var TimeSeriesChartWrapper = (props) => {
|
|
3738
|
-
|
|
3896
|
+
var _b, _c, _d;
|
|
3897
|
+
const _a = props, {
|
|
3739
3898
|
width,
|
|
3740
3899
|
height,
|
|
3741
3900
|
chartData,
|
|
@@ -3748,12 +3907,49 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3748
3907
|
markerDisplay,
|
|
3749
3908
|
onClick,
|
|
3750
3909
|
onPointMouseOver,
|
|
3751
|
-
onPointMouseOut
|
|
3752
|
-
|
|
3753
|
-
|
|
3910
|
+
onPointMouseOut,
|
|
3911
|
+
onSelect,
|
|
3912
|
+
splitByLayout,
|
|
3913
|
+
trellisKey,
|
|
3914
|
+
trellisSplitBy,
|
|
3754
3915
|
backgroundColor,
|
|
3916
|
+
defaultFontColor,
|
|
3917
|
+
additionalTooltipValues,
|
|
3918
|
+
showYAxisWithZero: showYAxisWithZeroFromProps,
|
|
3919
|
+
showY2AxisWithZero: showY2AxisWithZeroFromProps
|
|
3920
|
+
} = _a, otherOptions = __objRest(_a, [
|
|
3921
|
+
"width",
|
|
3922
|
+
"height",
|
|
3923
|
+
"chartData",
|
|
3924
|
+
"options",
|
|
3925
|
+
"userLocale",
|
|
3926
|
+
"annotationX",
|
|
3927
|
+
"annotationLabel",
|
|
3928
|
+
"annotationColor",
|
|
3929
|
+
"legendDisplay",
|
|
3930
|
+
"markerDisplay",
|
|
3931
|
+
"onClick",
|
|
3932
|
+
"onPointMouseOver",
|
|
3933
|
+
"onPointMouseOut",
|
|
3934
|
+
"onSelect",
|
|
3935
|
+
"splitByLayout",
|
|
3936
|
+
"trellisKey",
|
|
3937
|
+
"trellisSplitBy",
|
|
3938
|
+
"backgroundColor",
|
|
3939
|
+
"defaultFontColor",
|
|
3940
|
+
"additionalTooltipValues",
|
|
3941
|
+
// Extract showYAxisWithZero directly from props for accelerated render mode
|
|
3942
|
+
"showYAxisWithZero",
|
|
3943
|
+
"showY2AxisWithZero"
|
|
3944
|
+
]);
|
|
3945
|
+
const { eventHandlers, xField: xFieldFromProps } = otherOptions;
|
|
3946
|
+
const trellisEnabled = useTrellisEnabled(splitByLayout);
|
|
3947
|
+
const {
|
|
3948
|
+
backgroundColor: bgColorFromOptions,
|
|
3755
3949
|
seriesColors: seriesColorsStr,
|
|
3756
3950
|
fieldColors,
|
|
3951
|
+
legendLabels: legendLabelsStr,
|
|
3952
|
+
legendMode,
|
|
3757
3953
|
"axisTitleX.text": xAxisTitleText,
|
|
3758
3954
|
"axisTitleY.text": yAxisTitleText,
|
|
3759
3955
|
"axisTitleY2.text": y2AxisTitleText,
|
|
@@ -3761,8 +3957,11 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3761
3957
|
"axisTitleY.visibility": yAxisTitleVisibility,
|
|
3762
3958
|
"axisTitleY2.visibility": y2AxisTitleVisibility,
|
|
3763
3959
|
"axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
|
|
3960
|
+
"axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
|
|
3764
3961
|
"axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
|
|
3962
|
+
"axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
|
|
3765
3963
|
"axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
|
|
3964
|
+
"axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
|
|
3766
3965
|
"axisY.abbreviation": yAxisAbbreviation,
|
|
3767
3966
|
"axisY.scale": yAxisScale,
|
|
3768
3967
|
"axisY2.abbreviation": y2AxisAbbreviation,
|
|
@@ -3772,10 +3971,63 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3772
3971
|
"axisLabelsY2.integerUnits": y2IntegerUnits,
|
|
3773
3972
|
"chart.overlayFields": overlayFieldsStr,
|
|
3774
3973
|
"chart.nullValueMode": nullValueMode,
|
|
3775
|
-
|
|
3974
|
+
"chart.showDataLabels": showDataLabels,
|
|
3975
|
+
lineWidth,
|
|
3976
|
+
lineDashStyle,
|
|
3977
|
+
fieldDashStyles: lineDashStylesByFieldStr,
|
|
3978
|
+
yAxisMin: yAxisMinRaw,
|
|
3979
|
+
yAxisMax: yAxisMaxRaw,
|
|
3980
|
+
y2AxisMin: y2AxisMinRaw,
|
|
3981
|
+
y2AxisMax: y2AxisMaxRaw,
|
|
3982
|
+
showXMajorGridLines,
|
|
3983
|
+
showYMajorGridLines,
|
|
3984
|
+
showY2MajorGridLines,
|
|
3985
|
+
showYMinorGridLines,
|
|
3986
|
+
showY2MinorGridLines,
|
|
3987
|
+
showLineSmoothing,
|
|
3988
|
+
yAxisMajorTickVisibility,
|
|
3989
|
+
y2AxisMajorTickVisibility,
|
|
3990
|
+
yAxisMajorTickSize,
|
|
3991
|
+
y2AxisMajorTickSize,
|
|
3992
|
+
yAxisMajorTickInterval,
|
|
3993
|
+
y2AxisMajorTickInterval,
|
|
3994
|
+
yAxisMinorTickVisibility,
|
|
3995
|
+
y2AxisMinorTickVisibility,
|
|
3996
|
+
yAxisMinorTickSize,
|
|
3997
|
+
y2AxisMinorTickSize,
|
|
3998
|
+
showYAxisWithZero: showYAxisWithZeroFromOptions,
|
|
3999
|
+
showY2AxisWithZero: showY2AxisWithZeroFromOptions
|
|
3776
4000
|
} = options;
|
|
4001
|
+
const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
|
|
4002
|
+
const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
|
|
4003
|
+
const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
|
|
4004
|
+
const showYMajorTicks = yAxisMajorTickVisibility === "show";
|
|
4005
|
+
const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
|
|
4006
|
+
const showYMinorTicks = yAxisMinorTickVisibility === "show";
|
|
4007
|
+
const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
|
|
4008
|
+
const yAxisMin = parseAxisValue(yAxisMinRaw);
|
|
4009
|
+
const yAxisMax = parseAxisValue(yAxisMaxRaw);
|
|
4010
|
+
const y2AxisMin = parseAxisValue(y2AxisMinRaw);
|
|
4011
|
+
const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
|
|
4012
|
+
const parseTickInterval = (simpleXMLValue, canvasValue) => {
|
|
4013
|
+
if (simpleXMLValue) return Number(simpleXMLValue);
|
|
4014
|
+
if (canvasValue) return Number(canvasValue);
|
|
4015
|
+
return void 0;
|
|
4016
|
+
};
|
|
4017
|
+
const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
|
|
4018
|
+
const y2AxisMajorTickIntervalNum = parseTickInterval(
|
|
4019
|
+
y2AxisMajorUnitFromSimpleXML,
|
|
4020
|
+
y2AxisMajorTickInterval
|
|
4021
|
+
);
|
|
4022
|
+
const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
|
|
4023
|
+
const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
|
|
4024
|
+
const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
|
|
4025
|
+
const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
|
|
3777
4026
|
const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
|
|
3778
4027
|
const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
|
|
4028
|
+
const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
|
|
4029
|
+
const legendLabels = parseArrayOption(legendLabelsStr);
|
|
4030
|
+
const bgColor = backgroundColor || bgColorFromOptions;
|
|
3779
4031
|
const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
|
|
3780
4032
|
const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
|
|
3781
4033
|
const cachedHandleResize = react_exports.useCallback((w, h) => {
|
|
@@ -3786,31 +4038,64 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3786
4038
|
fields: chartData.fields,
|
|
3787
4039
|
columns: chartData.seriesList
|
|
3788
4040
|
});
|
|
3789
|
-
const xField =
|
|
4041
|
+
const xField = getFieldName2(filteredChartData.fields[0]);
|
|
3790
4042
|
const yFields = getFieldNames(
|
|
3791
4043
|
filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
|
|
3792
4044
|
);
|
|
3793
|
-
const y2Fields =
|
|
3794
|
-
|
|
4045
|
+
const y2Fields = (0, react_exports.useMemo)(
|
|
4046
|
+
() => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
|
|
4047
|
+
[y2FieldsStr]
|
|
4048
|
+
);
|
|
4049
|
+
const overlayFields = (0, react_exports.useMemo)(
|
|
4050
|
+
() => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
|
|
4051
|
+
[overlayFieldsStr]
|
|
4052
|
+
);
|
|
3795
4053
|
let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
|
|
3796
4054
|
xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
|
|
3797
|
-
|
|
4055
|
+
const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
|
|
4056
|
+
let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
|
|
3798
4057
|
yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
|
|
3799
4058
|
const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
|
|
3800
4059
|
let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
|
|
3801
4060
|
y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
|
|
3802
|
-
const xScaleConfig =
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
4061
|
+
const xScaleConfig = (0, react_exports.useMemo)(
|
|
4062
|
+
() => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
|
|
4063
|
+
[xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
|
|
4064
|
+
);
|
|
4065
|
+
const yScaleConfig = (0, react_exports.useMemo)(
|
|
4066
|
+
() => getYScaleConfig(
|
|
4067
|
+
yAxisTitle,
|
|
4068
|
+
yAxisAbbreviation,
|
|
4069
|
+
yAxisScale,
|
|
4070
|
+
yAxisLabelVisibility,
|
|
4071
|
+
yAxisMin,
|
|
4072
|
+
yAxisMax
|
|
4073
|
+
),
|
|
4074
|
+
[yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
|
|
4075
|
+
);
|
|
4076
|
+
const y2ScaleConfig = (0, react_exports.useMemo)(() => {
|
|
4077
|
+
if (y2Enabled) {
|
|
4078
|
+
return getY2ScaleConfig(
|
|
4079
|
+
y2AxisTitle,
|
|
4080
|
+
y2AxisAbbreviation,
|
|
4081
|
+
y2AxisScale,
|
|
4082
|
+
y2IntegerUnits,
|
|
4083
|
+
y2AxisLabelVisibility,
|
|
4084
|
+
y2AxisMin,
|
|
4085
|
+
y2AxisMax
|
|
4086
|
+
);
|
|
4087
|
+
}
|
|
4088
|
+
return {};
|
|
4089
|
+
}, [
|
|
4090
|
+
y2Enabled,
|
|
4091
|
+
y2AxisTitle,
|
|
4092
|
+
y2AxisAbbreviation,
|
|
4093
|
+
y2AxisScale,
|
|
4094
|
+
y2IntegerUnits,
|
|
4095
|
+
y2AxisLabelVisibility,
|
|
4096
|
+
y2AxisMin,
|
|
4097
|
+
y2AxisMax
|
|
4098
|
+
]);
|
|
3814
4099
|
const uplotContainerElement = (0, react_exports.useRef)(null);
|
|
3815
4100
|
const seriesDataFormatted = [
|
|
3816
4101
|
filteredChartData.columns[0],
|
|
@@ -3826,9 +4111,21 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3826
4111
|
overlayFields,
|
|
3827
4112
|
y2Enabled,
|
|
3828
4113
|
nullValueMode,
|
|
3829
|
-
markerDisplay
|
|
4114
|
+
markerDisplay,
|
|
4115
|
+
lineDashStyle,
|
|
4116
|
+
lineDashStylesByField
|
|
3830
4117
|
),
|
|
3831
|
-
[
|
|
4118
|
+
[
|
|
4119
|
+
yFields,
|
|
4120
|
+
y2Fields,
|
|
4121
|
+
lineWidth,
|
|
4122
|
+
overlayFields,
|
|
4123
|
+
y2Enabled,
|
|
4124
|
+
nullValueMode,
|
|
4125
|
+
markerDisplay,
|
|
4126
|
+
lineDashStyle,
|
|
4127
|
+
lineDashStylesByField
|
|
4128
|
+
]
|
|
3832
4129
|
);
|
|
3833
4130
|
const chartingEventAnnotations = (0, react_exports.useMemo)(
|
|
3834
4131
|
() => getAnnotationsForCanvas({
|
|
@@ -3842,25 +4139,54 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3842
4139
|
() => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
|
|
3843
4140
|
[xScaleConfig, yScaleConfig, y2ScaleConfig]
|
|
3844
4141
|
);
|
|
3845
|
-
const legend = (0, react_exports.useMemo)(
|
|
4142
|
+
const legend = (0, react_exports.useMemo)(
|
|
4143
|
+
() => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
|
|
4144
|
+
[legendDisplay, legendMode]
|
|
4145
|
+
);
|
|
3846
4146
|
const handleChartClick = react_exports.useCallback(
|
|
3847
4147
|
(event) => {
|
|
3848
4148
|
if (onClick) {
|
|
3849
|
-
handleClick(event, onClick);
|
|
4149
|
+
handleClick(event, onClick, trellisKey, trellisSplitBy);
|
|
3850
4150
|
}
|
|
3851
4151
|
},
|
|
3852
|
-
[onClick]
|
|
4152
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
3853
4153
|
);
|
|
3854
4154
|
const handleChartLegendClick = react_exports.useCallback(
|
|
3855
4155
|
(event) => {
|
|
3856
4156
|
if (onClick) {
|
|
3857
|
-
handleLegendClick(event, onClick);
|
|
4157
|
+
handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
|
|
4158
|
+
}
|
|
4159
|
+
},
|
|
4160
|
+
[onClick, trellisKey, trellisSplitBy]
|
|
4161
|
+
);
|
|
4162
|
+
const handleChartRangeSelection = react_exports.useCallback(
|
|
4163
|
+
(range2) => {
|
|
4164
|
+
if (onSelect) {
|
|
4165
|
+
handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
4166
|
+
}
|
|
4167
|
+
},
|
|
4168
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
4169
|
+
);
|
|
4170
|
+
const handleChartRangeZoom = react_exports.useCallback(
|
|
4171
|
+
(range2) => {
|
|
4172
|
+
if (onSelect) {
|
|
4173
|
+
handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
|
|
3858
4174
|
}
|
|
3859
4175
|
},
|
|
3860
|
-
[
|
|
4176
|
+
[onSelect, chartData, trellisKey, trellisSplitBy]
|
|
4177
|
+
);
|
|
4178
|
+
const xFieldToUse = xFieldFromProps || xField;
|
|
4179
|
+
const enableSearchZoom = react_exports.useMemo(
|
|
4180
|
+
() => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
|
|
4181
|
+
[eventHandlers, xFieldToUse]
|
|
3861
4182
|
);
|
|
3862
4183
|
const lastPayloadRef = react_exports.useRef(null);
|
|
3863
4184
|
const lastOriginalEventRef = react_exports.useRef(null);
|
|
4185
|
+
const previousMouseoverPayloadRef = react_exports.useRef(null);
|
|
4186
|
+
const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
|
|
4187
|
+
react_exports.useEffect(() => {
|
|
4188
|
+
additionalTooltipValuesRef.current = additionalTooltipValues;
|
|
4189
|
+
}, [additionalTooltipValues]);
|
|
3864
4190
|
const handleChartCrosshairChange = react_exports.useCallback(
|
|
3865
4191
|
(event) => {
|
|
3866
4192
|
if (onPointMouseOver || onPointMouseOut) {
|
|
@@ -3872,6 +4198,7 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3872
4198
|
payload: lastPayloadRef.current
|
|
3873
4199
|
});
|
|
3874
4200
|
}
|
|
4201
|
+
previousMouseoverPayloadRef.current = null;
|
|
3875
4202
|
return;
|
|
3876
4203
|
}
|
|
3877
4204
|
const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
|
|
@@ -3879,25 +4206,36 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3879
4206
|
});
|
|
3880
4207
|
delete payload.seriesKey;
|
|
3881
4208
|
if (event.rowContext) {
|
|
3882
|
-
Object.
|
|
3883
|
-
payload
|
|
3884
|
-
|
|
4209
|
+
Object.assign(
|
|
4210
|
+
payload,
|
|
4211
|
+
Object.keys(event.rowContext).reduce((acc, fieldName) => {
|
|
4212
|
+
acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
|
|
4213
|
+
return acc;
|
|
4214
|
+
}, {})
|
|
4215
|
+
);
|
|
4216
|
+
}
|
|
4217
|
+
const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
|
|
4218
|
+
if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
|
|
4219
|
+
return;
|
|
3885
4220
|
}
|
|
3886
|
-
lastPayloadRef.current =
|
|
4221
|
+
lastPayloadRef.current = updatedPayload;
|
|
3887
4222
|
lastOriginalEventRef.current = event;
|
|
4223
|
+
previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
|
|
3888
4224
|
if (onPointMouseOver) {
|
|
3889
4225
|
onPointMouseOver({
|
|
3890
4226
|
type: "point.mouseover",
|
|
3891
4227
|
originalEvent: event,
|
|
3892
|
-
payload
|
|
4228
|
+
payload: updatedPayload
|
|
3893
4229
|
});
|
|
3894
4230
|
}
|
|
3895
4231
|
}
|
|
3896
4232
|
},
|
|
3897
|
-
[onPointMouseOver, onPointMouseOut]
|
|
4233
|
+
[onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
|
|
3898
4234
|
);
|
|
3899
|
-
const
|
|
3900
|
-
|
|
4235
|
+
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}`;
|
|
4236
|
+
const memoizedChart = (0, react_exports.useMemo)(() => {
|
|
4237
|
+
const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
|
|
4238
|
+
return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
|
|
3901
4239
|
visualization_canvas_exports.TimeSeriesChart,
|
|
3902
4240
|
{
|
|
3903
4241
|
data: chartData,
|
|
@@ -3907,49 +4245,107 @@ var TimeSeriesChartWrapper = (props) => {
|
|
|
3907
4245
|
seriesColorsByField,
|
|
3908
4246
|
seriesConfig: seriesOverrides,
|
|
3909
4247
|
legend,
|
|
4248
|
+
legendLabels,
|
|
4249
|
+
isSeriesCompare: legendMode === "seriesCompare",
|
|
4250
|
+
maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
|
|
3910
4251
|
scaleConfig,
|
|
3911
4252
|
timestampFormat: "expanded",
|
|
3912
4253
|
onCrosshairClick: onClick ? handleChartClick : void 0,
|
|
3913
4254
|
onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
|
|
3914
4255
|
onSeriesClick: onClick ? handleChartLegendClick : void 0,
|
|
4256
|
+
onRangeSelection: handleChartRangeSelection,
|
|
4257
|
+
onRangeZoom: computedOnRangeZoom,
|
|
4258
|
+
serverSideZoom: enableSearchZoom,
|
|
3915
4259
|
userLocale,
|
|
3916
4260
|
events: chartingEventAnnotations,
|
|
3917
|
-
eventsConfig: { renderer: triangleEventAnnotationRenderer }
|
|
4261
|
+
eventsConfig: { renderer: triangleEventAnnotationRenderer },
|
|
4262
|
+
additionalTooltipValuesRef,
|
|
4263
|
+
showXMajorGridLines,
|
|
4264
|
+
showYMajorGridLines,
|
|
4265
|
+
showY2MajorGridLines,
|
|
4266
|
+
showYMinorGridLines,
|
|
4267
|
+
showY2MinorGridLines,
|
|
4268
|
+
showLineSmoothing,
|
|
4269
|
+
dataValuesDisplay,
|
|
4270
|
+
showYMajorTicks,
|
|
4271
|
+
showY2MajorTicks,
|
|
4272
|
+
yAxisMajorTickSize: yAxisMajorTickSizeNum,
|
|
4273
|
+
y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
|
|
4274
|
+
yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
|
|
4275
|
+
y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
|
|
4276
|
+
showYMinorTicks,
|
|
4277
|
+
showY2MinorTicks,
|
|
4278
|
+
yAxisMinorTickSize: yAxisMinorTickSizeNum,
|
|
4279
|
+
y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
|
|
4280
|
+
showYAxisWithZero,
|
|
4281
|
+
showY2AxisWithZero
|
|
3918
4282
|
}
|
|
3919
|
-
)
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
4283
|
+
));
|
|
4284
|
+
}, [
|
|
4285
|
+
onSelect,
|
|
4286
|
+
handleChartRangeZoom,
|
|
4287
|
+
dataKey,
|
|
4288
|
+
chartData,
|
|
4289
|
+
containerWidth,
|
|
4290
|
+
containerHeight,
|
|
4291
|
+
seriesColors,
|
|
4292
|
+
seriesColorsByField,
|
|
4293
|
+
seriesOverrides,
|
|
4294
|
+
legend,
|
|
4295
|
+
legendLabels,
|
|
4296
|
+
scaleConfig,
|
|
4297
|
+
onClick,
|
|
4298
|
+
handleChartClick,
|
|
4299
|
+
onPointMouseOver,
|
|
4300
|
+
onPointMouseOut,
|
|
4301
|
+
handleChartCrosshairChange,
|
|
4302
|
+
handleChartLegendClick,
|
|
4303
|
+
handleChartRangeSelection,
|
|
4304
|
+
enableSearchZoom,
|
|
4305
|
+
userLocale,
|
|
4306
|
+
chartingEventAnnotations,
|
|
4307
|
+
showXMajorGridLines,
|
|
4308
|
+
showYMajorGridLines,
|
|
4309
|
+
showY2MajorGridLines,
|
|
4310
|
+
showYMinorGridLines,
|
|
4311
|
+
showY2MinorGridLines,
|
|
4312
|
+
showLineSmoothing,
|
|
4313
|
+
dataValuesDisplay,
|
|
4314
|
+
showYMajorTicks,
|
|
4315
|
+
showY2MajorTicks,
|
|
4316
|
+
yAxisMajorTickSizeNum,
|
|
4317
|
+
y2AxisMajorTickSizeNum,
|
|
4318
|
+
yAxisMajorTickIntervalNum,
|
|
4319
|
+
y2AxisMajorTickIntervalNum,
|
|
4320
|
+
showYMinorTicks,
|
|
4321
|
+
showY2MinorTicks,
|
|
4322
|
+
yAxisMinorTickSizeNum,
|
|
4323
|
+
y2AxisMinorTickSizeNum,
|
|
4324
|
+
showYAxisWithZero,
|
|
4325
|
+
showY2AxisWithZero,
|
|
4326
|
+
legendMode
|
|
4327
|
+
]);
|
|
3939
4328
|
const memoizedVisualization = (0, react_exports.useMemo)(() => {
|
|
3940
|
-
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
|
|
3941
|
-
}, [
|
|
3942
|
-
return /* @__PURE__ */ react_exports.createElement(
|
|
4329
|
+
return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
|
|
4330
|
+
}, [bgColor, memoizedChart]);
|
|
4331
|
+
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
|
|
4332
|
+
TrellisTitle,
|
|
4333
|
+
{
|
|
4334
|
+
trellisKey,
|
|
4335
|
+
backgroundColor: bgColor,
|
|
4336
|
+
fontColor: defaultFontColor
|
|
4337
|
+
}
|
|
4338
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
3943
4339
|
TimeSeriesChartContainer,
|
|
3944
4340
|
{
|
|
3945
|
-
height,
|
|
4341
|
+
height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
|
|
3946
4342
|
width,
|
|
3947
4343
|
ref: uplotContainerElement,
|
|
3948
4344
|
"data-test": "timeseries-chart-wrapper"
|
|
3949
4345
|
},
|
|
3950
4346
|
/* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
|
|
3951
4347
|
memoizedVisualization
|
|
3952
|
-
);
|
|
4348
|
+
));
|
|
3953
4349
|
};
|
|
3954
4350
|
var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
|
|
3955
4351
|
|