mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Geomap: fix casing for panel options (#44688)
* fix casing for panel options * remove hardcoded label values
This commit is contained in:
parent
a86d7a5a90
commit
21796c61ba
@ -13,6 +13,7 @@ import {
|
|||||||
} from '@grafana/ui';
|
} from '@grafana/ui';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { useObservable } from 'react-use';
|
import { useObservable } from 'react-use';
|
||||||
|
import { capitalize } from 'lodash';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ColorDimensionEditor,
|
ColorDimensionEditor,
|
||||||
@ -294,9 +295,9 @@ export const StyleEditor: FC<StandardEditorProps<StyleConfig, StyleEditorOptions
|
|||||||
value={value?.textConfig?.textAlign ?? defaultStyleConfig.textConfig.textAlign}
|
value={value?.textConfig?.textAlign ?? defaultStyleConfig.textConfig.textAlign}
|
||||||
onChange={onTextAlignChange}
|
onChange={onTextAlignChange}
|
||||||
options={[
|
options={[
|
||||||
{ value: TextAlignment.Left, label: TextAlignment.Left },
|
{ value: TextAlignment.Left, label: capitalize(TextAlignment.Left) },
|
||||||
{ value: TextAlignment.Center, label: TextAlignment.Center },
|
{ value: TextAlignment.Center, label: capitalize(TextAlignment.Center) },
|
||||||
{ value: TextAlignment.Right, label: TextAlignment.Right },
|
{ value: TextAlignment.Right, label: capitalize(TextAlignment.Right) },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
@ -305,9 +306,9 @@ export const StyleEditor: FC<StandardEditorProps<StyleConfig, StyleEditorOptions
|
|||||||
value={value?.textConfig?.textBaseline ?? defaultStyleConfig.textConfig.textBaseline}
|
value={value?.textConfig?.textBaseline ?? defaultStyleConfig.textConfig.textBaseline}
|
||||||
onChange={onTextBaselineChange}
|
onChange={onTextBaselineChange}
|
||||||
options={[
|
options={[
|
||||||
{ value: TextBaseline.Top, label: TextBaseline.Top },
|
{ value: TextBaseline.Top, label: capitalize(TextBaseline.Top) },
|
||||||
{ value: TextBaseline.Middle, label: TextBaseline.Middle },
|
{ value: TextBaseline.Middle, label: capitalize(TextBaseline.Middle) },
|
||||||
{ value: TextBaseline.Bottom, label: TextBaseline.Bottom },
|
{ value: TextBaseline.Bottom, label: capitalize(TextBaseline.Bottom) },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
|
@ -168,7 +168,7 @@ export const geojsonLayer: MapLayerRegistryItem<GeoJSONMapperConfig> = {
|
|||||||
.addCustomEditor({
|
.addCustomEditor({
|
||||||
id: 'config.style',
|
id: 'config.style',
|
||||||
path: 'config.style',
|
path: 'config.style',
|
||||||
name: 'Default Style',
|
name: 'Default style',
|
||||||
description: 'The style to apply when no rules above match',
|
description: 'The style to apply when no rules above match',
|
||||||
editor: StyleEditor,
|
editor: StyleEditor,
|
||||||
settings: {
|
settings: {
|
||||||
@ -180,7 +180,7 @@ export const geojsonLayer: MapLayerRegistryItem<GeoJSONMapperConfig> = {
|
|||||||
.addCustomEditor({
|
.addCustomEditor({
|
||||||
id: 'config.rules',
|
id: 'config.rules',
|
||||||
path: 'config.rules',
|
path: 'config.rules',
|
||||||
name: 'Style Rules',
|
name: 'Style rules',
|
||||||
description: 'Apply styles based on feature properties',
|
description: 'Apply styles based on feature properties',
|
||||||
editor: GeomapStyleRulesEditor,
|
editor: GeomapStyleRulesEditor,
|
||||||
settings: {
|
settings: {
|
||||||
|
@ -36,7 +36,7 @@ const defaultOptions: HeatmapConfig = {
|
|||||||
export const heatmapLayer: MapLayerRegistryItem<HeatmapConfig> = {
|
export const heatmapLayer: MapLayerRegistryItem<HeatmapConfig> = {
|
||||||
id: 'heatmap',
|
id: 'heatmap',
|
||||||
name: 'Heatmap',
|
name: 'Heatmap',
|
||||||
description: 'visualizes a heatmap of the data',
|
description: 'Visualizes a heatmap of the data',
|
||||||
isBaseMap: false,
|
isBaseMap: false,
|
||||||
showLocation: true,
|
showLocation: true,
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ export const heatmapLayer: MapLayerRegistryItem<HeatmapConfig> = {
|
|||||||
})
|
})
|
||||||
.addSliderInput({
|
.addSliderInput({
|
||||||
path: 'config.radius',
|
path: 'config.radius',
|
||||||
description: 'configures the size of clusters',
|
description: 'Configures the size of clusters',
|
||||||
name: 'Radius',
|
name: 'Radius',
|
||||||
defaultValue: defaultOptions.radius,
|
defaultValue: defaultOptions.radius,
|
||||||
settings: {
|
settings: {
|
||||||
@ -128,7 +128,7 @@ export const heatmapLayer: MapLayerRegistryItem<HeatmapConfig> = {
|
|||||||
})
|
})
|
||||||
.addSliderInput({
|
.addSliderInput({
|
||||||
path: 'config.blur',
|
path: 'config.blur',
|
||||||
description: 'configures the amount of blur of clusters',
|
description: 'Configures the amount of blur of clusters',
|
||||||
name: 'Blur',
|
name: 'Blur',
|
||||||
defaultValue: defaultOptions.blur,
|
defaultValue: defaultOptions.blur,
|
||||||
settings: {
|
settings: {
|
||||||
|
@ -50,7 +50,7 @@ export const defaultMarkersConfig: MapLayerOptions<MarkersConfig> = {
|
|||||||
export const markersLayer: MapLayerRegistryItem<MarkersConfig> = {
|
export const markersLayer: MapLayerRegistryItem<MarkersConfig> = {
|
||||||
id: MARKERS_LAYER_ID,
|
id: MARKERS_LAYER_ID,
|
||||||
name: 'Markers',
|
name: 'Markers',
|
||||||
description: 'use markers to render each data point',
|
description: 'Use markers to render each data point',
|
||||||
isBaseMap: false,
|
isBaseMap: false,
|
||||||
showLocation: true,
|
showLocation: true,
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ export const markersLayer: MapLayerRegistryItem<MarkersConfig> = {
|
|||||||
.addBooleanSwitch({
|
.addBooleanSwitch({
|
||||||
path: 'config.showLegend',
|
path: 'config.showLegend',
|
||||||
name: 'Show legend',
|
name: 'Show legend',
|
||||||
description: 'Show legend',
|
description: 'Show map legend',
|
||||||
defaultValue: defaultOptions.showLegend,
|
defaultValue: defaultOptions.showLegend,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@ export const plugin = new PanelPlugin<GeomapPanelOptions>(GeomapPanel)
|
|||||||
id: 'view',
|
id: 'view',
|
||||||
path: 'view',
|
path: 'view',
|
||||||
name: 'Initial view', // don't show it
|
name: 'Initial view', // don't show it
|
||||||
description: 'This location will show when the panel first loads',
|
description: 'This location will show when the panel first loads.',
|
||||||
editor: MapViewEditor,
|
editor: MapViewEditor,
|
||||||
defaultValue: defaultView,
|
defaultValue: defaultView,
|
||||||
});
|
});
|
||||||
@ -88,13 +88,14 @@ export const plugin = new PanelPlugin<GeomapPanelOptions>(GeomapPanel)
|
|||||||
.addBooleanSwitch({
|
.addBooleanSwitch({
|
||||||
category,
|
category,
|
||||||
path: 'controls.showZoom',
|
path: 'controls.showZoom',
|
||||||
description: 'show buttons in the upper left',
|
description: 'Show zoom control buttons in the upper left corner',
|
||||||
name: 'Show zoom control',
|
name: 'Show zoom control',
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
})
|
})
|
||||||
.addBooleanSwitch({
|
.addBooleanSwitch({
|
||||||
category,
|
category,
|
||||||
path: 'controls.mouseWheelZoom',
|
path: 'controls.mouseWheelZoom',
|
||||||
|
description: 'Enable zoom control via mouse wheel',
|
||||||
name: 'Mouse wheel zoom',
|
name: 'Mouse wheel zoom',
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
})
|
})
|
||||||
@ -116,7 +117,7 @@ export const plugin = new PanelPlugin<GeomapPanelOptions>(GeomapPanel)
|
|||||||
category,
|
category,
|
||||||
path: 'controls.showDebug',
|
path: 'controls.showDebug',
|
||||||
name: 'Show debug',
|
name: 'Show debug',
|
||||||
description: 'show map info',
|
description: 'Show map info',
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user