+++ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- title = "PanelPlugin" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ ## PanelPlugin class Signature ```typescript export declare class PanelPlugin extends GrafanaPlugin ``` Import ```typescript import { PanelPlugin } from '@grafana/data'; ``` Constructors | Constructor | Modifiers | Description | | --- | --- | --- | | [constructor(panel)](#constructor-panel) | | Constructs a new instance of the PanelPlugin class | Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [angularPanelCtrl](#angularpanelctrl-property) | | any | Legacy angular ctrl. If this exists it will be used instead of the panel | | [customFieldConfigs](#customfieldconfigs-property) | | FieldConfigEditorRegistry | | | [defaults](#defaults-property) | | TOptions | | | [editor](#editor-property) | | ComponentClass<PanelEditorProps<TOptions>> | | | [noPadding](#nopadding-property) | | boolean | | | [onPanelMigration](#onpanelmigration-property) | | PanelMigrationHandler<TOptions> | | | [onPanelTypeChanged](#onpaneltypechanged-property) | | PanelTypeChangedHandler<TOptions> | | | [panel](#panel-property) | | ComponentType<PanelProps<TOptions>> | | Methods | Method | Modifiers | Description | | --- | --- | --- | | [setCustomFieldConfigs(registry)](#setcustomfieldconfigs-method) | | | | [setDefaults(defaults)](#setdefaults-method) | | | | [setEditor(editor)](#seteditor-method) | | | | [setMigrationHandler(handler)](#setmigrationhandler-method) | | This function is called before the panel first loads if the current version is different than the version that was saved.This is a good place to support any changes to the options model | | [setNoPadding()](#setnopadding-method) | | | | [setPanelChangeHandler(handler)](#setpanelchangehandler-method) | | This function is called when the visualization was changed. This passes in the options that were used in the previous visualization | ### constructor(panel) Constructs a new instance of the `PanelPlugin` class Signature ```typescript constructor(panel: ComponentType>); ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | panel | ComponentType<PanelProps<TOptions>> | | ### angularPanelCtrl property Legacy angular ctrl. If this exists it will be used instead of the panel Signature ```typescript angularPanelCtrl?: any; ``` ### customFieldConfigs property Signature ```typescript customFieldConfigs?: FieldConfigEditorRegistry; ``` ### defaults property Signature ```typescript defaults?: TOptions; ``` ### editor property Signature ```typescript editor?: ComponentClass>; ``` ### noPadding property Signature ```typescript noPadding?: boolean; ``` ### onPanelMigration property Signature ```typescript onPanelMigration?: PanelMigrationHandler; ``` ### onPanelTypeChanged property Signature ```typescript onPanelTypeChanged?: PanelTypeChangedHandler; ``` ### panel property Signature ```typescript panel: ComponentType>; ``` ### setCustomFieldConfigs method Signature ```typescript setCustomFieldConfigs(registry: FieldConfigEditorRegistry): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | registry | FieldConfigEditorRegistry | | Returns: `this` ### setDefaults method Signature ```typescript setDefaults(defaults: TOptions): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | defaults | TOptions | | Returns: `this` ### setEditor method Signature ```typescript setEditor(editor: ComponentClass>): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | editor | ComponentClass<PanelEditorProps<TOptions>> | | Returns: `this` ### setMigrationHandler method This function is called before the panel first loads if the current version is different than the version that was saved. This is a good place to support any changes to the options model Signature ```typescript setMigrationHandler(handler: PanelMigrationHandler): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | handler | PanelMigrationHandler | | Returns: `this` ### setNoPadding method Signature ```typescript setNoPadding(): this; ``` Returns: `this` ### setPanelChangeHandler method This function is called when the visualization was changed. This passes in the options that were used in the previous visualization Signature ```typescript setPanelChangeHandler(handler: PanelTypeChangedHandler): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | handler | PanelTypeChangedHandler | | Returns: `this`