From efe09d6a8b7459d6aa6396766b3002c3a386471e Mon Sep 17 00:00:00 2001 From: Adela Almasan <88068998+adela-almasan@users.noreply.github.com> Date: Wed, 4 May 2022 10:14:19 -0500 Subject: [PATCH] Geomap: Legend and scale overlapping (#47594) Updated legend bottom left custom style when scale is shown --- public/app/plugins/panel/geomap/GeomapOverlay.tsx | 9 +++++++-- public/app/plugins/panel/geomap/GeomapPanel.tsx | 13 +++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/public/app/plugins/panel/geomap/GeomapOverlay.tsx b/public/app/plugins/panel/geomap/GeomapOverlay.tsx index af999908a77..6128054f2c8 100644 --- a/public/app/plugins/panel/geomap/GeomapOverlay.tsx +++ b/public/app/plugins/panel/geomap/GeomapOverlay.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/css'; -import React, { PureComponent } from 'react'; +import React, { CSSProperties, PureComponent } from 'react'; import { GrafanaTheme } from '@grafana/data'; import { config } from '@grafana/runtime'; @@ -8,6 +8,7 @@ import { stylesFactory } from '@grafana/ui'; export interface OverlayProps { topRight?: React.ReactNode[]; bottomLeft?: React.ReactNode[]; + blStyle?: CSSProperties; } export class GeomapOverlay extends PureComponent { @@ -22,7 +23,11 @@ export class GeomapOverlay extends PureComponent { return (
{Boolean(topRight?.length) &&
{topRight}
} - {Boolean(bottomLeft?.length) &&
{bottomLeft}
} + {Boolean(bottomLeft?.length) && ( +
+ {bottomLeft} +
+ )}
); } diff --git a/public/app/plugins/panel/geomap/GeomapPanel.tsx b/public/app/plugins/panel/geomap/GeomapPanel.tsx index 090d38c562e..76f3d6d9e0d 100644 --- a/public/app/plugins/panel/geomap/GeomapPanel.tsx +++ b/public/app/plugins/panel/geomap/GeomapPanel.tsx @@ -17,14 +17,14 @@ import React, { Component, ReactNode } from 'react'; import { Subject, Subscription } from 'rxjs'; import { - PanelData, - MapLayerOptions, - PanelProps, - GrafanaTheme, + DataFrame, DataHoverClearEvent, DataHoverEvent, - DataFrame, FrameGeometrySourceMode, + GrafanaTheme, + MapLayerOptions, + PanelData, + PanelProps, } from '@grafana/data'; import { config } from '@grafana/runtime'; import { PanelContext, PanelContextRoot, stylesFactory } from '@grafana/ui'; @@ -645,13 +645,14 @@ export class GeomapPanel extends Component { render() { const { ttip, ttipOpen, topRight, legends } = this.state; + const showScale = this.props.options.controls.showScale; return ( <>
- +