Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Enterprise Open source

PanelOptionsEditorConfig interface

Signature

typescript
export interface PanelOptionsEditorConfig<TOptions, TSettings = any, TValue = any> 

Import

typescript
import { PanelOptionsEditorConfig } from '@grafana/data';

Properties

PropertyTypeDescription
categorystring[]Array of strings representing category of the option. First element in the array will make option render as collapsible section.
defaultValueTValue
descriptionstringDescription of the option. Will be displayed in the UI as form element description.
namestringName of the option. Will be displayed in the UI as form element label.
path(keyof TOptions & string) | stringPath of the option property to control.
settingsTSettingsal Custom settings of the editor.
showIf(currentConfig: TOptions) => boolean | undefinedFunction that enables configuration of when option editor should be shown based on current panel option properties.

category property

Array of strings representing category of the option. First element in the array will make option render as collapsible section.

Signature

typescript
category?: string[];

defaultValue property

Signature

typescript
defaultValue?: TValue;

description property

Description of the option. Will be displayed in the UI as form element description.

Signature

typescript
description?: string;

name property

Name of the option. Will be displayed in the UI as form element label.

Signature

typescript
name: string;

path property

Path of the option property to control.

Signature

typescript
path: (keyof TOptions & string) | string;

Example

Given options object of a type:

ts
interface Options {
  a: {
    b: string;
  }
}

path can be either ‘a’ or ‘a.b’.

settings property

al Custom settings of the editor.

Signature

typescript
settings?: TSettings;

showIf property

Function that enables configuration of when option editor should be shown based on current panel option properties.

Signature

typescript
showIf?: (currentConfig: TOptions) => boolean | undefined;