mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Geomap: Fix fixed edge text for network layer (#72863)
Geomap: Fix fixed edge text
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
|||||||
Field,
|
Field,
|
||||||
PluginState,
|
PluginState,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
|
import { TextDimensionMode } from '@grafana/schema';
|
||||||
import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource';
|
import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource';
|
||||||
import { getGeometryField, getLocationMatchers } from 'app/features/geo/utils/location';
|
import { getGeometryField, getLocationMatchers } from 'app/features/geo/utils/location';
|
||||||
import { GraphFrame } from 'app/plugins/panel/nodeGraph/types';
|
import { GraphFrame } from 'app/plugins/panel/nodeGraph/types';
|
||||||
@@ -159,11 +160,11 @@ export const networkLayer: MapLayerRegistryItem<NetworkConfig> = {
|
|||||||
flowStyle.setGeometry(LS);
|
flowStyle.setGeometry(LS);
|
||||||
|
|
||||||
const fontFamily = theme.typography.fontFamily;
|
const fontFamily = theme.typography.fontFamily;
|
||||||
if (edgeDims.text) {
|
if (edgeDims.text || edgeStyle.config.text?.mode === TextDimensionMode.Fixed) {
|
||||||
const labelStyle = new Style({
|
const labelStyle = new Style({
|
||||||
zIndex: 10,
|
zIndex: 10,
|
||||||
text: new Text({
|
text: new Text({
|
||||||
text: edgeDims.text.get(edgeId),
|
text: edgeDims.text?.get(edgeId) ?? edgeStyle.config.text?.fixed,
|
||||||
font: `normal ${edgeTextConfig?.fontSize}px ${fontFamily}`,
|
font: `normal ${edgeTextConfig?.fontSize}px ${fontFamily}`,
|
||||||
fill: new Fill({ color: color1 ?? defaultStyleConfig.color.fixed }),
|
fill: new Fill({ color: color1 ?? defaultStyleConfig.color.fixed }),
|
||||||
stroke: new Stroke({
|
stroke: new Stroke({
|
||||||
|
|||||||
Reference in New Issue
Block a user