The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/docs/sources/packages_api/data/panelplugin.md

5.6 KiB

+++

-----------------------------------------------------------------------

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

export declare class PanelPlugin<TOptions = any> extends GrafanaPlugin<PanelPluginMeta> 

Import

import { PanelPlugin } from '@grafana/data';

Constructors

Constructor Modifiers Description
constructor(panel) Constructs a new instance of the PanelPlugin class

Properties

Property Modifiers Type Description
angularPanelCtrl any Legacy angular ctrl. If this exists it will be used instead of the panel
customFieldConfigs FieldConfigEditorRegistry
defaults TOptions
editor ComponentClass<PanelEditorProps<TOptions>>
noPadding boolean
onPanelMigration PanelMigrationHandler<TOptions>
onPanelTypeChanged PanelTypeChangedHandler<TOptions>
panel ComponentType<PanelProps<TOptions>>

Methods

Method Modifiers Description
setCustomFieldConfigs(registry)
setDefaults(defaults)
setEditor(editor)
setMigrationHandler(handler) 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()
setPanelChangeHandler(handler) 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

constructor(panel: ComponentType<PanelProps<TOptions>>);

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

angularPanelCtrl?: any;

customFieldConfigs property

Signature

customFieldConfigs?: FieldConfigEditorRegistry;

defaults property

Signature

defaults?: TOptions;

editor property

Signature

editor?: ComponentClass<PanelEditorProps<TOptions>>;

noPadding property

Signature

noPadding?: boolean;

onPanelMigration property

Signature

onPanelMigration?: PanelMigrationHandler<TOptions>;

onPanelTypeChanged property

Signature

onPanelTypeChanged?: PanelTypeChangedHandler<TOptions>;

panel property

Signature

panel: ComponentType<PanelProps<TOptions>>;

setCustomFieldConfigs method

Signature

setCustomFieldConfigs(registry: FieldConfigEditorRegistry): this;

Parameters

Parameter Type Description
registry FieldConfigEditorRegistry

Returns:

this

setDefaults method

Signature

setDefaults(defaults: TOptions): this;

Parameters

Parameter Type Description
defaults TOptions

Returns:

this

setEditor method

Signature

setEditor(editor: ComponentClass<PanelEditorProps<TOptions>>): 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

setMigrationHandler(handler: PanelMigrationHandler): this;

Parameters

Parameter Type Description
handler PanelMigrationHandler

Returns:

this

setNoPadding method

Signature

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

setPanelChangeHandler(handler: PanelTypeChangedHandler): this;

Parameters

Parameter Type Description
handler PanelTypeChangedHandler

Returns:

this