kindsys: Adapt to new PanelCfg schema interface (#65297)

* kindsys: Adapt to new PanelCfg schema interface

* building locally

* Remove Panel prefix in cue files

* Regenerate

* Update imports

* fixup! Merge branch 'remove-panel-prefix' into sdboyer/redundant-panelcfg-prefixes

* Fix formatting

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Tania B <yalyna.ts@gmail.com>
This commit is contained in:
sam boyer 2023-05-15 23:07:54 -04:00 committed by GitHub
parent 5a5860256f
commit 33fd83f7e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
202 changed files with 618 additions and 617 deletions

View File

@ -14,10 +14,10 @@ title: AlertGroupsPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |-----------|--------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|---------|----------|---------|-------------------------------------------------------------| |----------------|---------|----------|---------|-------------------------------------------------------------|

View File

@ -14,10 +14,10 @@ title: AnnotationsListPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |-----------|--------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|-------------------------|----------|----------|---------|-------------| |-------------------------|----------|----------|---------|-------------|

View File

@ -14,11 +14,11 @@ title: BarChartPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|-----------------------------|----------|---------|-------------| |---------------|------------------------|----------|---------|-------------|
| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | | | `FieldConfig` | [object](#fieldconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelFieldConfig ### FieldConfig
It extends [AxisConfig](#axisconfig) and [HideableFieldConfig](#hideablefieldconfig). It extends [AxisConfig](#axisconfig) and [HideableFieldConfig](#hideablefieldconfig).
@ -91,7 +91,7 @@ TODO docs
|------------|---------------------------------------|----------|---------|-------------| |------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs | | `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### PanelOptions ### Options
It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTextFormatting](#optionswithtextformatting). It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTextFormatting](#optionswithtextformatting).

View File

@ -14,10 +14,10 @@ title: BarGaugePanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |-----------|--------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelOptions ### Options
It extends [SingleStatBaseOptions](#singlestatbaseoptions). It extends [SingleStatBaseOptions](#singlestatbaseoptions).

View File

@ -14,10 +14,10 @@ title: DashboardListPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |-----------|--------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------------|----------|----------|---------|-------------| |----------------------|----------|----------|---------|-------------|

View File

@ -14,10 +14,10 @@ title: DatagridPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |-----------|--------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|------------------|---------|----------|---------|-----------------------------------| |------------------|---------|----------|---------|-----------------------------------|

View File

@ -16,10 +16,10 @@ title: DebugPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|---------------------------------------------------------------------------| |----------------|-------------------------|----------|---------|---------------------------------------------------------------------------|
| `DebugMode` | string | **Yes** | | Possible values are: `render`, `events`, `cursor`, `State`, `ThrowError`. | | `DebugMode` | string | **Yes** | | Possible values are: `render`, `events`, `cursor`, `State`, `ThrowError`. |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
| `UpdateConfig` | [object](#updateconfig) | **Yes** | | | | `UpdateConfig` | [object](#updateconfig) | **Yes** | | |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|------------|-------------------------------|----------|---------|---------------------------------------------------------------------------| |------------|-------------------------------|----------|---------|---------------------------------------------------------------------------|

View File

@ -14,10 +14,10 @@ title: GaugePanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |-----------|--------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelOptions ### Options
It extends [SingleStatBaseOptions](#singlestatbaseoptions). It extends [SingleStatBaseOptions](#singlestatbaseoptions).

View File

@ -18,7 +18,7 @@ title: GeomapPanelCfg kind
| `ControlsOptions` | [object](#controlsoptions) | **Yes** | | | | `ControlsOptions` | [object](#controlsoptions) | **Yes** | | |
| `MapCenterID` | string | **Yes** | | Possible values are: `zero`, `coords`, `fit`. | | `MapCenterID` | string | **Yes** | | Possible values are: `zero`, `coords`, `fit`. |
| `MapViewConfig` | [object](#mapviewconfig) | **Yes** | | | | `MapViewConfig` | [object](#mapviewconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
| `TooltipMode` | string | **Yes** | | Possible values are: `none`, `details`. | | `TooltipMode` | string | **Yes** | | Possible values are: `none`, `details`. |
| `TooltipOptions` | [object](#tooltipoptions) | **Yes** | | | | `TooltipOptions` | [object](#tooltipoptions) | **Yes** | | |
@ -49,7 +49,7 @@ title: GeomapPanelCfg kind
| `shared` | boolean | No | | | | `shared` | boolean | No | | |
| `zoom` | int64 | No | `1` | | | `zoom` | int64 | No | `1` | |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|------------|---------------------------------------|----------|---------|-------------| |------------|---------------------------------------|----------|---------|-------------|

View File

@ -17,14 +17,14 @@ title: HeatmapPanelCfg kind
|-----------------------|--------------------------------|----------|---------|-------------------------------------------------------------------------------------------| |-----------------------|--------------------------------|----------|---------|-------------------------------------------------------------------------------------------|
| `CellValues` | [object](#cellvalues) | **Yes** | | Controls cell value options | | `CellValues` | [object](#cellvalues) | **Yes** | | Controls cell value options |
| `ExemplarConfig` | [object](#exemplarconfig) | **Yes** | | Controls exemplar options | | `ExemplarConfig` | [object](#exemplarconfig) | **Yes** | | Controls exemplar options |
| `FieldConfig` | [object](#fieldconfig) | **Yes** | | |
| `FilterValueRange` | [object](#filtervaluerange) | **Yes** | | Controls the value filter range | | `FilterValueRange` | [object](#filtervaluerange) | **Yes** | | Controls the value filter range |
| `HeatmapColorMode` | string | **Yes** | | Controls the color mode of the heatmap<br/>Possible values are: `opacity`, `scheme`. | | `HeatmapColorMode` | string | **Yes** | | Controls the color mode of the heatmap<br/>Possible values are: `opacity`, `scheme`. |
| `HeatmapColorOptions` | [object](#heatmapcoloroptions) | **Yes** | | Controls various color options | | `HeatmapColorOptions` | [object](#heatmapcoloroptions) | **Yes** | | Controls various color options |
| `HeatmapColorScale` | string | **Yes** | | Controls the color scale of the heatmap<br/>Possible values are: `linear`, `exponential`. | | `HeatmapColorScale` | string | **Yes** | | Controls the color scale of the heatmap<br/>Possible values are: `linear`, `exponential`. |
| `HeatmapLegend` | [object](#heatmaplegend) | **Yes** | | Controls legend options | | `HeatmapLegend` | [object](#heatmaplegend) | **Yes** | | Controls legend options |
| `HeatmapTooltip` | [object](#heatmaptooltip) | **Yes** | | Controls tooltip options | | `HeatmapTooltip` | [object](#heatmaptooltip) | **Yes** | | Controls tooltip options |
| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | |
| `RowsHeatmapOptions` | [object](#rowsheatmapoptions) | **Yes** | | Controls frame rows options | | `RowsHeatmapOptions` | [object](#rowsheatmapoptions) | **Yes** | | Controls frame rows options |
| `YAxisConfig` | [object](#yaxisconfig) | **Yes** | | Configuration options for the yAxis | | `YAxisConfig` | [object](#yaxisconfig) | **Yes** | | Configuration options for the yAxis |
@ -45,6 +45,43 @@ Controls exemplar options
|----------|--------|----------|---------|----------------------------------------| |----------|--------|----------|---------|----------------------------------------|
| `color` | string | **Yes** | | Sets the color of the exemplar markers | | `color` | string | **Yes** | | Sets the color of the exemplar markers |
### FieldConfig
It extends [HideableFieldConfig](#hideablefieldconfig).
| Property | Type | Required | Default | Description |
|---------------------|-----------------------------------------------------|----------|---------|------------------------------------------------------------------------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | *(Inherited from [HideableFieldConfig](#hideablefieldconfig))*<br/>TODO docs |
| `scaleDistribution` | [ScaleDistributionConfig](#scaledistributionconfig) | No | | TODO docs |
### HideSeriesConfig
TODO docs
| Property | Type | Required | Default | Description |
|-----------|---------|----------|---------|-------------|
| `legend` | boolean | **Yes** | | |
| `tooltip` | boolean | **Yes** | | |
| `viz` | boolean | **Yes** | | |
### HideableFieldConfig
TODO docs
| Property | Type | Required | Default | Description |
|------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### ScaleDistributionConfig
TODO docs
| Property | Type | Required | Default | Description |
|-------------------|--------|----------|---------|--------------------------------------------------------------------------|
| `type` | string | **Yes** | | TODO docs<br/>Possible values are: `linear`, `log`, `ordinal`, `symlog`. |
| `linearThreshold` | number | No | | |
| `log` | number | No | | |
### FilterValueRange ### FilterValueRange
Controls the value filter range Controls the value filter range
@ -87,44 +124,7 @@ Controls tooltip options
| `show` | boolean | **Yes** | | Controls if the tooltip is shown | | `show` | boolean | **Yes** | | Controls if the tooltip is shown |
| `yHistogram` | boolean | No | | Controls if the tooltip shows a histogram of the y-axis values | | `yHistogram` | boolean | No | | Controls if the tooltip shows a histogram of the y-axis values |
### PanelFieldConfig ### Options
It extends [HideableFieldConfig](#hideablefieldconfig).
| Property | Type | Required | Default | Description |
|---------------------|-----------------------------------------------------|----------|---------|------------------------------------------------------------------------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | *(Inherited from [HideableFieldConfig](#hideablefieldconfig))*<br/>TODO docs |
| `scaleDistribution` | [ScaleDistributionConfig](#scaledistributionconfig) | No | | TODO docs |
### HideSeriesConfig
TODO docs
| Property | Type | Required | Default | Description |
|-----------|---------|----------|---------|-------------|
| `legend` | boolean | **Yes** | | |
| `tooltip` | boolean | **Yes** | | |
| `viz` | boolean | **Yes** | | |
### HideableFieldConfig
TODO docs
| Property | Type | Required | Default | Description |
|------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### ScaleDistributionConfig
TODO docs
| Property | Type | Required | Default | Description |
|-------------------|--------|----------|---------|--------------------------------------------------------------------------|
| `type` | string | **Yes** | | TODO docs<br/>Possible values are: `linear`, `log`, `ordinal`, `symlog`. |
| `linearThreshold` | number | No | | |
| `log` | number | No | | |
### PanelOptions
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|---------------------------------------------------------|----------|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |----------------|---------------------------------------------------------|----------|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

View File

@ -14,11 +14,11 @@ title: HistogramPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|-----------------------------|----------|---------|-------------| |---------------|------------------------|----------|---------|-------------|
| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | | | `FieldConfig` | [object](#fieldconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelFieldConfig ### FieldConfig
It extends [AxisConfig](#axisconfig) and [HideableFieldConfig](#hideablefieldconfig). It extends [AxisConfig](#axisconfig) and [HideableFieldConfig](#hideablefieldconfig).
@ -82,7 +82,7 @@ TODO docs
|------------|---------------------------------------|----------|---------|-------------| |------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs | | `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### PanelOptions ### Options
It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip). It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip).

View File

@ -14,10 +14,10 @@ title: LogsPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |-----------|--------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------------|---------|----------|---------|---------------------------------------------------------------| |----------------------|---------|----------|---------|---------------------------------------------------------------|

View File

@ -14,10 +14,10 @@ title: NewsPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |-----------|--------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|-------------|---------|----------|---------|--------------------------------------------| |-------------|---------|----------|---------|--------------------------------------------|

View File

@ -14,11 +14,11 @@ title: NodeGraphPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |---------------|------------------------|----------|---------|-------------|
| `ArcOption` | [object](#arcoption) | **Yes** | | | | `ArcOption` | [object](#arcoption) | **Yes** | | |
| `EdgeOptions` | [object](#edgeoptions) | **Yes** | | | | `EdgeOptions` | [object](#edgeoptions) | **Yes** | | |
| `NodeOptions` | [object](#nodeoptions) | **Yes** | | | | `NodeOptions` | [object](#nodeoptions) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### ArcOption ### ArcOption
@ -42,7 +42,7 @@ title: NodeGraphPanelCfg kind
| `mainStatUnit` | string | No | | Unit for the main stat to override what ever is set in the data frame. | | `mainStatUnit` | string | No | | Unit for the main stat to override what ever is set in the data frame. |
| `secondaryStatUnit` | string | No | | Unit for the secondary stat to override what ever is set in the data frame. | | `secondaryStatUnit` | string | No | | Unit for the secondary stat to override what ever is set in the data frame. |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------|-----------------------------|----------|---------|-------------| |----------|-----------------------------|----------|---------|-------------|

View File

@ -15,8 +15,8 @@ title: PieChartPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|-------------------------|---------------------------------------------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |-------------------------|---------------------------------------------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `PanelFieldConfig` | [HideableFieldConfig](#hideablefieldconfig) | **Yes** | | TODO docs | | `FieldConfig` | [HideableFieldConfig](#hideablefieldconfig) | **Yes** | | TODO docs |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
| `PieChartLabels` | string | **Yes** | | Select labels to display on the pie chart.<br/> - Name - The series or field name.<br/> - Percent - The percentage of the whole.<br/> - Value - The raw numerical value.<br/>Possible values are: `name`, `value`, `percent`. | | `PieChartLabels` | string | **Yes** | | Select labels to display on the pie chart.<br/> - Name - The series or field name.<br/> - Percent - The percentage of the whole.<br/> - Value - The raw numerical value.<br/>Possible values are: `name`, `value`, `percent`. |
| `PieChartLegendOptions` | [object](#piechartlegendoptions) | **Yes** | | | | `PieChartLegendOptions` | [object](#piechartlegendoptions) | **Yes** | | |
| `PieChartLegendValues` | string | **Yes** | | Select values to display in the legend.<br/> - Percent: The percentage of the whole.<br/> - Value: The raw numerical value.<br/>Possible values are: `value`, `percent`. | | `PieChartLegendValues` | string | **Yes** | | Select values to display in the legend.<br/> - Percent: The percentage of the whole.<br/> - Value: The raw numerical value.<br/>Possible values are: `value`, `percent`. |
@ -40,7 +40,7 @@ TODO docs
| `tooltip` | boolean | **Yes** | | | | `tooltip` | boolean | **Yes** | | |
| `viz` | boolean | **Yes** | | | | `viz` | boolean | **Yes** | | |
### PanelOptions ### Options
It extends [OptionsWithTooltip](#optionswithtooltip) and [SingleStatBaseOptions](#singlestatbaseoptions). It extends [OptionsWithTooltip](#optionswithtooltip) and [SingleStatBaseOptions](#singlestatbaseoptions).

View File

@ -14,11 +14,11 @@ title: StateTimelinePanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|-----------------------------|----------|---------|-------------| |---------------|------------------------|----------|---------|-------------|
| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | | | `FieldConfig` | [object](#fieldconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelFieldConfig ### FieldConfig
It extends [HideableFieldConfig](#hideablefieldconfig). It extends [HideableFieldConfig](#hideablefieldconfig).
@ -46,7 +46,7 @@ TODO docs
|------------|---------------------------------------|----------|---------|-------------| |------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs | | `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### PanelOptions ### Options
It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTimezones](#optionswithtimezones). It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTimezones](#optionswithtimezones).

View File

@ -14,10 +14,10 @@ title: StatPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |-----------|--------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelOptions ### Options
It extends [SingleStatBaseOptions](#singlestatbaseoptions). It extends [SingleStatBaseOptions](#singlestatbaseoptions).

View File

@ -14,11 +14,11 @@ title: StatusHistoryPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|-----------------------------|----------|---------|-------------| |---------------|------------------------|----------|---------|-------------|
| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | | | `FieldConfig` | [object](#fieldconfig) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelFieldConfig ### FieldConfig
It extends [HideableFieldConfig](#hideablefieldconfig). It extends [HideableFieldConfig](#hideablefieldconfig).
@ -46,7 +46,7 @@ TODO docs
|------------|---------------------------------------|----------|---------|-------------| |------------|---------------------------------------|----------|---------|-------------|
| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs | | `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs |
### PanelOptions ### Options
It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTimezones](#optionswithtimezones). It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTimezones](#optionswithtimezones).

View File

@ -14,10 +14,10 @@ title: TablePanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|---------|-------------| |-----------|--------------------|----------|---------|-------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|-----------------|---------------------------------------------------|----------|----------------------------------------------|--------------------------------------------------------------------| |-----------------|---------------------------------------------------|----------|----------------------------------------------|--------------------------------------------------------------------|

View File

@ -14,10 +14,10 @@ title: TextPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|----------------|-------------------------|----------|-------------|---------------------------------------------------------------------------------------------------------| |----------------|------------------------|----------|-------------|---------------------------------------------------------------------------------------------------------|
| `CodeLanguage` | string | **Yes** | `plaintext` | Possible values are: `plaintext`, `yaml`, `xml`, `typescript`, `sql`, `go`, `markdown`, `html`, `json`. | | `CodeLanguage` | string | **Yes** | `plaintext` | Possible values are: `plaintext`, `yaml`, `xml`, `typescript`, `sql`, `go`, `markdown`, `html`, `json`. |
| `CodeOptions` | [object](#codeoptions) | **Yes** | | | | `CodeOptions` | [object](#codeoptions) | **Yes** | | |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
| `TextMode` | string | **Yes** | | Possible values are: `html`, `markdown`, `code`. | | `TextMode` | string | **Yes** | | Possible values are: `html`, `markdown`, `code`. |
### CodeOptions ### CodeOptions
@ -28,7 +28,7 @@ title: TextPanelCfg kind
| `showLineNumbers` | boolean | **Yes** | `false` | | | `showLineNumbers` | boolean | **Yes** | `false` | |
| `showMiniMap` | boolean | **Yes** | `false` | | | `showMiniMap` | boolean | **Yes** | `false` | |
### PanelOptions ### Options
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|-----------|-----------------------------|----------|--------------------------------------------------------------------------------|--------------------------------------------------| |-----------|-----------------------------|----------|--------------------------------------------------------------------------------|--------------------------------------------------|

View File

@ -14,9 +14,9 @@ title: TimeSeriesPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|---------------------------------------|----------|---------|-------------| |---------------|---------------------------------------|----------|---------|-------------|
| `PanelFieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs | | `FieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
### GraphFieldConfig ### GraphFieldConfig
@ -178,7 +178,7 @@ TODO docs
| `group` | string | No | | | | `group` | string | No | | |
| `mode` | string | No | | TODO docs<br/>Possible values are: `none`, `normal`, `percent`. | | `mode` | string | No | | TODO docs<br/>Possible values are: `none`, `normal`, `percent`. |
### PanelOptions ### Options
It extends [OptionsWithTimezones](#optionswithtimezones). It extends [OptionsWithTimezones](#optionswithtimezones).

View File

@ -14,9 +14,9 @@ title: TrendPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|---------------------------------------|----------|---------|----------------------------------------------------------------------| |---------------|---------------------------------------|----------|---------|----------------------------------------------------------------------|
| `PanelFieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs | | `FieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs |
| `PanelOptions` | [object](#paneloptions) | **Yes** | | Identical to timeseries... except it does not have timezone settings | | `Options` | [object](#options) | **Yes** | | Identical to timeseries... except it does not have timezone settings |
### GraphFieldConfig ### GraphFieldConfig
@ -178,7 +178,7 @@ TODO docs
| `group` | string | No | | | | `group` | string | No | | |
| `mode` | string | No | | TODO docs<br/>Possible values are: `none`, `normal`, `percent`. | | `mode` | string | No | | TODO docs<br/>Possible values are: `none`, `normal`, `percent`. |
### PanelOptions ### Options
Identical to timeseries... except it does not have timezone settings Identical to timeseries... except it does not have timezone settings

View File

@ -15,14 +15,14 @@ title: XYChartPanelCfg kind
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|-----------------------|--------------------------------|----------|---------|---------------------------------------------------------| |-----------------------|--------------------------------|----------|---------|---------------------------------------------------------|
| `PanelOptions` | [object](#paneloptions) | **Yes** | | | | `Options` | [object](#options) | **Yes** | | |
| `ScatterFieldConfig` | [object](#scatterfieldconfig) | **Yes** | | | | `ScatterFieldConfig` | [object](#scatterfieldconfig) | **Yes** | | |
| `ScatterSeriesConfig` | [object](#scatterseriesconfig) | **Yes** | | | | `ScatterSeriesConfig` | [object](#scatterseriesconfig) | **Yes** | | |
| `ScatterShow` | string | **Yes** | | Possible values are: `points`, `lines`, `points+lines`. | | `ScatterShow` | string | **Yes** | | Possible values are: `points`, `lines`, `points+lines`. |
| `SeriesMapping` | string | **Yes** | | Possible values are: `auto`, `manual`. | | `SeriesMapping` | string | **Yes** | | Possible values are: `auto`, `manual`. |
| `XYDimensionConfig` | [object](#xydimensionconfig) | **Yes** | | | | `XYDimensionConfig` | [object](#xydimensionconfig) | **Yes** | | |
### PanelOptions ### Options
It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip). It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip).

View File

@ -215,7 +215,7 @@ TODO docs
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | | TODO docs | | `color` | [FieldColor](#fieldcolor) | No | | TODO docs |
| `custom` | [object](#custom) | No | | custom is specified by the PanelFieldConfig field<br/>in panel plugin schemas. | | `custom` | [object](#custom) | No | | custom is specified by the FieldConfig field<br/>in panel plugin schemas. |
| `decimals` | number | No | | Significant digits (for display) | | `decimals` | number | No | | Significant digits (for display) |
| `description` | string | No | | Human readable field metadata | | `description` | string | No | | Human readable field metadata |
| `displayNameFromDS` | string | No | | This can be used by data sources that return and explicit naming structure for values and labels<br/>When this property is configured, this value is used rather than the default naming strategy. | | `displayNameFromDS` | string | No | | This can be used by data sources that return and explicit naming structure for values and labels<br/>When this property is configured, this value is used rather than the default naming strategy. |
@ -339,7 +339,7 @@ TODO docs
### Custom ### Custom
custom is specified by the PanelFieldConfig field custom is specified by the FieldConfig field
in panel plugin schemas. in panel plugin schemas.
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
@ -410,7 +410,7 @@ schema; they do not evolve independently.
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|-------------------|---------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------| |-------------------|---------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | | | `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | |
| `options` | [object](#options) | **Yes** | | options is specified by the PanelOptions field in panel<br/>plugin schemas. | | `options` | [object](#options) | **Yes** | | options is specified by the Options field in panel<br/>plugin schemas. |
| `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. | | `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | | | `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | |
| `transparent` | boolean | **Yes** | `false` | Whether to display the panel without a background. | | `transparent` | boolean | **Yes** | `false` | Whether to display the panel without a background. |
@ -446,7 +446,7 @@ schema; they do not evolve independently.
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | | TODO docs | | `color` | [FieldColor](#fieldcolor) | No | | TODO docs |
| `custom` | [custom](#custom) | No | | custom is specified by the PanelFieldConfig field<br/>in panel plugin schemas. | | `custom` | [custom](#custom) | No | | custom is specified by the FieldConfig field<br/>in panel plugin schemas. |
| `decimals` | number | No | | Significant digits (for display) | | `decimals` | number | No | | Significant digits (for display) |
| `description` | string | No | | Human readable field metadata | | `description` | string | No | | Human readable field metadata |
| `displayNameFromDS` | string | No | | This can be used by data sources that return and explicit naming structure for values and labels<br/>When this property is configured, this value is used rather than the default naming strategy. | | `displayNameFromDS` | string | No | | This can be used by data sources that return and explicit naming structure for values and labels<br/>When this property is configured, this value is used rather than the default naming strategy. |
@ -513,7 +513,7 @@ The datasource used in all targets.
### Options ### Options
options is specified by the PanelOptions field in panel options is specified by the Options field in panel
plugin schemas. plugin schemas.
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
@ -567,7 +567,7 @@ schema; they do not evolve independently.
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|-------------------|---------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------| |-------------------|---------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | | | `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | |
| `options` | [options](#options) | **Yes** | | options is specified by the PanelOptions field in panel<br/>plugin schemas. | | `options` | [options](#options) | **Yes** | | options is specified by the Options field in panel<br/>plugin schemas. |
| `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. | | `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | | | `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | |
| `transparent` | boolean | **Yes** | `false` | Whether to display the panel without a background. | | `transparent` | boolean | **Yes** | `false` | Whether to display the panel without a background. |
@ -663,7 +663,7 @@ TODO this appears to be spread all over in the frontend. Concepts will likely ne
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use | | `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. | | `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields ### AdditionalFields

View File

@ -74,7 +74,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use | | `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. | | `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields ### AdditionalFields

View File

@ -108,7 +108,7 @@ Typescript: Omit<Panel, 'gridPos' | 'id' | 'libraryPanel'>;
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use | | `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. | | `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields ### AdditionalFields

View File

@ -83,7 +83,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use | | `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. | | `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields ### AdditionalFields

View File

@ -83,7 +83,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use | | `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. | | `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields ### AdditionalFields

View File

@ -77,7 +77,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use | | `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. | | `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields ### AdditionalFields

View File

@ -81,7 +81,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use | | `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. | | `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields ### AdditionalFields

View File

@ -78,7 +78,7 @@ extraFields is reserved for any fields that are pulled from the API server metad
| Property | Type | Required | Default | Description | | Property | Type | Required | Default | Description |
|--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `additionalFields` | [object](#additionalfields) | **Yes** | | additionalFields is reserved for future use | | `additionalFields` | [object](#additionalfields) | No | | additionalFields is reserved for future use |
| `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. | | `operatorStates` | map[string][joinSchema.status.#OperatorState](#joinschema.status.#operatorstate) | No | | operatorStates is a map of operator ID to operator state evaluations.<br/>Any operator which consumes this kind SHOULD add its state evaluation information to this field. |
### AdditionalFields ### AdditionalFields

2
go.mod
View File

@ -264,7 +264,7 @@ require (
github.com/grafana/dataplane/examples v0.0.0-20230404174214-4d6fd58a18ad github.com/grafana/dataplane/examples v0.0.0-20230404174214-4d6fd58a18ad
github.com/grafana/dataplane/sdata v0.0.6 github.com/grafana/dataplane/sdata v0.0.6
github.com/grafana/go-mssqldb v0.9.1 github.com/grafana/go-mssqldb v0.9.1
github.com/grafana/kindsys v0.0.0-20230427152021-bb328815be7a github.com/grafana/kindsys v0.0.0-20230508175818-7ad73516220b
github.com/grafana/thema v0.0.0-20230417103609-99b482c479fe github.com/grafana/thema v0.0.0-20230417103609-99b482c479fe
github.com/redis/go-redis/v9 v9.0.2 github.com/redis/go-redis/v9 v9.0.2
github.com/weaveworks/common v0.0.0-20230208133027-16871410fca4 github.com/weaveworks/common v0.0.0-20230208133027-16871410fca4

6
go.sum
View File

@ -1062,8 +1062,14 @@ github.com/grafana/grafana-plugin-sdk-go v0.94.0/go.mod h1:3VXz4nCv6wH5SfgB3mlW3
github.com/grafana/grafana-plugin-sdk-go v0.114.0/go.mod h1:D7x3ah+1d4phNXpbnOaxa/osSaZlwh9/ZUnGGzegRbk= github.com/grafana/grafana-plugin-sdk-go v0.114.0/go.mod h1:D7x3ah+1d4phNXpbnOaxa/osSaZlwh9/ZUnGGzegRbk=
github.com/grafana/grafana-plugin-sdk-go v0.160.0 h1:jELbsqee5kRz9vD1hZeP8+984xMZDU/M6uGv0RhOR34= github.com/grafana/grafana-plugin-sdk-go v0.160.0 h1:jELbsqee5kRz9vD1hZeP8+984xMZDU/M6uGv0RhOR34=
github.com/grafana/grafana-plugin-sdk-go v0.160.0/go.mod h1:dPhljkVno3Bg/ZYafMrR/BfYjtCRJD2hU2719Nl3QzM= github.com/grafana/grafana-plugin-sdk-go v0.160.0/go.mod h1:dPhljkVno3Bg/ZYafMrR/BfYjtCRJD2hU2719Nl3QzM=
github.com/grafana/kindsys v0.0.0-20230323180930-c2a9ced5c751 h1:X5jwaMcpUMQ+xv7fKhs9U+oBxfo2x+x8GpHWybDSgk0=
github.com/grafana/kindsys v0.0.0-20230323180930-c2a9ced5c751/go.mod h1:213a3clTiegHfheYcLPLeEyHv/azK/fAF67OEbzuLzw=
github.com/grafana/kindsys v0.0.0-20230427152021-bb328815be7a h1:i2YhC6eTyDp+7Ftv5c6VZDUQskmKX4oIPGf38qfiZiU= github.com/grafana/kindsys v0.0.0-20230427152021-bb328815be7a h1:i2YhC6eTyDp+7Ftv5c6VZDUQskmKX4oIPGf38qfiZiU=
github.com/grafana/kindsys v0.0.0-20230427152021-bb328815be7a/go.mod h1:GNcfpy5+SY6RVbNGQW264gC0r336Dm+0zgQ5vt6+M8Y= github.com/grafana/kindsys v0.0.0-20230427152021-bb328815be7a/go.mod h1:GNcfpy5+SY6RVbNGQW264gC0r336Dm+0zgQ5vt6+M8Y=
github.com/grafana/kindsys v0.0.0-20230508172648-19fc432f045a h1:L8Qph5iUyVnLGinQzPmtJYUtPDG4TyT6vGDFT9EdCTU=
github.com/grafana/kindsys v0.0.0-20230508172648-19fc432f045a/go.mod h1:GNcfpy5+SY6RVbNGQW264gC0r336Dm+0zgQ5vt6+M8Y=
github.com/grafana/kindsys v0.0.0-20230508175818-7ad73516220b h1:x3gw5zsWZ2vxQ0GYucB2PFQ6eISAoWkba5MrQd8ZK0E=
github.com/grafana/kindsys v0.0.0-20230508175818-7ad73516220b/go.mod h1:GNcfpy5+SY6RVbNGQW264gC0r336Dm+0zgQ5vt6+M8Y=
github.com/grafana/phlare/api v0.1.4-0.20230426005640-f90edba05413 h1:bBzCezZNRyYlJpXTkyZdY4fpPxHZUdyeyRWzhtw/P6I= github.com/grafana/phlare/api v0.1.4-0.20230426005640-f90edba05413 h1:bBzCezZNRyYlJpXTkyZdY4fpPxHZUdyeyRWzhtw/P6I=
github.com/grafana/phlare/api v0.1.4-0.20230426005640-f90edba05413/go.mod h1:IvwuGG9xa/h96UH/exgvsfy3zE+ZpctkNT9o5aaGdrU= github.com/grafana/phlare/api v0.1.4-0.20230426005640-f90edba05413/go.mod h1:IvwuGG9xa/h96UH/exgvsfy3zE+ZpctkNT9o5aaGdrU=
github.com/grafana/prometheus-alertmanager v0.25.1-0.20230508090422-7d5630522a53 h1:X3Jl4PBIGCtlPSMa6Uiu2+3FDNWmddSjivp+1DDznQs= github.com/grafana/prometheus-alertmanager v0.25.1-0.20230508090422-7d5630522a53 h1:X3Jl4PBIGCtlPSMa6Uiu2+3FDNWmddSjivp+1DDznQs=

View File

@ -460,7 +460,7 @@ lineage: seqs: [
// Dynamically load the panel // Dynamically load the panel
libraryPanel?: #LibraryPanelRef libraryPanel?: #LibraryPanelRef
// options is specified by the PanelOptions field in panel // options is specified by the Options field in panel
// plugin schemas. // plugin schemas.
options: {...} @grafanamaturity(NeedsExpertReview) options: {...} @grafanamaturity(NeedsExpertReview)
@ -541,7 +541,7 @@ lineage: seqs: [
// Alternative to empty string // Alternative to empty string
noValue?: string @grafanamaturity(NeedsExpertReview) noValue?: string @grafanamaturity(NeedsExpertReview)
// custom is specified by the PanelFieldConfig field // custom is specified by the FieldConfig field
// in panel plugin schemas. // in panel plugin schemas.
custom?: {...} @grafanamaturity(NeedsExpertReview) custom?: {...} @grafanamaturity(NeedsExpertReview)
} @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview) } @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview)

View File

@ -482,7 +482,7 @@ export interface Panel {
*/ */
maxDataPoints?: number; maxDataPoints?: number;
/** /**
* options is specified by the PanelOptions field in panel * options is specified by the Options field in panel
* plugin schemas. * plugin schemas.
*/ */
options: Record<string, unknown>; options: Record<string, unknown>;
@ -591,7 +591,7 @@ export interface FieldConfig {
*/ */
color?: FieldColor; color?: FieldColor;
/** /**
* custom is specified by the PanelFieldConfig field * custom is specified by the FieldConfig field
* in panel plugin schemas. * in panel plugin schemas.
*/ */
custom?: Record<string, unknown>; custom?: Record<string, unknown>;

View File

@ -279,7 +279,7 @@ type FieldConfig struct {
// TODO docs // TODO docs
Color *FieldColor `json:"color,omitempty"` Color *FieldColor `json:"color,omitempty"`
// custom is specified by the PanelFieldConfig field // custom is specified by the FieldConfig field
// in panel plugin schemas. // in panel plugin schemas.
Custom map[string]interface{} `json:"custom,omitempty"` Custom map[string]interface{} `json:"custom,omitempty"`
@ -422,7 +422,7 @@ type Panel struct {
// TODO docs // TODO docs
MaxDataPoints *float32 `json:"maxDataPoints,omitempty"` MaxDataPoints *float32 `json:"maxDataPoints,omitempty"`
// options is specified by the PanelOptions field in panel // options is specified by the Options field in panel
// plugin schemas. // plugin schemas.
Options map[string]interface{} `json:"options"` Options map[string]interface{} `json:"options"`

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status. // Status defines model for Status.
type Status struct { type Status struct {
// additionalFields is reserved for future use // additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"` AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations. // operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field. // Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status. // Status defines model for Status.
type Status struct { type Status struct {
// additionalFields is reserved for future use // additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"` AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations. // operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field. // Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status. // Status defines model for Status.
type Status struct { type Status struct {
// additionalFields is reserved for future use // additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"` AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations. // operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field. // Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status. // Status defines model for Status.
type Status struct { type Status struct {
// additionalFields is reserved for future use // additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"` AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations. // operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field. // Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status. // Status defines model for Status.
type Status struct { type Status struct {
// additionalFields is reserved for future use // additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"` AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations. // operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field. // Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status. // Status defines model for Status.
type Status struct { type Status struct {
// additionalFields is reserved for future use // additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"` AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations. // operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field. // Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status. // Status defines model for Status.
type Status struct { type Status struct {
// additionalFields is reserved for future use // additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"` AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations. // operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field. // Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -39,7 +39,7 @@ type OperatorStateState string
// Status defines model for Status. // Status defines model for Status.
type Status struct { type Status struct {
// additionalFields is reserved for future use // additionalFields is reserved for future use
AdditionalFields map[string]interface{} `json:"additionalFields"` AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
// operatorStates is a map of operator ID to operator state evaluations. // operatorStates is a map of operator ID to operator state evaluations.
// Any operator which consumes this kind SHOULD add its state evaluation information to this field. // Any operator which consumes this kind SHOULD add its state evaluation information to this field.

View File

@ -14,7 +14,7 @@ composableKinds: PanelCfg: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
foo: string foo: string
} @cuetsy(kind="interface") } @cuetsy(kind="interface")
}, },

View File

@ -6,7 +6,7 @@ composableKinds: PanelCfg: lineage: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
foo: string foo: string
} @cuetsy(kind="interface") } @cuetsy(kind="interface")
}, },

View File

@ -5,18 +5,18 @@ import "github.com/grafana/thema"
composableKinds: PanelCfg: { composableKinds: PanelCfg: {
lineage: { lineage: {
joinSchema: { joinSchema: {
PanelOptions: {...} Options: {...}
PanelFieldConfig: string FieldConfig: string
} }
name: "panel_conflicting_joinschema" name: "panel_conflicting_joinschema"
seqs: [ seqs: [
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
foo: string foo: string
} @cuetsy(kind="interface") } @cuetsy(kind="interface")
PanelFieldConfig: string FieldConfig: string
}, },
] ]
}, },

View File

@ -9,10 +9,10 @@ composableKinds: PanelCfg: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
foo: string foo: string
} @cuetsy(kind="interface") } @cuetsy(kind="interface")
PanelFieldConfig: string FieldConfig: string
}, },
] ]
}, },

View File

@ -5,7 +5,7 @@ composableKinds: PanelCfg: lineage: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
foo: string foo: string
} @cuetsy(kind="interface") } @cuetsy(kind="interface")
}, },

View File

@ -6,8 +6,8 @@ import { VisibilityMode, TimelineValueAlignment } from '@grafana/schema';
import { FIXED_UNIT } from '@grafana/ui/src/components/GraphNG/GraphNG'; import { FIXED_UNIT } from '@grafana/ui/src/components/GraphNG/GraphNG';
import { distribute, SPACE_BETWEEN } from 'app/plugins/panel/barchart/distribute'; import { distribute, SPACE_BETWEEN } from 'app/plugins/panel/barchart/distribute';
import { pointWithin, Quadtree, Rect } from 'app/plugins/panel/barchart/quadtree'; import { pointWithin, Quadtree, Rect } from 'app/plugins/panel/barchart/quadtree';
import { PanelFieldConfig as StateTimeLineFieldConfig } from 'app/plugins/panel/state-timeline/panelcfg.gen'; import { FieldConfig as StateTimeLineFieldConfig } from 'app/plugins/panel/state-timeline/panelcfg.gen';
import { PanelFieldConfig as StatusHistoryFieldConfig } from 'app/plugins/panel/status-history/panelcfg.gen'; import { FieldConfig as StatusHistoryFieldConfig } from 'app/plugins/panel/status-history/panelcfg.gen';
import { TimelineMode } from './utils'; import { TimelineMode } from './utils';

View File

@ -4,7 +4,7 @@ import { RefreshEvent } from '@grafana/runtime';
import { PanelChrome } from '@grafana/ui'; import { PanelChrome } from '@grafana/ui';
import { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel'; import { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel';
import { PanelRenderer } from 'app/features/panel/components/PanelRenderer'; import { PanelRenderer } from 'app/features/panel/components/PanelRenderer';
import { PanelOptions } from 'app/plugins/panel/table/panelcfg.gen'; import { Options } from 'app/plugins/panel/table/panelcfg.gen';
import PanelHeaderCorner from '../../dashgrid/PanelHeader/PanelHeaderCorner'; import PanelHeaderCorner from '../../dashgrid/PanelHeader/PanelHeaderCorner';
import { getTimeSrv } from '../../services/TimeSrv'; import { getTimeSrv } from '../../services/TimeSrv';
@ -21,7 +21,7 @@ export interface Props {
export function PanelEditorTableView({ width, height, panel, dashboard }: Props) { export function PanelEditorTableView({ width, height, panel, dashboard }: Props) {
const { data } = usePanelLatestData(panel, { withTransforms: true, withFieldConfig: false }, false); const { data } = usePanelLatestData(panel, { withTransforms: true, withFieldConfig: false }, false);
const [options, setOptions] = useState<PanelOptions>({ const [options, setOptions] = useState<Options>({
frameIndex: 0, frameIndex: 0,
showHeader: true, showHeader: true,
showTypeIcons: true, showTypeIcons: true,

View File

@ -38,7 +38,7 @@ import {
} from '@grafana/ui'; } from '@grafana/ui';
import { GraphFieldConfig } from 'app/plugins/panel/graph/types'; import { GraphFieldConfig } from 'app/plugins/panel/graph/types';
import { defaultGraphConfig, getGraphFieldConfig } from 'app/plugins/panel/timeseries/config'; import { defaultGraphConfig, getGraphFieldConfig } from 'app/plugins/panel/timeseries/config';
import { PanelOptions as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen'; import { Options as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen';
import { ExploreGraphStyle } from 'app/types'; import { ExploreGraphStyle } from 'app/types';
import { seriesVisibilityConfigFactory } from '../../dashboard/dashgrid/SeriesVisibilityConfigFactory'; import { seriesVisibilityConfigFactory } from '../../dashboard/dashgrid/SeriesVisibilityConfigFactory';

View File

@ -1,8 +1,8 @@
import { VizPanel, VizPanelState } from '@grafana/scenes'; import { VizPanel, VizPanelState } from '@grafana/scenes';
import { GraphFieldConfig, TableFieldOptions } from '@grafana/schema'; import { GraphFieldConfig, TableFieldOptions } from '@grafana/schema';
import { PanelOptions as BarGaugePanelOptions } from 'app/plugins/panel/bargauge/panelcfg.gen'; import { Options as BarGaugePanelOptions } from 'app/plugins/panel/bargauge/panelcfg.gen';
import { PanelOptions as TablePanelOptions } from 'app/plugins/panel/table/panelcfg.gen'; import { Options as TablePanelOptions } from 'app/plugins/panel/table/panelcfg.gen';
import { PanelOptions as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen'; import { Options as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen';
export type TypedVizPanelState<TOptions, TFieldConfig> = Omit< export type TypedVizPanelState<TOptions, TFieldConfig> = Omit<
Partial<VizPanelState<TOptions, TFieldConfig>>, Partial<VizPanelState<TOptions, TFieldConfig>>,

View File

@ -19,7 +19,7 @@ import { DashboardModel } from 'app/features/dashboard/state';
import { configureStore } from 'app/store/configureStore'; import { configureStore } from 'app/store/configureStore';
import { AlertGroupsPanel } from './AlertGroupsPanel'; import { AlertGroupsPanel } from './AlertGroupsPanel';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
jest.mock('app/features/alerting/unified/api/alertmanager'); jest.mock('app/features/alerting/unified/api/alertmanager');
@ -46,13 +46,13 @@ const dataSources = {
}), }),
}; };
const defaultOptions: PanelOptions = { const defaultOptions: Options = {
labels: '', labels: '',
alertmanager: 'Alertmanager', alertmanager: 'Alertmanager',
expandAll: false, expandAll: false,
}; };
const defaultProps: PanelProps<PanelOptions> = { const defaultProps: PanelProps<Options> = {
data: { state: LoadingState.Done, series: [], timeRange: getDefaultTimeRange() }, data: { state: LoadingState.Done, series: [], timeRange: getDefaultTimeRange() },
id: 1, id: 1,
timeRange: getDefaultTimeRange(), timeRange: getDefaultTimeRange(),
@ -79,7 +79,7 @@ const defaultProps: PanelProps<PanelOptions> = {
width: 320, width: 320,
}; };
const renderPanel = (options: PanelOptions = defaultOptions) => { const renderPanel = (options: Options = defaultOptions) => {
const store = configureStore(); const store = configureStore();
const dash = new DashboardModel({ id: 1 } as Dashboard); const dash = new DashboardModel({ id: 1 } as Dashboard);
dash.formatDate = (time: number) => new Date(time).toISOString(); dash.formatDate = (time: number) => new Date(time).toISOString();

View File

@ -12,10 +12,10 @@ import { AlertmanagerGroup, Matcher } from 'app/plugins/datasource/alertmanager/
import { useDispatch } from 'app/types'; import { useDispatch } from 'app/types';
import { AlertGroup } from './AlertGroup'; import { AlertGroup } from './AlertGroup';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
import { useFilteredGroups } from './useFilteredGroups'; import { useFilteredGroups } from './useFilteredGroups';
export const AlertGroupsPanel = (props: PanelProps<PanelOptions>) => { export const AlertGroupsPanel = (props: PanelProps<Options>) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const isAlertingEnabled = config.unifiedAlertingEnabled; const isAlertingEnabled = config.unifiedAlertingEnabled;

View File

@ -8,9 +8,9 @@ import {
} from 'app/features/alerting/unified/utils/datasource'; } from 'app/features/alerting/unified/utils/datasource';
import { AlertGroupsPanel } from './AlertGroupsPanel'; import { AlertGroupsPanel } from './AlertGroupsPanel';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
export const plugin = new PanelPlugin<PanelOptions>(AlertGroupsPanel).setPanelOptions((builder) => { export const plugin = new PanelPlugin<Options>(AlertGroupsPanel).setPanelOptions((builder) => {
return builder return builder
.addCustomEditor({ .addCustomEditor({
name: 'Alertmanager', name: 'Alertmanager',

View File

@ -20,7 +20,7 @@ composableKinds: PanelCfg: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
// Comma-separated list of values used to filter alert results // Comma-separated list of values used to filter alert results
labels: string labels: string
// Name of the alertmanager used as a source for alerts // Name of the alertmanager used as a source for alerts

View File

@ -10,7 +10,7 @@
export const PanelCfgModelVersion = Object.freeze([0, 0]); export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions { export interface Options {
/** /**
* Name of the alertmanager used as a source for alerts * Name of the alertmanager used as a source for alerts
*/ */

View File

@ -10,14 +10,14 @@ import { backendSrv } from '../../../core/services/backend_srv';
import { setDashboardSrv } from '../../../features/dashboard/services/DashboardSrv'; import { setDashboardSrv } from '../../../features/dashboard/services/DashboardSrv';
import { AnnoListPanel, Props } from './AnnoListPanel'; import { AnnoListPanel, Props } from './AnnoListPanel';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
jest.mock('@grafana/runtime', () => ({ jest.mock('@grafana/runtime', () => ({
...jest.requireActual('@grafana/runtime'), ...jest.requireActual('@grafana/runtime'),
getBackendSrv: () => backendSrv, getBackendSrv: () => backendSrv,
})); }));
const defaultOptions: PanelOptions = { const defaultOptions: Options = {
limit: 10, limit: 10,
navigateAfter: '10m', navigateAfter: '10m',
navigateBefore: '10m', navigateBefore: '10m',
@ -49,7 +49,7 @@ const defaultResult: any = {
async function setupTestContext({ async function setupTestContext({
options = defaultOptions, options = defaultOptions,
results = [defaultResult], results = [defaultResult],
}: { options?: PanelOptions; results?: AnnotationEvent[] } = {}) { }: { options?: Options; results?: AnnotationEvent[] } = {}) {
jest.clearAllMocks(); jest.clearAllMocks();
const getMock = jest.spyOn(backendSrv, 'get'); const getMock = jest.spyOn(backendSrv, 'get');

View File

@ -19,7 +19,7 @@ import appEvents from 'app/core/app_events';
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
import { AnnotationListItem } from './AnnotationListItem'; import { AnnotationListItem } from './AnnotationListItem';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
interface UserInfo { interface UserInfo {
id?: number; id?: number;
@ -27,7 +27,7 @@ interface UserInfo {
email?: string; email?: string;
} }
export interface Props extends PanelProps<PanelOptions> {} export interface Props extends PanelProps<Options> {}
interface State { interface State {
annotations: AnnotationEvent[]; annotations: AnnotationEvent[];
timeInfo: string; timeInfo: string;

View File

@ -4,9 +4,9 @@ import React, { MouseEvent } from 'react';
import { AnnotationEvent, DateTimeInput, GrafanaTheme2, PanelProps } from '@grafana/data'; import { AnnotationEvent, DateTimeInput, GrafanaTheme2, PanelProps } from '@grafana/data';
import { Card, TagList, Tooltip, RenderUserContentAsHTML, useStyles2 } from '@grafana/ui'; import { Card, TagList, Tooltip, RenderUserContentAsHTML, useStyles2 } from '@grafana/ui';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
interface Props extends Pick<PanelProps<PanelOptions>, 'options'> { interface Props extends Pick<PanelProps<Options>, 'options'> {
annotation: AnnotationEvent; annotation: AnnotationEvent;
formatDate: (date: DateTimeInput, format?: string) => string; formatDate: (date: DateTimeInput, format?: string) => string;
onClick: (annotation: AnnotationEvent) => void; onClick: (annotation: AnnotationEvent) => void;

View File

@ -4,16 +4,16 @@ import { PanelModel, PanelPlugin } from '@grafana/data';
import { TagsInput } from '@grafana/ui'; import { TagsInput } from '@grafana/ui';
import { AnnoListPanel } from './AnnoListPanel'; import { AnnoListPanel } from './AnnoListPanel';
import { defaultPanelOptions, PanelOptions } from './panelcfg.gen'; import { defaultOptions, Options } from './panelcfg.gen';
export const plugin = new PanelPlugin<PanelOptions>(AnnoListPanel) export const plugin = new PanelPlugin<Options>(AnnoListPanel)
.setPanelOptions((builder) => { .setPanelOptions((builder) => {
builder builder
.addRadio({ .addRadio({
category: ['Annotation query'], category: ['Annotation query'],
path: 'onlyFromThisDashboard', path: 'onlyFromThisDashboard',
name: 'Query filter', name: 'Query filter',
defaultValue: defaultPanelOptions.onlyFromThisDashboard, defaultValue: defaultOptions.onlyFromThisDashboard,
settings: { settings: {
options: [ options: [
{ value: false, label: 'All dashboards' }, { value: false, label: 'All dashboards' },
@ -25,7 +25,7 @@ export const plugin = new PanelPlugin<PanelOptions>(AnnoListPanel)
category: ['Annotation query'], category: ['Annotation query'],
path: 'onlyInTimeRange', path: 'onlyInTimeRange',
name: 'Time range', name: 'Time range',
defaultValue: defaultPanelOptions.onlyInTimeRange, defaultValue: defaultOptions.onlyInTimeRange,
settings: { settings: {
options: [ options: [
{ value: false, label: 'None' }, { value: false, label: 'None' },
@ -47,31 +47,31 @@ export const plugin = new PanelPlugin<PanelOptions>(AnnoListPanel)
category: ['Annotation query'], category: ['Annotation query'],
path: 'limit', path: 'limit',
name: 'Limit', name: 'Limit',
defaultValue: defaultPanelOptions.limit, defaultValue: defaultOptions.limit,
}) })
.addBooleanSwitch({ .addBooleanSwitch({
category: ['Display'], category: ['Display'],
path: 'showUser', path: 'showUser',
name: 'Show user', name: 'Show user',
defaultValue: defaultPanelOptions.showUser, defaultValue: defaultOptions.showUser,
}) })
.addBooleanSwitch({ .addBooleanSwitch({
category: ['Display'], category: ['Display'],
path: 'showTime', path: 'showTime',
name: 'Show time', name: 'Show time',
defaultValue: defaultPanelOptions.showTime, defaultValue: defaultOptions.showTime,
}) })
.addBooleanSwitch({ .addBooleanSwitch({
category: ['Display'], category: ['Display'],
path: 'showTags', path: 'showTags',
name: 'Show tags', name: 'Show tags',
defaultValue: defaultPanelOptions.showTags, defaultValue: defaultOptions.showTags,
}) })
.addRadio({ .addRadio({
category: ['Link behavior'], category: ['Link behavior'],
path: 'navigateToPanel', path: 'navigateToPanel',
name: 'Link target', name: 'Link target',
defaultValue: defaultPanelOptions.navigateToPanel, defaultValue: defaultOptions.navigateToPanel,
settings: { settings: {
options: [ options: [
{ value: true, label: 'Panel' }, { value: true, label: 'Panel' },
@ -83,21 +83,21 @@ export const plugin = new PanelPlugin<PanelOptions>(AnnoListPanel)
category: ['Link behavior'], category: ['Link behavior'],
path: 'navigateBefore', path: 'navigateBefore',
name: 'Time before', name: 'Time before',
defaultValue: defaultPanelOptions.navigateBefore, defaultValue: defaultOptions.navigateBefore,
description: '', description: '',
}) })
.addTextInput({ .addTextInput({
category: ['Link behavior'], category: ['Link behavior'],
path: 'navigateAfter', path: 'navigateAfter',
name: 'Time after', name: 'Time after',
defaultValue: defaultPanelOptions.navigateAfter, defaultValue: defaultOptions.navigateAfter,
description: '', description: '',
}); });
}) })
// TODO, we should support this directly in the plugin infrastructure // TODO, we should support this directly in the plugin infrastructure
.setPanelChangeHandler((panel: PanelModel<PanelOptions>, prevPluginId: string, prevOptions: unknown) => { .setPanelChangeHandler((panel: PanelModel<Options>, prevPluginId: string, prevOptions: unknown) => {
if (prevPluginId === 'ryantxu-annolist-panel') { if (prevPluginId === 'ryantxu-annolist-panel') {
return prevOptions as PanelOptions; return prevOptions as Options;
} }
return panel.options; return panel.options;

View File

@ -22,7 +22,7 @@ composableKinds: PanelCfg: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
onlyFromThisDashboard: bool | *false onlyFromThisDashboard: bool | *false
onlyInTimeRange: bool | *false onlyInTimeRange: bool | *false
tags: [...string] tags: [...string]

View File

@ -10,7 +10,7 @@
export const PanelCfgModelVersion = Object.freeze([0, 0]); export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions { export interface Options {
limit: number; limit: number;
navigateAfter: string; navigateAfter: string;
navigateBefore: string; navigateBefore: string;
@ -23,7 +23,7 @@ export interface PanelOptions {
tags: Array<string>; tags: Array<string>;
} }
export const defaultPanelOptions: Partial<PanelOptions> = { export const defaultOptions: Partial<Options> = {
limit: 10, limit: 10,
navigateAfter: '10m', navigateAfter: '10m',
navigateBefore: '10m', navigateBefore: '10m',

View File

@ -38,7 +38,7 @@ import { getFieldLegendItem } from 'app/core/components/TimelineChart/utils';
import { DataHoverView } from '../geomap/components/DataHoverView'; import { DataHoverView } from '../geomap/components/DataHoverView';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
import { prepareBarChartDisplayValues, preparePlotConfigBuilder } from './utils'; import { prepareBarChartDisplayValues, preparePlotConfigBuilder } from './utils';
const TOOLTIP_OFFSET = 10; const TOOLTIP_OFFSET = 10;
@ -47,7 +47,7 @@ const TOOLTIP_OFFSET = 10;
* @alpha * @alpha
*/ */
export interface BarChartProps export interface BarChartProps
extends PanelOptions, extends Options,
Omit<GraphNGProps, 'prepConfig' | 'propsToDiff' | 'renderLegend' | 'theme'> {} Omit<GraphNGProps, 'prepConfig' | 'propsToDiff' | 'renderLegend' | 'theme'> {}
const propsToDiff: Array<string | PropDiffFn> = [ const propsToDiff: Array<string | PropDiffFn> = [
@ -66,7 +66,7 @@ const propsToDiff: Array<string | PropDiffFn> = [
(prev: BarChartProps, next: BarChartProps) => next.text?.valueSize === prev.text?.valueSize, (prev: BarChartProps, next: BarChartProps) => next.text?.valueSize === prev.text?.valueSize,
]; ];
interface Props extends PanelProps<PanelOptions> {} interface Props extends PanelProps<Options> {}
export const BarChartPanel = ({ data, options, fieldConfig, width, height, timeZone, id }: Props) => { export const BarChartPanel = ({ data, options, fieldConfig, width, height, timeZone, id }: Props) => {
const theme = useTheme2(); const theme = useTheme2();

View File

@ -16,11 +16,11 @@ import { ThresholdsStyleEditor } from '../timeseries/ThresholdsStyleEditor';
import { BarChartPanel } from './BarChartPanel'; import { BarChartPanel } from './BarChartPanel';
import { TickSpacingEditor } from './TickSpacingEditor'; import { TickSpacingEditor } from './TickSpacingEditor';
import { PanelFieldConfig, PanelOptions, defaultPanelFieldConfig, defaultPanelOptions } from './panelcfg.gen'; import { FieldConfig, Options, defaultFieldConfig, defaultOptions } from './panelcfg.gen';
import { BarChartSuggestionsSupplier } from './suggestions'; import { BarChartSuggestionsSupplier } from './suggestions';
import { prepareBarChartDisplayValues } from './utils'; import { prepareBarChartDisplayValues } from './utils';
export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPanel) export const plugin = new PanelPlugin<Options, FieldConfig>(BarChartPanel)
.useFieldConfig({ .useFieldConfig({
standardOptions: { standardOptions: {
[FieldConfigProperty.Color]: { [FieldConfigProperty.Color]: {
@ -34,7 +34,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
}, },
}, },
useCustomConfig: (builder) => { useCustomConfig: (builder) => {
const cfg = defaultPanelFieldConfig; const cfg = defaultFieldConfig;
builder builder
.addSliderInput({ .addSliderInput({
@ -108,7 +108,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
}, },
}) })
.setPanelOptions((builder, context) => { .setPanelOptions((builder, context) => {
const disp = prepareBarChartDisplayValues(context.data, config.theme2, context.options ?? ({} as PanelOptions)); const disp = prepareBarChartDisplayValues(context.data, config.theme2, context.options ?? ({} as Options));
let xaxisPlaceholder = 'First string or time field'; let xaxisPlaceholder = 'First string or time field';
const viz = 'viz' in disp ? disp.viz[0] : undefined; const viz = 'viz' in disp ? disp.viz[0] : undefined;
if (viz?.fields?.length) { if (viz?.fields?.length) {
@ -134,12 +134,12 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
{ value: VizOrientation.Vertical, label: 'Vertical' }, { value: VizOrientation.Vertical, label: 'Vertical' },
], ],
}, },
defaultValue: defaultPanelOptions.orientation, defaultValue: defaultOptions.orientation,
}) })
.addSliderInput({ .addSliderInput({
path: 'xTickLabelRotation', path: 'xTickLabelRotation',
name: 'Rotate x-axis tick labels', name: 'Rotate x-axis tick labels',
defaultValue: defaultPanelOptions.xTickLabelRotation, defaultValue: defaultOptions.xTickLabelRotation,
settings: { settings: {
min: -90, min: -90,
max: 90, max: 90,
@ -162,7 +162,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
id: 'xTickLabelSpacing', id: 'xTickLabelSpacing',
path: 'xTickLabelSpacing', path: 'xTickLabelSpacing',
name: 'X-axis labels minimum spacing', name: 'X-axis labels minimum spacing',
defaultValue: defaultPanelOptions.xTickLabelSpacing, defaultValue: defaultOptions.xTickLabelSpacing,
editor: TickSpacingEditor, editor: TickSpacingEditor,
}) })
.addRadio({ .addRadio({
@ -175,7 +175,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
{ value: VisibilityMode.Never, label: 'Never' }, { value: VisibilityMode.Never, label: 'Never' },
], ],
}, },
defaultValue: defaultPanelOptions.showValue, defaultValue: defaultOptions.showValue,
}) })
.addRadio({ .addRadio({
path: 'stacking', path: 'stacking',
@ -183,12 +183,12 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
settings: { settings: {
options: graphFieldOptions.stacking, options: graphFieldOptions.stacking,
}, },
defaultValue: defaultPanelOptions.stacking, defaultValue: defaultOptions.stacking,
}) })
.addSliderInput({ .addSliderInput({
path: 'groupWidth', path: 'groupWidth',
name: 'Group width', name: 'Group width',
defaultValue: defaultPanelOptions.groupWidth, defaultValue: defaultOptions.groupWidth,
settings: { settings: {
min: 0, min: 0,
max: 1, max: 1,
@ -204,7 +204,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
.addSliderInput({ .addSliderInput({
path: 'barWidth', path: 'barWidth',
name: 'Bar width', name: 'Bar width',
defaultValue: defaultPanelOptions.barWidth, defaultValue: defaultOptions.barWidth,
settings: { settings: {
min: 0, min: 0,
max: 1, max: 1,
@ -214,7 +214,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
.addSliderInput({ .addSliderInput({
path: 'barRadius', path: 'barRadius',
name: 'Bar radius', name: 'Bar radius',
defaultValue: defaultPanelOptions.barRadius, defaultValue: defaultOptions.barRadius,
settings: { settings: {
min: 0, min: 0,
max: 0.5, max: 0.5,
@ -224,7 +224,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
.addBooleanSwitch({ .addBooleanSwitch({
path: 'fullHighlight', path: 'fullHighlight',
name: 'Highlight full area on hover', name: 'Highlight full area on hover',
defaultValue: defaultPanelOptions.fullHighlight, defaultValue: defaultOptions.fullHighlight,
}); });
builder.addFieldNamePicker({ builder.addFieldNamePicker({

View File

@ -27,7 +27,7 @@ composableKinds: PanelCfg: {
schemas: [ schemas: [
// v0.0 // v0.0
{ {
PanelOptions: { Options: {
common.OptionsWithLegend common.OptionsWithLegend
common.OptionsWithTooltip common.OptionsWithTooltip
common.OptionsWithTextFormatting common.OptionsWithTextFormatting
@ -59,7 +59,7 @@ composableKinds: PanelCfg: {
// hovers over highlighted area // hovers over highlighted area
fullHighlight: bool | *false fullHighlight: bool | *false
} @cuetsy(kind="interface") } @cuetsy(kind="interface")
PanelFieldConfig: { FieldConfig: {
common.AxisConfig common.AxisConfig
common.HideableFieldConfig common.HideableFieldConfig

View File

@ -12,7 +12,7 @@ import * as common from '@grafana/schema';
export const PanelCfgModelVersion = Object.freeze([0, 0]); export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions extends common.OptionsWithLegend, common.OptionsWithTooltip, common.OptionsWithTextFormatting { export interface Options extends common.OptionsWithLegend, common.OptionsWithTooltip, common.OptionsWithTextFormatting {
/** /**
* Controls the radius of each bar. * Controls the radius of each bar.
*/ */
@ -65,7 +65,7 @@ export interface PanelOptions extends common.OptionsWithLegend, common.OptionsWi
xTickLabelSpacing?: number; xTickLabelSpacing?: number;
} }
export const defaultPanelOptions: Partial<PanelOptions> = { export const defaultOptions: Partial<Options> = {
barRadius: 0, barRadius: 0,
barWidth: 0.97, barWidth: 0.97,
fullHighlight: false, fullHighlight: false,
@ -77,7 +77,7 @@ export const defaultPanelOptions: Partial<PanelOptions> = {
xTickLabelSpacing: 0, xTickLabelSpacing: 0,
}; };
export interface PanelFieldConfig extends common.AxisConfig, common.HideableFieldConfig { export interface FieldConfig extends common.AxisConfig, common.HideableFieldConfig {
/** /**
* Controls the fill opacity of the bars. * Controls the fill opacity of the bars.
*/ */
@ -97,7 +97,7 @@ export interface PanelFieldConfig extends common.AxisConfig, common.HideableFiel
thresholdsStyle?: common.GraphThresholdsStyleConfig; thresholdsStyle?: common.GraphThresholdsStyleConfig;
} }
export const defaultPanelFieldConfig: Partial<PanelFieldConfig> = { export const defaultFieldConfig: Partial<FieldConfig> = {
fillOpacity: 80, fillOpacity: 80,
gradientMode: common.GraphGradientMode.None, gradientMode: common.GraphGradientMode.None,
lineWidth: 1, lineWidth: 1,

View File

@ -2,11 +2,11 @@ import { VisualizationSuggestionsBuilder, VizOrientation } from '@grafana/data';
import { LegendDisplayMode, StackingMode, VisibilityMode } from '@grafana/schema'; import { LegendDisplayMode, StackingMode, VisibilityMode } from '@grafana/schema';
import { SuggestionName } from 'app/types/suggestions'; import { SuggestionName } from 'app/types/suggestions';
import { PanelFieldConfig, PanelOptions } from './panelcfg.gen'; import { FieldConfig, Options } from './panelcfg.gen';
export class BarChartSuggestionsSupplier { export class BarChartSuggestionsSupplier {
getListWithDefaults(builder: VisualizationSuggestionsBuilder) { getListWithDefaults(builder: VisualizationSuggestionsBuilder) {
return builder.getListAppender<PanelOptions, PanelFieldConfig>({ return builder.getListAppender<Options, FieldConfig>({
name: SuggestionName.BarChart, name: SuggestionName.BarChart,
pluginId: 'barchart', pluginId: 'barchart',
options: { options: {

View File

@ -19,7 +19,7 @@ import {
SortOrder, SortOrder,
} from '@grafana/schema'; } from '@grafana/schema';
import { PanelFieldConfig, PanelOptions } from './panelcfg.gen'; import { FieldConfig as PanelFieldConfig, Options } from './panelcfg.gen';
import { BarChartOptionsEX, prepareBarChartDisplayValues, preparePlotConfigBuilder } from './utils'; import { BarChartOptionsEX, prepareBarChartDisplayValues, preparePlotConfigBuilder } from './utils';
function mockDataFrame() { function mockDataFrame() {
@ -69,7 +69,7 @@ function mockDataFrame() {
state: {}, state: {},
}); });
const info = prepareBarChartDisplayValues([df1], createTheme(), {} as PanelOptions); const info = prepareBarChartDisplayValues([df1], createTheme(), {} as Options);
if (!('aligned' in info)) { if (!('aligned' in info)) {
throw new Error('Bar chart not prepared correctly'); throw new Error('Bar chart not prepared correctly');
@ -159,7 +159,7 @@ describe('BarChart utils', () => {
describe('prepareGraphableFrames', () => { describe('prepareGraphableFrames', () => {
it('will warn when there is no data in the response', () => { it('will warn when there is no data in the response', () => {
const result = prepareBarChartDisplayValues([], createTheme(), { stacking: StackingMode.None } as PanelOptions); const result = prepareBarChartDisplayValues([], createTheme(), { stacking: StackingMode.None } as Options);
const warning = assertIsDefined('warn' in result ? result : null); const warning = assertIsDefined('warn' in result ? result : null);
expect(warning.warn).toEqual('No data in response'); expect(warning.warn).toEqual('No data in response');
@ -172,7 +172,7 @@ describe('BarChart utils', () => {
{ name: 'value', values: [1, 2, 3, 4, 5] }, { name: 'value', values: [1, 2, 3, 4, 5] },
], ],
}); });
const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as PanelOptions); const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as Options);
const warning = assertIsDefined('warn' in result ? result : null); const warning = assertIsDefined('warn' in result ? result : null);
expect(warning.warn).toEqual('Bar charts requires a string or time field'); expect(warning.warn).toEqual('Bar charts requires a string or time field');
expect(warning).not.toHaveProperty('viz'); expect(warning).not.toHaveProperty('viz');
@ -185,7 +185,7 @@ describe('BarChart utils', () => {
{ name: 'value', type: FieldType.boolean, values: [true, true, true, true, true] }, { name: 'value', type: FieldType.boolean, values: [true, true, true, true, true] },
], ],
}); });
const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as PanelOptions); const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as Options);
const warning = assertIsDefined('warn' in result ? result : null); const warning = assertIsDefined('warn' in result ? result : null);
expect(warning.warn).toEqual('No numeric fields found'); expect(warning.warn).toEqual('No numeric fields found');
expect(warning).not.toHaveProperty('viz'); expect(warning).not.toHaveProperty('viz');
@ -198,7 +198,7 @@ describe('BarChart utils', () => {
{ name: 'value', values: [-10, NaN, 10, -Infinity, +Infinity] }, { name: 'value', values: [-10, NaN, 10, -Infinity, +Infinity] },
], ],
}); });
const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as PanelOptions); const result = prepareBarChartDisplayValues([df], createTheme(), { stacking: StackingMode.None } as Options);
const displayValues = assertIsDefined('viz' in result ? result : null); const displayValues = assertIsDefined('viz' in result ? result : null);
const field = displayValues.viz[0].fields[1]; const field = displayValues.viz[0].fields[1];
@ -238,7 +238,7 @@ describe('BarChart utils', () => {
const resultAsc = prepareBarChartDisplayValues([frame], createTheme(), { const resultAsc = prepareBarChartDisplayValues([frame], createTheme(), {
legend: { sortBy: 'Min', sortDesc: false }, legend: { sortBy: 'Min', sortDesc: false },
} as PanelOptions); } as Options);
const displayValuesAsc = assertIsDefined('viz' in resultAsc ? resultAsc : null).viz[0]; const displayValuesAsc = assertIsDefined('viz' in resultAsc ? resultAsc : null).viz[0];
expect(displayValuesAsc.fields[0].type).toBe(FieldType.string); expect(displayValuesAsc.fields[0].type).toBe(FieldType.string);
expect(displayValuesAsc.fields[1].name).toBe('a'); expect(displayValuesAsc.fields[1].name).toBe('a');
@ -253,7 +253,7 @@ describe('BarChart utils', () => {
const resultDesc = prepareBarChartDisplayValues([frame], createTheme(), { const resultDesc = prepareBarChartDisplayValues([frame], createTheme(), {
legend: { sortBy: 'Min', sortDesc: true }, legend: { sortBy: 'Min', sortDesc: true },
} as PanelOptions); } as Options);
const displayValuesDesc = assertIsDefined('viz' in resultDesc ? resultDesc : null).viz[0]; const displayValuesDesc = assertIsDefined('viz' in resultDesc ? resultDesc : null).viz[0];
expect(displayValuesDesc.fields[0].type).toBe(FieldType.string); expect(displayValuesDesc.fields[0].type).toBe(FieldType.string);
expect(displayValuesDesc.fields[1].name).toBe('b'); expect(displayValuesDesc.fields[1].name).toBe('b');
@ -279,7 +279,7 @@ describe('BarChart utils', () => {
const resultAsc = prepareBarChartDisplayValues([frame], createTheme(), { const resultAsc = prepareBarChartDisplayValues([frame], createTheme(), {
stacking: StackingMode.Percent, stacking: StackingMode.Percent,
} as PanelOptions); } as Options);
const displayLegendValuesAsc = assertIsDefined('legend' in resultAsc ? resultAsc : null).legend; const displayLegendValuesAsc = assertIsDefined('legend' in resultAsc ? resultAsc : null).legend;
expect(displayLegendValuesAsc.fields[1].config.unit).toBeUndefined(); expect(displayLegendValuesAsc.fields[1].config.unit).toBeUndefined();

View File

@ -31,7 +31,7 @@ import { getStackingGroups } from '@grafana/ui/src/components/uPlot/utils';
import { findField } from 'app/features/dimensions'; import { findField } from 'app/features/dimensions';
import { BarsOptions, getConfig } from './bars'; import { BarsOptions, getConfig } from './bars';
import { PanelFieldConfig, PanelOptions, defaultPanelFieldConfig } from './panelcfg.gen'; import { FieldConfig, Options, defaultFieldConfig } from './panelcfg.gen';
import { BarChartDisplayValues, BarChartDisplayWarning } from './types'; import { BarChartDisplayValues, BarChartDisplayWarning } from './types';
function getBarCharScaleOrientation(orientation: VizOrientation) { function getBarCharScaleOrientation(orientation: VizOrientation) {
@ -52,7 +52,7 @@ function getBarCharScaleOrientation(orientation: VizOrientation) {
}; };
} }
export interface BarChartOptionsEX extends PanelOptions { export interface BarChartOptionsEX extends Options {
rawValue: (seriesIdx: number, valueIdx: number) => number | null; rawValue: (seriesIdx: number, valueIdx: number) => number | null;
getColor?: (seriesIdx: number, valueIdx: number, value: unknown) => string | null; getColor?: (seriesIdx: number, valueIdx: number, value: unknown) => string | null;
timeZone?: TimeZone; timeZone?: TimeZone;
@ -185,7 +185,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<BarChartOptionsEX> = ({
seriesIndex++; seriesIndex++;
const customConfig: PanelFieldConfig = { ...defaultPanelFieldConfig, ...field.config.custom }; const customConfig: FieldConfig = { ...defaultFieldConfig, ...field.config.custom };
const scaleKey = field.config.unit || FIXED_UNIT; const scaleKey = field.config.unit || FIXED_UNIT;
const colorMode = getFieldColorModeForField(field); const colorMode = getFieldColorModeForField(field);
@ -358,7 +358,7 @@ function getRotationPadding(
export function prepareBarChartDisplayValues( export function prepareBarChartDisplayValues(
series: DataFrame[], series: DataFrame[],
theme: GrafanaTheme2, theme: GrafanaTheme2,
options: PanelOptions options: Options
): BarChartDisplayValues | BarChartDisplayWarning { ): BarChartDisplayValues | BarChartDisplayWarning {
if (!series?.length) { if (!series?.length) {
return { warn: 'No data in response' }; return { warn: 'No data in response' };

View File

@ -1,8 +1,8 @@
import { PanelModel } from '@grafana/data'; import { PanelModel } from '@grafana/data';
import { sharedSingleStatMigrationHandler } from '@grafana/ui'; import { sharedSingleStatMigrationHandler } from '@grafana/ui';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
export const barGaugePanelMigrationHandler = (panel: PanelModel<PanelOptions>): Partial<PanelOptions> => { export const barGaugePanelMigrationHandler = (panel: PanelModel<Options>): Partial<Options> => {
return sharedSingleStatMigrationHandler(panel); return sharedSingleStatMigrationHandler(panel);
}; };

View File

@ -16,7 +16,7 @@ import { BarGauge, DataLinksContextMenu, VizRepeater, VizRepeaterRenderValueProp
import { DataLinksContextMenuApi } from '@grafana/ui/src/components/DataLinks/DataLinksContextMenu'; import { DataLinksContextMenuApi } from '@grafana/ui/src/components/DataLinks/DataLinksContextMenu';
import { config } from 'app/core/config'; import { config } from 'app/core/config';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
export class BarGaugePanel extends PureComponent<BarGaugePanelProps> { export class BarGaugePanel extends PureComponent<BarGaugePanelProps> {
renderComponent = ( renderComponent = (
@ -110,7 +110,7 @@ export class BarGaugePanel extends PureComponent<BarGaugePanelProps> {
); );
} }
} }
export type BarGaugePanelProps = PanelProps<PanelOptions>; export type BarGaugePanelProps = PanelProps<Options>;
export function clearNameForSingleSeries(count: number, field: FieldConfig, display: DisplayValue): DisplayValue { export function clearNameForSingleSeries(count: number, field: FieldConfig, display: DisplayValue): DisplayValue {
if (count === 1 && !field.displayName) { if (count === 1 && !field.displayName) {

View File

@ -6,10 +6,10 @@ import { addOrientationOption, addStandardDataReduceOptions } from '../stat/comm
import { barGaugePanelMigrationHandler } from './BarGaugeMigrations'; import { barGaugePanelMigrationHandler } from './BarGaugeMigrations';
import { BarGaugePanel } from './BarGaugePanel'; import { BarGaugePanel } from './BarGaugePanel';
import { PanelOptions, defaultPanelOptions } from './panelcfg.gen'; import { Options, defaultOptions } from './panelcfg.gen';
import { BarGaugeSuggestionsSupplier } from './suggestions'; import { BarGaugeSuggestionsSupplier } from './suggestions';
export const plugin = new PanelPlugin<PanelOptions>(BarGaugePanel) export const plugin = new PanelPlugin<Options>(BarGaugePanel)
.useFieldConfig() .useFieldConfig()
.setPanelOptions((builder) => { .setPanelOptions((builder) => {
addStandardDataReduceOptions(builder); addStandardDataReduceOptions(builder);
@ -27,7 +27,7 @@ export const plugin = new PanelPlugin<PanelOptions>(BarGaugePanel)
{ value: BarGaugeDisplayMode.Basic, label: 'Basic' }, { value: BarGaugeDisplayMode.Basic, label: 'Basic' },
], ],
}, },
defaultValue: defaultPanelOptions.displayMode, defaultValue: defaultOptions.displayMode,
}) })
.addRadio({ .addRadio({
path: 'valueMode', path: 'valueMode',
@ -39,27 +39,27 @@ export const plugin = new PanelPlugin<PanelOptions>(BarGaugePanel)
{ value: BarGaugeValueMode.Hidden, label: 'Hidden' }, { value: BarGaugeValueMode.Hidden, label: 'Hidden' },
], ],
}, },
defaultValue: defaultPanelOptions.valueMode, defaultValue: defaultOptions.valueMode,
}) })
.addBooleanSwitch({ .addBooleanSwitch({
path: 'showUnfilled', path: 'showUnfilled',
name: 'Show unfilled area', name: 'Show unfilled area',
description: 'When enabled renders the unfilled region as gray', description: 'When enabled renders the unfilled region as gray',
defaultValue: defaultPanelOptions.showUnfilled, defaultValue: defaultOptions.showUnfilled,
showIf: (options) => options.displayMode !== 'lcd', showIf: (options) => options.displayMode !== 'lcd',
}) })
.addNumberInput({ .addNumberInput({
path: 'minVizWidth', path: 'minVizWidth',
name: 'Min width', name: 'Min width',
description: 'Minimum column width', description: 'Minimum column width',
defaultValue: defaultPanelOptions.minVizWidth, defaultValue: defaultOptions.minVizWidth,
showIf: (options) => options.orientation === VizOrientation.Vertical, showIf: (options) => options.orientation === VizOrientation.Vertical,
}) })
.addNumberInput({ .addNumberInput({
path: 'minVizHeight', path: 'minVizHeight',
name: 'Min height', name: 'Min height',
description: 'Minimum row height', description: 'Minimum row height',
defaultValue: defaultPanelOptions.minVizHeight, defaultValue: defaultOptions.minVizHeight,
showIf: (options) => options.orientation === VizOrientation.Horizontal, showIf: (options) => options.orientation === VizOrientation.Horizontal,
}); });
}) })

View File

@ -26,7 +26,7 @@ composableKinds: PanelCfg: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
common.SingleStatBaseOptions common.SingleStatBaseOptions
displayMode: common.BarGaugeDisplayMode & (*"gradient" | _) displayMode: common.BarGaugeDisplayMode & (*"gradient" | _)
valueMode: common.BarGaugeValueMode & (*"color" | _) valueMode: common.BarGaugeValueMode & (*"color" | _)

View File

@ -12,7 +12,7 @@ import * as common from '@grafana/schema';
export const PanelCfgModelVersion = Object.freeze([0, 0]); export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions extends common.SingleStatBaseOptions { export interface Options extends common.SingleStatBaseOptions {
displayMode: common.BarGaugeDisplayMode; displayMode: common.BarGaugeDisplayMode;
minVizHeight: number; minVizHeight: number;
minVizWidth: number; minVizWidth: number;
@ -20,7 +20,7 @@ export interface PanelOptions extends common.SingleStatBaseOptions {
valueMode: common.BarGaugeValueMode; valueMode: common.BarGaugeValueMode;
} }
export const defaultPanelOptions: Partial<PanelOptions> = { export const defaultOptions: Partial<Options> = {
displayMode: common.BarGaugeDisplayMode.Gradient, displayMode: common.BarGaugeDisplayMode.Gradient,
minVizHeight: 10, minVizHeight: 10,
minVizWidth: 0, minVizWidth: 0,

View File

@ -2,7 +2,7 @@ import { VisualizationSuggestionsBuilder, VizOrientation } from '@grafana/data';
import { BarGaugeDisplayMode } from '@grafana/ui'; import { BarGaugeDisplayMode } from '@grafana/ui';
import { SuggestionName } from 'app/types/suggestions'; import { SuggestionName } from 'app/types/suggestions';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
export class BarGaugeSuggestionsSupplier { export class BarGaugeSuggestionsSupplier {
getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) {
@ -12,7 +12,7 @@ export class BarGaugeSuggestionsSupplier {
return; return;
} }
const list = builder.getListAppender<PanelOptions, {}>({ const list = builder.getListAppender<Options, {}>({
name: '', name: '',
pluginId: 'bargauge', pluginId: 'bargauge',
options: {}, options: {},

View File

@ -58,7 +58,7 @@ export interface CandlestickOptions extends OptionsWithLegend {
includeAllFields?: boolean; includeAllFields?: boolean;
} }
export const defaultPanelOptions: CandlestickOptions = { export const defaultOptions: CandlestickOptions = {
mode: VizDisplayMode.CandlesVolume, mode: VizDisplayMode.CandlesVolume,
candleStyle: CandleStyle.Candles, candleStyle: CandleStyle.Candles,
colorStrategy: ColorStrategy.OpenClose, colorStrategy: ColorStrategy.OpenClose,

View File

@ -19,7 +19,7 @@ import {
CandlestickOptions, CandlestickOptions,
VizDisplayMode, VizDisplayMode,
ColorStrategy, ColorStrategy,
defaultPanelOptions, defaultOptions,
CandleStyle, CandleStyle,
} from './models.gen'; } from './models.gen';
import { CandlestickSuggestionsSupplier } from './suggestions'; import { CandlestickSuggestionsSupplier } from './suggestions';
@ -77,7 +77,7 @@ function addFieldPicker(
export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(CandlestickPanel) export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(CandlestickPanel)
.useFieldConfig(getGraphFieldConfig(defaultGraphConfig)) .useFieldConfig(getGraphFieldConfig(defaultGraphConfig))
.setPanelOptions((builder, context) => { .setPanelOptions((builder, context) => {
const opts = context.options ?? defaultPanelOptions; const opts = context.options ?? defaultOptions;
const info = prepareCandlestickFields(context.data, opts, config.theme2); const info = prepareCandlestickFields(context.data, opts, config.theme2);
builder builder
@ -85,7 +85,7 @@ export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(Cand
path: 'mode', path: 'mode',
name: 'Mode', name: 'Mode',
description: '', description: '',
defaultValue: defaultPanelOptions.mode, defaultValue: defaultOptions.mode,
settings: { settings: {
options: modeOptions, options: modeOptions,
}, },
@ -94,7 +94,7 @@ export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(Cand
path: 'candleStyle', path: 'candleStyle',
name: 'Candle style', name: 'Candle style',
description: '', description: '',
defaultValue: defaultPanelOptions.candleStyle, defaultValue: defaultOptions.candleStyle,
settings: { settings: {
options: candleStyles, options: candleStyles,
}, },
@ -104,7 +104,7 @@ export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(Cand
path: 'colorStrategy', path: 'colorStrategy',
name: 'Color strategy', name: 'Color strategy',
description: '', description: '',
defaultValue: defaultPanelOptions.colorStrategy, defaultValue: defaultOptions.colorStrategy,
settings: { settings: {
options: colorStrategies, options: colorStrategies,
}, },
@ -135,7 +135,7 @@ export const plugin = new PanelPlugin<CandlestickOptions, GraphFieldConfig>(Cand
path: 'includeAllFields', path: 'includeAllFields',
name: 'Additional fields', name: 'Additional fields',
description: 'Use standard timeseries options to configure any fields not mapped above', description: 'Use standard timeseries options to configure any fields not mapped above',
defaultValue: defaultPanelOptions.includeAllFields, defaultValue: defaultOptions.includeAllFields,
settings: { settings: {
options: [ options: [
{ label: 'Ignore', value: false }, { label: 'Ignore', value: false },

View File

@ -20,11 +20,11 @@ composableKinds: PanelCfg: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
// anything for now // anything for now
... ...
} @cuetsy(kind="interface") } @cuetsy(kind="interface")
PanelFieldConfig: { FieldConfig: {
// anything for now // anything for now
... ...
} @cuetsy(kind="interface") } @cuetsy(kind="interface")

View File

@ -3,7 +3,7 @@ import { config } from '@grafana/runtime';
import { SuggestionName } from 'app/types/suggestions'; import { SuggestionName } from 'app/types/suggestions';
import { prepareCandlestickFields } from './fields'; import { prepareCandlestickFields } from './fields';
import { CandlestickOptions, defaultPanelOptions } from './models.gen'; import { CandlestickOptions, defaultOptions } from './models.gen';
export class CandlestickSuggestionsSupplier { export class CandlestickSuggestionsSupplier {
getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) {
@ -19,7 +19,7 @@ export class CandlestickSuggestionsSupplier {
return; return;
} }
const info = prepareCandlestickFields(builder.data.series, defaultPanelOptions, config.theme2); const info = prepareCandlestickFields(builder.data.series, defaultOptions, config.theme2);
if (!info) { if (!info) {
return; return;
} }
@ -43,7 +43,7 @@ export class CandlestickSuggestionsSupplier {
list.append({ list.append({
name: SuggestionName.Candlestick, name: SuggestionName.Candlestick,
options: defaultPanelOptions, options: defaultOptions,
fieldConfig: { fieldConfig: {
defaults: {}, defaults: {},
overrides: [], overrides: [],

View File

@ -11,10 +11,10 @@ import { PanelEditEnteredEvent, PanelEditExitedEvent } from 'app/types/events';
import { InlineEdit } from './InlineEdit'; import { InlineEdit } from './InlineEdit';
import { SetBackground } from './SetBackground'; import { SetBackground } from './SetBackground';
import { PanelOptions } from './models.gen'; import { Options } from './models.gen';
import { AnchorPoint, CanvasTooltipPayload, ConnectionState } from './types'; import { AnchorPoint, CanvasTooltipPayload, ConnectionState } from './types';
interface Props extends PanelProps<PanelOptions> {} interface Props extends PanelProps<Options> {}
interface State { interface State {
refresh: number; refresh: number;

View File

@ -7,7 +7,7 @@ import { Field, HorizontalGroup, Icon, InlineField, InlineFieldRow, Select, Vert
import { NumberInput } from 'app/core/components/OptionsUI/NumberInput'; import { NumberInput } from 'app/core/components/OptionsUI/NumberInput';
import { HorizontalConstraint, Placement, VerticalConstraint } from 'app/features/canvas'; import { HorizontalConstraint, Placement, VerticalConstraint } from 'app/features/canvas';
import { PanelOptions } from '../models.gen'; import { Options } from '../models.gen';
import { ConstraintSelectionBox } from './ConstraintSelectionBox'; import { ConstraintSelectionBox } from './ConstraintSelectionBox';
import { QuickPositioning } from './QuickPositioning'; import { QuickPositioning } from './QuickPositioning';
@ -31,7 +31,7 @@ const verticalOptions: Array<SelectableValue<VerticalConstraint>> = [
{ label: 'Scale', value: VerticalConstraint.Scale }, { label: 'Scale', value: VerticalConstraint.Scale },
]; ];
type Props = StandardEditorProps<any, CanvasEditorOptions, PanelOptions>; type Props = StandardEditorProps<any, CanvasEditorOptions, Options>;
export function PlacementEditor({ item }: Props) { export function PlacementEditor({ item }: Props) {
const settings = item.settings; const settings = item.settings;

View File

@ -10,7 +10,7 @@ import { ElementState } from 'app/features/canvas/runtime/element';
import { AddLayerButton } from '../../../../core/components/Layers/AddLayerButton'; import { AddLayerButton } from '../../../../core/components/Layers/AddLayerButton';
import { getGlobalStyles } from '../globalStyles'; import { getGlobalStyles } from '../globalStyles';
import { PanelOptions } from '../models.gen'; import { Options } from '../models.gen';
import { getTreeData, onNodeDrop, TreeElement } from '../tree'; import { getTreeData, onNodeDrop, TreeElement } from '../tree';
import { DragNode, DropNode } from '../types'; import { DragNode, DropNode } from '../types';
import { doSelect, getElementTypes, onAddItem } from '../utils'; import { doSelect, getElementTypes, onAddItem } from '../utils';
@ -20,7 +20,7 @@ import { TreeViewEditorProps } from './elementEditor';
let allowSelection = true; let allowSelection = true;
export const TreeNavigationEditor = ({ item }: StandardEditorProps<any, TreeViewEditorProps, PanelOptions>) => { export const TreeNavigationEditor = ({ item }: StandardEditorProps<any, TreeViewEditorProps, Options>) => {
const [treeData, setTreeData] = useState(getTreeData(item?.settings?.scene.root)); const [treeData, setTreeData] = useState(getTreeData(item?.settings?.scene.root));
const [autoExpandParent, setAutoExpandParent] = useState(true); const [autoExpandParent, setAutoExpandParent] = useState(true);
const [expandedKeys, setExpandedKeys] = useState<Key[]>([]); const [expandedKeys, setExpandedKeys] = useState<Key[]>([]);

View File

@ -1,8 +1,8 @@
import { PanelModel } from '@grafana/data'; import { PanelModel } from '@grafana/data';
import { PanelOptions } from './models.gen'; import { Options } from './models.gen';
export const canvasMigrationHandler = (panel: PanelModel): Partial<PanelOptions> => { export const canvasMigrationHandler = (panel: PanelModel): Partial<Options> => {
const pluginVersion = panel?.pluginVersion ?? ''; const pluginVersion = panel?.pluginVersion ?? '';
// Rename text-box to rectangle // Rename text-box to rectangle

View File

@ -7,13 +7,13 @@ import { CanvasFrameOptions, DEFAULT_CANVAS_ELEMENT_CONFIG } from 'app/features/
export const modelVersion = Object.freeze([1, 0]); export const modelVersion = Object.freeze([1, 0]);
export interface PanelOptions { export interface Options {
inlineEditing: boolean; inlineEditing: boolean;
showAdvancedTypes: boolean; showAdvancedTypes: boolean;
root: CanvasFrameOptions; root: CanvasFrameOptions;
} }
export const defaultPanelOptions: PanelOptions = { export const defaultOptions: Options = {
inlineEditing: true, inlineEditing: true,
showAdvancedTypes: false, showAdvancedTypes: false,
root: { root: {

View File

@ -6,9 +6,9 @@ import { getConnectionEditor } from './editor/connectionEditor';
import { getElementEditor } from './editor/elementEditor'; import { getElementEditor } from './editor/elementEditor';
import { getLayerEditor } from './editor/layerEditor'; import { getLayerEditor } from './editor/layerEditor';
import { canvasMigrationHandler } from './migrations'; import { canvasMigrationHandler } from './migrations';
import { PanelOptions } from './models.gen'; import { Options } from './models.gen';
export const addStandardCanvasEditorOptions = (builder: PanelOptionsEditorBuilder<PanelOptions>) => { export const addStandardCanvasEditorOptions = (builder: PanelOptionsEditorBuilder<Options>) => {
builder.addBooleanSwitch({ builder.addBooleanSwitch({
path: 'inlineEditing', path: 'inlineEditing',
name: 'Inline editing', name: 'Inline editing',
@ -24,7 +24,7 @@ export const addStandardCanvasEditorOptions = (builder: PanelOptionsEditorBuilde
}); });
}; };
export const plugin = new PanelPlugin<PanelOptions>(CanvasPanel) export const plugin = new PanelPlugin<Options>(CanvasPanel)
.setNoPadding() // extend to panel edges .setNoPadding() // extend to panel edges
.useFieldConfig({ .useFieldConfig({
standardOptions: { standardOptions: {

View File

@ -20,7 +20,7 @@ composableKinds: PanelCfg: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
// anything for now // anything for now
... ...
} @cuetsy(kind="interface") } @cuetsy(kind="interface")

View File

@ -24,7 +24,7 @@ import { DashboardSearchItem } from 'app/features/search/types';
import { getVariablesUrlParams } from 'app/features/variables/getAllVariableValuesForUrl'; import { getVariablesUrlParams } from 'app/features/variables/getAllVariableValuesForUrl';
import { useDispatch } from 'app/types'; import { useDispatch } from 'app/types';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
import { getStyles } from './styles'; import { getStyles } from './styles';
type Dashboard = DashboardSearchItem & { id?: number; isSearchResult?: boolean; isRecent?: boolean }; type Dashboard = DashboardSearchItem & { id?: number; isSearchResult?: boolean; isRecent?: boolean };
@ -35,7 +35,7 @@ interface DashboardGroup {
dashboards: Dashboard[]; dashboards: Dashboard[];
} }
async function fetchDashboards(options: PanelOptions, replaceVars: InterpolateFunction) { async function fetchDashboards(options: Options, replaceVars: InterpolateFunction) {
let starredDashboards: Promise<DashboardSearchItem[]> = Promise.resolve([]); let starredDashboards: Promise<DashboardSearchItem[]> = Promise.resolve([]);
if (options.showStarred) { if (options.showStarred) {
const params = { limit: options.maxItems, starred: 'true' }; const params = { limit: options.maxItems, starred: 'true' };
@ -99,7 +99,7 @@ async function fetchDashboards(options: PanelOptions, replaceVars: InterpolateFu
return dashMap; return dashMap;
} }
export function DashList(props: PanelProps<PanelOptions>) { export function DashList(props: PanelProps<Options>) {
const [dashboards, setDashboards] = useState(new Map<string, Dashboard>()); const [dashboards, setDashboards] = useState(new Map<string, Dashboard>());
const dispatch = useDispatch(); const dispatch = useDispatch();
useEffect(() => { useEffect(() => {

View File

@ -10,50 +10,50 @@ import {
} from '../../../core/components/Select/ReadonlyFolderPicker/ReadonlyFolderPicker'; } from '../../../core/components/Select/ReadonlyFolderPicker/ReadonlyFolderPicker';
import { DashList } from './DashList'; import { DashList } from './DashList';
import { defaultPanelOptions, PanelOptions } from './panelcfg.gen'; import { defaultOptions, Options } from './panelcfg.gen';
export const plugin = new PanelPlugin<PanelOptions>(DashList) export const plugin = new PanelPlugin<Options>(DashList)
.setPanelOptions((builder) => { .setPanelOptions((builder) => {
builder builder
.addBooleanSwitch({ .addBooleanSwitch({
path: 'keepTime', path: 'keepTime',
name: 'Include current time range', name: 'Include current time range',
defaultValue: defaultPanelOptions.keepTime, defaultValue: defaultOptions.keepTime,
}) })
.addBooleanSwitch({ .addBooleanSwitch({
path: 'includeVars', path: 'includeVars',
name: 'Include current template variable values', name: 'Include current template variable values',
defaultValue: defaultPanelOptions.includeVars, defaultValue: defaultOptions.includeVars,
}) })
.addBooleanSwitch({ .addBooleanSwitch({
path: 'showStarred', path: 'showStarred',
name: 'Starred', name: 'Starred',
defaultValue: defaultPanelOptions.showStarred, defaultValue: defaultOptions.showStarred,
}) })
.addBooleanSwitch({ .addBooleanSwitch({
path: 'showRecentlyViewed', path: 'showRecentlyViewed',
name: 'Recently viewed', name: 'Recently viewed',
defaultValue: defaultPanelOptions.showRecentlyViewed, defaultValue: defaultOptions.showRecentlyViewed,
}) })
.addBooleanSwitch({ .addBooleanSwitch({
path: 'showSearch', path: 'showSearch',
name: 'Search', name: 'Search',
defaultValue: defaultPanelOptions.showSearch, defaultValue: defaultOptions.showSearch,
}) })
.addBooleanSwitch({ .addBooleanSwitch({
path: 'showHeadings', path: 'showHeadings',
name: 'Show headings', name: 'Show headings',
defaultValue: defaultPanelOptions.showHeadings, defaultValue: defaultOptions.showHeadings,
}) })
.addNumberInput({ .addNumberInput({
path: 'maxItems', path: 'maxItems',
name: 'Max items', name: 'Max items',
defaultValue: defaultPanelOptions.maxItems, defaultValue: defaultOptions.maxItems,
}) })
.addTextInput({ .addTextInput({
path: 'query', path: 'query',
name: 'Query', name: 'Query',
defaultValue: defaultPanelOptions.query, defaultValue: defaultOptions.query,
}) })
.addCustomEditor({ .addCustomEditor({
path: 'folderId', path: 'folderId',
@ -75,13 +75,13 @@ export const plugin = new PanelPlugin<PanelOptions>(DashList)
path: 'tags', path: 'tags',
name: 'Tags', name: 'Tags',
description: '', description: '',
defaultValue: defaultPanelOptions.tags, defaultValue: defaultOptions.tags,
editor(props) { editor(props) {
return <TagsInput tags={props.value} onChange={props.onChange} />; return <TagsInput tags={props.value} onChange={props.onChange} />;
}, },
}); });
}) })
.setMigrationHandler((panel: PanelModel<PanelOptions> & Record<string, any>) => { .setMigrationHandler((panel: PanelModel<Options> & Record<string, any>) => {
const newOptions = { const newOptions = {
showStarred: panel.options.showStarred ?? panel.starred, showStarred: panel.options.showStarred ?? panel.starred,
showRecentlyViewed: panel.options.showRecentlyViewed ?? panel.recent, showRecentlyViewed: panel.options.showRecentlyViewed ?? panel.recent,

View File

@ -22,7 +22,7 @@ composableKinds: PanelCfg: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
keepTime: bool | *false keepTime: bool | *false
includeVars: bool | *false includeVars: bool | *false
showStarred: bool | *true showStarred: bool | *true

View File

@ -10,7 +10,7 @@
export const PanelCfgModelVersion = Object.freeze([0, 0]); export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions { export interface Options {
folderId?: number; folderId?: number;
includeVars: boolean; includeVars: boolean;
keepTime: boolean; keepTime: boolean;
@ -23,7 +23,7 @@ export interface PanelOptions {
tags: Array<string>; tags: Array<string>;
} }
export const defaultPanelOptions: Partial<PanelOptions> = { export const defaultOptions: Partial<Options> = {
includeVars: false, includeVars: false,
keepTime: false, keepTime: false,
maxItems: 10, maxItems: 10,

View File

@ -20,7 +20,7 @@ import { AddColumn } from './components/AddColumn';
import { DatagridContextMenu } from './components/DatagridContextMenu'; import { DatagridContextMenu } from './components/DatagridContextMenu';
import { RenameColumnCell } from './components/RenameColumnCell'; import { RenameColumnCell } from './components/RenameColumnCell';
import { isDatagridEnabled } from './featureFlagUtils'; import { isDatagridEnabled } from './featureFlagUtils';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
import { DatagridActionType, datagridReducer, initialState } from './state'; import { DatagridActionType, datagridReducer, initialState } from './state';
import { import {
clearCellsFromRangeSelection, clearCellsFromRangeSelection,
@ -37,7 +37,7 @@ import {
updateSnapshot, updateSnapshot,
} from './utils'; } from './utils';
export interface DataGridProps extends PanelProps<PanelOptions> {} export interface DataGridProps extends PanelProps<Options> {}
export function DataGridPanel({ options, data, id, fieldConfig, width, height }: DataGridProps) { export function DataGridPanel({ options, data, id, fieldConfig, width, height }: DataGridProps) {
const [state, dispatch] = useReducer(datagridReducer, initialState); const [state, dispatch] = useReducer(datagridReducer, initialState);

View File

@ -1,22 +1,22 @@
import { PanelPlugin } from '@grafana/data'; import { PanelPlugin } from '@grafana/data';
import { DataGridPanel } from './DataGridPanel'; import { DataGridPanel } from './DataGridPanel';
import { defaultPanelOptions, PanelOptions } from './panelcfg.gen'; import { defaultOptions, Options } from './panelcfg.gen';
export const plugin = new PanelPlugin<PanelOptions>(DataGridPanel).setPanelOptions((builder, context) => { export const plugin = new PanelPlugin<Options>(DataGridPanel).setPanelOptions((builder, context) => {
const seriesOptions = context.data.map((frame, idx) => ({ value: idx, label: frame.refId })); const seriesOptions = context.data.map((frame, idx) => ({ value: idx, label: frame.refId }));
if ( if (
context.options && context.options &&
!seriesOptions.map((s: { value: number }) => s.value).includes(context.options.selectedSeries ?? 0) !seriesOptions.map((s: { value: number }) => s.value).includes(context.options.selectedSeries ?? 0)
) { ) {
context.options.selectedSeries = defaultPanelOptions.selectedSeries!; context.options.selectedSeries = defaultOptions.selectedSeries!;
} }
return builder.addSelect({ return builder.addSelect({
path: 'selectedSeries', path: 'selectedSeries',
name: 'Select series', name: 'Select series',
defaultValue: defaultPanelOptions.selectedSeries, defaultValue: defaultOptions.selectedSeries,
settings: { settings: {
options: seriesOptions, options: seriesOptions,
}, },

View File

@ -22,7 +22,7 @@ composableKinds: PanelCfg: {
{ {
schemas: [ schemas: [
{ {
PanelOptions: { Options: {
selectedSeries: int32 & >=0 | *0 selectedSeries: int32 & >=0 | *0
} @cuetsy(kind="interface") } @cuetsy(kind="interface")
}, },

View File

@ -10,10 +10,10 @@
export const PanelCfgModelVersion = Object.freeze([0, 0]); export const PanelCfgModelVersion = Object.freeze([0, 0]);
export interface PanelOptions { export interface Options {
selectedSeries: number; selectedSeries: number;
} }
export const defaultPanelOptions: Partial<PanelOptions> = { export const defaultOptions: Partial<Options> = {
selectedSeries: 0, selectedSeries: 0,
}; };

View File

@ -6,9 +6,9 @@ import { CursorView } from './CursorView';
import { EventBusLoggerPanel } from './EventBusLogger'; import { EventBusLoggerPanel } from './EventBusLogger';
import { RenderInfoViewer } from './RenderInfoViewer'; import { RenderInfoViewer } from './RenderInfoViewer';
import { StateView } from './StateView'; import { StateView } from './StateView';
import { PanelOptions, DebugMode } from './panelcfg.gen'; import { Options, DebugMode } from './panelcfg.gen';
type Props = PanelProps<PanelOptions>; type Props = PanelProps<Options>;
export class DebugPanel extends Component<Props> { export class DebugPanel extends Component<Props> {
render() { render() {

View File

@ -11,9 +11,9 @@ import {
} from '@grafana/data'; } from '@grafana/data';
import { IconButton } from '@grafana/ui'; import { IconButton } from '@grafana/ui';
import { PanelOptions, UpdateConfig } from './panelcfg.gen'; import { Options, UpdateConfig } from './panelcfg.gen';
type Props = PanelProps<PanelOptions>; type Props = PanelProps<Options>;
type UpdateCounters = { type UpdateCounters = {
[K in keyof UpdateConfig]: number; [K in keyof UpdateConfig]: number;

View File

@ -3,9 +3,9 @@ import React, { FormEvent } from 'react';
import { PanelOptionsEditorProps, PanelProps } from '@grafana/data'; import { PanelOptionsEditorProps, PanelProps } from '@grafana/data';
import { Field, Input, usePanelContext } from '@grafana/ui'; import { Field, Input, usePanelContext } from '@grafana/ui';
import { PanelOptions } from './panelcfg.gen'; import { Options } from './panelcfg.gen';
export function StateView(props: PanelProps<PanelOptions>) { export function StateView(props: PanelProps<Options>) {
const context = usePanelContext(); const context = usePanelContext();
const onChangeName = (e: FormEvent<HTMLInputElement>) => { const onChangeName = (e: FormEvent<HTMLInputElement>) => {

View File

@ -2,9 +2,9 @@ import { PanelPlugin } from '@grafana/data';
import { DebugPanel } from './DebugPanel'; import { DebugPanel } from './DebugPanel';
import { StateViewEditor } from './StateView'; import { StateViewEditor } from './StateView';
import { DebugMode, PanelOptions } from './panelcfg.gen'; import { DebugMode, Options } from './panelcfg.gen';
export const plugin = new PanelPlugin<PanelOptions>(DebugPanel).useFieldConfig().setPanelOptions((builder) => { export const plugin = new PanelPlugin<Options>(DebugPanel).useFieldConfig().setPanelOptions((builder) => {
builder builder
.addSelect({ .addSelect({
path: 'mode', path: 'mode',

Some files were not shown because too many files have changed in this diff Show More