Commit 762a7195 by Dominik Prokop Committed by GitHub

Explore: Minor tweaks to exemplars marble (#28366)

parent 89ebb97f
...@@ -67,9 +67,9 @@ export const ExemplarMarker: React.FC<ExemplarMarkerProps> = ({ time, text, tags ...@@ -67,9 +67,9 @@ export const ExemplarMarker: React.FC<ExemplarMarkerProps> = ({ time, text, tags
return ( return (
<> <>
<div ref={markerRef} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} className={cx(styles.markerWrapper)}> <div ref={markerRef} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} className={styles.markerWrapper}>
<svg viewBox="0 0 599 599" width="8" height="8"> <svg viewBox="0 0 599 599" width="8" height="8" className={cx(styles.marble, isOpen && styles.activeMarble)}>
<path id="black_diamond" fill="#000" d="M 300,575 L 575,300 L 300,25 L 25,300 L 300,575 Z" /> <path d="M 300,575 L 575,300 L 300,25 L 25,300 L 300,575 Z" />
</svg> </svg>
</div> </div>
{isOpen && <Portal>{renderMarker()}</Portal>} {isOpen && <Portal>{renderMarker()}</Portal>}
...@@ -81,6 +81,19 @@ const getExemplarMarkerStyles = (theme: GrafanaTheme) => { ...@@ -81,6 +81,19 @@ const getExemplarMarkerStyles = (theme: GrafanaTheme) => {
const bg = theme.isDark ? theme.palette.dark2 : theme.palette.white; const bg = theme.isDark ? theme.palette.dark2 : theme.palette.white;
const headerBg = theme.isDark ? theme.palette.dark9 : theme.palette.gray5; const headerBg = theme.isDark ? theme.palette.dark9 : theme.palette.gray5;
const shadowColor = theme.isDark ? theme.palette.black : theme.palette.white; const shadowColor = theme.isDark ? theme.palette.black : theme.palette.white;
const marbleFill = theme.isDark ? theme.palette.gray3 : theme.palette.gray1;
const marbleFillHover = theme.isDark ? theme.palette.blue85 : theme.palette.blue77;
const marble = css`
display: block;
fill: ${marbleFill};
transition: transform 0.15s ease-out;
`;
const activeMarble = css`
fill: ${marbleFillHover};
transform: scale(1.3);
filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
`;
return { return {
markerWrapper: css` markerWrapper: css`
...@@ -88,8 +101,11 @@ const getExemplarMarkerStyles = (theme: GrafanaTheme) => { ...@@ -88,8 +101,11 @@ const getExemplarMarkerStyles = (theme: GrafanaTheme) => {
width: 8px; width: 8px;
height: 8px; height: 8px;
box-sizing: content-box; box-sizing: content-box;
&:hover {
> svg { > svg {
display: block; ${activeMarble}
}
} }
`, `,
marker: css` marker: css`
...@@ -107,6 +123,7 @@ const getExemplarMarkerStyles = (theme: GrafanaTheme) => { ...@@ -107,6 +123,7 @@ const getExemplarMarkerStyles = (theme: GrafanaTheme) => {
max-width: 400px; max-width: 400px;
box-shadow: 0 0 20px ${shadowColor}; box-shadow: 0 0 20px ${shadowColor};
`, `,
tooltip: css` tooltip: css`
background: none; background: none;
padding: 0; padding: 0;
...@@ -137,5 +154,7 @@ const getExemplarMarkerStyles = (theme: GrafanaTheme) => { ...@@ -137,5 +154,7 @@ const getExemplarMarkerStyles = (theme: GrafanaTheme) => {
padding: ${theme.spacing.sm}; padding: ${theme.spacing.sm};
font-weight: ${theme.typography.weight.semibold}; font-weight: ${theme.typography.weight.semibold};
`, `,
marble,
activeMarble,
}; };
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment