Skip to content

Commit 7482a2e

Browse files
[ML] add marker body (#104672) (#104724)
Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
1 parent 09ed1bb commit 7482a2e

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

x-pack/plugins/ml/public/application/jobs/new_job/pages/components/charts/event_rate_chart/overlay_range.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import React, { FC } from 'react';
99
import { EuiIcon } from '@elastic/eui';
1010
import { RectAnnotation, LineAnnotation, AnnotationDomainType, Position } from '@elastic/charts';
1111
import { timeFormatter } from '../../../../../../../../common/util/date_utils';
12+
import { useCurrentEuiTheme } from '../../../../../../components/color_range_legend';
1213

1314
interface Props {
1415
overlayKey: number;
@@ -19,12 +20,14 @@ interface Props {
1920
}
2021

2122
export const OverlayRange: FC<Props> = ({ overlayKey, start, end, color, showMarker = true }) => {
23+
const { euiTheme } = useCurrentEuiTheme();
24+
2225
return (
2326
<>
2427
<RectAnnotation
2528
id={`rect_annotation_${overlayKey}`}
2629
zIndex={1}
27-
hideTooltips={true}
30+
hideTooltips
2831
dataValues={[
2932
{
3033
coordinates: {
@@ -50,14 +53,12 @@ export const OverlayRange: FC<Props> = ({ overlayKey, start, end, color, showMar
5053
},
5154
}}
5255
markerPosition={Position.Bottom}
53-
hideTooltips={true}
54-
marker={
56+
hideTooltips
57+
marker={showMarker ? <EuiIcon type="arrowUp" /> : undefined}
58+
markerBody={
5559
showMarker ? (
56-
<div>
57-
<div style={{ textAlign: 'center' }}>
58-
<EuiIcon type="arrowUp" />
59-
</div>
60-
<div style={{ fontWeight: 'normal', color: '#343741' }}>{timeFormatter(start)}</div>
60+
<div style={{ fontWeight: 'normal', color: euiTheme.euiTextColor }}>
61+
{timeFormatter(start)}
6162
</div>
6263
) : undefined
6364
}

x-pack/plugins/ml/public/application/jobs/new_job/pages/components/charts/loading_wrapper/loading_wrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const LoadingWrapper: FC<Props> = ({ hasData, loading = false, height, ch
2626
transition: 'opacity 0.2s',
2727
}}
2828
>
29-
{children}
29+
{loading && !hasData ? null : children}
3030
</div>
3131
{loading === true && (
3232
<EuiFlexGroup

0 commit comments

Comments
 (0)