mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
Heatmap: Fix log scale editor (#68132)
This commit is contained in:
parent
f100a4c680
commit
4ee894b0be
@ -150,6 +150,7 @@ const LOG_DISTRIBUTION_OPTIONS: Array<SelectableValue<number>> = [
|
||||
*/
|
||||
export const ScaleDistributionEditor = ({ value, onChange }: StandardEditorProps<ScaleDistributionConfig>) => {
|
||||
const type = value?.type ?? ScaleDistribution.Linear;
|
||||
const log = value?.log ?? 2;
|
||||
return (
|
||||
<>
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
@ -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
|
||||
<Field label="Log base">
|
||||
<Select
|
||||
options={LOG_DISTRIBUTION_OPTIONS}
|
||||
value={value.log ?? 2}
|
||||
value={log}
|
||||
onChange={(v) => {
|
||||
onChange({
|
||||
...value,
|
||||
@ -183,7 +184,7 @@ export const ScaleDistributionEditor = ({ value, onChange }: StandardEditorProps
|
||||
<Field label="Linear threshold">
|
||||
<Input
|
||||
placeholder="1"
|
||||
value={value.linearThreshold}
|
||||
value={value?.linearThreshold}
|
||||
onChange={(v) => {
|
||||
onChange({
|
||||
...value,
|
||||
|
Loading…
Reference in New Issue
Block a user