From 4ee894b0bea4306bc171a16c0cc5f15fd799b414 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Tue, 9 May 2023 14:29:52 -0700 Subject: [PATCH] Heatmap: Fix log scale editor (#68132) --- packages/grafana-ui/src/options/builder/axis.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/options/builder/axis.tsx b/packages/grafana-ui/src/options/builder/axis.tsx index 6b940e0736c..2a728eff2e7 100644 --- a/packages/grafana-ui/src/options/builder/axis.tsx +++ b/packages/grafana-ui/src/options/builder/axis.tsx @@ -150,6 +150,7 @@ const LOG_DISTRIBUTION_OPTIONS: Array> = [ */ export const ScaleDistributionEditor = ({ value, onChange }: StandardEditorProps) => { const type = value?.type ?? ScaleDistribution.Linear; + const log = value?.log ?? 2; return ( <>
@@ -160,7 +161,7 @@ export const ScaleDistributionEditor = ({ value, onChange }: StandardEditorProps onChange({ ...value, type: v!, - log: v === ScaleDistribution.Linear ? undefined : value.log ?? 2, + log: v === ScaleDistribution.Linear ? undefined : log, }); }} /> @@ -169,7 +170,7 @@ export const ScaleDistributionEditor = ({ value, onChange }: StandardEditorProps { onChange({ ...value,