diff --git a/x-pack/plugins/lens/public/app_plugin/app.scss b/x-pack/plugins/lens/public/app_plugin/app.scss index 83b0a39be9229..39eee969f488d 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.scss +++ b/x-pack/plugins/lens/public/app_plugin/app.scss @@ -39,6 +39,10 @@ } } +.lensAnnotationIconFill { + fill: $euiColorLightestShade; +} + // Less-than-ideal styles to add a vertical divider after this button. Consider restructuring markup for better semantics and styling options in the future. .lnsNavItem__goBack { @include euiBreakpoint('m', 'l', 'xl') { diff --git a/x-pack/plugins/lens/public/assets/annotation_icons/circle.tsx b/x-pack/plugins/lens/public/assets/annotation_icons/circle.tsx index 326c51ff0890f..6e1395e5d977e 100644 --- a/x-pack/plugins/lens/public/assets/annotation_icons/circle.tsx +++ b/x-pack/plugins/lens/public/assets/annotation_icons/circle.tsx @@ -18,10 +18,14 @@ export const IconCircle = ({ title, titleId, ...props }: Omit {title ? {title} : null} - ); diff --git a/x-pack/plugins/lens/public/assets/annotation_icons/triangle.tsx b/x-pack/plugins/lens/public/assets/annotation_icons/triangle.tsx index af0b7a67c729f..7e3dee6db821c 100644 --- a/x-pack/plugins/lens/public/assets/annotation_icons/triangle.tsx +++ b/x-pack/plugins/lens/public/assets/annotation_icons/triangle.tsx @@ -19,6 +19,15 @@ export const IconTriangle = ({ title, titleId, ...props }: Omit {title ? {title} : null} - + + + + ); diff --git a/x-pack/plugins/lens/public/xy_visualization/annotations/expression.tsx b/x-pack/plugins/lens/public/xy_visualization/annotations/expression.tsx index 9dae0c83cbc4c..60b7a2a88d8b5 100644 --- a/x-pack/plugins/lens/public/xy_visualization/annotations/expression.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/annotations/expression.tsx @@ -176,6 +176,7 @@ export const Annotations = ({ const header = formatter?.convert(isGrouped ? roundedTimestamp : exactTimestamp) || moment(isGrouped ? roundedTimestamp : exactTimestamp).toISOString(); + const strokeWidth = annotation.lineWidth || 1; return ( ) : undefined @@ -217,13 +219,13 @@ export const Annotations = ({ customTooltipDetails={annotation.customTooltipDetails} style={{ line: { - strokeWidth: annotation.lineWidth || 1, + strokeWidth, stroke: annotation.color || defaultAnnotationColor, dash: annotation.lineStyle === 'dashed' - ? [(annotation.lineWidth || 1) * 3, annotation.lineWidth || 1] + ? [strokeWidth * 3, strokeWidth] : annotation.lineStyle === 'dotted' - ? [annotation.lineWidth || 1, annotation.lineWidth || 1] + ? [strokeWidth, strokeWidth] : undefined, opacity: 1, }, diff --git a/x-pack/plugins/lens/public/xy_visualization/annotations_helpers.tsx b/x-pack/plugins/lens/public/xy_visualization/annotations_helpers.tsx index 33e5d688064d7..7bc9e8960af6b 100644 --- a/x-pack/plugins/lens/public/xy_visualization/annotations_helpers.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/annotations_helpers.tsx @@ -9,6 +9,7 @@ import './expression_reference_lines.scss'; import React from 'react'; import { EuiFlexGroup, EuiIcon, EuiIconProps, EuiText, IconType } from '@elastic/eui'; import { Position } from '@elastic/charts'; +import classnames from 'classnames'; import type { IconPosition, YAxisMode, YConfig } from '../../common/expressions'; import { hasIcon } from './xy_config_panel/shared/icon_select'; import { IconCircle, IconTriangle } from '../assets/annotation_icons'; @@ -215,11 +216,13 @@ export const AnnotationIcon = ({ type, rotationClass = '', isHorizontal, + strokeWidth, ...rest }: { type: string; rotationClass?: string; isHorizontal?: boolean; + strokeWidth?: number; } & EuiIconProps) => { if (isNumericalString(type)) { return ; @@ -230,7 +233,15 @@ export const AnnotationIcon = ({ } const rotationClassName = shapesIconMap[type].shouldRotate ? rotationClass : ''; - return ; + return ( + + ); }; export function Marker({ @@ -239,15 +250,19 @@ export function Marker({ hasReducedPadding, label, rotationClass, + strokeWidth, }: { config: MarkerConfig; isHorizontal: boolean; hasReducedPadding: boolean; label?: string; rotationClass?: string; + strokeWidth?: number; }) { if (hasIcon(config.icon)) { - return ; + return ( + + ); } // if there's some text, check whether to show it as marker, or just show some padding for the icon