Skip to content

Commit 789b67f

Browse files
authored
[APM] Improvements for breakdown data gaps (#75534)
Closes #69704, #73387, #43780.
1 parent 4efaba3 commit 789b67f

File tree

11 files changed

+1242
-245
lines changed

11 files changed

+1242
-245
lines changed

x-pack/plugins/apm/public/components/shared/charts/CustomPlot/StaticPlot.js

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,29 @@ class StaticPlot extends PureComponent {
7171
const data = serie.data.map((value) => {
7272
return 'y' in value && isValidCoordinateValue(value.y)
7373
? value
74-
: {
75-
...value,
76-
y: undefined,
77-
};
74+
: { ...value, y: undefined };
7875
});
76+
77+
// make sure individual markers are displayed in cases
78+
// where there are gaps
79+
80+
const markersForGaps = serie.data.map((value, index) => {
81+
const prevHasData = getNull(serie.data[index - 1] ?? {});
82+
const nextHasData = getNull(serie.data[index + 1] ?? {});
83+
const thisHasData = getNull(value);
84+
85+
const isGap = !prevHasData && !nextHasData && thisHasData;
86+
87+
if (!isGap) {
88+
return {
89+
...value,
90+
y: undefined,
91+
};
92+
}
93+
94+
return value;
95+
});
96+
7997
return [
8098
<AreaSeries
8199
getNull={getNull}
@@ -99,6 +117,21 @@ class StaticPlot extends PureComponent {
99117
stack={true}
100118
cluster="line"
101119
/>,
120+
<LineMarkSeries
121+
getNull={getNull}
122+
key={`${serie.title}-line-markers`}
123+
xType="time-utc"
124+
curve={'curveMonotoneX'}
125+
data={markersForGaps}
126+
stroke={serie.color}
127+
color={serie.color}
128+
lineStyle={{
129+
opacity: 0,
130+
}}
131+
stack={true}
132+
cluster="line-mark"
133+
size={1}
134+
/>,
102135
];
103136
}
104137

@@ -132,7 +165,7 @@ class StaticPlot extends PureComponent {
132165
curve={'curveMonotoneX'}
133166
data={serie.data}
134167
color={serie.color}
135-
size={0.5}
168+
size={1}
136169
/>
137170
);
138171
default:

0 commit comments

Comments
 (0)