Skip to content

Commit

Permalink
[ML] add marker body (#104672)
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov authored and kibanamachine committed Jul 7, 2021
1 parent 2bf6791 commit c749916
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import React, { FC } from 'react';
import { EuiIcon } from '@elastic/eui';
import { RectAnnotation, LineAnnotation, AnnotationDomainType, Position } from '@elastic/charts';
import { timeFormatter } from '../../../../../../../../common/util/date_utils';
import { useCurrentEuiTheme } from '../../../../../../components/color_range_legend';

interface Props {
overlayKey: number;
Expand All @@ -19,12 +20,14 @@ interface Props {
}

export const OverlayRange: FC<Props> = ({ overlayKey, start, end, color, showMarker = true }) => {
const { euiTheme } = useCurrentEuiTheme();

return (
<>
<RectAnnotation
id={`rect_annotation_${overlayKey}`}
zIndex={1}
hideTooltips={true}
hideTooltips
dataValues={[
{
coordinates: {
Expand All @@ -50,14 +53,12 @@ export const OverlayRange: FC<Props> = ({ overlayKey, start, end, color, showMar
},
}}
markerPosition={Position.Bottom}
hideTooltips={true}
marker={
hideTooltips
marker={showMarker ? <EuiIcon type="arrowUp" /> : undefined}
markerBody={
showMarker ? (
<div>
<div style={{ textAlign: 'center' }}>
<EuiIcon type="arrowUp" />
</div>
<div style={{ fontWeight: 'normal', color: '#343741' }}>{timeFormatter(start)}</div>
<div style={{ fontWeight: 'normal', color: euiTheme.euiTextColor }}>
{timeFormatter(start)}
</div>
) : undefined
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const LoadingWrapper: FC<Props> = ({ hasData, loading = false, height, ch
transition: 'opacity 0.2s',
}}
>
{children}
{loading && !hasData ? null : children}
</div>
{loading === true && (
<EuiFlexGroup
Expand Down

0 comments on commit c749916

Please sign in to comment.