diff --git a/docs/sources/developers/kinds/composable/alertgroupspanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/alertgroupspanelcfg/schema-reference.md index 40697956a47..8c5a5f91dad 100644 --- a/docs/sources/developers/kinds/composable/alertgroupspanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/alertgroupspanelcfg/schema-reference.md @@ -13,11 +13,11 @@ title: AlertGroupsPanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|-----------|--------------------|----------|---------|-------------| +| `Options` | [object](#options) | **Yes** | | | -### PanelOptions +### Options | Property | Type | Required | Default | Description | |----------------|---------|----------|---------|-------------------------------------------------------------| diff --git a/docs/sources/developers/kinds/composable/annotationslistpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/annotationslistpanelcfg/schema-reference.md index b5d98acf461..10bf7734054 100644 --- a/docs/sources/developers/kinds/composable/annotationslistpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/annotationslistpanelcfg/schema-reference.md @@ -13,11 +13,11 @@ title: AnnotationsListPanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|-----------|--------------------|----------|---------|-------------| +| `Options` | [object](#options) | **Yes** | | | -### PanelOptions +### Options | Property | Type | Required | Default | Description | |-------------------------|----------|----------|---------|-------------| diff --git a/docs/sources/developers/kinds/composable/barchartpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/barchartpanelcfg/schema-reference.md index 2bfe35d4273..a9cb3deda85 100644 --- a/docs/sources/developers/kinds/composable/barchartpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/barchartpanelcfg/schema-reference.md @@ -13,12 +13,12 @@ title: BarChartPanelCfg kind -| Property | Type | Required | Default | Description | -|--------------------|-----------------------------|----------|---------|-------------| -| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|---------------|------------------------|----------|---------|-------------| +| `FieldConfig` | [object](#fieldconfig) | **Yes** | | | +| `Options` | [object](#options) | **Yes** | | | -### PanelFieldConfig +### FieldConfig It extends [AxisConfig](#axisconfig) and [HideableFieldConfig](#hideablefieldconfig). @@ -91,7 +91,7 @@ TODO docs |------------|---------------------------------------|----------|---------|-------------| | `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs | -### PanelOptions +### Options It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTextFormatting](#optionswithtextformatting). diff --git a/docs/sources/developers/kinds/composable/bargaugepanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/bargaugepanelcfg/schema-reference.md index c8b16c51a00..d9d93d2485d 100644 --- a/docs/sources/developers/kinds/composable/bargaugepanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/bargaugepanelcfg/schema-reference.md @@ -13,11 +13,11 @@ title: BarGaugePanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|-----------|--------------------|----------|---------|-------------| +| `Options` | [object](#options) | **Yes** | | | -### PanelOptions +### Options It extends [SingleStatBaseOptions](#singlestatbaseoptions). diff --git a/docs/sources/developers/kinds/composable/dashboardlistpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/dashboardlistpanelcfg/schema-reference.md index 70cf0953e9f..3155ad87d21 100644 --- a/docs/sources/developers/kinds/composable/dashboardlistpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/dashboardlistpanelcfg/schema-reference.md @@ -13,11 +13,11 @@ title: DashboardListPanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|-----------|--------------------|----------|---------|-------------| +| `Options` | [object](#options) | **Yes** | | | -### PanelOptions +### Options | Property | Type | Required | Default | Description | |----------------------|----------|----------|---------|-------------| diff --git a/docs/sources/developers/kinds/composable/datagridpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/datagridpanelcfg/schema-reference.md index 7960e397144..48da483509e 100644 --- a/docs/sources/developers/kinds/composable/datagridpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/datagridpanelcfg/schema-reference.md @@ -13,11 +13,11 @@ title: DatagridPanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|-----------|--------------------|----------|---------|-------------| +| `Options` | [object](#options) | **Yes** | | | -### PanelOptions +### Options | Property | Type | Required | Default | Description | |------------------|---------|----------|---------|-----------------------------------| diff --git a/docs/sources/developers/kinds/composable/debugpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/debugpanelcfg/schema-reference.md index cef92f15639..1603e4812e9 100644 --- a/docs/sources/developers/kinds/composable/debugpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/debugpanelcfg/schema-reference.md @@ -16,10 +16,10 @@ title: DebugPanelCfg kind | Property | Type | Required | Default | Description | |----------------|-------------------------|----------|---------|---------------------------------------------------------------------------| | `DebugMode` | string | **Yes** | | Possible values are: `render`, `events`, `cursor`, `State`, `ThrowError`. | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| `Options` | [object](#options) | **Yes** | | | | `UpdateConfig` | [object](#updateconfig) | **Yes** | | | -### PanelOptions +### Options | Property | Type | Required | Default | Description | |------------|-------------------------------|----------|---------|---------------------------------------------------------------------------| diff --git a/docs/sources/developers/kinds/composable/gaugepanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/gaugepanelcfg/schema-reference.md index 1821b3ccea6..ceb32f80f72 100644 --- a/docs/sources/developers/kinds/composable/gaugepanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/gaugepanelcfg/schema-reference.md @@ -13,11 +13,11 @@ title: GaugePanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|-----------|--------------------|----------|---------|-------------| +| `Options` | [object](#options) | **Yes** | | | -### PanelOptions +### Options It extends [SingleStatBaseOptions](#singlestatbaseoptions). diff --git a/docs/sources/developers/kinds/composable/geomappanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/geomappanelcfg/schema-reference.md index 6b68810de66..55b57ec9a4e 100644 --- a/docs/sources/developers/kinds/composable/geomappanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/geomappanelcfg/schema-reference.md @@ -18,7 +18,7 @@ title: GeomapPanelCfg kind | `ControlsOptions` | [object](#controlsoptions) | **Yes** | | | | `MapCenterID` | string | **Yes** | | Possible values are: `zero`, `coords`, `fit`. | | `MapViewConfig` | [object](#mapviewconfig) | **Yes** | | | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| `Options` | [object](#options) | **Yes** | | | | `TooltipMode` | string | **Yes** | | Possible values are: `none`, `details`. | | `TooltipOptions` | [object](#tooltipoptions) | **Yes** | | | @@ -49,7 +49,7 @@ title: GeomapPanelCfg kind | `shared` | boolean | No | | | | `zoom` | int64 | No | `1` | | -### PanelOptions +### Options | Property | Type | Required | Default | Description | |------------|---------------------------------------|----------|---------|-------------| diff --git a/docs/sources/developers/kinds/composable/heatmappanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/heatmappanelcfg/schema-reference.md index 3c2a99716e1..7d4efc3081f 100644 --- a/docs/sources/developers/kinds/composable/heatmappanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/heatmappanelcfg/schema-reference.md @@ -17,14 +17,14 @@ title: HeatmapPanelCfg kind |-----------------------|--------------------------------|----------|---------|-------------------------------------------------------------------------------------------| | `CellValues` | [object](#cellvalues) | **Yes** | | Controls cell value options | | `ExemplarConfig` | [object](#exemplarconfig) | **Yes** | | Controls exemplar options | +| `FieldConfig` | [object](#fieldconfig) | **Yes** | | | | `FilterValueRange` | [object](#filtervaluerange) | **Yes** | | Controls the value filter range | | `HeatmapColorMode` | string | **Yes** | | Controls the color mode of the heatmap
Possible values are: `opacity`, `scheme`. | | `HeatmapColorOptions` | [object](#heatmapcoloroptions) | **Yes** | | Controls various color options | | `HeatmapColorScale` | string | **Yes** | | Controls the color scale of the heatmap
Possible values are: `linear`, `exponential`. | | `HeatmapLegend` | [object](#heatmaplegend) | **Yes** | | Controls legend options | | `HeatmapTooltip` | [object](#heatmaptooltip) | **Yes** | | Controls tooltip options | -| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| `Options` | [object](#options) | **Yes** | | | | `RowsHeatmapOptions` | [object](#rowsheatmapoptions) | **Yes** | | Controls frame rows options | | `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 | +### FieldConfig + +It extends [HideableFieldConfig](#hideablefieldconfig). + +| Property | Type | Required | Default | Description | +|---------------------|-----------------------------------------------------|----------|---------|------------------------------------------------------------------------------| +| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | *(Inherited from [HideableFieldConfig](#hideablefieldconfig))*
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
Possible values are: `linear`, `log`, `ordinal`, `symlog`. | +| `linearThreshold` | number | No | | | +| `log` | number | No | | | + ### FilterValueRange Controls the value filter range @@ -87,44 +124,7 @@ Controls tooltip options | `show` | boolean | **Yes** | | Controls if the tooltip is shown | | `yHistogram` | boolean | No | | Controls if the tooltip shows a histogram of the y-axis values | -### PanelFieldConfig - -It extends [HideableFieldConfig](#hideablefieldconfig). - -| Property | Type | Required | Default | Description | -|---------------------|-----------------------------------------------------|----------|---------|------------------------------------------------------------------------------| -| `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | *(Inherited from [HideableFieldConfig](#hideablefieldconfig))*
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
Possible values are: `linear`, `log`, `ordinal`, `symlog`. | -| `linearThreshold` | number | No | | | -| `log` | number | No | | | - -### PanelOptions +### Options | Property | Type | Required | Default | Description | |----------------|---------------------------------------------------------|----------|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| diff --git a/docs/sources/developers/kinds/composable/histogrampanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/histogrampanelcfg/schema-reference.md index d2cd33902ea..8db7d68aeb4 100644 --- a/docs/sources/developers/kinds/composable/histogrampanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/histogrampanelcfg/schema-reference.md @@ -13,12 +13,12 @@ title: HistogramPanelCfg kind -| Property | Type | Required | Default | Description | -|--------------------|-----------------------------|----------|---------|-------------| -| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|---------------|------------------------|----------|---------|-------------| +| `FieldConfig` | [object](#fieldconfig) | **Yes** | | | +| `Options` | [object](#options) | **Yes** | | | -### PanelFieldConfig +### FieldConfig It extends [AxisConfig](#axisconfig) and [HideableFieldConfig](#hideablefieldconfig). @@ -82,7 +82,7 @@ TODO docs |------------|---------------------------------------|----------|---------|-------------| | `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs | -### PanelOptions +### Options It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip). diff --git a/docs/sources/developers/kinds/composable/logspanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/logspanelcfg/schema-reference.md index f055a682486..898b37b6aaa 100644 --- a/docs/sources/developers/kinds/composable/logspanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/logspanelcfg/schema-reference.md @@ -13,11 +13,11 @@ title: LogsPanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|-----------|--------------------|----------|---------|-------------| +| `Options` | [object](#options) | **Yes** | | | -### PanelOptions +### Options | Property | Type | Required | Default | Description | |----------------------|---------|----------|---------|---------------------------------------------------------------| diff --git a/docs/sources/developers/kinds/composable/newspanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/newspanelcfg/schema-reference.md index b9351ea28f0..0a30b2951f1 100644 --- a/docs/sources/developers/kinds/composable/newspanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/newspanelcfg/schema-reference.md @@ -13,11 +13,11 @@ title: NewsPanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|-----------|--------------------|----------|---------|-------------| +| `Options` | [object](#options) | **Yes** | | | -### PanelOptions +### Options | Property | Type | Required | Default | Description | |-------------|---------|----------|---------|--------------------------------------------| diff --git a/docs/sources/developers/kinds/composable/nodegraphpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/nodegraphpanelcfg/schema-reference.md index e5196d3bf5f..62b010fb374 100644 --- a/docs/sources/developers/kinds/composable/nodegraphpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/nodegraphpanelcfg/schema-reference.md @@ -13,12 +13,12 @@ title: NodeGraphPanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `ArcOption` | [object](#arcoption) | **Yes** | | | -| `EdgeOptions` | [object](#edgeoptions) | **Yes** | | | -| `NodeOptions` | [object](#nodeoptions) | **Yes** | | | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|---------------|------------------------|----------|---------|-------------| +| `ArcOption` | [object](#arcoption) | **Yes** | | | +| `EdgeOptions` | [object](#edgeoptions) | **Yes** | | | +| `NodeOptions` | [object](#nodeoptions) | **Yes** | | | +| `Options` | [object](#options) | **Yes** | | | ### 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. | | `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 | |----------|-----------------------------|----------|---------|-------------| diff --git a/docs/sources/developers/kinds/composable/piechartpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/piechartpanelcfg/schema-reference.md index 2f2b779c35a..0d032859041 100644 --- a/docs/sources/developers/kinds/composable/piechartpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/piechartpanelcfg/schema-reference.md @@ -15,8 +15,8 @@ title: PieChartPanelCfg kind | Property | Type | Required | Default | Description | |-------------------------|---------------------------------------------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `PanelFieldConfig` | [HideableFieldConfig](#hideablefieldconfig) | **Yes** | | TODO docs | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| `FieldConfig` | [HideableFieldConfig](#hideablefieldconfig) | **Yes** | | TODO docs | +| `Options` | [object](#options) | **Yes** | | | | `PieChartLabels` | string | **Yes** | | Select labels to display on the pie chart.
- Name - The series or field name.
- Percent - The percentage of the whole.
- Value - The raw numerical value.
Possible values are: `name`, `value`, `percent`. | | `PieChartLegendOptions` | [object](#piechartlegendoptions) | **Yes** | | | | `PieChartLegendValues` | string | **Yes** | | Select values to display in the legend.
- Percent: The percentage of the whole.
- Value: The raw numerical value.
Possible values are: `value`, `percent`. | @@ -40,7 +40,7 @@ TODO docs | `tooltip` | boolean | **Yes** | | | | `viz` | boolean | **Yes** | | | -### PanelOptions +### Options It extends [OptionsWithTooltip](#optionswithtooltip) and [SingleStatBaseOptions](#singlestatbaseoptions). diff --git a/docs/sources/developers/kinds/composable/statetimelinepanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/statetimelinepanelcfg/schema-reference.md index 174d173249a..d383e8e68fd 100644 --- a/docs/sources/developers/kinds/composable/statetimelinepanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/statetimelinepanelcfg/schema-reference.md @@ -13,12 +13,12 @@ title: StateTimelinePanelCfg kind -| Property | Type | Required | Default | Description | -|--------------------|-----------------------------|----------|---------|-------------| -| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|---------------|------------------------|----------|---------|-------------| +| `FieldConfig` | [object](#fieldconfig) | **Yes** | | | +| `Options` | [object](#options) | **Yes** | | | -### PanelFieldConfig +### FieldConfig It extends [HideableFieldConfig](#hideablefieldconfig). @@ -46,7 +46,7 @@ TODO docs |------------|---------------------------------------|----------|---------|-------------| | `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs | -### PanelOptions +### Options It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTimezones](#optionswithtimezones). diff --git a/docs/sources/developers/kinds/composable/statpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/statpanelcfg/schema-reference.md index 5aa0c1ab84a..f4949566aa9 100644 --- a/docs/sources/developers/kinds/composable/statpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/statpanelcfg/schema-reference.md @@ -13,11 +13,11 @@ title: StatPanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|-----------|--------------------|----------|---------|-------------| +| `Options` | [object](#options) | **Yes** | | | -### PanelOptions +### Options It extends [SingleStatBaseOptions](#singlestatbaseoptions). diff --git a/docs/sources/developers/kinds/composable/statushistorypanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/statushistorypanelcfg/schema-reference.md index baaf987b83b..1113fbaa539 100644 --- a/docs/sources/developers/kinds/composable/statushistorypanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/statushistorypanelcfg/schema-reference.md @@ -13,12 +13,12 @@ title: StatusHistoryPanelCfg kind -| Property | Type | Required | Default | Description | -|--------------------|-----------------------------|----------|---------|-------------| -| `PanelFieldConfig` | [object](#panelfieldconfig) | **Yes** | | | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|---------------|------------------------|----------|---------|-------------| +| `FieldConfig` | [object](#fieldconfig) | **Yes** | | | +| `Options` | [object](#options) | **Yes** | | | -### PanelFieldConfig +### FieldConfig It extends [HideableFieldConfig](#hideablefieldconfig). @@ -46,7 +46,7 @@ TODO docs |------------|---------------------------------------|----------|---------|-------------| | `hideFrom` | [HideSeriesConfig](#hideseriesconfig) | No | | TODO docs | -### PanelOptions +### Options It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip) and [OptionsWithTimezones](#optionswithtimezones). diff --git a/docs/sources/developers/kinds/composable/tablepanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/tablepanelcfg/schema-reference.md index e03d4d6f868..6a054007d25 100644 --- a/docs/sources/developers/kinds/composable/tablepanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/tablepanelcfg/schema-reference.md @@ -13,11 +13,11 @@ title: TablePanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|---------|-------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|-----------|--------------------|----------|---------|-------------| +| `Options` | [object](#options) | **Yes** | | | -### PanelOptions +### Options | Property | Type | Required | Default | Description | |-----------------|---------------------------------------------------|----------|----------------------------------------------|--------------------------------------------------------------------| diff --git a/docs/sources/developers/kinds/composable/textpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/textpanelcfg/schema-reference.md index acdeb39703c..067c697f620 100644 --- a/docs/sources/developers/kinds/composable/textpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/textpanelcfg/schema-reference.md @@ -13,12 +13,12 @@ title: TextPanelCfg kind -| Property | Type | Required | Default | Description | -|----------------|-------------------------|----------|-------------|---------------------------------------------------------------------------------------------------------| -| `CodeLanguage` | string | **Yes** | `plaintext` | Possible values are: `plaintext`, `yaml`, `xml`, `typescript`, `sql`, `go`, `markdown`, `html`, `json`. | -| `CodeOptions` | [object](#codeoptions) | **Yes** | | | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | -| `TextMode` | string | **Yes** | | Possible values are: `html`, `markdown`, `code`. | +| Property | Type | Required | Default | Description | +|----------------|------------------------|----------|-------------|---------------------------------------------------------------------------------------------------------| +| `CodeLanguage` | string | **Yes** | `plaintext` | Possible values are: `plaintext`, `yaml`, `xml`, `typescript`, `sql`, `go`, `markdown`, `html`, `json`. | +| `CodeOptions` | [object](#codeoptions) | **Yes** | | | +| `Options` | [object](#options) | **Yes** | | | +| `TextMode` | string | **Yes** | | Possible values are: `html`, `markdown`, `code`. | ### CodeOptions @@ -28,7 +28,7 @@ title: TextPanelCfg kind | `showLineNumbers` | boolean | **Yes** | `false` | | | `showMiniMap` | boolean | **Yes** | `false` | | -### PanelOptions +### Options | Property | Type | Required | Default | Description | |-----------|-----------------------------|----------|--------------------------------------------------------------------------------|--------------------------------------------------| diff --git a/docs/sources/developers/kinds/composable/timeseriespanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/timeseriespanelcfg/schema-reference.md index 4e1a7d041ae..f5d2a9f8e2d 100644 --- a/docs/sources/developers/kinds/composable/timeseriespanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/timeseriespanelcfg/schema-reference.md @@ -13,10 +13,10 @@ title: TimeSeriesPanelCfg kind -| Property | Type | Required | Default | Description | -|--------------------|---------------------------------------|----------|---------|-------------| -| `PanelFieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| Property | Type | Required | Default | Description | +|---------------|---------------------------------------|----------|---------|-------------| +| `FieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs | +| `Options` | [object](#options) | **Yes** | | | ### GraphFieldConfig @@ -178,7 +178,7 @@ TODO docs | `group` | string | No | | | | `mode` | string | No | | TODO docs
Possible values are: `none`, `normal`, `percent`. | -### PanelOptions +### Options It extends [OptionsWithTimezones](#optionswithtimezones). diff --git a/docs/sources/developers/kinds/composable/trendpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/trendpanelcfg/schema-reference.md index e1a019b0d5e..2908dc13bf8 100644 --- a/docs/sources/developers/kinds/composable/trendpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/trendpanelcfg/schema-reference.md @@ -13,10 +13,10 @@ title: TrendPanelCfg kind -| Property | Type | Required | Default | Description | -|--------------------|---------------------------------------|----------|---------|----------------------------------------------------------------------| -| `PanelFieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs | -| `PanelOptions` | [object](#paneloptions) | **Yes** | | Identical to timeseries... except it does not have timezone settings | +| Property | Type | Required | Default | Description | +|---------------|---------------------------------------|----------|---------|----------------------------------------------------------------------| +| `FieldConfig` | [GraphFieldConfig](#graphfieldconfig) | **Yes** | | TODO docs | +| `Options` | [object](#options) | **Yes** | | Identical to timeseries... except it does not have timezone settings | ### GraphFieldConfig @@ -178,7 +178,7 @@ TODO docs | `group` | string | No | | | | `mode` | string | No | | TODO docs
Possible values are: `none`, `normal`, `percent`. | -### PanelOptions +### Options Identical to timeseries... except it does not have timezone settings diff --git a/docs/sources/developers/kinds/composable/xychartpanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/xychartpanelcfg/schema-reference.md index 7f00947e8b3..cdcfffeb885 100644 --- a/docs/sources/developers/kinds/composable/xychartpanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/xychartpanelcfg/schema-reference.md @@ -15,14 +15,14 @@ title: XYChartPanelCfg kind | Property | Type | Required | Default | Description | |-----------------------|--------------------------------|----------|---------|---------------------------------------------------------| -| `PanelOptions` | [object](#paneloptions) | **Yes** | | | +| `Options` | [object](#options) | **Yes** | | | | `ScatterFieldConfig` | [object](#scatterfieldconfig) | **Yes** | | | | `ScatterSeriesConfig` | [object](#scatterseriesconfig) | **Yes** | | | | `ScatterShow` | string | **Yes** | | Possible values are: `points`, `lines`, `points+lines`. | | `SeriesMapping` | string | **Yes** | | Possible values are: `auto`, `manual`. | | `XYDimensionConfig` | [object](#xydimensionconfig) | **Yes** | | | -### PanelOptions +### Options It extends [OptionsWithLegend](#optionswithlegend) and [OptionsWithTooltip](#optionswithtooltip). diff --git a/docs/sources/developers/kinds/core/dashboard/schema-reference.md b/docs/sources/developers/kinds/core/dashboard/schema-reference.md index 43bb5161711..9e002ceeddf 100644 --- a/docs/sources/developers/kinds/core/dashboard/schema-reference.md +++ b/docs/sources/developers/kinds/core/dashboard/schema-reference.md @@ -215,7 +215,7 @@ TODO docs | Property | Type | Required | Default | Description | |---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `color` | [FieldColor](#fieldcolor) | No | | TODO docs | -| `custom` | [object](#custom) | No | | custom is specified by the PanelFieldConfig field
in panel plugin schemas. | +| `custom` | [object](#custom) | No | | custom is specified by the FieldConfig field
in panel plugin schemas. | | `decimals` | number | No | | Significant digits (for display) | | `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
When this property is configured, this value is used rather than the default naming strategy. | @@ -339,7 +339,7 @@ TODO docs ### Custom -custom is specified by the PanelFieldConfig field +custom is specified by the FieldConfig field in panel plugin schemas. | Property | Type | Required | Default | Description | @@ -410,7 +410,7 @@ schema; they do not evolve independently. | Property | Type | Required | Default | Description | |-------------------|---------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------| | `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | | -| `options` | [object](#options) | **Yes** | | options is specified by the PanelOptions field in panel
plugin schemas. | +| `options` | [object](#options) | **Yes** | | options is specified by the Options field in panel
plugin schemas. | | `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.
"h" for horizontal, "v" for vertical.
TODO this is probably optional
Possible values are: `h`, `v`. | | `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | | | `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 | |---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `color` | [FieldColor](#fieldcolor) | No | | TODO docs | -| `custom` | [custom](#custom) | No | | custom is specified by the PanelFieldConfig field
in panel plugin schemas. | +| `custom` | [custom](#custom) | No | | custom is specified by the FieldConfig field
in panel plugin schemas. | | `decimals` | number | No | | Significant digits (for display) | | `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
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 is specified by the PanelOptions field in panel +options is specified by the Options field in panel plugin schemas. | Property | Type | Required | Default | Description | @@ -567,7 +567,7 @@ schema; they do not evolve independently. | Property | Type | Required | Default | Description | |-------------------|---------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------| | `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | | -| `options` | [options](#options) | **Yes** | | options is specified by the PanelOptions field in panel
plugin schemas. | +| `options` | [options](#options) | **Yes** | | options is specified by the Options field in panel
plugin schemas. | | `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.
"h" for horizontal, "v" for vertical.
TODO this is probably optional
Possible values are: `h`, `v`. | | `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | | | `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 | |--------------------|----------------------------------------------------------------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `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.
Any operator which consumes this kind SHOULD add its state evaluation information to this field. | ### AdditionalFields diff --git a/docs/sources/developers/kinds/core/folder/schema-reference.md b/docs/sources/developers/kinds/core/folder/schema-reference.md index dca49d90100..f2d318ca9c1 100644 --- a/docs/sources/developers/kinds/core/folder/schema-reference.md +++ b/docs/sources/developers/kinds/core/folder/schema-reference.md @@ -74,7 +74,7 @@ extraFields is reserved for any fields that are pulled from the API server metad | 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.
Any operator which consumes this kind SHOULD add its state evaluation information to this field. | ### AdditionalFields diff --git a/docs/sources/developers/kinds/core/librarypanel/schema-reference.md b/docs/sources/developers/kinds/core/librarypanel/schema-reference.md index b0e7fa8b078..7cb34df6ce7 100644 --- a/docs/sources/developers/kinds/core/librarypanel/schema-reference.md +++ b/docs/sources/developers/kinds/core/librarypanel/schema-reference.md @@ -108,7 +108,7 @@ Typescript: Omit; | 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.
Any operator which consumes this kind SHOULD add its state evaluation information to this field. | ### AdditionalFields diff --git a/docs/sources/developers/kinds/core/playlist/schema-reference.md b/docs/sources/developers/kinds/core/playlist/schema-reference.md index 06285751bef..f9dff68f48e 100644 --- a/docs/sources/developers/kinds/core/playlist/schema-reference.md +++ b/docs/sources/developers/kinds/core/playlist/schema-reference.md @@ -83,7 +83,7 @@ extraFields is reserved for any fields that are pulled from the API server metad | 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.
Any operator which consumes this kind SHOULD add its state evaluation information to this field. | ### AdditionalFields diff --git a/docs/sources/developers/kinds/core/preferences/schema-reference.md b/docs/sources/developers/kinds/core/preferences/schema-reference.md index 54254a08232..42ecb60000e 100644 --- a/docs/sources/developers/kinds/core/preferences/schema-reference.md +++ b/docs/sources/developers/kinds/core/preferences/schema-reference.md @@ -83,7 +83,7 @@ extraFields is reserved for any fields that are pulled from the API server metad | 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.
Any operator which consumes this kind SHOULD add its state evaluation information to this field. | ### AdditionalFields diff --git a/docs/sources/developers/kinds/core/publicdashboard/schema-reference.md b/docs/sources/developers/kinds/core/publicdashboard/schema-reference.md index 1539db4cf20..1001879803e 100644 --- a/docs/sources/developers/kinds/core/publicdashboard/schema-reference.md +++ b/docs/sources/developers/kinds/core/publicdashboard/schema-reference.md @@ -77,7 +77,7 @@ extraFields is reserved for any fields that are pulled from the API server metad | 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.
Any operator which consumes this kind SHOULD add its state evaluation information to this field. | ### AdditionalFields diff --git a/docs/sources/developers/kinds/core/serviceaccount/schema-reference.md b/docs/sources/developers/kinds/core/serviceaccount/schema-reference.md index dd9a9942187..34a680a7d46 100644 --- a/docs/sources/developers/kinds/core/serviceaccount/schema-reference.md +++ b/docs/sources/developers/kinds/core/serviceaccount/schema-reference.md @@ -81,7 +81,7 @@ extraFields is reserved for any fields that are pulled from the API server metad | 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.
Any operator which consumes this kind SHOULD add its state evaluation information to this field. | ### AdditionalFields diff --git a/docs/sources/developers/kinds/core/team/schema-reference.md b/docs/sources/developers/kinds/core/team/schema-reference.md index 8950ac81b88..f2e9b55bb57 100644 --- a/docs/sources/developers/kinds/core/team/schema-reference.md +++ b/docs/sources/developers/kinds/core/team/schema-reference.md @@ -78,7 +78,7 @@ extraFields is reserved for any fields that are pulled from the API server metad | 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.
Any operator which consumes this kind SHOULD add its state evaluation information to this field. | ### AdditionalFields diff --git a/go.mod b/go.mod index f07e2474f33..c6e26599dc9 100644 --- a/go.mod +++ b/go.mod @@ -264,7 +264,7 @@ require ( github.com/grafana/dataplane/examples v0.0.0-20230404174214-4d6fd58a18ad github.com/grafana/dataplane/sdata v0.0.6 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/redis/go-redis/v9 v9.0.2 github.com/weaveworks/common v0.0.0-20230208133027-16871410fca4 diff --git a/go.sum b/go.sum index bd5430000c9..71c81031cd0 100644 --- a/go.sum +++ b/go.sum @@ -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.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/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/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/go.mod h1:IvwuGG9xa/h96UH/exgvsfy3zE+ZpctkNT9o5aaGdrU= github.com/grafana/prometheus-alertmanager v0.25.1-0.20230508090422-7d5630522a53 h1:X3Jl4PBIGCtlPSMa6Uiu2+3FDNWmddSjivp+1DDznQs= diff --git a/kinds/dashboard/dashboard_kind.cue b/kinds/dashboard/dashboard_kind.cue index 6711c0deb61..e1e2fe7b6b4 100644 --- a/kinds/dashboard/dashboard_kind.cue +++ b/kinds/dashboard/dashboard_kind.cue @@ -460,7 +460,7 @@ lineage: seqs: [ // Dynamically load the panel libraryPanel?: #LibraryPanelRef - // options is specified by the PanelOptions field in panel + // options is specified by the Options field in panel // plugin schemas. options: {...} @grafanamaturity(NeedsExpertReview) @@ -541,7 +541,7 @@ lineage: seqs: [ // Alternative to empty string noValue?: string @grafanamaturity(NeedsExpertReview) - // custom is specified by the PanelFieldConfig field + // custom is specified by the FieldConfig field // in panel plugin schemas. custom?: {...} @grafanamaturity(NeedsExpertReview) } @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview) diff --git a/packages/grafana-schema/src/raw/dashboard/x/dashboard_types.gen.ts b/packages/grafana-schema/src/raw/dashboard/x/dashboard_types.gen.ts index 144f939eee2..c2c0a3e2555 100644 --- a/packages/grafana-schema/src/raw/dashboard/x/dashboard_types.gen.ts +++ b/packages/grafana-schema/src/raw/dashboard/x/dashboard_types.gen.ts @@ -482,7 +482,7 @@ export interface Panel { */ maxDataPoints?: number; /** - * options is specified by the PanelOptions field in panel + * options is specified by the Options field in panel * plugin schemas. */ options: Record; @@ -591,7 +591,7 @@ export interface FieldConfig { */ color?: FieldColor; /** - * custom is specified by the PanelFieldConfig field + * custom is specified by the FieldConfig field * in panel plugin schemas. */ custom?: Record; diff --git a/pkg/kinds/dashboard/dashboard_spec_gen.go b/pkg/kinds/dashboard/dashboard_spec_gen.go index 384abdf7b00..5d4ff373638 100644 --- a/pkg/kinds/dashboard/dashboard_spec_gen.go +++ b/pkg/kinds/dashboard/dashboard_spec_gen.go @@ -279,7 +279,7 @@ type FieldConfig struct { // TODO docs Color *FieldColor `json:"color,omitempty"` - // custom is specified by the PanelFieldConfig field + // custom is specified by the FieldConfig field // in panel plugin schemas. Custom map[string]interface{} `json:"custom,omitempty"` @@ -422,7 +422,7 @@ type Panel struct { // TODO docs 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. Options map[string]interface{} `json:"options"` diff --git a/pkg/kinds/dashboard/dashboard_status_gen.go b/pkg/kinds/dashboard/dashboard_status_gen.go index f8dd45b58b4..837817189a6 100644 --- a/pkg/kinds/dashboard/dashboard_status_gen.go +++ b/pkg/kinds/dashboard/dashboard_status_gen.go @@ -39,7 +39,7 @@ type OperatorStateState string // Status defines model for Status. type Status struct { // 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. // Any operator which consumes this kind SHOULD add its state evaluation information to this field. diff --git a/pkg/kinds/folder/folder_status_gen.go b/pkg/kinds/folder/folder_status_gen.go index 2a8f6a334eb..7084903509d 100644 --- a/pkg/kinds/folder/folder_status_gen.go +++ b/pkg/kinds/folder/folder_status_gen.go @@ -39,7 +39,7 @@ type OperatorStateState string // Status defines model for Status. type Status struct { // 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. // Any operator which consumes this kind SHOULD add its state evaluation information to this field. diff --git a/pkg/kinds/librarypanel/librarypanel_status_gen.go b/pkg/kinds/librarypanel/librarypanel_status_gen.go index de50bacf2f7..e92e5397980 100644 --- a/pkg/kinds/librarypanel/librarypanel_status_gen.go +++ b/pkg/kinds/librarypanel/librarypanel_status_gen.go @@ -39,7 +39,7 @@ type OperatorStateState string // Status defines model for Status. type Status struct { // 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. // Any operator which consumes this kind SHOULD add its state evaluation information to this field. diff --git a/pkg/kinds/playlist/playlist_status_gen.go b/pkg/kinds/playlist/playlist_status_gen.go index 0ad3608f04e..c928ac191f7 100644 --- a/pkg/kinds/playlist/playlist_status_gen.go +++ b/pkg/kinds/playlist/playlist_status_gen.go @@ -39,7 +39,7 @@ type OperatorStateState string // Status defines model for Status. type Status struct { // 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. // Any operator which consumes this kind SHOULD add its state evaluation information to this field. diff --git a/pkg/kinds/preferences/preferences_status_gen.go b/pkg/kinds/preferences/preferences_status_gen.go index 22fb6b7f5c3..868cf70eea4 100644 --- a/pkg/kinds/preferences/preferences_status_gen.go +++ b/pkg/kinds/preferences/preferences_status_gen.go @@ -39,7 +39,7 @@ type OperatorStateState string // Status defines model for Status. type Status struct { // 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. // Any operator which consumes this kind SHOULD add its state evaluation information to this field. diff --git a/pkg/kinds/publicdashboard/publicdashboard_status_gen.go b/pkg/kinds/publicdashboard/publicdashboard_status_gen.go index 95665a48706..2761b84af26 100644 --- a/pkg/kinds/publicdashboard/publicdashboard_status_gen.go +++ b/pkg/kinds/publicdashboard/publicdashboard_status_gen.go @@ -39,7 +39,7 @@ type OperatorStateState string // Status defines model for Status. type Status struct { // 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. // Any operator which consumes this kind SHOULD add its state evaluation information to this field. diff --git a/pkg/kinds/serviceaccount/serviceaccount_status_gen.go b/pkg/kinds/serviceaccount/serviceaccount_status_gen.go index a2480770195..cf7d545c34f 100644 --- a/pkg/kinds/serviceaccount/serviceaccount_status_gen.go +++ b/pkg/kinds/serviceaccount/serviceaccount_status_gen.go @@ -39,7 +39,7 @@ type OperatorStateState string // Status defines model for Status. type Status struct { // 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. // Any operator which consumes this kind SHOULD add its state evaluation information to this field. diff --git a/pkg/kinds/team/team_status_gen.go b/pkg/kinds/team/team_status_gen.go index 77957257d5f..088483794d1 100644 --- a/pkg/kinds/team/team_status_gen.go +++ b/pkg/kinds/team/team_status_gen.go @@ -39,7 +39,7 @@ type OperatorStateState string // Status defines model for Status. type Status struct { // 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. // Any operator which consumes this kind SHOULD add its state evaluation information to this field. diff --git a/pkg/plugins/manager/testdata/disallowed-cue-import/composable.cue b/pkg/plugins/manager/testdata/disallowed-cue-import/composable.cue index 9860217cda5..53bee61158a 100644 --- a/pkg/plugins/manager/testdata/disallowed-cue-import/composable.cue +++ b/pkg/plugins/manager/testdata/disallowed-cue-import/composable.cue @@ -14,7 +14,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { foo: string } @cuetsy(kind="interface") }, diff --git a/pkg/plugins/manager/testdata/name-mismatch-panel/composable_panelcfg.cue b/pkg/plugins/manager/testdata/name-mismatch-panel/composable_panelcfg.cue index afa95827f18..1ce326d0bbe 100644 --- a/pkg/plugins/manager/testdata/name-mismatch-panel/composable_panelcfg.cue +++ b/pkg/plugins/manager/testdata/name-mismatch-panel/composable_panelcfg.cue @@ -6,7 +6,7 @@ composableKinds: PanelCfg: lineage: { { schemas: [ { - PanelOptions: { + Options: { foo: string } @cuetsy(kind="interface") }, diff --git a/pkg/plugins/manager/testdata/panel-conflicting-joinschema/composable.cue b/pkg/plugins/manager/testdata/panel-conflicting-joinschema/composable.cue index d93b7e57c78..b8118e1179f 100644 --- a/pkg/plugins/manager/testdata/panel-conflicting-joinschema/composable.cue +++ b/pkg/plugins/manager/testdata/panel-conflicting-joinschema/composable.cue @@ -5,18 +5,18 @@ import "github.com/grafana/thema" composableKinds: PanelCfg: { lineage: { joinSchema: { - PanelOptions: {...} - PanelFieldConfig: string + Options: {...} + FieldConfig: string } name: "panel_conflicting_joinschema" seqs: [ { schemas: [ { - PanelOptions: { + Options: { foo: string } @cuetsy(kind="interface") - PanelFieldConfig: string + FieldConfig: string }, ] }, diff --git a/pkg/plugins/manager/testdata/panel-does-not-follow-slot-joinschema/composable.cue b/pkg/plugins/manager/testdata/panel-does-not-follow-slot-joinschema/composable.cue index 9c504db59e6..39bdcaafe9e 100644 --- a/pkg/plugins/manager/testdata/panel-does-not-follow-slot-joinschema/composable.cue +++ b/pkg/plugins/manager/testdata/panel-does-not-follow-slot-joinschema/composable.cue @@ -9,10 +9,10 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { foo: string } @cuetsy(kind="interface") - PanelFieldConfig: string + FieldConfig: string }, ] }, diff --git a/pkg/plugins/manager/testdata/valid-model-panel/composable.cue b/pkg/plugins/manager/testdata/valid-model-panel/composable.cue index a33fdf7cc19..e5437d645bb 100644 --- a/pkg/plugins/manager/testdata/valid-model-panel/composable.cue +++ b/pkg/plugins/manager/testdata/valid-model-panel/composable.cue @@ -5,7 +5,7 @@ composableKinds: PanelCfg: lineage: { { schemas: [ { - PanelOptions: { + Options: { foo: string } @cuetsy(kind="interface") }, diff --git a/public/app/core/components/TimelineChart/timeline.ts b/public/app/core/components/TimelineChart/timeline.ts index bfad801275f..6a53ef3b363 100644 --- a/public/app/core/components/TimelineChart/timeline.ts +++ b/public/app/core/components/TimelineChart/timeline.ts @@ -6,8 +6,8 @@ import { VisibilityMode, TimelineValueAlignment } from '@grafana/schema'; import { FIXED_UNIT } from '@grafana/ui/src/components/GraphNG/GraphNG'; import { distribute, SPACE_BETWEEN } from 'app/plugins/panel/barchart/distribute'; import { pointWithin, Quadtree, Rect } from 'app/plugins/panel/barchart/quadtree'; -import { PanelFieldConfig 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 StateTimeLineFieldConfig } from 'app/plugins/panel/state-timeline/panelcfg.gen'; +import { FieldConfig as StatusHistoryFieldConfig } from 'app/plugins/panel/status-history/panelcfg.gen'; import { TimelineMode } from './utils'; diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.tsx index 065131123df..12b06b511a5 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.tsx @@ -4,7 +4,7 @@ import { RefreshEvent } from '@grafana/runtime'; import { PanelChrome } from '@grafana/ui'; import { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel'; 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 { getTimeSrv } from '../../services/TimeSrv'; @@ -21,7 +21,7 @@ export interface Props { export function PanelEditorTableView({ width, height, panel, dashboard }: Props) { const { data } = usePanelLatestData(panel, { withTransforms: true, withFieldConfig: false }, false); - const [options, setOptions] = useState({ + const [options, setOptions] = useState({ frameIndex: 0, showHeader: true, showTypeIcons: true, diff --git a/public/app/features/explore/Graph/ExploreGraph.tsx b/public/app/features/explore/Graph/ExploreGraph.tsx index 2eeb0fee9cf..9b3fdd72766 100644 --- a/public/app/features/explore/Graph/ExploreGraph.tsx +++ b/public/app/features/explore/Graph/ExploreGraph.tsx @@ -38,7 +38,7 @@ import { } from '@grafana/ui'; import { GraphFieldConfig } from 'app/plugins/panel/graph/types'; 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 { seriesVisibilityConfigFactory } from '../../dashboard/dashgrid/SeriesVisibilityConfigFactory'; diff --git a/public/app/features/scenes/builders/panelBuilders.ts b/public/app/features/scenes/builders/panelBuilders.ts index 9ecedd11b5d..c8b15fd456c 100644 --- a/public/app/features/scenes/builders/panelBuilders.ts +++ b/public/app/features/scenes/builders/panelBuilders.ts @@ -1,8 +1,8 @@ import { VizPanel, VizPanelState } from '@grafana/scenes'; import { GraphFieldConfig, TableFieldOptions } from '@grafana/schema'; -import { PanelOptions as BarGaugePanelOptions } from 'app/plugins/panel/bargauge/panelcfg.gen'; -import { PanelOptions as TablePanelOptions } from 'app/plugins/panel/table/panelcfg.gen'; -import { PanelOptions as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen'; +import { Options as BarGaugePanelOptions } from 'app/plugins/panel/bargauge/panelcfg.gen'; +import { Options as TablePanelOptions } from 'app/plugins/panel/table/panelcfg.gen'; +import { Options as TimeSeriesOptions } from 'app/plugins/panel/timeseries/panelcfg.gen'; export type TypedVizPanelState = Omit< Partial>, diff --git a/public/app/plugins/panel/alertGroups/AlertGroupsPanel.test.tsx b/public/app/plugins/panel/alertGroups/AlertGroupsPanel.test.tsx index 6849197c054..5499e623250 100644 --- a/public/app/plugins/panel/alertGroups/AlertGroupsPanel.test.tsx +++ b/public/app/plugins/panel/alertGroups/AlertGroupsPanel.test.tsx @@ -19,7 +19,7 @@ import { DashboardModel } from 'app/features/dashboard/state'; import { configureStore } from 'app/store/configureStore'; import { AlertGroupsPanel } from './AlertGroupsPanel'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; jest.mock('app/features/alerting/unified/api/alertmanager'); @@ -46,13 +46,13 @@ const dataSources = { }), }; -const defaultOptions: PanelOptions = { +const defaultOptions: Options = { labels: '', alertmanager: 'Alertmanager', expandAll: false, }; -const defaultProps: PanelProps = { +const defaultProps: PanelProps = { data: { state: LoadingState.Done, series: [], timeRange: getDefaultTimeRange() }, id: 1, timeRange: getDefaultTimeRange(), @@ -79,7 +79,7 @@ const defaultProps: PanelProps = { width: 320, }; -const renderPanel = (options: PanelOptions = defaultOptions) => { +const renderPanel = (options: Options = defaultOptions) => { const store = configureStore(); const dash = new DashboardModel({ id: 1 } as Dashboard); dash.formatDate = (time: number) => new Date(time).toISOString(); diff --git a/public/app/plugins/panel/alertGroups/AlertGroupsPanel.tsx b/public/app/plugins/panel/alertGroups/AlertGroupsPanel.tsx index 00badfa982e..8de959e4da1 100644 --- a/public/app/plugins/panel/alertGroups/AlertGroupsPanel.tsx +++ b/public/app/plugins/panel/alertGroups/AlertGroupsPanel.tsx @@ -12,10 +12,10 @@ import { AlertmanagerGroup, Matcher } from 'app/plugins/datasource/alertmanager/ import { useDispatch } from 'app/types'; import { AlertGroup } from './AlertGroup'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; import { useFilteredGroups } from './useFilteredGroups'; -export const AlertGroupsPanel = (props: PanelProps) => { +export const AlertGroupsPanel = (props: PanelProps) => { const dispatch = useDispatch(); const isAlertingEnabled = config.unifiedAlertingEnabled; diff --git a/public/app/plugins/panel/alertGroups/module.tsx b/public/app/plugins/panel/alertGroups/module.tsx index 66aeabd22c1..d46df5fcfd3 100644 --- a/public/app/plugins/panel/alertGroups/module.tsx +++ b/public/app/plugins/panel/alertGroups/module.tsx @@ -8,9 +8,9 @@ import { } from 'app/features/alerting/unified/utils/datasource'; import { AlertGroupsPanel } from './AlertGroupsPanel'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; -export const plugin = new PanelPlugin(AlertGroupsPanel).setPanelOptions((builder) => { +export const plugin = new PanelPlugin(AlertGroupsPanel).setPanelOptions((builder) => { return builder .addCustomEditor({ name: 'Alertmanager', diff --git a/public/app/plugins/panel/alertGroups/panelcfg.cue b/public/app/plugins/panel/alertGroups/panelcfg.cue index 009ff732fdf..f5908d13799 100644 --- a/public/app/plugins/panel/alertGroups/panelcfg.cue +++ b/public/app/plugins/panel/alertGroups/panelcfg.cue @@ -20,7 +20,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { // Comma-separated list of values used to filter alert results labels: string // Name of the alertmanager used as a source for alerts diff --git a/public/app/plugins/panel/alertGroups/panelcfg.gen.ts b/public/app/plugins/panel/alertGroups/panelcfg.gen.ts index d7543479587..25eaf3015bb 100644 --- a/public/app/plugins/panel/alertGroups/panelcfg.gen.ts +++ b/public/app/plugins/panel/alertGroups/panelcfg.gen.ts @@ -10,7 +10,7 @@ export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions { +export interface Options { /** * Name of the alertmanager used as a source for alerts */ diff --git a/public/app/plugins/panel/annolist/AnnoListPanel.test.tsx b/public/app/plugins/panel/annolist/AnnoListPanel.test.tsx index 03f3179cd3b..a04dc697a6a 100644 --- a/public/app/plugins/panel/annolist/AnnoListPanel.test.tsx +++ b/public/app/plugins/panel/annolist/AnnoListPanel.test.tsx @@ -10,14 +10,14 @@ import { backendSrv } from '../../../core/services/backend_srv'; import { setDashboardSrv } from '../../../features/dashboard/services/DashboardSrv'; import { AnnoListPanel, Props } from './AnnoListPanel'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; jest.mock('@grafana/runtime', () => ({ ...jest.requireActual('@grafana/runtime'), getBackendSrv: () => backendSrv, })); -const defaultOptions: PanelOptions = { +const defaultOptions: Options = { limit: 10, navigateAfter: '10m', navigateBefore: '10m', @@ -49,7 +49,7 @@ const defaultResult: any = { async function setupTestContext({ options = defaultOptions, results = [defaultResult], -}: { options?: PanelOptions; results?: AnnotationEvent[] } = {}) { +}: { options?: Options; results?: AnnotationEvent[] } = {}) { jest.clearAllMocks(); const getMock = jest.spyOn(backendSrv, 'get'); diff --git a/public/app/plugins/panel/annolist/AnnoListPanel.tsx b/public/app/plugins/panel/annolist/AnnoListPanel.tsx index 1574e3bfe37..252e353dccc 100644 --- a/public/app/plugins/panel/annolist/AnnoListPanel.tsx +++ b/public/app/plugins/panel/annolist/AnnoListPanel.tsx @@ -19,7 +19,7 @@ import appEvents from 'app/core/app_events'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { AnnotationListItem } from './AnnotationListItem'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; interface UserInfo { id?: number; @@ -27,7 +27,7 @@ interface UserInfo { email?: string; } -export interface Props extends PanelProps {} +export interface Props extends PanelProps {} interface State { annotations: AnnotationEvent[]; timeInfo: string; diff --git a/public/app/plugins/panel/annolist/AnnotationListItem.tsx b/public/app/plugins/panel/annolist/AnnotationListItem.tsx index 0d50dbc0e6a..1578f9d057f 100644 --- a/public/app/plugins/panel/annolist/AnnotationListItem.tsx +++ b/public/app/plugins/panel/annolist/AnnotationListItem.tsx @@ -4,9 +4,9 @@ import React, { MouseEvent } from 'react'; import { AnnotationEvent, DateTimeInput, GrafanaTheme2, PanelProps } from '@grafana/data'; import { Card, TagList, Tooltip, RenderUserContentAsHTML, useStyles2 } from '@grafana/ui'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; -interface Props extends Pick, 'options'> { +interface Props extends Pick, 'options'> { annotation: AnnotationEvent; formatDate: (date: DateTimeInput, format?: string) => string; onClick: (annotation: AnnotationEvent) => void; diff --git a/public/app/plugins/panel/annolist/module.tsx b/public/app/plugins/panel/annolist/module.tsx index 0a796ccbbcb..d719e221fb6 100644 --- a/public/app/plugins/panel/annolist/module.tsx +++ b/public/app/plugins/panel/annolist/module.tsx @@ -4,16 +4,16 @@ import { PanelModel, PanelPlugin } from '@grafana/data'; import { TagsInput } from '@grafana/ui'; import { AnnoListPanel } from './AnnoListPanel'; -import { defaultPanelOptions, PanelOptions } from './panelcfg.gen'; +import { defaultOptions, Options } from './panelcfg.gen'; -export const plugin = new PanelPlugin(AnnoListPanel) +export const plugin = new PanelPlugin(AnnoListPanel) .setPanelOptions((builder) => { builder .addRadio({ category: ['Annotation query'], path: 'onlyFromThisDashboard', name: 'Query filter', - defaultValue: defaultPanelOptions.onlyFromThisDashboard, + defaultValue: defaultOptions.onlyFromThisDashboard, settings: { options: [ { value: false, label: 'All dashboards' }, @@ -25,7 +25,7 @@ export const plugin = new PanelPlugin(AnnoListPanel) category: ['Annotation query'], path: 'onlyInTimeRange', name: 'Time range', - defaultValue: defaultPanelOptions.onlyInTimeRange, + defaultValue: defaultOptions.onlyInTimeRange, settings: { options: [ { value: false, label: 'None' }, @@ -47,31 +47,31 @@ export const plugin = new PanelPlugin(AnnoListPanel) category: ['Annotation query'], path: 'limit', name: 'Limit', - defaultValue: defaultPanelOptions.limit, + defaultValue: defaultOptions.limit, }) .addBooleanSwitch({ category: ['Display'], path: 'showUser', name: 'Show user', - defaultValue: defaultPanelOptions.showUser, + defaultValue: defaultOptions.showUser, }) .addBooleanSwitch({ category: ['Display'], path: 'showTime', name: 'Show time', - defaultValue: defaultPanelOptions.showTime, + defaultValue: defaultOptions.showTime, }) .addBooleanSwitch({ category: ['Display'], path: 'showTags', name: 'Show tags', - defaultValue: defaultPanelOptions.showTags, + defaultValue: defaultOptions.showTags, }) .addRadio({ category: ['Link behavior'], path: 'navigateToPanel', name: 'Link target', - defaultValue: defaultPanelOptions.navigateToPanel, + defaultValue: defaultOptions.navigateToPanel, settings: { options: [ { value: true, label: 'Panel' }, @@ -83,21 +83,21 @@ export const plugin = new PanelPlugin(AnnoListPanel) category: ['Link behavior'], path: 'navigateBefore', name: 'Time before', - defaultValue: defaultPanelOptions.navigateBefore, + defaultValue: defaultOptions.navigateBefore, description: '', }) .addTextInput({ category: ['Link behavior'], path: 'navigateAfter', name: 'Time after', - defaultValue: defaultPanelOptions.navigateAfter, + defaultValue: defaultOptions.navigateAfter, description: '', }); }) // TODO, we should support this directly in the plugin infrastructure - .setPanelChangeHandler((panel: PanelModel, prevPluginId: string, prevOptions: unknown) => { + .setPanelChangeHandler((panel: PanelModel, prevPluginId: string, prevOptions: unknown) => { if (prevPluginId === 'ryantxu-annolist-panel') { - return prevOptions as PanelOptions; + return prevOptions as Options; } return panel.options; diff --git a/public/app/plugins/panel/annolist/panelcfg.cue b/public/app/plugins/panel/annolist/panelcfg.cue index 446a4a4a798..d2f05466e32 100644 --- a/public/app/plugins/panel/annolist/panelcfg.cue +++ b/public/app/plugins/panel/annolist/panelcfg.cue @@ -22,7 +22,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { onlyFromThisDashboard: bool | *false onlyInTimeRange: bool | *false tags: [...string] diff --git a/public/app/plugins/panel/annolist/panelcfg.gen.ts b/public/app/plugins/panel/annolist/panelcfg.gen.ts index 479e5e0e46a..8f7cd82849b 100644 --- a/public/app/plugins/panel/annolist/panelcfg.gen.ts +++ b/public/app/plugins/panel/annolist/panelcfg.gen.ts @@ -10,7 +10,7 @@ export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions { +export interface Options { limit: number; navigateAfter: string; navigateBefore: string; @@ -23,7 +23,7 @@ export interface PanelOptions { tags: Array; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { limit: 10, navigateAfter: '10m', navigateBefore: '10m', diff --git a/public/app/plugins/panel/barchart/BarChartPanel.tsx b/public/app/plugins/panel/barchart/BarChartPanel.tsx index 748151b1758..a4137b1b3dd 100644 --- a/public/app/plugins/panel/barchart/BarChartPanel.tsx +++ b/public/app/plugins/panel/barchart/BarChartPanel.tsx @@ -38,7 +38,7 @@ import { getFieldLegendItem } from 'app/core/components/TimelineChart/utils'; import { DataHoverView } from '../geomap/components/DataHoverView'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; import { prepareBarChartDisplayValues, preparePlotConfigBuilder } from './utils'; const TOOLTIP_OFFSET = 10; @@ -47,7 +47,7 @@ const TOOLTIP_OFFSET = 10; * @alpha */ export interface BarChartProps - extends PanelOptions, + extends Options, Omit {} const propsToDiff: Array = [ @@ -66,7 +66,7 @@ const propsToDiff: Array = [ (prev: BarChartProps, next: BarChartProps) => next.text?.valueSize === prev.text?.valueSize, ]; -interface Props extends PanelProps {} +interface Props extends PanelProps {} export const BarChartPanel = ({ data, options, fieldConfig, width, height, timeZone, id }: Props) => { const theme = useTheme2(); diff --git a/public/app/plugins/panel/barchart/module.tsx b/public/app/plugins/panel/barchart/module.tsx index 237bf532f5e..fbbdefb0b28 100644 --- a/public/app/plugins/panel/barchart/module.tsx +++ b/public/app/plugins/panel/barchart/module.tsx @@ -16,11 +16,11 @@ import { ThresholdsStyleEditor } from '../timeseries/ThresholdsStyleEditor'; import { BarChartPanel } from './BarChartPanel'; 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 { prepareBarChartDisplayValues } from './utils'; -export const plugin = new PanelPlugin(BarChartPanel) +export const plugin = new PanelPlugin(BarChartPanel) .useFieldConfig({ standardOptions: { [FieldConfigProperty.Color]: { @@ -34,7 +34,7 @@ export const plugin = new PanelPlugin(BarChartPa }, }, useCustomConfig: (builder) => { - const cfg = defaultPanelFieldConfig; + const cfg = defaultFieldConfig; builder .addSliderInput({ @@ -108,7 +108,7 @@ export const plugin = new PanelPlugin(BarChartPa }, }) .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'; const viz = 'viz' in disp ? disp.viz[0] : undefined; if (viz?.fields?.length) { @@ -134,12 +134,12 @@ export const plugin = new PanelPlugin(BarChartPa { value: VizOrientation.Vertical, label: 'Vertical' }, ], }, - defaultValue: defaultPanelOptions.orientation, + defaultValue: defaultOptions.orientation, }) .addSliderInput({ path: 'xTickLabelRotation', name: 'Rotate x-axis tick labels', - defaultValue: defaultPanelOptions.xTickLabelRotation, + defaultValue: defaultOptions.xTickLabelRotation, settings: { min: -90, max: 90, @@ -162,7 +162,7 @@ export const plugin = new PanelPlugin(BarChartPa id: 'xTickLabelSpacing', path: 'xTickLabelSpacing', name: 'X-axis labels minimum spacing', - defaultValue: defaultPanelOptions.xTickLabelSpacing, + defaultValue: defaultOptions.xTickLabelSpacing, editor: TickSpacingEditor, }) .addRadio({ @@ -175,7 +175,7 @@ export const plugin = new PanelPlugin(BarChartPa { value: VisibilityMode.Never, label: 'Never' }, ], }, - defaultValue: defaultPanelOptions.showValue, + defaultValue: defaultOptions.showValue, }) .addRadio({ path: 'stacking', @@ -183,12 +183,12 @@ export const plugin = new PanelPlugin(BarChartPa settings: { options: graphFieldOptions.stacking, }, - defaultValue: defaultPanelOptions.stacking, + defaultValue: defaultOptions.stacking, }) .addSliderInput({ path: 'groupWidth', name: 'Group width', - defaultValue: defaultPanelOptions.groupWidth, + defaultValue: defaultOptions.groupWidth, settings: { min: 0, max: 1, @@ -204,7 +204,7 @@ export const plugin = new PanelPlugin(BarChartPa .addSliderInput({ path: 'barWidth', name: 'Bar width', - defaultValue: defaultPanelOptions.barWidth, + defaultValue: defaultOptions.barWidth, settings: { min: 0, max: 1, @@ -214,7 +214,7 @@ export const plugin = new PanelPlugin(BarChartPa .addSliderInput({ path: 'barRadius', name: 'Bar radius', - defaultValue: defaultPanelOptions.barRadius, + defaultValue: defaultOptions.barRadius, settings: { min: 0, max: 0.5, @@ -224,7 +224,7 @@ export const plugin = new PanelPlugin(BarChartPa .addBooleanSwitch({ path: 'fullHighlight', name: 'Highlight full area on hover', - defaultValue: defaultPanelOptions.fullHighlight, + defaultValue: defaultOptions.fullHighlight, }); builder.addFieldNamePicker({ diff --git a/public/app/plugins/panel/barchart/panelcfg.cue b/public/app/plugins/panel/barchart/panelcfg.cue index 988ddf3f442..71e509165b8 100644 --- a/public/app/plugins/panel/barchart/panelcfg.cue +++ b/public/app/plugins/panel/barchart/panelcfg.cue @@ -27,7 +27,7 @@ composableKinds: PanelCfg: { schemas: [ // v0.0 { - PanelOptions: { + Options: { common.OptionsWithLegend common.OptionsWithTooltip common.OptionsWithTextFormatting @@ -59,7 +59,7 @@ composableKinds: PanelCfg: { // hovers over highlighted area fullHighlight: bool | *false } @cuetsy(kind="interface") - PanelFieldConfig: { + FieldConfig: { common.AxisConfig common.HideableFieldConfig diff --git a/public/app/plugins/panel/barchart/panelcfg.gen.ts b/public/app/plugins/panel/barchart/panelcfg.gen.ts index e6a2c9e317f..7761573aa27 100644 --- a/public/app/plugins/panel/barchart/panelcfg.gen.ts +++ b/public/app/plugins/panel/barchart/panelcfg.gen.ts @@ -12,7 +12,7 @@ import * as common from '@grafana/schema'; 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. */ @@ -65,7 +65,7 @@ export interface PanelOptions extends common.OptionsWithLegend, common.OptionsWi xTickLabelSpacing?: number; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { barRadius: 0, barWidth: 0.97, fullHighlight: false, @@ -77,7 +77,7 @@ export const defaultPanelOptions: Partial = { 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. */ @@ -97,7 +97,7 @@ export interface PanelFieldConfig extends common.AxisConfig, common.HideableFiel thresholdsStyle?: common.GraphThresholdsStyleConfig; } -export const defaultPanelFieldConfig: Partial = { +export const defaultFieldConfig: Partial = { fillOpacity: 80, gradientMode: common.GraphGradientMode.None, lineWidth: 1, diff --git a/public/app/plugins/panel/barchart/suggestions.ts b/public/app/plugins/panel/barchart/suggestions.ts index c850ccf8152..f9428d6e709 100644 --- a/public/app/plugins/panel/barchart/suggestions.ts +++ b/public/app/plugins/panel/barchart/suggestions.ts @@ -2,11 +2,11 @@ import { VisualizationSuggestionsBuilder, VizOrientation } from '@grafana/data'; import { LegendDisplayMode, StackingMode, VisibilityMode } from '@grafana/schema'; import { SuggestionName } from 'app/types/suggestions'; -import { PanelFieldConfig, PanelOptions } from './panelcfg.gen'; +import { FieldConfig, Options } from './panelcfg.gen'; export class BarChartSuggestionsSupplier { getListWithDefaults(builder: VisualizationSuggestionsBuilder) { - return builder.getListAppender({ + return builder.getListAppender({ name: SuggestionName.BarChart, pluginId: 'barchart', options: { diff --git a/public/app/plugins/panel/barchart/utils.test.ts b/public/app/plugins/panel/barchart/utils.test.ts index e5282267f2d..d979cef829c 100644 --- a/public/app/plugins/panel/barchart/utils.test.ts +++ b/public/app/plugins/panel/barchart/utils.test.ts @@ -19,7 +19,7 @@ import { SortOrder, } from '@grafana/schema'; -import { PanelFieldConfig, PanelOptions } from './panelcfg.gen'; +import { FieldConfig as PanelFieldConfig, Options } from './panelcfg.gen'; import { BarChartOptionsEX, prepareBarChartDisplayValues, preparePlotConfigBuilder } from './utils'; function mockDataFrame() { @@ -69,7 +69,7 @@ function mockDataFrame() { state: {}, }); - const info = prepareBarChartDisplayValues([df1], createTheme(), {} as PanelOptions); + const info = prepareBarChartDisplayValues([df1], createTheme(), {} as Options); if (!('aligned' in info)) { throw new Error('Bar chart not prepared correctly'); @@ -159,7 +159,7 @@ describe('BarChart utils', () => { describe('prepareGraphableFrames', () => { 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); expect(warning.warn).toEqual('No data in response'); @@ -172,7 +172,7 @@ describe('BarChart utils', () => { { 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); expect(warning.warn).toEqual('Bar charts requires a string or time field'); expect(warning).not.toHaveProperty('viz'); @@ -185,7 +185,7 @@ describe('BarChart utils', () => { { 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); expect(warning.warn).toEqual('No numeric fields found'); expect(warning).not.toHaveProperty('viz'); @@ -198,7 +198,7 @@ describe('BarChart utils', () => { { 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 field = displayValues.viz[0].fields[1]; @@ -238,7 +238,7 @@ describe('BarChart utils', () => { const resultAsc = prepareBarChartDisplayValues([frame], createTheme(), { legend: { sortBy: 'Min', sortDesc: false }, - } as PanelOptions); + } as Options); const displayValuesAsc = assertIsDefined('viz' in resultAsc ? resultAsc : null).viz[0]; expect(displayValuesAsc.fields[0].type).toBe(FieldType.string); expect(displayValuesAsc.fields[1].name).toBe('a'); @@ -253,7 +253,7 @@ describe('BarChart utils', () => { const resultDesc = prepareBarChartDisplayValues([frame], createTheme(), { legend: { sortBy: 'Min', sortDesc: true }, - } as PanelOptions); + } as Options); const displayValuesDesc = assertIsDefined('viz' in resultDesc ? resultDesc : null).viz[0]; expect(displayValuesDesc.fields[0].type).toBe(FieldType.string); expect(displayValuesDesc.fields[1].name).toBe('b'); @@ -279,7 +279,7 @@ describe('BarChart utils', () => { const resultAsc = prepareBarChartDisplayValues([frame], createTheme(), { stacking: StackingMode.Percent, - } as PanelOptions); + } as Options); const displayLegendValuesAsc = assertIsDefined('legend' in resultAsc ? resultAsc : null).legend; expect(displayLegendValuesAsc.fields[1].config.unit).toBeUndefined(); diff --git a/public/app/plugins/panel/barchart/utils.ts b/public/app/plugins/panel/barchart/utils.ts index 768d3fd77c7..3e48e0e3ddc 100644 --- a/public/app/plugins/panel/barchart/utils.ts +++ b/public/app/plugins/panel/barchart/utils.ts @@ -31,7 +31,7 @@ import { getStackingGroups } from '@grafana/ui/src/components/uPlot/utils'; import { findField } from 'app/features/dimensions'; import { BarsOptions, getConfig } from './bars'; -import { PanelFieldConfig, PanelOptions, defaultPanelFieldConfig } from './panelcfg.gen'; +import { FieldConfig, Options, defaultFieldConfig } from './panelcfg.gen'; import { BarChartDisplayValues, BarChartDisplayWarning } from './types'; 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; getColor?: (seriesIdx: number, valueIdx: number, value: unknown) => string | null; timeZone?: TimeZone; @@ -185,7 +185,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn = ({ seriesIndex++; - const customConfig: PanelFieldConfig = { ...defaultPanelFieldConfig, ...field.config.custom }; + const customConfig: FieldConfig = { ...defaultFieldConfig, ...field.config.custom }; const scaleKey = field.config.unit || FIXED_UNIT; const colorMode = getFieldColorModeForField(field); @@ -358,7 +358,7 @@ function getRotationPadding( export function prepareBarChartDisplayValues( series: DataFrame[], theme: GrafanaTheme2, - options: PanelOptions + options: Options ): BarChartDisplayValues | BarChartDisplayWarning { if (!series?.length) { return { warn: 'No data in response' }; diff --git a/public/app/plugins/panel/bargauge/BarGaugeMigrations.ts b/public/app/plugins/panel/bargauge/BarGaugeMigrations.ts index ff07dc838b4..c1750963c59 100644 --- a/public/app/plugins/panel/bargauge/BarGaugeMigrations.ts +++ b/public/app/plugins/panel/bargauge/BarGaugeMigrations.ts @@ -1,8 +1,8 @@ import { PanelModel } from '@grafana/data'; import { sharedSingleStatMigrationHandler } from '@grafana/ui'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; -export const barGaugePanelMigrationHandler = (panel: PanelModel): Partial => { +export const barGaugePanelMigrationHandler = (panel: PanelModel): Partial => { return sharedSingleStatMigrationHandler(panel); }; diff --git a/public/app/plugins/panel/bargauge/BarGaugePanel.tsx b/public/app/plugins/panel/bargauge/BarGaugePanel.tsx index 326e5b3fb60..1a68e41d26a 100644 --- a/public/app/plugins/panel/bargauge/BarGaugePanel.tsx +++ b/public/app/plugins/panel/bargauge/BarGaugePanel.tsx @@ -16,7 +16,7 @@ import { BarGauge, DataLinksContextMenu, VizRepeater, VizRepeaterRenderValueProp import { DataLinksContextMenuApi } from '@grafana/ui/src/components/DataLinks/DataLinksContextMenu'; import { config } from 'app/core/config'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; export class BarGaugePanel extends PureComponent { renderComponent = ( @@ -110,7 +110,7 @@ export class BarGaugePanel extends PureComponent { ); } } -export type BarGaugePanelProps = PanelProps; +export type BarGaugePanelProps = PanelProps; export function clearNameForSingleSeries(count: number, field: FieldConfig, display: DisplayValue): DisplayValue { if (count === 1 && !field.displayName) { diff --git a/public/app/plugins/panel/bargauge/module.tsx b/public/app/plugins/panel/bargauge/module.tsx index 778abfd49ab..7cdb3e40d00 100644 --- a/public/app/plugins/panel/bargauge/module.tsx +++ b/public/app/plugins/panel/bargauge/module.tsx @@ -6,10 +6,10 @@ import { addOrientationOption, addStandardDataReduceOptions } from '../stat/comm import { barGaugePanelMigrationHandler } from './BarGaugeMigrations'; import { BarGaugePanel } from './BarGaugePanel'; -import { PanelOptions, defaultPanelOptions } from './panelcfg.gen'; +import { Options, defaultOptions } from './panelcfg.gen'; import { BarGaugeSuggestionsSupplier } from './suggestions'; -export const plugin = new PanelPlugin(BarGaugePanel) +export const plugin = new PanelPlugin(BarGaugePanel) .useFieldConfig() .setPanelOptions((builder) => { addStandardDataReduceOptions(builder); @@ -27,7 +27,7 @@ export const plugin = new PanelPlugin(BarGaugePanel) { value: BarGaugeDisplayMode.Basic, label: 'Basic' }, ], }, - defaultValue: defaultPanelOptions.displayMode, + defaultValue: defaultOptions.displayMode, }) .addRadio({ path: 'valueMode', @@ -39,27 +39,27 @@ export const plugin = new PanelPlugin(BarGaugePanel) { value: BarGaugeValueMode.Hidden, label: 'Hidden' }, ], }, - defaultValue: defaultPanelOptions.valueMode, + defaultValue: defaultOptions.valueMode, }) .addBooleanSwitch({ path: 'showUnfilled', name: 'Show unfilled area', description: 'When enabled renders the unfilled region as gray', - defaultValue: defaultPanelOptions.showUnfilled, + defaultValue: defaultOptions.showUnfilled, showIf: (options) => options.displayMode !== 'lcd', }) .addNumberInput({ path: 'minVizWidth', name: 'Min width', description: 'Minimum column width', - defaultValue: defaultPanelOptions.minVizWidth, + defaultValue: defaultOptions.minVizWidth, showIf: (options) => options.orientation === VizOrientation.Vertical, }) .addNumberInput({ path: 'minVizHeight', name: 'Min height', description: 'Minimum row height', - defaultValue: defaultPanelOptions.minVizHeight, + defaultValue: defaultOptions.minVizHeight, showIf: (options) => options.orientation === VizOrientation.Horizontal, }); }) diff --git a/public/app/plugins/panel/bargauge/panelcfg.cue b/public/app/plugins/panel/bargauge/panelcfg.cue index 7e9e3d8ad66..fbfc98734c5 100644 --- a/public/app/plugins/panel/bargauge/panelcfg.cue +++ b/public/app/plugins/panel/bargauge/panelcfg.cue @@ -26,7 +26,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { common.SingleStatBaseOptions displayMode: common.BarGaugeDisplayMode & (*"gradient" | _) valueMode: common.BarGaugeValueMode & (*"color" | _) diff --git a/public/app/plugins/panel/bargauge/panelcfg.gen.ts b/public/app/plugins/panel/bargauge/panelcfg.gen.ts index 9d2b6b5135b..fdf1509e89b 100644 --- a/public/app/plugins/panel/bargauge/panelcfg.gen.ts +++ b/public/app/plugins/panel/bargauge/panelcfg.gen.ts @@ -12,7 +12,7 @@ import * as common from '@grafana/schema'; export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions extends common.SingleStatBaseOptions { +export interface Options extends common.SingleStatBaseOptions { displayMode: common.BarGaugeDisplayMode; minVizHeight: number; minVizWidth: number; @@ -20,7 +20,7 @@ export interface PanelOptions extends common.SingleStatBaseOptions { valueMode: common.BarGaugeValueMode; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { displayMode: common.BarGaugeDisplayMode.Gradient, minVizHeight: 10, minVizWidth: 0, diff --git a/public/app/plugins/panel/bargauge/suggestions.ts b/public/app/plugins/panel/bargauge/suggestions.ts index 2fc434f37df..9acbad2451b 100644 --- a/public/app/plugins/panel/bargauge/suggestions.ts +++ b/public/app/plugins/panel/bargauge/suggestions.ts @@ -2,7 +2,7 @@ import { VisualizationSuggestionsBuilder, VizOrientation } from '@grafana/data'; import { BarGaugeDisplayMode } from '@grafana/ui'; import { SuggestionName } from 'app/types/suggestions'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; export class BarGaugeSuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { @@ -12,7 +12,7 @@ export class BarGaugeSuggestionsSupplier { return; } - const list = builder.getListAppender({ + const list = builder.getListAppender({ name: '', pluginId: 'bargauge', options: {}, diff --git a/public/app/plugins/panel/candlestick/models.gen.ts b/public/app/plugins/panel/candlestick/models.gen.ts index 5f4c4410e4c..f847e443450 100644 --- a/public/app/plugins/panel/candlestick/models.gen.ts +++ b/public/app/plugins/panel/candlestick/models.gen.ts @@ -58,7 +58,7 @@ export interface CandlestickOptions extends OptionsWithLegend { includeAllFields?: boolean; } -export const defaultPanelOptions: CandlestickOptions = { +export const defaultOptions: CandlestickOptions = { mode: VizDisplayMode.CandlesVolume, candleStyle: CandleStyle.Candles, colorStrategy: ColorStrategy.OpenClose, diff --git a/public/app/plugins/panel/candlestick/module.tsx b/public/app/plugins/panel/candlestick/module.tsx index 11159394e90..c77ab0e5da9 100644 --- a/public/app/plugins/panel/candlestick/module.tsx +++ b/public/app/plugins/panel/candlestick/module.tsx @@ -19,7 +19,7 @@ import { CandlestickOptions, VizDisplayMode, ColorStrategy, - defaultPanelOptions, + defaultOptions, CandleStyle, } from './models.gen'; import { CandlestickSuggestionsSupplier } from './suggestions'; @@ -77,7 +77,7 @@ function addFieldPicker( export const plugin = new PanelPlugin(CandlestickPanel) .useFieldConfig(getGraphFieldConfig(defaultGraphConfig)) .setPanelOptions((builder, context) => { - const opts = context.options ?? defaultPanelOptions; + const opts = context.options ?? defaultOptions; const info = prepareCandlestickFields(context.data, opts, config.theme2); builder @@ -85,7 +85,7 @@ export const plugin = new PanelPlugin(Cand path: 'mode', name: 'Mode', description: '', - defaultValue: defaultPanelOptions.mode, + defaultValue: defaultOptions.mode, settings: { options: modeOptions, }, @@ -94,7 +94,7 @@ export const plugin = new PanelPlugin(Cand path: 'candleStyle', name: 'Candle style', description: '', - defaultValue: defaultPanelOptions.candleStyle, + defaultValue: defaultOptions.candleStyle, settings: { options: candleStyles, }, @@ -104,7 +104,7 @@ export const plugin = new PanelPlugin(Cand path: 'colorStrategy', name: 'Color strategy', description: '', - defaultValue: defaultPanelOptions.colorStrategy, + defaultValue: defaultOptions.colorStrategy, settings: { options: colorStrategies, }, @@ -135,7 +135,7 @@ export const plugin = new PanelPlugin(Cand path: 'includeAllFields', name: 'Additional fields', description: 'Use standard timeseries options to configure any fields not mapped above', - defaultValue: defaultPanelOptions.includeAllFields, + defaultValue: defaultOptions.includeAllFields, settings: { options: [ { label: 'Ignore', value: false }, diff --git a/public/app/plugins/panel/candlestick/panelcfg.cue b/public/app/plugins/panel/candlestick/panelcfg.cue index d548b45934f..c60e3ad5ca9 100644 --- a/public/app/plugins/panel/candlestick/panelcfg.cue +++ b/public/app/plugins/panel/candlestick/panelcfg.cue @@ -20,11 +20,11 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { // anything for now ... } @cuetsy(kind="interface") - PanelFieldConfig: { + FieldConfig: { // anything for now ... } @cuetsy(kind="interface") diff --git a/public/app/plugins/panel/candlestick/suggestions.ts b/public/app/plugins/panel/candlestick/suggestions.ts index bd5981a4664..8ab7caa453a 100644 --- a/public/app/plugins/panel/candlestick/suggestions.ts +++ b/public/app/plugins/panel/candlestick/suggestions.ts @@ -3,7 +3,7 @@ import { config } from '@grafana/runtime'; import { SuggestionName } from 'app/types/suggestions'; import { prepareCandlestickFields } from './fields'; -import { CandlestickOptions, defaultPanelOptions } from './models.gen'; +import { CandlestickOptions, defaultOptions } from './models.gen'; export class CandlestickSuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { @@ -19,7 +19,7 @@ export class CandlestickSuggestionsSupplier { return; } - const info = prepareCandlestickFields(builder.data.series, defaultPanelOptions, config.theme2); + const info = prepareCandlestickFields(builder.data.series, defaultOptions, config.theme2); if (!info) { return; } @@ -43,7 +43,7 @@ export class CandlestickSuggestionsSupplier { list.append({ name: SuggestionName.Candlestick, - options: defaultPanelOptions, + options: defaultOptions, fieldConfig: { defaults: {}, overrides: [], diff --git a/public/app/plugins/panel/canvas/CanvasPanel.tsx b/public/app/plugins/panel/canvas/CanvasPanel.tsx index 0b80d268ae7..e7a00e702f4 100644 --- a/public/app/plugins/panel/canvas/CanvasPanel.tsx +++ b/public/app/plugins/panel/canvas/CanvasPanel.tsx @@ -11,10 +11,10 @@ import { PanelEditEnteredEvent, PanelEditExitedEvent } from 'app/types/events'; import { InlineEdit } from './InlineEdit'; import { SetBackground } from './SetBackground'; -import { PanelOptions } from './models.gen'; +import { Options } from './models.gen'; import { AnchorPoint, CanvasTooltipPayload, ConnectionState } from './types'; -interface Props extends PanelProps {} +interface Props extends PanelProps {} interface State { refresh: number; diff --git a/public/app/plugins/panel/canvas/editor/PlacementEditor.tsx b/public/app/plugins/panel/canvas/editor/PlacementEditor.tsx index 1614d9367d0..731bc89c605 100644 --- a/public/app/plugins/panel/canvas/editor/PlacementEditor.tsx +++ b/public/app/plugins/panel/canvas/editor/PlacementEditor.tsx @@ -7,7 +7,7 @@ import { Field, HorizontalGroup, Icon, InlineField, InlineFieldRow, Select, Vert import { NumberInput } from 'app/core/components/OptionsUI/NumberInput'; import { HorizontalConstraint, Placement, VerticalConstraint } from 'app/features/canvas'; -import { PanelOptions } from '../models.gen'; +import { Options } from '../models.gen'; import { ConstraintSelectionBox } from './ConstraintSelectionBox'; import { QuickPositioning } from './QuickPositioning'; @@ -31,7 +31,7 @@ const verticalOptions: Array> = [ { label: 'Scale', value: VerticalConstraint.Scale }, ]; -type Props = StandardEditorProps; +type Props = StandardEditorProps; export function PlacementEditor({ item }: Props) { const settings = item.settings; diff --git a/public/app/plugins/panel/canvas/editor/TreeNavigationEditor.tsx b/public/app/plugins/panel/canvas/editor/TreeNavigationEditor.tsx index 53af0e107d1..06f6bcc5aa9 100644 --- a/public/app/plugins/panel/canvas/editor/TreeNavigationEditor.tsx +++ b/public/app/plugins/panel/canvas/editor/TreeNavigationEditor.tsx @@ -10,7 +10,7 @@ import { ElementState } from 'app/features/canvas/runtime/element'; import { AddLayerButton } from '../../../../core/components/Layers/AddLayerButton'; import { getGlobalStyles } from '../globalStyles'; -import { PanelOptions } from '../models.gen'; +import { Options } from '../models.gen'; import { getTreeData, onNodeDrop, TreeElement } from '../tree'; import { DragNode, DropNode } from '../types'; import { doSelect, getElementTypes, onAddItem } from '../utils'; @@ -20,7 +20,7 @@ import { TreeViewEditorProps } from './elementEditor'; let allowSelection = true; -export const TreeNavigationEditor = ({ item }: StandardEditorProps) => { +export const TreeNavigationEditor = ({ item }: StandardEditorProps) => { const [treeData, setTreeData] = useState(getTreeData(item?.settings?.scene.root)); const [autoExpandParent, setAutoExpandParent] = useState(true); const [expandedKeys, setExpandedKeys] = useState([]); diff --git a/public/app/plugins/panel/canvas/migrations.ts b/public/app/plugins/panel/canvas/migrations.ts index 29e805d4841..8bbc22321f1 100644 --- a/public/app/plugins/panel/canvas/migrations.ts +++ b/public/app/plugins/panel/canvas/migrations.ts @@ -1,8 +1,8 @@ import { PanelModel } from '@grafana/data'; -import { PanelOptions } from './models.gen'; +import { Options } from './models.gen'; -export const canvasMigrationHandler = (panel: PanelModel): Partial => { +export const canvasMigrationHandler = (panel: PanelModel): Partial => { const pluginVersion = panel?.pluginVersion ?? ''; // Rename text-box to rectangle diff --git a/public/app/plugins/panel/canvas/models.gen.ts b/public/app/plugins/panel/canvas/models.gen.ts index a27b3fbd0a4..b1f67028eb1 100644 --- a/public/app/plugins/panel/canvas/models.gen.ts +++ b/public/app/plugins/panel/canvas/models.gen.ts @@ -7,13 +7,13 @@ import { CanvasFrameOptions, DEFAULT_CANVAS_ELEMENT_CONFIG } from 'app/features/ export const modelVersion = Object.freeze([1, 0]); -export interface PanelOptions { +export interface Options { inlineEditing: boolean; showAdvancedTypes: boolean; root: CanvasFrameOptions; } -export const defaultPanelOptions: PanelOptions = { +export const defaultOptions: Options = { inlineEditing: true, showAdvancedTypes: false, root: { diff --git a/public/app/plugins/panel/canvas/module.tsx b/public/app/plugins/panel/canvas/module.tsx index 5e3fe07af0e..745787b3423 100644 --- a/public/app/plugins/panel/canvas/module.tsx +++ b/public/app/plugins/panel/canvas/module.tsx @@ -6,9 +6,9 @@ import { getConnectionEditor } from './editor/connectionEditor'; import { getElementEditor } from './editor/elementEditor'; import { getLayerEditor } from './editor/layerEditor'; import { canvasMigrationHandler } from './migrations'; -import { PanelOptions } from './models.gen'; +import { Options } from './models.gen'; -export const addStandardCanvasEditorOptions = (builder: PanelOptionsEditorBuilder) => { +export const addStandardCanvasEditorOptions = (builder: PanelOptionsEditorBuilder) => { builder.addBooleanSwitch({ path: 'inlineEditing', name: 'Inline editing', @@ -24,7 +24,7 @@ export const addStandardCanvasEditorOptions = (builder: PanelOptionsEditorBuilde }); }; -export const plugin = new PanelPlugin(CanvasPanel) +export const plugin = new PanelPlugin(CanvasPanel) .setNoPadding() // extend to panel edges .useFieldConfig({ standardOptions: { diff --git a/public/app/plugins/panel/canvas/panelcfg.cue b/public/app/plugins/panel/canvas/panelcfg.cue index b547dea5f40..a7af8698a2b 100644 --- a/public/app/plugins/panel/canvas/panelcfg.cue +++ b/public/app/plugins/panel/canvas/panelcfg.cue @@ -20,7 +20,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { // anything for now ... } @cuetsy(kind="interface") diff --git a/public/app/plugins/panel/dashlist/DashList.tsx b/public/app/plugins/panel/dashlist/DashList.tsx index c776990ea44..ae64b3339ea 100644 --- a/public/app/plugins/panel/dashlist/DashList.tsx +++ b/public/app/plugins/panel/dashlist/DashList.tsx @@ -24,7 +24,7 @@ import { DashboardSearchItem } from 'app/features/search/types'; import { getVariablesUrlParams } from 'app/features/variables/getAllVariableValuesForUrl'; import { useDispatch } from 'app/types'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; import { getStyles } from './styles'; type Dashboard = DashboardSearchItem & { id?: number; isSearchResult?: boolean; isRecent?: boolean }; @@ -35,7 +35,7 @@ interface DashboardGroup { dashboards: Dashboard[]; } -async function fetchDashboards(options: PanelOptions, replaceVars: InterpolateFunction) { +async function fetchDashboards(options: Options, replaceVars: InterpolateFunction) { let starredDashboards: Promise = Promise.resolve([]); if (options.showStarred) { const params = { limit: options.maxItems, starred: 'true' }; @@ -99,7 +99,7 @@ async function fetchDashboards(options: PanelOptions, replaceVars: InterpolateFu return dashMap; } -export function DashList(props: PanelProps) { +export function DashList(props: PanelProps) { const [dashboards, setDashboards] = useState(new Map()); const dispatch = useDispatch(); useEffect(() => { diff --git a/public/app/plugins/panel/dashlist/module.tsx b/public/app/plugins/panel/dashlist/module.tsx index 19e5a85c64a..35dfb485817 100644 --- a/public/app/plugins/panel/dashlist/module.tsx +++ b/public/app/plugins/panel/dashlist/module.tsx @@ -10,50 +10,50 @@ import { } from '../../../core/components/Select/ReadonlyFolderPicker/ReadonlyFolderPicker'; import { DashList } from './DashList'; -import { defaultPanelOptions, PanelOptions } from './panelcfg.gen'; +import { defaultOptions, Options } from './panelcfg.gen'; -export const plugin = new PanelPlugin(DashList) +export const plugin = new PanelPlugin(DashList) .setPanelOptions((builder) => { builder .addBooleanSwitch({ path: 'keepTime', name: 'Include current time range', - defaultValue: defaultPanelOptions.keepTime, + defaultValue: defaultOptions.keepTime, }) .addBooleanSwitch({ path: 'includeVars', name: 'Include current template variable values', - defaultValue: defaultPanelOptions.includeVars, + defaultValue: defaultOptions.includeVars, }) .addBooleanSwitch({ path: 'showStarred', name: 'Starred', - defaultValue: defaultPanelOptions.showStarred, + defaultValue: defaultOptions.showStarred, }) .addBooleanSwitch({ path: 'showRecentlyViewed', name: 'Recently viewed', - defaultValue: defaultPanelOptions.showRecentlyViewed, + defaultValue: defaultOptions.showRecentlyViewed, }) .addBooleanSwitch({ path: 'showSearch', name: 'Search', - defaultValue: defaultPanelOptions.showSearch, + defaultValue: defaultOptions.showSearch, }) .addBooleanSwitch({ path: 'showHeadings', name: 'Show headings', - defaultValue: defaultPanelOptions.showHeadings, + defaultValue: defaultOptions.showHeadings, }) .addNumberInput({ path: 'maxItems', name: 'Max items', - defaultValue: defaultPanelOptions.maxItems, + defaultValue: defaultOptions.maxItems, }) .addTextInput({ path: 'query', name: 'Query', - defaultValue: defaultPanelOptions.query, + defaultValue: defaultOptions.query, }) .addCustomEditor({ path: 'folderId', @@ -75,13 +75,13 @@ export const plugin = new PanelPlugin(DashList) path: 'tags', name: 'Tags', description: '', - defaultValue: defaultPanelOptions.tags, + defaultValue: defaultOptions.tags, editor(props) { return ; }, }); }) - .setMigrationHandler((panel: PanelModel & Record) => { + .setMigrationHandler((panel: PanelModel & Record) => { const newOptions = { showStarred: panel.options.showStarred ?? panel.starred, showRecentlyViewed: panel.options.showRecentlyViewed ?? panel.recent, diff --git a/public/app/plugins/panel/dashlist/panelcfg.cue b/public/app/plugins/panel/dashlist/panelcfg.cue index bd656a5e174..e192aced895 100644 --- a/public/app/plugins/panel/dashlist/panelcfg.cue +++ b/public/app/plugins/panel/dashlist/panelcfg.cue @@ -22,7 +22,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { keepTime: bool | *false includeVars: bool | *false showStarred: bool | *true diff --git a/public/app/plugins/panel/dashlist/panelcfg.gen.ts b/public/app/plugins/panel/dashlist/panelcfg.gen.ts index a884e896d2b..e7aa0eeb633 100644 --- a/public/app/plugins/panel/dashlist/panelcfg.gen.ts +++ b/public/app/plugins/panel/dashlist/panelcfg.gen.ts @@ -10,7 +10,7 @@ export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions { +export interface Options { folderId?: number; includeVars: boolean; keepTime: boolean; @@ -23,7 +23,7 @@ export interface PanelOptions { tags: Array; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { includeVars: false, keepTime: false, maxItems: 10, diff --git a/public/app/plugins/panel/datagrid/DataGridPanel.tsx b/public/app/plugins/panel/datagrid/DataGridPanel.tsx index c2d058eacc0..6c20c4dc26c 100644 --- a/public/app/plugins/panel/datagrid/DataGridPanel.tsx +++ b/public/app/plugins/panel/datagrid/DataGridPanel.tsx @@ -20,7 +20,7 @@ import { AddColumn } from './components/AddColumn'; import { DatagridContextMenu } from './components/DatagridContextMenu'; import { RenameColumnCell } from './components/RenameColumnCell'; import { isDatagridEnabled } from './featureFlagUtils'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; import { DatagridActionType, datagridReducer, initialState } from './state'; import { clearCellsFromRangeSelection, @@ -37,7 +37,7 @@ import { updateSnapshot, } from './utils'; -export interface DataGridProps extends PanelProps {} +export interface DataGridProps extends PanelProps {} export function DataGridPanel({ options, data, id, fieldConfig, width, height }: DataGridProps) { const [state, dispatch] = useReducer(datagridReducer, initialState); diff --git a/public/app/plugins/panel/datagrid/module.tsx b/public/app/plugins/panel/datagrid/module.tsx index 5331bab25d3..a02bcdff662 100644 --- a/public/app/plugins/panel/datagrid/module.tsx +++ b/public/app/plugins/panel/datagrid/module.tsx @@ -1,22 +1,22 @@ import { PanelPlugin } from '@grafana/data'; import { DataGridPanel } from './DataGridPanel'; -import { defaultPanelOptions, PanelOptions } from './panelcfg.gen'; +import { defaultOptions, Options } from './panelcfg.gen'; -export const plugin = new PanelPlugin(DataGridPanel).setPanelOptions((builder, context) => { +export const plugin = new PanelPlugin(DataGridPanel).setPanelOptions((builder, context) => { const seriesOptions = context.data.map((frame, idx) => ({ value: idx, label: frame.refId })); if ( context.options && !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({ path: 'selectedSeries', name: 'Select series', - defaultValue: defaultPanelOptions.selectedSeries, + defaultValue: defaultOptions.selectedSeries, settings: { options: seriesOptions, }, diff --git a/public/app/plugins/panel/datagrid/panelcfg.cue b/public/app/plugins/panel/datagrid/panelcfg.cue index 6928432b6cc..9183ef1a70b 100644 --- a/public/app/plugins/panel/datagrid/panelcfg.cue +++ b/public/app/plugins/panel/datagrid/panelcfg.cue @@ -22,7 +22,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { selectedSeries: int32 & >=0 | *0 } @cuetsy(kind="interface") }, diff --git a/public/app/plugins/panel/datagrid/panelcfg.gen.ts b/public/app/plugins/panel/datagrid/panelcfg.gen.ts index e8c62517a7e..b626519b3f0 100644 --- a/public/app/plugins/panel/datagrid/panelcfg.gen.ts +++ b/public/app/plugins/panel/datagrid/panelcfg.gen.ts @@ -10,10 +10,10 @@ export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions { +export interface Options { selectedSeries: number; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { selectedSeries: 0, }; diff --git a/public/app/plugins/panel/debug/DebugPanel.tsx b/public/app/plugins/panel/debug/DebugPanel.tsx index 2b8a3c63c61..de966b146ab 100644 --- a/public/app/plugins/panel/debug/DebugPanel.tsx +++ b/public/app/plugins/panel/debug/DebugPanel.tsx @@ -6,9 +6,9 @@ import { CursorView } from './CursorView'; import { EventBusLoggerPanel } from './EventBusLogger'; import { RenderInfoViewer } from './RenderInfoViewer'; import { StateView } from './StateView'; -import { PanelOptions, DebugMode } from './panelcfg.gen'; +import { Options, DebugMode } from './panelcfg.gen'; -type Props = PanelProps; +type Props = PanelProps; export class DebugPanel extends Component { render() { diff --git a/public/app/plugins/panel/debug/RenderInfoViewer.tsx b/public/app/plugins/panel/debug/RenderInfoViewer.tsx index 503aae803fd..d26ecd64408 100644 --- a/public/app/plugins/panel/debug/RenderInfoViewer.tsx +++ b/public/app/plugins/panel/debug/RenderInfoViewer.tsx @@ -11,9 +11,9 @@ import { } from '@grafana/data'; import { IconButton } from '@grafana/ui'; -import { PanelOptions, UpdateConfig } from './panelcfg.gen'; +import { Options, UpdateConfig } from './panelcfg.gen'; -type Props = PanelProps; +type Props = PanelProps; type UpdateCounters = { [K in keyof UpdateConfig]: number; diff --git a/public/app/plugins/panel/debug/StateView.tsx b/public/app/plugins/panel/debug/StateView.tsx index 896d5e20838..2dc4529c029 100644 --- a/public/app/plugins/panel/debug/StateView.tsx +++ b/public/app/plugins/panel/debug/StateView.tsx @@ -3,9 +3,9 @@ import React, { FormEvent } from 'react'; import { PanelOptionsEditorProps, PanelProps } from '@grafana/data'; import { Field, Input, usePanelContext } from '@grafana/ui'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; -export function StateView(props: PanelProps) { +export function StateView(props: PanelProps) { const context = usePanelContext(); const onChangeName = (e: FormEvent) => { diff --git a/public/app/plugins/panel/debug/module.tsx b/public/app/plugins/panel/debug/module.tsx index 646b796498a..adec1600220 100644 --- a/public/app/plugins/panel/debug/module.tsx +++ b/public/app/plugins/panel/debug/module.tsx @@ -2,9 +2,9 @@ import { PanelPlugin } from '@grafana/data'; import { DebugPanel } from './DebugPanel'; import { StateViewEditor } from './StateView'; -import { DebugMode, PanelOptions } from './panelcfg.gen'; +import { DebugMode, Options } from './panelcfg.gen'; -export const plugin = new PanelPlugin(DebugPanel).useFieldConfig().setPanelOptions((builder) => { +export const plugin = new PanelPlugin(DebugPanel).useFieldConfig().setPanelOptions((builder) => { builder .addSelect({ path: 'mode', diff --git a/public/app/plugins/panel/debug/panelcfg.cue b/public/app/plugins/panel/debug/panelcfg.cue index c030786014c..e7530340e68 100644 --- a/public/app/plugins/panel/debug/panelcfg.cue +++ b/public/app/plugins/panel/debug/panelcfg.cue @@ -38,7 +38,7 @@ composableKinds: PanelCfg: { DebugMode: "render" | "events" | "cursor" | "State" | "ThrowError" @cuetsy(kind="enum") - PanelOptions: { + Options: { mode: DebugMode counters?: UpdateConfig } @cuetsy(kind="interface") diff --git a/public/app/plugins/panel/debug/panelcfg.gen.ts b/public/app/plugins/panel/debug/panelcfg.gen.ts index 0065b3a4389..48baed3aa58 100644 --- a/public/app/plugins/panel/debug/panelcfg.gen.ts +++ b/public/app/plugins/panel/debug/panelcfg.gen.ts @@ -24,7 +24,7 @@ export enum DebugMode { ThrowError = 'ThrowError', } -export interface PanelOptions { +export interface Options { counters?: UpdateConfig; mode: DebugMode; } diff --git a/public/app/plugins/panel/gauge/GaugeMigrations.ts b/public/app/plugins/panel/gauge/GaugeMigrations.ts index de5ca2ba668..280baf34be9 100644 --- a/public/app/plugins/panel/gauge/GaugeMigrations.ts +++ b/public/app/plugins/panel/gauge/GaugeMigrations.ts @@ -1,21 +1,21 @@ import { PanelModel } from '@grafana/data'; import { sharedSingleStatPanelChangedHandler, sharedSingleStatMigrationHandler } from '@grafana/ui'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; // This is called when the panel first loads -export const gaugePanelMigrationHandler = (panel: PanelModel): Partial => { +export const gaugePanelMigrationHandler = (panel: PanelModel): Partial => { return sharedSingleStatMigrationHandler(panel); }; // This is called when the panel changes from another panel export const gaugePanelChangedHandler = ( - panel: PanelModel>, + panel: PanelModel>, prevPluginId: string, prevOptions: any ) => { // This handles most config changes - const opts: PanelOptions = sharedSingleStatPanelChangedHandler(panel, prevPluginId, prevOptions); + const opts: Options = sharedSingleStatPanelChangedHandler(panel, prevPluginId, prevOptions); // Changing from angular singlestat if (prevPluginId === 'singlestat' && prevOptions.angular) { diff --git a/public/app/plugins/panel/gauge/GaugePanel.tsx b/public/app/plugins/panel/gauge/GaugePanel.tsx index 1ac500ed62e..670a9d09bfe 100644 --- a/public/app/plugins/panel/gauge/GaugePanel.tsx +++ b/public/app/plugins/panel/gauge/GaugePanel.tsx @@ -7,9 +7,9 @@ import { config } from 'app/core/config'; import { clearNameForSingleSeries } from '../bargauge/BarGaugePanel'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; -export class GaugePanel extends PureComponent> { +export class GaugePanel extends PureComponent> { renderComponent = ( valueProps: VizRepeaterRenderValueProps, menuProps: DataLinksContextMenuApi diff --git a/public/app/plugins/panel/gauge/module.tsx b/public/app/plugins/panel/gauge/module.tsx index f101553107f..23b1b7369c5 100644 --- a/public/app/plugins/panel/gauge/module.tsx +++ b/public/app/plugins/panel/gauge/module.tsx @@ -5,10 +5,10 @@ import { addOrientationOption, addStandardDataReduceOptions } from '../stat/comm import { gaugePanelMigrationHandler, gaugePanelChangedHandler } from './GaugeMigrations'; import { GaugePanel } from './GaugePanel'; -import { PanelOptions, defaultPanelOptions } from './panelcfg.gen'; +import { Options, defaultOptions } from './panelcfg.gen'; import { GaugeSuggestionsSupplier } from './suggestions'; -export const plugin = new PanelPlugin(GaugePanel) +export const plugin = new PanelPlugin(GaugePanel) .useFieldConfig({ useCustomConfig: (builder) => { builder.addNumberInput({ @@ -30,13 +30,13 @@ export const plugin = new PanelPlugin(GaugePanel) path: 'showThresholdLabels', name: 'Show threshold labels', description: 'Render the threshold values around the gauge bar', - defaultValue: defaultPanelOptions.showThresholdLabels, + defaultValue: defaultOptions.showThresholdLabels, }) .addBooleanSwitch({ path: 'showThresholdMarkers', name: 'Show threshold markers', description: 'Renders the thresholds as an outer bar', - defaultValue: defaultPanelOptions.showThresholdMarkers, + defaultValue: defaultOptions.showThresholdMarkers, }); commonOptionsBuilder.addTextSizeOptions(builder); diff --git a/public/app/plugins/panel/gauge/panelcfg.cue b/public/app/plugins/panel/gauge/panelcfg.cue index 0c14160c8e3..0aae870ed77 100644 --- a/public/app/plugins/panel/gauge/panelcfg.cue +++ b/public/app/plugins/panel/gauge/panelcfg.cue @@ -26,7 +26,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { common.SingleStatBaseOptions showThresholdLabels: bool | *false showThresholdMarkers: bool | *true diff --git a/public/app/plugins/panel/gauge/panelcfg.gen.ts b/public/app/plugins/panel/gauge/panelcfg.gen.ts index 9541d694bc5..b8d68e28cb7 100644 --- a/public/app/plugins/panel/gauge/panelcfg.gen.ts +++ b/public/app/plugins/panel/gauge/panelcfg.gen.ts @@ -12,12 +12,12 @@ import * as common from '@grafana/schema'; export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions extends common.SingleStatBaseOptions { +export interface Options extends common.SingleStatBaseOptions { showThresholdLabels: boolean; showThresholdMarkers: boolean; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { showThresholdLabels: false, showThresholdMarkers: true, }; diff --git a/public/app/plugins/panel/gauge/suggestions.ts b/public/app/plugins/panel/gauge/suggestions.ts index 6f9716c235f..dd1d4ad0c82 100644 --- a/public/app/plugins/panel/gauge/suggestions.ts +++ b/public/app/plugins/panel/gauge/suggestions.ts @@ -1,7 +1,7 @@ import { ThresholdsMode, VisualizationSuggestionsBuilder } from '@grafana/data'; import { SuggestionName } from 'app/types/suggestions'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; export class GaugeSuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { @@ -16,7 +16,7 @@ export class GaugeSuggestionsSupplier { return; } - const list = builder.getListAppender({ + const list = builder.getListAppender({ name: SuggestionName.Gauge, pluginId: 'gauge', options: {}, diff --git a/public/app/plugins/panel/geomap/GeomapPanel.tsx b/public/app/plugins/panel/geomap/GeomapPanel.tsx index cc7ce494331..ff2bdd7cced 100644 --- a/public/app/plugins/panel/geomap/GeomapPanel.tsx +++ b/public/app/plugins/panel/geomap/GeomapPanel.tsx @@ -25,7 +25,7 @@ import { GeomapHoverPayload } from './event'; import { getGlobalStyles } from './globalStyles'; import { defaultMarkersConfig } from './layers/data/markersLayer'; import { DEFAULT_BASEMAP_CONFIG } from './layers/registry'; -import { ControlsOptions, PanelOptions, MapLayerState, MapViewConfig, TooltipMode } from './types'; +import { ControlsOptions, Options, MapLayerState, MapViewConfig, TooltipMode } from './types'; import { getActions } from './utils/actions'; import { getLayersExtent } from './utils/getLayersExtent'; import { applyLayerFilter, initLayer } from './utils/layers'; @@ -36,7 +36,7 @@ import { centerPointRegistry, MapCenterID } from './view'; // Allows multiple panels to share the same view instance let sharedView: View | undefined = undefined; -type Props = PanelProps; +type Props = PanelProps; interface State extends OverlayProps { ttip?: GeomapHoverPayload; ttipOpen: boolean; @@ -146,7 +146,7 @@ export class GeomapPanel extends Component { * * NOTE: changes to basemap and layers are handled independently */ - optionsChanged(options: PanelOptions) { + optionsChanged(options: Options) { const oldOptions = this.props.options; if (options.view !== oldOptions.view) { const [updatedSharedView, view] = this.initMapView(options.view, sharedView); diff --git a/public/app/plugins/panel/geomap/editor/FitMapViewEditor.tsx b/public/app/plugins/panel/geomap/editor/FitMapViewEditor.tsx index 738e5b238e9..576dacf042a 100644 --- a/public/app/plugins/panel/geomap/editor/FitMapViewEditor.tsx +++ b/public/app/plugins/panel/geomap/editor/FitMapViewEditor.tsx @@ -4,13 +4,13 @@ import { SelectableValue, StandardEditorContext } from '@grafana/data'; import { InlineFieldRow, InlineField, RadioButtonGroup, Select } from '@grafana/ui'; import { NumberInput } from 'app/core/components/OptionsUI/NumberInput'; -import { GeomapInstanceState, PanelOptions, MapViewConfig } from '../types'; +import { GeomapInstanceState, Options, MapViewConfig } from '../types'; type Props = { labelWidth: number; value: MapViewConfig; onChange: (value?: MapViewConfig | undefined) => void; - context: StandardEditorContext; + context: StandardEditorContext; }; // Data scope options for 'Fit to data' diff --git a/public/app/plugins/panel/geomap/editor/LayersEditor.tsx b/public/app/plugins/panel/geomap/editor/LayersEditor.tsx index db14dc55fe2..63753e24d76 100644 --- a/public/app/plugins/panel/geomap/editor/LayersEditor.tsx +++ b/public/app/plugins/panel/geomap/editor/LayersEditor.tsx @@ -7,9 +7,9 @@ import { AddLayerButton } from 'app/core/components/Layers/AddLayerButton'; import { LayerDragDropList } from 'app/core/components/Layers/LayerDragDropList'; import { getLayersOptions } from '../layers/registry'; -import { PanelOptions, MapLayerState, GeomapInstanceState } from '../types'; +import { Options, MapLayerState, GeomapInstanceState } from '../types'; -type LayersEditorProps = StandardEditorProps; +type LayersEditorProps = StandardEditorProps; export const LayersEditor = (props: LayersEditorProps) => { const { layers, selected, actions } = props.context.instanceState ?? {}; diff --git a/public/app/plugins/panel/geomap/editor/MapViewEditor.tsx b/public/app/plugins/panel/geomap/editor/MapViewEditor.tsx index 749a80b2eec..fa45d02e69c 100644 --- a/public/app/plugins/panel/geomap/editor/MapViewEditor.tsx +++ b/public/app/plugins/panel/geomap/editor/MapViewEditor.tsx @@ -5,7 +5,7 @@ import { StandardEditorProps, SelectableValue } from '@grafana/data'; import { Button, InlineField, InlineFieldRow, Select, VerticalGroup } from '@grafana/ui'; import { NumberInput } from 'app/core/components/OptionsUI/NumberInput'; -import { PanelOptions, MapViewConfig, GeomapInstanceState } from '../types'; +import { Options, MapViewConfig, GeomapInstanceState } from '../types'; import { centerPointRegistry, MapCenterID } from '../view'; import { CoordinatesMapViewEditor } from './CoordinatesMapViewEditor'; @@ -15,7 +15,7 @@ export const MapViewEditor = ({ value, onChange, context, -}: StandardEditorProps) => { +}: StandardEditorProps) => { const labelWidth = 10; const views = useMemo(() => { diff --git a/public/app/plugins/panel/geomap/migrations.ts b/public/app/plugins/panel/geomap/migrations.ts index 7da1f75818b..ae9e7a74bcc 100644 --- a/public/app/plugins/panel/geomap/migrations.ts +++ b/public/app/plugins/panel/geomap/migrations.ts @@ -16,7 +16,7 @@ import { ResourceDimensionMode } from '@grafana/schema'; import { defaultMarkersConfig, MarkersConfig } from './layers/data/markersLayer'; import { getMarkerAsPath } from './style/markers'; import { defaultStyleConfig } from './style/types'; -import { PanelOptions, TooltipMode } from './types'; +import { Options, TooltipMode } from './types'; import { MapCenterID } from './view'; /** @@ -41,7 +41,7 @@ export const mapPanelChangedHandler: PanelTypeChangedHandler = (panel, prevPlugi export function worldmapToGeomapOptions(angular: any): { fieldConfig: FieldConfigSource; - options: PanelOptions; + options: Options; xform?: DataTransformerConfig; } { const fieldConfig: FieldConfigSource = { @@ -50,7 +50,7 @@ export function worldmapToGeomapOptions(angular: any): { }; const markersLayer = cloneDeep(defaultMarkersConfig); - const options: PanelOptions = { + const options: Options = { view: { id: MapCenterID.Zero, }, @@ -164,7 +164,7 @@ function asNumber(v: any): number | undefined { return isNaN(num) ? undefined : num; } -export const mapMigrationHandler = (panel: PanelModel): Partial => { +export const mapMigrationHandler = (panel: PanelModel): Partial => { const pluginVersion = panel?.pluginVersion ?? ''; // before 8.3, only one layer was supported! diff --git a/public/app/plugins/panel/geomap/module.tsx b/public/app/plugins/panel/geomap/module.tsx index c03f0289d2f..b2a37446b46 100644 --- a/public/app/plugins/panel/geomap/module.tsx +++ b/public/app/plugins/panel/geomap/module.tsx @@ -9,9 +9,9 @@ import { LayersEditor } from './editor/LayersEditor'; import { MapViewEditor } from './editor/MapViewEditor'; import { getLayerEditor } from './editor/layerEditor'; import { mapPanelChangedHandler, mapMigrationHandler } from './migrations'; -import { defaultMapViewConfig, PanelOptions, TooltipMode, GeomapInstanceState } from './types'; +import { defaultMapViewConfig, Options, TooltipMode, GeomapInstanceState } from './types'; -export const plugin = new PanelPlugin(GeomapPanel) +export const plugin = new PanelPlugin(GeomapPanel) .setNoPadding() .setPanelChangeHandler(mapPanelChangedHandler) .setMigrationHandler(mapMigrationHandler) diff --git a/public/app/plugins/panel/geomap/panelcfg.cue b/public/app/plugins/panel/geomap/panelcfg.cue index 2778bb076e4..90d805b9026 100644 --- a/public/app/plugins/panel/geomap/panelcfg.cue +++ b/public/app/plugins/panel/geomap/panelcfg.cue @@ -26,7 +26,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { view: MapViewConfig controls: ControlsOptions basemap: ui.MapLayerOptions diff --git a/public/app/plugins/panel/geomap/panelcfg.gen.ts b/public/app/plugins/panel/geomap/panelcfg.gen.ts index bed8730a6a2..f210114861e 100644 --- a/public/app/plugins/panel/geomap/panelcfg.gen.ts +++ b/public/app/plugins/panel/geomap/panelcfg.gen.ts @@ -12,7 +12,7 @@ import * as ui from '@grafana/schema'; export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions { +export interface Options { basemap: ui.MapLayerOptions; controls: ControlsOptions; layers: Array; @@ -20,7 +20,7 @@ export interface PanelOptions { view: MapViewConfig; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { layers: [], }; diff --git a/public/app/plugins/panel/geomap/types.ts b/public/app/plugins/panel/geomap/types.ts index c7f645902bf..30d031aa9d3 100644 --- a/public/app/plugins/panel/geomap/types.ts +++ b/public/app/plugins/panel/geomap/types.ts @@ -53,4 +53,4 @@ export interface MapLayerState extends LayerElement { mouseEvents: Subject; } -export { PanelOptions, MapViewConfig, TooltipOptions, TooltipMode, defaultMapViewConfig } from './panelcfg.gen'; +export { Options, MapViewConfig, TooltipOptions, TooltipMode, defaultMapViewConfig } from './panelcfg.gen'; diff --git a/public/app/plugins/panel/geomap/utils/utils.ts b/public/app/plugins/panel/geomap/utils/utils.ts index 47aa8bbf310..865497c7fa7 100644 --- a/public/app/plugins/panel/geomap/utils/utils.ts +++ b/public/app/plugins/panel/geomap/utils/utils.ts @@ -8,7 +8,7 @@ import { getGrafanaDatasource } from 'app/plugins/datasource/grafana/datasource' import { GeomapPanel } from '../GeomapPanel'; import { defaultStyleConfig, StyleConfig, StyleConfigState, StyleDimensions } from '../style/types'; -import { PanelOptions, MapLayerState } from '../types'; +import { Options, MapLayerState } from '../types'; export function getStyleDimension( frame: DataFrame | undefined, @@ -74,7 +74,7 @@ async function initGeojsonFiles() { } } -export const getNewOpenLayersMap = (panel: GeomapPanel, options: PanelOptions, div: HTMLDivElement) => { +export const getNewOpenLayersMap = (panel: GeomapPanel, options: Options, div: HTMLDivElement) => { const [view] = panel.initMapView(options.view, undefined); return (panel.map = new OpenLayersMap({ view: view, @@ -88,7 +88,7 @@ export const getNewOpenLayersMap = (panel: GeomapPanel, options: PanelOptions, d })); }; -export const updateMap = (panel: GeomapPanel, options: PanelOptions) => { +export const updateMap = (panel: GeomapPanel, options: Options) => { panel.initControls(options.controls); panel.forceUpdate(); // first render }; diff --git a/public/app/plugins/panel/heatmap/HeatmapPanel.tsx b/public/app/plugins/panel/heatmap/HeatmapPanel.tsx index 92a2e6bd71f..594b013c800 100644 --- a/public/app/plugins/panel/heatmap/HeatmapPanel.tsx +++ b/public/app/plugins/panel/heatmap/HeatmapPanel.tsx @@ -21,10 +21,10 @@ import { ExemplarModalHeader } from './ExemplarModalHeader'; import { HeatmapHoverView } from './HeatmapHoverView'; import { prepareHeatmapData } from './fields'; import { quantizeScheme } from './palettes'; -import { PanelOptions } from './types'; +import { Options } from './types'; import { HeatmapHoverEvent, prepConfig } from './utils'; -interface HeatmapPanelProps extends PanelProps {} +interface HeatmapPanelProps extends PanelProps {} export const HeatmapPanel = ({ data, diff --git a/public/app/plugins/panel/heatmap/fields.test.ts b/public/app/plugins/panel/heatmap/fields.test.ts index 3017df328b2..c3b7a1c3a7c 100644 --- a/public/app/plugins/panel/heatmap/fields.test.ts +++ b/public/app/plugins/panel/heatmap/fields.test.ts @@ -1,11 +1,11 @@ import { createTheme } from '@grafana/data'; -import { PanelOptions } from './types'; +import { Options } from './types'; const theme = createTheme(); describe('Heatmap data', () => { - const options: PanelOptions = {} as PanelOptions; + const options: Options = {} as Options; it('simple test stub', () => { expect(theme).toBeDefined(); diff --git a/public/app/plugins/panel/heatmap/fields.ts b/public/app/plugins/panel/heatmap/fields.ts index 9c3aae6fcd4..07bc18baf8b 100644 --- a/public/app/plugins/panel/heatmap/fields.ts +++ b/public/app/plugins/panel/heatmap/fields.ts @@ -20,7 +20,7 @@ import { } from 'app/features/transformers/calculateHeatmap/heatmap'; import { parseSampleValue, sortSeriesByLabel } from 'app/plugins/datasource/prometheus/result_transformer'; -import { CellValues, PanelOptions } from './types'; +import { CellValues, Options } from './types'; import { boundedMinMax } from './utils'; export interface HeatmapData { @@ -57,7 +57,7 @@ export interface HeatmapData { export function prepareHeatmapData( frames: DataFrame[], annotations: DataFrame[] | undefined, - options: PanelOptions, + options: Options, theme: GrafanaTheme2, getFieldLinks?: (exemplars: DataFrame, field: Field) => (config: ValueLinkConfig) => Array> ): HeatmapData { @@ -128,7 +128,7 @@ export function prepareHeatmapData( const getSparseHeatmapData = ( frame: DataFrame, exemplars: DataFrame | undefined, - options: PanelOptions, + options: Options, theme: GrafanaTheme2 ): HeatmapData => { if (frame.meta?.type !== DataFrameType.HeatmapCells || isHeatmapCellsDense(frame)) { @@ -164,7 +164,7 @@ const getSparseHeatmapData = ( const getDenseHeatmapData = ( frame: DataFrame, exemplars: DataFrame | undefined, - options: PanelOptions, + options: Options, theme: GrafanaTheme2 ): HeatmapData => { if (frame.meta?.type !== DataFrameType.HeatmapCells) { diff --git a/public/app/plugins/panel/heatmap/migrations.ts b/public/app/plugins/panel/heatmap/migrations.ts index b55deb3d3b7..c11035db4f0 100644 --- a/public/app/plugins/panel/heatmap/migrations.ts +++ b/public/app/plugins/panel/heatmap/migrations.ts @@ -9,10 +9,10 @@ import { } from '@grafana/schema'; import { colorSchemes } from './palettes'; -import { PanelOptions, defaultPanelOptions, HeatmapColorMode } from './types'; +import { Options, defaultOptions, HeatmapColorMode } from './types'; /** Called when the version number changes */ -export const heatmapMigrationHandler = (panel: PanelModel): Partial => { +export const heatmapMigrationHandler = (panel: PanelModel): Partial => { // Migrating from angular if (Object.keys(panel.options).length === 0) { return heatmapChangedHandler(panel, 'heatmap', { angular: panel }, panel.fieldConfig); @@ -43,7 +43,7 @@ export const heatmapChangedHandler: PanelTypeChangedHandler = (panel, prevPlugin return {}; }; -export function angularToReactHeatmap(angular: any): { fieldConfig: FieldConfigSource; options: PanelOptions } { +export function angularToReactHeatmap(angular: any): { fieldConfig: FieldConfigSource; options: Options } { const fieldConfig: FieldConfigSource = { defaults: {}, overrides: [], @@ -51,7 +51,7 @@ export function angularToReactHeatmap(angular: any): { fieldConfig: FieldConfigS const calculate = angular.dataFormat === 'tsbuckets' ? false : true; const calculation: HeatmapCalculationOptions = { - ...defaultPanelOptions.calculation, + ...defaultOptions.calculation, }; const oldYAxis = { logBase: 1, ...angular.yAxis }; @@ -82,11 +82,11 @@ export function angularToReactHeatmap(angular: any): { fieldConfig: FieldConfigS } const cellGap = asNumber(angular.cards?.cardPadding, 2); - const options: PanelOptions = { + const options: Options = { calculate, calculation, color: { - ...defaultPanelOptions.color, + ...defaultOptions.color, steps: 128, // best match with existing colors }, cellGap: cellGap ? cellGap : 1, // default to size 1 @@ -115,12 +115,12 @@ export function angularToReactHeatmap(angular: any): { fieldConfig: FieldConfigS yHistogram: Boolean(angular.tooltip?.showHistogram), }, exemplars: { - ...defaultPanelOptions.exemplars, + ...defaultOptions.exemplars, }, }; if (angular.hideZeroBuckets) { - options.filterValues = { ...defaultPanelOptions.filterValues }; // min: 1e-9 + options.filterValues = { ...defaultOptions.filterValues }; // min: 1e-9 } // Migrate color options @@ -134,7 +134,7 @@ export function angularToReactHeatmap(angular: any): { fieldConfig: FieldConfigS if (!scheme) { scheme = colorSchemes.find((v) => current.indexOf(v.name) >= 0); } - options.color.scheme = scheme ? scheme.name : defaultPanelOptions.color.scheme; + options.color.scheme = scheme ? scheme.name : defaultOptions.color.scheme; break; } case 'opacity': { diff --git a/public/app/plugins/panel/heatmap/module.tsx b/public/app/plugins/panel/heatmap/module.tsx index 36772167e57..ee4967d26dd 100644 --- a/public/app/plugins/panel/heatmap/module.tsx +++ b/public/app/plugins/panel/heatmap/module.tsx @@ -19,9 +19,9 @@ import { prepareHeatmapData } from './fields'; import { heatmapChangedHandler, heatmapMigrationHandler } from './migrations'; import { colorSchemes, quantizeScheme } from './palettes'; import { HeatmapSuggestionsSupplier } from './suggestions'; -import { PanelOptions, defaultPanelOptions, HeatmapColorMode, HeatmapColorScale } from './types'; +import { Options, defaultOptions, HeatmapColorMode, HeatmapColorScale } from './types'; -export const plugin = new PanelPlugin(HeatmapPanel) +export const plugin = new PanelPlugin(HeatmapPanel) .useFieldConfig({ disableStandardOptions: Object.values(FieldConfigProperty).filter((v) => v !== FieldConfigProperty.Links), useCustomConfig: (builder) => { @@ -43,7 +43,7 @@ export const plugin = new PanelPlugin(HeatmapPan .setPanelChangeHandler(heatmapChangedHandler) .setMigrationHandler(heatmapMigrationHandler) .setPanelOptions((builder, context) => { - const opts = context.options ?? defaultPanelOptions; + const opts = context.options ?? defaultOptions; let isOrdinalY = false; @@ -57,7 +57,7 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addRadio({ path: 'calculate', name: 'Calculate from data', - defaultValue: defaultPanelOptions.calculate, + defaultValue: defaultOptions.calculate, category, settings: { options: [ @@ -77,7 +77,7 @@ export const plugin = new PanelPlugin(HeatmapPan .addRadio({ path: 'yAxis.axisPlacement', name: 'Placement', - defaultValue: defaultPanelOptions.yAxis.axisPlacement ?? AxisPlacement.Left, + defaultValue: defaultOptions.yAxis.axisPlacement ?? AxisPlacement.Left, category, settings: { options: [ @@ -130,7 +130,7 @@ export const plugin = new PanelPlugin(HeatmapPan .addNumberInput({ path: 'yAxis.axisWidth', name: 'Axis width', - defaultValue: defaultPanelOptions.yAxis.axisWidth, + defaultValue: defaultOptions.yAxis.axisWidth, settings: { placeholder: 'Auto', min: 5, // smaller should just be hidden @@ -140,7 +140,7 @@ export const plugin = new PanelPlugin(HeatmapPan .addTextInput({ path: 'yAxis.axisLabel', name: 'Axis label', - defaultValue: defaultPanelOptions.yAxis.axisLabel, + defaultValue: defaultOptions.yAxis.axisLabel, settings: { placeholder: 'Auto', }, @@ -151,7 +151,7 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addRadio({ path: 'rowsFrame.layout', name: 'Tick alignment', - defaultValue: defaultPanelOptions.rowsFrame?.layout ?? HeatmapCellLayout.auto, + defaultValue: defaultOptions.rowsFrame?.layout ?? HeatmapCellLayout.auto, category, settings: { options: [ @@ -166,7 +166,7 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addBooleanSwitch({ path: 'yAxis.reverse', name: 'Reverse', - defaultValue: defaultPanelOptions.yAxis.reverse === true, + defaultValue: defaultOptions.yAxis.reverse === true, category, }); @@ -175,7 +175,7 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addRadio({ path: `color.mode`, name: 'Mode', - defaultValue: defaultPanelOptions.color.mode, + defaultValue: defaultOptions.color.mode, category, settings: { options: [ @@ -188,7 +188,7 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addColorPicker({ path: `color.fill`, name: 'Color', - defaultValue: defaultPanelOptions.color.fill, + defaultValue: defaultOptions.color.fill, category, showIf: (opts) => opts.color.mode === HeatmapColorMode.Opacity, }); @@ -196,7 +196,7 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addRadio({ path: `color.scale`, name: 'Scale', - defaultValue: defaultPanelOptions.color.scale, + defaultValue: defaultOptions.color.scale, category, settings: { options: [ @@ -210,7 +210,7 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addSliderInput({ path: 'color.exponent', name: 'Exponent', - defaultValue: defaultPanelOptions.color.exponent, + defaultValue: defaultOptions.color.exponent, category, settings: { min: 0.1, // 1 for on/off? @@ -225,7 +225,7 @@ export const plugin = new PanelPlugin(HeatmapPan path: `color.scheme`, name: 'Scheme', description: '', - defaultValue: defaultPanelOptions.color.scheme, + defaultValue: defaultOptions.color.scheme, category, settings: { options: colorSchemes.map((scheme) => ({ @@ -241,7 +241,7 @@ export const plugin = new PanelPlugin(HeatmapPan .addSliderInput({ path: 'color.steps', name: 'Steps', - defaultValue: defaultPanelOptions.color.steps, + defaultValue: defaultOptions.color.steps, category, settings: { min: 2, @@ -252,7 +252,7 @@ export const plugin = new PanelPlugin(HeatmapPan .addBooleanSwitch({ path: 'color.reverse', name: 'Reverse', - defaultValue: defaultPanelOptions.color.reverse, + defaultValue: defaultOptions.color.reverse, category, }) .addCustomEditor({ @@ -274,7 +274,7 @@ export const plugin = new PanelPlugin(HeatmapPan .addNumberInput({ path: 'color.min', name: 'Start color scale from value', - defaultValue: defaultPanelOptions.color.min, + defaultValue: defaultOptions.color.min, settings: { placeholder: 'Auto (min)', }, @@ -283,7 +283,7 @@ export const plugin = new PanelPlugin(HeatmapPan .addNumberInput({ path: 'color.max', name: 'End color scale at value', - defaultValue: defaultPanelOptions.color.max, + defaultValue: defaultOptions.color.max, settings: { placeholder: 'Auto (max)', }, @@ -296,7 +296,7 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addTextInput({ path: 'rowsFrame.value', name: 'Value name', - defaultValue: defaultPanelOptions.rowsFrame?.value, + defaultValue: defaultOptions.rowsFrame?.value, settings: { placeholder: 'Value', }, @@ -327,7 +327,7 @@ export const plugin = new PanelPlugin(HeatmapPan // .addRadio({ // path: 'showValue', // name: 'Show values', - // defaultValue: defaultPanelOptions.showValue, + // defaultValue: defaultOptions.showValue, // category, // settings: { // options: [ @@ -340,7 +340,7 @@ export const plugin = new PanelPlugin(HeatmapPan .addSliderInput({ name: 'Cell gap', path: 'cellGap', - defaultValue: defaultPanelOptions.cellGap, + defaultValue: defaultOptions.cellGap, category, settings: { min: 0, @@ -350,7 +350,7 @@ export const plugin = new PanelPlugin(HeatmapPan .addNumberInput({ path: 'filterValues.le', name: 'Hide cells with values <=', - defaultValue: defaultPanelOptions.filterValues?.le, + defaultValue: defaultOptions.filterValues?.le, settings: { placeholder: 'None', }, @@ -359,7 +359,7 @@ export const plugin = new PanelPlugin(HeatmapPan .addNumberInput({ path: 'filterValues.ge', name: 'Hide cells with values >=', - defaultValue: defaultPanelOptions.filterValues?.ge, + defaultValue: defaultOptions.filterValues?.ge, settings: { placeholder: 'None', }, @@ -368,7 +368,7 @@ export const plugin = new PanelPlugin(HeatmapPan // .addSliderInput({ // name: 'Cell radius', // path: 'cellRadius', - // defaultValue: defaultPanelOptions.cellRadius, + // defaultValue: defaultOptions.cellRadius, // category, // settings: { // min: 0, @@ -381,14 +381,14 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addBooleanSwitch({ path: 'tooltip.show', name: 'Show tooltip', - defaultValue: defaultPanelOptions.tooltip.show, + defaultValue: defaultOptions.tooltip.show, category, }); builder.addBooleanSwitch({ path: 'tooltip.yHistogram', name: 'Show histogram (Y axis)', - defaultValue: defaultPanelOptions.tooltip.yHistogram, + defaultValue: defaultOptions.tooltip.yHistogram, category, showIf: (opts) => opts.tooltip.show, }); @@ -397,7 +397,7 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addBooleanSwitch({ path: 'legend.show', name: 'Show legend', - defaultValue: defaultPanelOptions.legend.show, + defaultValue: defaultOptions.legend.show, category, }); @@ -405,7 +405,7 @@ export const plugin = new PanelPlugin(HeatmapPan builder.addColorPicker({ path: 'exemplars.color', name: 'Color', - defaultValue: defaultPanelOptions.exemplars.color, + defaultValue: defaultOptions.exemplars.color, category, }); }) diff --git a/public/app/plugins/panel/heatmap/palettes.ts b/public/app/plugins/panel/heatmap/palettes.ts index 50b2537d242..acf69c2a787 100644 --- a/public/app/plugins/panel/heatmap/palettes.ts +++ b/public/app/plugins/panel/heatmap/palettes.ts @@ -4,7 +4,7 @@ import tinycolor from 'tinycolor2'; import { GrafanaTheme2 } from '@grafana/data'; -import { HeatmapColorOptions, defaultPanelOptions, HeatmapColorMode, HeatmapColorScale } from './types'; +import { HeatmapColorOptions, defaultOptions, HeatmapColorMode, HeatmapColorScale } from './types'; // https://observablehq.com/@d3/color-schemes?collection=@d3/d3-scale-chromatic @@ -66,7 +66,7 @@ type Interpolator = (t: number) => string; const DEFAULT_SCHEME = colorSchemes.find((scheme) => scheme.name === 'Spectral'); export function quantizeScheme(opts: HeatmapColorOptions, theme: GrafanaTheme2): string[] { - const options = { ...defaultPanelOptions.color, ...opts }; + const options = { ...defaultOptions.color, ...opts }; const palette = []; const steps = (options.steps ?? 128) - 1; diff --git a/public/app/plugins/panel/heatmap/panelcfg.cue b/public/app/plugins/panel/heatmap/panelcfg.cue index 77df808db82..10a90921ae3 100644 --- a/public/app/plugins/panel/heatmap/panelcfg.cue +++ b/public/app/plugins/panel/heatmap/panelcfg.cue @@ -102,7 +102,7 @@ composableKinds: PanelCfg: { // Controls tick alignment when not calculating from data layout?: ui.HeatmapCellLayout } @cuetsy(kind="interface") - PanelOptions: { + Options: { // Controls if the heatmap should be calculated from data calculate?: bool | *false // Calculation options for the heatmap @@ -153,7 +153,7 @@ composableKinds: PanelCfg: { color: "rgba(255,0,255,0.7)" } } @cuetsy(kind="interface") - PanelFieldConfig: { + FieldConfig: { ui.HideableFieldConfig scaleDistribution?: ui.ScaleDistributionConfig diff --git a/public/app/plugins/panel/heatmap/panelcfg.gen.ts b/public/app/plugins/panel/heatmap/panelcfg.gen.ts index 1fe42371a11..6663726407c 100644 --- a/public/app/plugins/panel/heatmap/panelcfg.gen.ts +++ b/public/app/plugins/panel/heatmap/panelcfg.gen.ts @@ -172,7 +172,7 @@ export interface RowsHeatmapOptions { value?: string; } -export interface PanelOptions { +export interface Options { /** * Controls if the heatmap should be calculated from data */ @@ -233,7 +233,7 @@ export interface PanelOptions { yAxis: YAxisConfig; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { calculate: false, cellGap: 1, cellValues: {}, @@ -266,6 +266,6 @@ export const defaultPanelOptions: Partial = { }, }; -export interface PanelFieldConfig extends ui.HideableFieldConfig { +export interface FieldConfig extends ui.HideableFieldConfig { scaleDistribution?: ui.ScaleDistributionConfig; } diff --git a/public/app/plugins/panel/heatmap/suggestions.ts b/public/app/plugins/panel/heatmap/suggestions.ts index af8e26f4b70..b6c65a7c5cd 100644 --- a/public/app/plugins/panel/heatmap/suggestions.ts +++ b/public/app/plugins/panel/heatmap/suggestions.ts @@ -2,7 +2,7 @@ import { VisualizationSuggestionsBuilder } from '@grafana/data'; import { config } from '@grafana/runtime'; import { prepareHeatmapData } from './fields'; -import { PanelOptions, defaultPanelOptions } from './types'; +import { Options, defaultOptions } from './types'; export class HeatmapSuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { @@ -18,12 +18,12 @@ export class HeatmapSuggestionsSupplier { return; } - const info = prepareHeatmapData(builder.data.series, undefined, defaultPanelOptions, config.theme2); + const info = prepareHeatmapData(builder.data.series, undefined, defaultOptions, config.theme2); if (!info || info.warning) { return; } - builder.getListAppender({ + builder.getListAppender({ name: '', pluginId: 'heatmap', options: {}, diff --git a/public/app/plugins/panel/heatmap/types.ts b/public/app/plugins/panel/heatmap/types.ts index 94cc42ed1d2..260509d2e5f 100644 --- a/public/app/plugins/panel/heatmap/types.ts +++ b/public/app/plugins/panel/heatmap/types.ts @@ -2,16 +2,11 @@ export * from './panelcfg.gen'; import { AxisPlacement, HeatmapCellLayout } from '@grafana/schema'; -import { - defaultPanelOptions as defaultPanelOptionsGen, - HeatmapColorMode, - HeatmapColorScale, - PanelOptions, -} from './panelcfg.gen'; +import { defaultOptions as defaultOptionsGen, HeatmapColorMode, HeatmapColorScale, Options } from './panelcfg.gen'; -export const defaultPanelOptions = { - ...defaultPanelOptionsGen, - color: { ...defaultPanelOptionsGen.color, mode: HeatmapColorMode.Scheme, scale: HeatmapColorScale.Exponential }, - yAxis: { ...defaultPanelOptionsGen.yAxis, axisPlacement: AxisPlacement.Left }, - rowsFrame: { ...defaultPanelOptionsGen.rowsFrame, layout: HeatmapCellLayout.auto }, -} as PanelOptions; +export const defaultOptions = { + ...defaultOptionsGen, + color: { ...defaultOptionsGen.color, mode: HeatmapColorMode.Scheme, scale: HeatmapColorScale.Exponential }, + yAxis: { ...defaultOptionsGen.yAxis, axisPlacement: AxisPlacement.Left }, + rowsFrame: { ...defaultOptionsGen.rowsFrame, layout: HeatmapCellLayout.auto }, +} as Options; diff --git a/public/app/plugins/panel/heatmap/utils.ts b/public/app/plugins/panel/heatmap/utils.ts index 5cf14c381ca..dbfe8ea127e 100644 --- a/public/app/plugins/panel/heatmap/utils.ts +++ b/public/app/plugins/panel/heatmap/utils.ts @@ -23,7 +23,7 @@ import { isHeatmapCellsDense, readHeatmapRowsCustomMeta } from 'app/features/tra import { pointWithin, Quadtree, Rect } from '../barchart/quadtree'; import { HeatmapData } from './fields'; -import { PanelFieldConfig, YAxisConfig } from './types'; +import { FieldConfig, YAxisConfig } from './types'; interface PathbuilderOpts { each: (u: uPlot, seriesIdx: number, dataIdx: number, lft: number, top: number, wid: number, hgt: number) => void; @@ -290,7 +290,7 @@ export function prepConfig(opts: PrepConfigOpts) { } // eslint-ignore @typescript-eslint/no-explicit-any - const yFieldConfig = yField.config?.custom as PanelFieldConfig | undefined; + const yFieldConfig = yField.config?.custom as FieldConfig | undefined; const yScale = yFieldConfig?.scaleDistribution ?? { type: ScaleDistribution.Linear }; const yAxisReverse = Boolean(yAxisConfig.reverse); const isSparseHeatmap = heatmapType === DataFrameType.HeatmapCells && !isHeatmapCellsDense(dataRef.current?.heatmap!); diff --git a/public/app/plugins/panel/histogram/Histogram.tsx b/public/app/plugins/panel/histogram/Histogram.tsx index 092560382f4..650d34e857d 100644 --- a/public/app/plugins/panel/histogram/Histogram.tsx +++ b/public/app/plugins/panel/histogram/Histogram.tsx @@ -23,7 +23,7 @@ import { UPLOT_AXIS_FONT_SIZE, } from '@grafana/ui'; -import { defaultPanelFieldConfig, PanelFieldConfig, PanelOptions } from './panelcfg.gen'; +import { defaultFieldConfig, FieldConfig, Options } from './panelcfg.gen'; function incrRoundDn(num: number, incr: number) { return Math.floor(num / incr) * incr; @@ -34,7 +34,7 @@ function incrRoundUp(num: number, incr: number) { } export interface HistogramProps extends Themeable2 { - options: PanelOptions; // used for diff + options: Options; // used for diff alignedFrame: DataFrame; // This could take HistogramFields bucketSize: number; width: number; @@ -194,7 +194,7 @@ const prepConfig = (frame: DataFrame, theme: GrafanaTheme2) => { field.state = field.state ?? {}; field.state.seriesIndex = seriesIndex++; - const customConfig: PanelFieldConfig = { ...defaultPanelFieldConfig, ...field.config.custom }; + const customConfig: FieldConfig = { ...defaultFieldConfig, ...field.config.custom }; const scaleKey = 'y'; const colorMode = getFieldColorModeForField(field); diff --git a/public/app/plugins/panel/histogram/HistogramPanel.tsx b/public/app/plugins/panel/histogram/HistogramPanel.tsx index ec8dde8a4a8..8919927cb3e 100644 --- a/public/app/plugins/panel/histogram/HistogramPanel.tsx +++ b/public/app/plugins/panel/histogram/HistogramPanel.tsx @@ -5,9 +5,9 @@ import { histogramFieldsToFrame } from '@grafana/data/src/transformations/transf import { useTheme2 } from '@grafana/ui'; import { Histogram, getBucketSize } from './Histogram'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; -type Props = PanelProps; +type Props = PanelProps; export const HistogramPanel = ({ data, options, width, height }: Props) => { const theme = useTheme2(); diff --git a/public/app/plugins/panel/histogram/module.tsx b/public/app/plugins/panel/histogram/module.tsx index 9b395ebeec4..0b27fa61c1b 100644 --- a/public/app/plugins/panel/histogram/module.tsx +++ b/public/app/plugins/panel/histogram/module.tsx @@ -3,10 +3,10 @@ import { histogramFieldInfo } from '@grafana/data/src/transformations/transforme import { commonOptionsBuilder, graphFieldOptions } from '@grafana/ui'; import { HistogramPanel } from './HistogramPanel'; -import { PanelFieldConfig, PanelOptions, defaultPanelFieldConfig, defaultPanelOptions } from './panelcfg.gen'; +import { FieldConfig, Options, defaultFieldConfig, defaultOptions } from './panelcfg.gen'; import { originalDataHasHistogram } from './utils'; -export const plugin = new PanelPlugin(HistogramPanel) +export const plugin = new PanelPlugin(HistogramPanel) .setPanelOptions((builder) => { builder .addCustomEditor({ @@ -25,7 +25,7 @@ export const plugin = new PanelPlugin(HistogramP placeholder: 'Auto', min: 0, }, - defaultValue: defaultPanelOptions.bucketSize, + defaultValue: defaultOptions.bucketSize, showIf: (opts, data) => !originalDataHasHistogram(data), }) .addNumberInput({ @@ -36,14 +36,14 @@ export const plugin = new PanelPlugin(HistogramP placeholder: '0', min: 0, }, - defaultValue: defaultPanelOptions.bucketOffset, + defaultValue: defaultOptions.bucketOffset, showIf: (opts, data) => !originalDataHasHistogram(data), }) .addBooleanSwitch({ path: 'combine', name: histogramFieldInfo.combine.name, description: histogramFieldInfo.combine.description, - defaultValue: defaultPanelOptions.combine, + defaultValue: defaultOptions.combine, showIf: (opts, data) => !originalDataHasHistogram(data), }); @@ -62,7 +62,7 @@ export const plugin = new PanelPlugin(HistogramP }, }, useCustomConfig: (builder) => { - const cfg = defaultPanelFieldConfig; + const cfg = defaultFieldConfig; builder .addSliderInput({ diff --git a/public/app/plugins/panel/histogram/panelcfg.cue b/public/app/plugins/panel/histogram/panelcfg.cue index 7e6bdda9328..946d6f6ea77 100644 --- a/public/app/plugins/panel/histogram/panelcfg.cue +++ b/public/app/plugins/panel/histogram/panelcfg.cue @@ -26,7 +26,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { common.OptionsWithLegend common.OptionsWithTooltip @@ -38,7 +38,7 @@ composableKinds: PanelCfg: { combine?: bool } @cuetsy(kind="interface") - PanelFieldConfig: { + FieldConfig: { common.AxisConfig common.HideableFieldConfig diff --git a/public/app/plugins/panel/histogram/panelcfg.gen.ts b/public/app/plugins/panel/histogram/panelcfg.gen.ts index cb4012cf859..1e85c2751d2 100644 --- a/public/app/plugins/panel/histogram/panelcfg.gen.ts +++ b/public/app/plugins/panel/histogram/panelcfg.gen.ts @@ -12,7 +12,7 @@ import * as common from '@grafana/schema'; export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions extends common.OptionsWithLegend, common.OptionsWithTooltip { +export interface Options extends common.OptionsWithLegend, common.OptionsWithTooltip { /** * Offset buckets by this amount */ @@ -27,11 +27,11 @@ export interface PanelOptions extends common.OptionsWithLegend, common.OptionsWi combine?: boolean; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { bucketOffset: 0, }; -export interface PanelFieldConfig extends common.AxisConfig, common.HideableFieldConfig { +export interface FieldConfig extends common.AxisConfig, common.HideableFieldConfig { /** * Controls the fill opacity of the bars. */ @@ -47,7 +47,7 @@ export interface PanelFieldConfig extends common.AxisConfig, common.HideableFiel lineWidth?: number; } -export const defaultPanelFieldConfig: Partial = { +export const defaultFieldConfig: Partial = { fillOpacity: 80, gradientMode: common.GraphGradientMode.None, lineWidth: 1, diff --git a/public/app/plugins/panel/icon/IconPanel.tsx b/public/app/plugins/panel/icon/IconPanel.tsx index 063d1c78109..d248ceef4c1 100644 --- a/public/app/plugins/panel/icon/IconPanel.tsx +++ b/public/app/plugins/panel/icon/IconPanel.tsx @@ -20,9 +20,9 @@ import { getTextDimensionFromData, } from 'app/features/dimensions'; -import { PanelOptions } from './models.gen'; +import { Options } from './models.gen'; -interface Props extends PanelProps {} +interface Props extends PanelProps {} export class IconPanel extends Component { private element: ElementState; diff --git a/public/app/plugins/panel/icon/models.gen.ts b/public/app/plugins/panel/icon/models.gen.ts index 0dc01c29754..b068bcda677 100644 --- a/public/app/plugins/panel/icon/models.gen.ts +++ b/public/app/plugins/panel/icon/models.gen.ts @@ -7,11 +7,11 @@ import { CanvasElementOptions } from 'app/features/canvas'; import { IconConfig } from 'app/features/canvas/elements/icon'; import { ResourceDimensionMode } from '@grafana/schema'; -export interface PanelOptions { +export interface Options { root: Omit, 'type' | 'name'>; // type is forced } -export const defaultPanelOptions: PanelOptions = { +export const defaultOptions: Options = { root: { config: { path: { diff --git a/public/app/plugins/panel/icon/module.tsx b/public/app/plugins/panel/icon/module.tsx index 37e8706b0a5..1cce66fea37 100644 --- a/public/app/plugins/panel/icon/module.tsx +++ b/public/app/plugins/panel/icon/module.tsx @@ -5,9 +5,9 @@ import { IconConfig, iconItem } from 'app/features/canvas/elements/icon'; import { optionBuilder } from '../canvas/editor/options'; import { IconPanel } from './IconPanel'; -import { defaultPanelOptions, PanelOptions } from './models.gen'; +import { defaultOptions, Options } from './models.gen'; -export const plugin = new PanelPlugin(IconPanel) +export const plugin = new PanelPlugin(IconPanel) .setNoPadding() // extend to panel edges .useFieldConfig({ standardOptions: { @@ -31,6 +31,6 @@ export const plugin = new PanelPlugin(IconPanel) optionBuilder.addBorder(builder, ctx); }, - defaultValue: defaultPanelOptions.root as any, + defaultValue: defaultOptions.root as any, }); }); diff --git a/public/app/plugins/panel/logs/panelcfg.cue b/public/app/plugins/panel/logs/panelcfg.cue index 2d27b75e1b8..fd6630d9c79 100644 --- a/public/app/plugins/panel/logs/panelcfg.cue +++ b/public/app/plugins/panel/logs/panelcfg.cue @@ -26,7 +26,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { showLabels: bool showCommonLabels: bool showTime: bool diff --git a/public/app/plugins/panel/logs/panelcfg.gen.ts b/public/app/plugins/panel/logs/panelcfg.gen.ts index 76cdd44824d..f4100a4b7c7 100644 --- a/public/app/plugins/panel/logs/panelcfg.gen.ts +++ b/public/app/plugins/panel/logs/panelcfg.gen.ts @@ -12,7 +12,7 @@ import * as common from '@grafana/schema'; export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions { +export interface Options { dedupStrategy: common.LogsDedupStrategy; enableLogDetails: boolean; prettifyLogMessage: boolean; diff --git a/public/app/plugins/panel/logs/types.ts b/public/app/plugins/panel/logs/types.ts index 63cd35450aa..1473f1fd934 100644 --- a/public/app/plugins/panel/logs/types.ts +++ b/public/app/plugins/panel/logs/types.ts @@ -1 +1 @@ -export { PanelOptions as Options } from './panelcfg.gen'; +export { Options } from './panelcfg.gen'; diff --git a/public/app/plugins/panel/news/NewsPanel.tsx b/public/app/plugins/panel/news/NewsPanel.tsx index a8a2a9453ab..48542639d8c 100644 --- a/public/app/plugins/panel/news/NewsPanel.tsx +++ b/public/app/plugins/panel/news/NewsPanel.tsx @@ -6,10 +6,10 @@ import { CustomScrollbar } from '@grafana/ui'; import { News } from './component/News'; import { DEFAULT_FEED_URL } from './constants'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; import { useNewsFeed } from './useNewsFeed'; -interface NewsPanelProps extends PanelProps {} +interface NewsPanelProps extends PanelProps {} export function NewsPanel(props: NewsPanelProps) { const { diff --git a/public/app/plugins/panel/news/module.tsx b/public/app/plugins/panel/news/module.tsx index eead921f0a6..a072d45e34a 100644 --- a/public/app/plugins/panel/news/module.tsx +++ b/public/app/plugins/panel/news/module.tsx @@ -2,9 +2,9 @@ import { PanelPlugin } from '@grafana/data'; import { NewsPanel } from './NewsPanel'; import { DEFAULT_FEED_URL } from './constants'; -import { PanelOptions, defaultPanelOptions } from './panelcfg.gen'; +import { Options, defaultOptions } from './panelcfg.gen'; -export const plugin = new PanelPlugin(NewsPanel).setPanelOptions((builder) => { +export const plugin = new PanelPlugin(NewsPanel).setPanelOptions((builder) => { builder .addTextInput({ path: 'feedUrl', @@ -13,12 +13,12 @@ export const plugin = new PanelPlugin(NewsPanel).setPanelOptions(( settings: { placeholder: DEFAULT_FEED_URL, }, - defaultValue: defaultPanelOptions.feedUrl, + defaultValue: defaultOptions.feedUrl, }) .addBooleanSwitch({ path: 'showImage', name: 'Show image', description: 'Controls if the news item social (og:image) image is shown above text content', - defaultValue: defaultPanelOptions.showImage, + defaultValue: defaultOptions.showImage, }); }); diff --git a/public/app/plugins/panel/news/panelcfg.cue b/public/app/plugins/panel/news/panelcfg.cue index 454ac9fc665..93134a16d03 100644 --- a/public/app/plugins/panel/news/panelcfg.cue +++ b/public/app/plugins/panel/news/panelcfg.cue @@ -22,7 +22,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { // empty/missing will default to grafana blog feedUrl?: string showImage?: bool | *true diff --git a/public/app/plugins/panel/news/panelcfg.gen.ts b/public/app/plugins/panel/news/panelcfg.gen.ts index a5037c732d3..c81cfd4373d 100644 --- a/public/app/plugins/panel/news/panelcfg.gen.ts +++ b/public/app/plugins/panel/news/panelcfg.gen.ts @@ -10,7 +10,7 @@ export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions { +export interface Options { /** * empty/missing will default to grafana blog */ @@ -18,6 +18,6 @@ export interface PanelOptions { showImage?: boolean; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { showImage: true, }; diff --git a/public/app/plugins/panel/nodeGraph/panelcfg.cue b/public/app/plugins/panel/nodeGraph/panelcfg.cue index 5ef167b0a8c..811c074796a 100644 --- a/public/app/plugins/panel/nodeGraph/panelcfg.cue +++ b/public/app/plugins/panel/nodeGraph/panelcfg.cue @@ -43,7 +43,7 @@ composableKinds: PanelCfg: { // Unit for the secondary stat to override what ever is set in the data frame. secondaryStatUnit?: string } - PanelOptions: { + Options: { nodes?: NodeOptions edges?: EdgeOptions } @cuetsy(kind="interface") diff --git a/public/app/plugins/panel/nodeGraph/panelcfg.gen.ts b/public/app/plugins/panel/nodeGraph/panelcfg.gen.ts index e531ea79ddc..2627b8a8f04 100644 --- a/public/app/plugins/panel/nodeGraph/panelcfg.gen.ts +++ b/public/app/plugins/panel/nodeGraph/panelcfg.gen.ts @@ -21,7 +21,7 @@ export interface ArcOption { field?: string; } -export interface PanelOptions { +export interface Options { edges?: { /** * Unit for the main stat to override what ever is set in the data frame. diff --git a/public/app/plugins/panel/nodeGraph/types.ts b/public/app/plugins/panel/nodeGraph/types.ts index 5af3c19a61a..8e2a1636c86 100644 --- a/public/app/plugins/panel/nodeGraph/types.ts +++ b/public/app/plugins/panel/nodeGraph/types.ts @@ -2,7 +2,7 @@ import { SimulationNodeDatum, SimulationLinkDatum } from 'd3-force'; import { Field, IconName } from '@grafana/data'; -export { PanelOptions as NodeGraphOptions, ArcOption } from './panelcfg.gen'; +export { Options as NodeGraphOptions, ArcOption } from './panelcfg.gen'; export type NodeDatum = SimulationNodeDatum & { id: string; diff --git a/public/app/plugins/panel/piechart/PieChartPanel.test.tsx b/public/app/plugins/panel/piechart/PieChartPanel.test.tsx index 3d1f2536f11..48b995f6344 100644 --- a/public/app/plugins/panel/piechart/PieChartPanel.test.tsx +++ b/public/app/plugins/panel/piechart/PieChartPanel.test.tsx @@ -14,7 +14,7 @@ import { import { LegendDisplayMode, SortOrder, TooltipDisplayMode } from '@grafana/schema'; import { PieChartPanel } from './PieChartPanel'; -import { PanelOptions, PieChartType, PieChartLegendValues } from './panelcfg.gen'; +import { Options, PieChartType, PieChartLegendValues } from './panelcfg.gen'; jest.mock('react-use', () => ({ ...jest.requireActual('react-use'), @@ -171,7 +171,7 @@ const setup = (propsOverrides?: {}) => { overrides: [], }; - const options: PanelOptions = { + const options: Options = { pieType: PieChartType.Pie, displayLabels: [], legend: { diff --git a/public/app/plugins/panel/piechart/PieChartPanel.tsx b/public/app/plugins/panel/piechart/PieChartPanel.tsx index e4f9ff58eb3..ea40c659633 100644 --- a/public/app/plugins/panel/piechart/PieChartPanel.tsx +++ b/public/app/plugins/panel/piechart/PieChartPanel.tsx @@ -22,7 +22,7 @@ import { } from '@grafana/ui'; import { PieChart } from './PieChart'; -import { PieChartLegendOptions, PieChartLegendValues, PanelOptions } from './panelcfg.gen'; +import { PieChartLegendOptions, PieChartLegendValues, Options } from './panelcfg.gen'; import { filterDisplayItems, sumDisplayItemsReducer } from './utils'; const defaultLegendOptions: PieChartLegendOptions = { @@ -33,7 +33,7 @@ const defaultLegendOptions: PieChartLegendOptions = { values: [PieChartLegendValues.Percent], }; -interface Props extends PanelProps {} +interface Props extends PanelProps {} /** * @beta diff --git a/public/app/plugins/panel/piechart/migrations.ts b/public/app/plugins/panel/piechart/migrations.ts index 46cd1dba31e..8cde9d8d41e 100644 --- a/public/app/plugins/panel/piechart/migrations.ts +++ b/public/app/plugins/panel/piechart/migrations.ts @@ -1,17 +1,17 @@ import { FieldColorModeId, FieldConfigProperty, FieldMatcherID, PanelModel } from '@grafana/data'; import { LegendDisplayMode } from '@grafana/schema'; -import { PanelOptions, PieChartLabels, PieChartLegendValues, PieChartType } from './panelcfg.gen'; +import { Options, PieChartLabels, PieChartLegendValues, PieChartType } from './panelcfg.gen'; export const PieChartPanelChangedHandler = ( - panel: PanelModel> | any, + panel: PanelModel> | any, prevPluginId: string, prevOptions: any ) => { if (prevPluginId === 'grafana-piechart-panel' && prevOptions.angular) { const angular = prevOptions.angular; const overrides = []; - let options: PanelOptions = panel.options; + let options: Options = panel.options; // Migrate color overrides for series if (angular.aliasColors) { diff --git a/public/app/plugins/panel/piechart/module.tsx b/public/app/plugins/panel/piechart/module.tsx index b2d6a3634eb..e90a8cdc670 100644 --- a/public/app/plugins/panel/piechart/module.tsx +++ b/public/app/plugins/panel/piechart/module.tsx @@ -5,10 +5,10 @@ import { addStandardDataReduceOptions } from '../stat/common'; import { PieChartPanel } from './PieChartPanel'; import { PieChartPanelChangedHandler } from './migrations'; -import { PanelOptions, PanelFieldConfig, PieChartType, PieChartLabels, PieChartLegendValues } from './panelcfg.gen'; +import { Options, FieldConfig, PieChartType, PieChartLabels, PieChartLegendValues } from './panelcfg.gen'; import { PieChartSuggestionsSupplier } from './suggestions'; -export const plugin = new PanelPlugin(PieChartPanel) +export const plugin = new PanelPlugin(PieChartPanel) .setPanelChangeHandler(PieChartPanelChangedHandler) .useFieldConfig({ disableStandardOptions: [FieldConfigProperty.Thresholds], diff --git a/public/app/plugins/panel/piechart/panelcfg.cue b/public/app/plugins/panel/piechart/panelcfg.cue index aaea5b8861a..038fc21d0b8 100644 --- a/public/app/plugins/panel/piechart/panelcfg.cue +++ b/public/app/plugins/panel/piechart/panelcfg.cue @@ -42,14 +42,14 @@ composableKinds: PanelCfg: { common.VizLegendOptions values: [...PieChartLegendValues] } @cuetsy(kind="interface") - PanelOptions: { + Options: { common.OptionsWithTooltip common.SingleStatBaseOptions pieType: PieChartType displayLabels: [...PieChartLabels] legend: PieChartLegendOptions } @cuetsy(kind="interface") - PanelFieldConfig: common.HideableFieldConfig @cuetsy(kind="interface") + FieldConfig: common.HideableFieldConfig @cuetsy(kind="interface") }, ] }, diff --git a/public/app/plugins/panel/piechart/panelcfg.gen.ts b/public/app/plugins/panel/piechart/panelcfg.gen.ts index a47ad37c9bd..90eddb63d08 100644 --- a/public/app/plugins/panel/piechart/panelcfg.gen.ts +++ b/public/app/plugins/panel/piechart/panelcfg.gen.ts @@ -50,14 +50,14 @@ export const defaultPieChartLegendOptions: Partial = { values: [], }; -export interface PanelOptions extends common.OptionsWithTooltip, common.SingleStatBaseOptions { +export interface Options extends common.OptionsWithTooltip, common.SingleStatBaseOptions { displayLabels: Array; legend: PieChartLegendOptions; pieType: PieChartType; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { displayLabels: [], }; -export interface PanelFieldConfig extends common.HideableFieldConfig {} +export interface FieldConfig extends common.HideableFieldConfig {} diff --git a/public/app/plugins/panel/piechart/suggestions.ts b/public/app/plugins/panel/piechart/suggestions.ts index 6bc1a86e095..0aa156539a1 100644 --- a/public/app/plugins/panel/piechart/suggestions.ts +++ b/public/app/plugins/panel/piechart/suggestions.ts @@ -1,11 +1,11 @@ import { VisualizationSuggestionsBuilder } from '@grafana/data'; import { SuggestionName } from 'app/types/suggestions'; -import { PieChartLabels, PanelOptions, PieChartType } from './panelcfg.gen'; +import { PieChartLabels, Options, PieChartType } from './panelcfg.gen'; export class PieChartSuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { - const list = builder.getListAppender({ + const list = builder.getListAppender({ name: SuggestionName.PieChart, pluginId: 'piechart', options: { diff --git a/public/app/plugins/panel/stat/StatMigrations.ts b/public/app/plugins/panel/stat/StatMigrations.ts index 4348e3468df..81a7b5b68cd 100644 --- a/public/app/plugins/panel/stat/StatMigrations.ts +++ b/public/app/plugins/panel/stat/StatMigrations.ts @@ -2,16 +2,16 @@ import { FieldColorModeId, FieldConfigSource, PanelModel } from '@grafana/data'; import { BigValueTextMode, BigValueGraphMode, BigValueColorMode } from '@grafana/schema'; import { sharedSingleStatPanelChangedHandler } from '@grafana/ui'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; // This is called when the panel changes from another panel export const statPanelChangedHandler = ( - panel: PanelModel> | any, + panel: PanelModel> | any, prevPluginId: string, prevOptions: any ) => { // This handles most config changes - const options = sharedSingleStatPanelChangedHandler(panel, prevPluginId, prevOptions) as PanelOptions; + const options = sharedSingleStatPanelChangedHandler(panel, prevPluginId, prevOptions) as Options; // Changing from angular singlestat if (prevOptions.angular && (prevPluginId === 'singlestat' || prevPluginId === 'grafana-singlestat-panel')) { diff --git a/public/app/plugins/panel/stat/StatPanel.tsx b/public/app/plugins/panel/stat/StatPanel.tsx index bbc29f28230..25750a7aaee 100644 --- a/public/app/plugins/panel/stat/StatPanel.tsx +++ b/public/app/plugins/panel/stat/StatPanel.tsx @@ -16,9 +16,9 @@ import { BigValue, DataLinksContextMenu, VizRepeater, VizRepeaterRenderValueProp import { DataLinksContextMenuApi } from '@grafana/ui/src/components/DataLinks/DataLinksContextMenu'; import { config } from 'app/core/config'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; -export class StatPanel extends PureComponent> { +export class StatPanel extends PureComponent> { renderComponent = ( valueProps: VizRepeaterRenderValueProps, menuProps: DataLinksContextMenuApi diff --git a/public/app/plugins/panel/stat/module.tsx b/public/app/plugins/panel/stat/module.tsx index 83e17cc519a..98b5b4c8784 100644 --- a/public/app/plugins/panel/stat/module.tsx +++ b/public/app/plugins/panel/stat/module.tsx @@ -5,10 +5,10 @@ import { commonOptionsBuilder, sharedSingleStatMigrationHandler } from '@grafana import { statPanelChangedHandler } from './StatMigrations'; import { StatPanel } from './StatPanel'; import { addStandardDataReduceOptions, addOrientationOption } from './common'; -import { defaultPanelOptions, PanelOptions } from './panelcfg.gen'; +import { defaultOptions, Options } from './panelcfg.gen'; import { StatSuggestionsSupplier } from './suggestions'; -export const plugin = new PanelPlugin(StatPanel) +export const plugin = new PanelPlugin(StatPanel) .useFieldConfig() .setPanelOptions((builder) => { const mainCategory = ['Stat styles']; @@ -31,7 +31,7 @@ export const plugin = new PanelPlugin(StatPanel) { value: BigValueTextMode.None, label: 'None' }, ], }, - defaultValue: defaultPanelOptions.textMode, + defaultValue: defaultOptions.textMode, }); builder @@ -54,7 +54,7 @@ export const plugin = new PanelPlugin(StatPanel) name: 'Graph mode', description: 'Stat panel graph / sparkline mode', category: mainCategory, - defaultValue: defaultPanelOptions.graphMode, + defaultValue: defaultOptions.graphMode, settings: { options: [ { value: BigValueGraphMode.None, label: 'None' }, @@ -65,7 +65,7 @@ export const plugin = new PanelPlugin(StatPanel) .addRadio({ path: 'justifyMode', name: 'Text alignment', - defaultValue: defaultPanelOptions.justifyMode, + defaultValue: defaultOptions.justifyMode, category: mainCategory, settings: { options: [ diff --git a/public/app/plugins/panel/stat/panelcfg.cue b/public/app/plugins/panel/stat/panelcfg.cue index 17ea0e2ddfd..eaf0c9972bd 100644 --- a/public/app/plugins/panel/stat/panelcfg.cue +++ b/public/app/plugins/panel/stat/panelcfg.cue @@ -26,7 +26,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { common.SingleStatBaseOptions graphMode: common.BigValueGraphMode & (*"area" | _) colorMode: common.BigValueColorMode & (*"value" | _) diff --git a/public/app/plugins/panel/stat/panelcfg.gen.ts b/public/app/plugins/panel/stat/panelcfg.gen.ts index c1a246e82e3..1967112431b 100644 --- a/public/app/plugins/panel/stat/panelcfg.gen.ts +++ b/public/app/plugins/panel/stat/panelcfg.gen.ts @@ -12,14 +12,14 @@ import * as common from '@grafana/schema'; export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions extends common.SingleStatBaseOptions { +export interface Options extends common.SingleStatBaseOptions { colorMode: common.BigValueColorMode; graphMode: common.BigValueGraphMode; justifyMode: common.BigValueJustifyMode; textMode: common.BigValueTextMode; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { colorMode: common.BigValueColorMode.Value, graphMode: common.BigValueGraphMode.Area, justifyMode: common.BigValueJustifyMode.Auto, diff --git a/public/app/plugins/panel/stat/suggestions.ts b/public/app/plugins/panel/stat/suggestions.ts index 7adc240be00..c07fa1d1b07 100644 --- a/public/app/plugins/panel/stat/suggestions.ts +++ b/public/app/plugins/panel/stat/suggestions.ts @@ -2,7 +2,7 @@ import { VisualizationSuggestionsBuilder } from '@grafana/data'; import { BigValueColorMode, BigValueGraphMode } from '@grafana/schema'; import { SuggestionName } from 'app/types/suggestions'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; export class StatSuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { @@ -12,7 +12,7 @@ export class StatSuggestionsSupplier { return; } - const list = builder.getListAppender({ + const list = builder.getListAppender({ name: SuggestionName.Stat, pluginId: 'stat', options: {}, diff --git a/public/app/plugins/panel/state-timeline/StateTimelinePanel.tsx b/public/app/plugins/panel/state-timeline/StateTimelinePanel.tsx index 6baf9662a1d..37eefe8e0be 100644 --- a/public/app/plugins/panel/state-timeline/StateTimelinePanel.tsx +++ b/public/app/plugins/panel/state-timeline/StateTimelinePanel.tsx @@ -26,11 +26,11 @@ import { OutsideRangePlugin } from '../timeseries/plugins/OutsideRangePlugin'; import { getTimezones } from '../timeseries/utils'; import { StateTimelineTooltip } from './StateTimelineTooltip'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; const TOOLTIP_OFFSET = 10; -interface TimelinePanelProps extends PanelProps {} +interface TimelinePanelProps extends PanelProps {} /** * @alpha diff --git a/public/app/plugins/panel/state-timeline/migrations.ts b/public/app/plugins/panel/state-timeline/migrations.ts index 9e09969706a..178a75af7e4 100644 --- a/public/app/plugins/panel/state-timeline/migrations.ts +++ b/public/app/plugins/panel/state-timeline/migrations.ts @@ -2,15 +2,15 @@ import { isArray } from 'lodash'; import { FieldConfigSource, MappingType, PanelModel, ValueMap } from '@grafana/data'; -import { PanelFieldConfig, PanelOptions } from './panelcfg.gen'; +import { FieldConfig, Options } from './panelcfg.gen'; // This is called when the panel changes from another panel export const timelinePanelChangedHandler = ( - panel: PanelModel> | any, + panel: PanelModel> | any, prevPluginId: string, prevOptions: any ) => { - let options = (panel.options ?? {}) as PanelOptions; + let options = (panel.options ?? {}) as Options; // Changing from angular singlestat if (prevPluginId === 'natel-discrete-panel' && prevOptions.angular) { @@ -21,7 +21,7 @@ export const timelinePanelChangedHandler = ( fieldConfig.defaults.unit = oldOptions.units; } - const custom: PanelFieldConfig = { + const custom: FieldConfig = { fillOpacity: 100, lineWidth: 0, }; diff --git a/public/app/plugins/panel/state-timeline/module.tsx b/public/app/plugins/panel/state-timeline/module.tsx index 7782fc6f984..dd97e7ebae4 100644 --- a/public/app/plugins/panel/state-timeline/module.tsx +++ b/public/app/plugins/panel/state-timeline/module.tsx @@ -12,10 +12,10 @@ import { SpanNullsEditor } from '../timeseries/SpanNullsEditor'; import { StateTimelinePanel } from './StateTimelinePanel'; import { timelinePanelChangedHandler } from './migrations'; -import { PanelOptions, PanelFieldConfig, defaultPanelOptions, defaultPanelFieldConfig } from './panelcfg.gen'; +import { Options, FieldConfig, defaultOptions, defaultFieldConfig } from './panelcfg.gen'; import { StatTimelineSuggestionsSupplier } from './suggestions'; -export const plugin = new PanelPlugin(StateTimelinePanel) +export const plugin = new PanelPlugin(StateTimelinePanel) .setPanelChangeHandler(timelinePanelChangedHandler) .useFieldConfig({ standardOptions: { @@ -33,7 +33,7 @@ export const plugin = new PanelPlugin(StateTimel .addSliderInput({ path: 'lineWidth', name: 'Line width', - defaultValue: defaultPanelFieldConfig.lineWidth, + defaultValue: defaultFieldConfig.lineWidth, settings: { min: 0, max: 10, @@ -43,7 +43,7 @@ export const plugin = new PanelPlugin(StateTimel .addSliderInput({ path: 'fillOpacity', name: 'Fill opacity', - defaultValue: defaultPanelFieldConfig.fillOpacity, + defaultValue: defaultFieldConfig.fillOpacity, settings: { min: 0, max: 100, @@ -67,7 +67,7 @@ export const plugin = new PanelPlugin(StateTimel .addBooleanSwitch({ path: 'mergeValues', name: 'Merge equal consecutive values', - defaultValue: defaultPanelOptions.mergeValues, + defaultValue: defaultOptions.mergeValues, }) .addRadio({ path: 'showValue', @@ -79,7 +79,7 @@ export const plugin = new PanelPlugin(StateTimel { value: VisibilityMode.Never, label: 'Never' }, ], }, - defaultValue: defaultPanelOptions.showValue, + defaultValue: defaultOptions.showValue, }) .addRadio({ path: 'alignValue', @@ -91,7 +91,7 @@ export const plugin = new PanelPlugin(StateTimel { value: 'right', label: 'Right' }, ], }, - defaultValue: defaultPanelOptions.alignValue, + defaultValue: defaultOptions.alignValue, }) .addSliderInput({ path: 'rowHeight', @@ -101,7 +101,7 @@ export const plugin = new PanelPlugin(StateTimel max: 1, step: 0.01, }, - defaultValue: defaultPanelOptions.rowHeight, + defaultValue: defaultOptions.rowHeight, }); commonOptionsBuilder.addLegendOptions(builder, false); diff --git a/public/app/plugins/panel/state-timeline/panelcfg.cue b/public/app/plugins/panel/state-timeline/panelcfg.cue index c29fc243684..850efc9774e 100644 --- a/public/app/plugins/panel/state-timeline/panelcfg.cue +++ b/public/app/plugins/panel/state-timeline/panelcfg.cue @@ -25,7 +25,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { ui.OptionsWithLegend ui.OptionsWithTooltip ui.OptionsWithTimezones @@ -39,7 +39,7 @@ composableKinds: PanelCfg: { //Controls value alignment on the timelines alignValue?: ui.TimelineValueAlignment & (*"left" | _) } @cuetsy(kind="interface") - PanelFieldConfig: { + FieldConfig: { ui.HideableFieldConfig lineWidth?: uint32 & <=10 | *0 fillOpacity?: uint32 & <=100 | *70 diff --git a/public/app/plugins/panel/state-timeline/panelcfg.gen.ts b/public/app/plugins/panel/state-timeline/panelcfg.gen.ts index f61ac232654..4579a7c234f 100644 --- a/public/app/plugins/panel/state-timeline/panelcfg.gen.ts +++ b/public/app/plugins/panel/state-timeline/panelcfg.gen.ts @@ -12,7 +12,7 @@ import * as ui from '@grafana/schema'; export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions extends ui.OptionsWithLegend, ui.OptionsWithTooltip, ui.OptionsWithTimezones { +export interface Options extends ui.OptionsWithLegend, ui.OptionsWithTooltip, ui.OptionsWithTimezones { /** * Controls value alignment on the timelines */ @@ -31,19 +31,19 @@ export interface PanelOptions extends ui.OptionsWithLegend, ui.OptionsWithToolti showValue: ui.VisibilityMode; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { alignValue: 'left', mergeValues: true, rowHeight: 0.9, showValue: ui.VisibilityMode.Auto, }; -export interface PanelFieldConfig extends ui.HideableFieldConfig { +export interface FieldConfig extends ui.HideableFieldConfig { fillOpacity?: number; lineWidth?: number; } -export const defaultPanelFieldConfig: Partial = { +export const defaultFieldConfig: Partial = { fillOpacity: 70, lineWidth: 0, }; diff --git a/public/app/plugins/panel/state-timeline/suggestions.ts b/public/app/plugins/panel/state-timeline/suggestions.ts index 4e778f2ad65..f98c1ea7273 100644 --- a/public/app/plugins/panel/state-timeline/suggestions.ts +++ b/public/app/plugins/panel/state-timeline/suggestions.ts @@ -1,7 +1,7 @@ import { VisualizationSuggestionsBuilder } from '@grafana/data'; import { SuggestionName } from 'app/types/suggestions'; -import { PanelFieldConfig, PanelOptions } from './panelcfg.gen'; +import { FieldConfig, Options } from './panelcfg.gen'; export class StatTimelineSuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { @@ -26,7 +26,7 @@ export class StatTimelineSuggestionsSupplier { return; } - const list = builder.getListAppender({ + const list = builder.getListAppender({ name: '', pluginId: 'state-timeline', options: {}, diff --git a/public/app/plugins/panel/status-history/StatusHistoryPanel.tsx b/public/app/plugins/panel/status-history/StatusHistoryPanel.tsx index e98f3edcd72..be421751558 100644 --- a/public/app/plugins/panel/status-history/StatusHistoryPanel.tsx +++ b/public/app/plugins/panel/status-history/StatusHistoryPanel.tsx @@ -23,11 +23,11 @@ import { OutsideRangePlugin } from '../timeseries/plugins/OutsideRangePlugin'; import { getTimezones } from '../timeseries/utils'; import { StatusHistoryTooltip } from './StatusHistoryTooltip'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; const TOOLTIP_OFFSET = 10; -interface TimelinePanelProps extends PanelProps {} +interface TimelinePanelProps extends PanelProps {} /** * @alpha diff --git a/public/app/plugins/panel/status-history/module.tsx b/public/app/plugins/panel/status-history/module.tsx index 8a922cf43e2..6b4d7af5032 100644 --- a/public/app/plugins/panel/status-history/module.tsx +++ b/public/app/plugins/panel/status-history/module.tsx @@ -3,10 +3,10 @@ import { VisibilityMode } from '@grafana/schema'; import { commonOptionsBuilder } from '@grafana/ui'; import { StatusHistoryPanel } from './StatusHistoryPanel'; -import { PanelOptions, PanelFieldConfig, defaultPanelFieldConfig } from './panelcfg.gen'; +import { Options, FieldConfig, defaultFieldConfig } from './panelcfg.gen'; import { StatusHistorySuggestionsSupplier } from './suggestions'; -export const plugin = new PanelPlugin(StatusHistoryPanel) +export const plugin = new PanelPlugin(StatusHistoryPanel) .useFieldConfig({ standardOptions: { [FieldConfigProperty.Color]: { @@ -23,7 +23,7 @@ export const plugin = new PanelPlugin(StatusHist .addSliderInput({ path: 'lineWidth', name: 'Line width', - defaultValue: defaultPanelFieldConfig.lineWidth, + defaultValue: defaultFieldConfig.lineWidth, settings: { min: 0, max: 10, @@ -33,7 +33,7 @@ export const plugin = new PanelPlugin(StatusHist .addSliderInput({ path: 'fillOpacity', name: 'Fill opacity', - defaultValue: defaultPanelFieldConfig.fillOpacity, + defaultValue: defaultFieldConfig.fillOpacity, settings: { min: 0, max: 100, diff --git a/public/app/plugins/panel/status-history/panelcfg.cue b/public/app/plugins/panel/status-history/panelcfg.cue index ec4df7f94ab..180e6b2fa6b 100644 --- a/public/app/plugins/panel/status-history/panelcfg.cue +++ b/public/app/plugins/panel/status-history/panelcfg.cue @@ -25,7 +25,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { ui.OptionsWithLegend ui.OptionsWithTooltip ui.OptionsWithTimezones @@ -37,7 +37,7 @@ composableKinds: PanelCfg: { //Controls the column width colWidth?: float & <=1 | *0.9 } @cuetsy(kind="interface") - PanelFieldConfig: { + FieldConfig: { ui.HideableFieldConfig lineWidth?: uint32 & <=10 | *1 fillOpacity?: uint32 & <=100 | *70 diff --git a/public/app/plugins/panel/status-history/panelcfg.gen.ts b/public/app/plugins/panel/status-history/panelcfg.gen.ts index 4c96a911e9c..7d981a4fe09 100644 --- a/public/app/plugins/panel/status-history/panelcfg.gen.ts +++ b/public/app/plugins/panel/status-history/panelcfg.gen.ts @@ -12,7 +12,7 @@ import * as ui from '@grafana/schema'; export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions extends ui.OptionsWithLegend, ui.OptionsWithTooltip, ui.OptionsWithTimezones { +export interface Options extends ui.OptionsWithLegend, ui.OptionsWithTooltip, ui.OptionsWithTimezones { /** * Controls the column width */ @@ -27,18 +27,18 @@ export interface PanelOptions extends ui.OptionsWithLegend, ui.OptionsWithToolti showValue: ui.VisibilityMode; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { colWidth: 0.9, rowHeight: 0.9, showValue: ui.VisibilityMode.Auto, }; -export interface PanelFieldConfig extends ui.HideableFieldConfig { +export interface FieldConfig extends ui.HideableFieldConfig { fillOpacity?: number; lineWidth?: number; } -export const defaultPanelFieldConfig: Partial = { +export const defaultFieldConfig: Partial = { fillOpacity: 70, lineWidth: 1, }; diff --git a/public/app/plugins/panel/status-history/suggestions.ts b/public/app/plugins/panel/status-history/suggestions.ts index 5ca72215598..48add53c83d 100644 --- a/public/app/plugins/panel/status-history/suggestions.ts +++ b/public/app/plugins/panel/status-history/suggestions.ts @@ -1,7 +1,7 @@ import { FieldColorModeId, VisualizationSuggestionsBuilder } from '@grafana/data'; import { SuggestionName } from 'app/types/suggestions'; -import { PanelOptions, PanelFieldConfig } from './panelcfg.gen'; +import { Options, FieldConfig } from './panelcfg.gen'; export class StatusHistorySuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { @@ -31,7 +31,7 @@ export class StatusHistorySuggestionsSupplier { return; } - const list = builder.getListAppender({ + const list = builder.getListAppender({ name: '', pluginId: 'status-history', options: {}, diff --git a/public/app/plugins/panel/table/TablePanel.tsx b/public/app/plugins/panel/table/TablePanel.tsx index fcc50f96d31..f43839882f6 100644 --- a/public/app/plugins/panel/table/TablePanel.tsx +++ b/public/app/plugins/panel/table/TablePanel.tsx @@ -6,9 +6,9 @@ import { PanelDataErrorView } from '@grafana/runtime'; import { Select, Table, usePanelContext, useTheme2 } from '@grafana/ui'; import { TableSortByFieldState } from '@grafana/ui/src/components/Table/types'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; -interface Props extends PanelProps {} +interface Props extends PanelProps {} export function TablePanel(props: Props) { const { data, height, width, options, fieldConfig, id } = props; @@ -78,7 +78,7 @@ export function TablePanel(props: Props) { ); } -function getCurrentFrameIndex(frames: DataFrame[], options: PanelOptions) { +function getCurrentFrameIndex(frames: DataFrame[], options: Options) { return options.frameIndex > 0 && options.frameIndex < frames.length ? options.frameIndex : 0; } diff --git a/public/app/plugins/panel/table/migrations.ts b/public/app/plugins/panel/table/migrations.ts index 926a4907ab4..f807a497e22 100644 --- a/public/app/plugins/panel/table/migrations.ts +++ b/public/app/plugins/panel/table/migrations.ts @@ -10,14 +10,14 @@ import { } from '@grafana/data'; import { ReduceTransformerOptions } from '@grafana/data/src/transformations/transformers/reduce'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; /** * At 7.0, the `table` panel was swapped from an angular implementation to a react one. * The models do not match, so this process will delegate to the old implementation when * a saved table configuration exists. */ -export const tableMigrationHandler = (panel: PanelModel): Partial => { +export const tableMigrationHandler = (panel: PanelModel): Partial => { // Table was saved as an angular table, lets just swap to the 'table-old' panel if (!panel.pluginVersion && (panel as any).columns) { console.log('Was angular table', panel); @@ -73,7 +73,7 @@ const generateThresholds = (thresholds: string[], colors: string[]) => { }; const migrateTransformations = ( - panel: PanelModel> | any, + panel: PanelModel> | any, oldOpts: { columns: any; transform: Transformations } ) => { const transformations: Transformation[] = panel.transformations ?? []; @@ -228,7 +228,7 @@ const migrateDefaults = (prevDefaults: Style) => { * This is called when the panel changes from another panel */ export const tablePanelChangedHandler = ( - panel: PanelModel> | any, + panel: PanelModel> | any, prevPluginId: string, prevOptions: any ) => { diff --git a/public/app/plugins/panel/table/module.tsx b/public/app/plugins/panel/table/module.tsx index 8676cd9b9a9..2e18317877d 100644 --- a/public/app/plugins/panel/table/module.tsx +++ b/public/app/plugins/panel/table/module.tsx @@ -19,13 +19,13 @@ import { PaginationEditor } from './PaginationEditor'; import { TableCellOptionEditor } from './TableCellOptionEditor'; import { TablePanel } from './TablePanel'; import { tableMigrationHandler, tablePanelChangedHandler } from './migrations'; -import { PanelOptions, defaultPanelOptions } from './panelcfg.gen'; +import { Options, defaultOptions } from './panelcfg.gen'; import { TableSuggestionsSupplier } from './suggestions'; const footerCategory = 'Table footer'; const cellCategory = ['Cell options']; -export const plugin = new PanelPlugin(TablePanel) +export const plugin = new PanelPlugin(TablePanel) .setPanelChangeHandler(tablePanelChangedHandler) .setMigrationHandler(tableMigrationHandler) .useFieldConfig({ @@ -112,12 +112,12 @@ export const plugin = new PanelPlugin(TablePane .addBooleanSwitch({ path: 'showHeader', name: 'Show table header', - defaultValue: defaultPanelOptions.showHeader, + defaultValue: defaultOptions.showHeader, }) .addRadio({ path: 'cellHeight', name: 'Cell height', - defaultValue: defaultPanelOptions.cellHeight, + defaultValue: defaultOptions.cellHeight, settings: { options: [ { value: TableCellHeight.Sm, label: 'Small' }, @@ -130,7 +130,7 @@ export const plugin = new PanelPlugin(TablePane path: 'footer.show', category: [footerCategory], name: 'Show table footer', - defaultValue: defaultPanelOptions.footer?.show, + defaultValue: defaultOptions.footer?.show, }) .addCustomEditor({ id: 'footer.reducer', @@ -147,7 +147,7 @@ export const plugin = new PanelPlugin(TablePane category: [footerCategory], name: 'Count rows', description: 'Display a single count for all data rows', - defaultValue: defaultPanelOptions.footer?.countRows, + defaultValue: defaultOptions.footer?.countRows, showIf: (cfg) => cfg.footer?.reducer?.length === 1 && cfg.footer?.reducer[0] === ReducerID.count, }) .addMultiSelect({ diff --git a/public/app/plugins/panel/table/panelcfg.cue b/public/app/plugins/panel/table/panelcfg.cue index c79cc2510b2..49a773cc695 100644 --- a/public/app/plugins/panel/table/panelcfg.cue +++ b/public/app/plugins/panel/table/panelcfg.cue @@ -25,7 +25,7 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: { + Options: { // Represents the index of the selected frame frameIndex: number | *0 // Controls whether the panel should show the header diff --git a/public/app/plugins/panel/table/panelcfg.gen.ts b/public/app/plugins/panel/table/panelcfg.gen.ts index 804bf638ce2..c73008002cd 100644 --- a/public/app/plugins/panel/table/panelcfg.gen.ts +++ b/public/app/plugins/panel/table/panelcfg.gen.ts @@ -12,7 +12,7 @@ import * as ui from '@grafana/schema'; export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions { +export interface Options { /** * Controls the height of the rows */ @@ -39,7 +39,7 @@ export interface PanelOptions { sortBy?: Array; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { cellHeight: ui.TableCellHeight.Sm, footer: { /** diff --git a/public/app/plugins/panel/table/suggestions.ts b/public/app/plugins/panel/table/suggestions.ts index 63f002db9f2..a848257318f 100644 --- a/public/app/plugins/panel/table/suggestions.ts +++ b/public/app/plugins/panel/table/suggestions.ts @@ -2,11 +2,11 @@ import { VisualizationSuggestionsBuilder } from '@grafana/data'; import { TableFieldOptions } from '@grafana/schema'; import { SuggestionName } from 'app/types/suggestions'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; export class TableSuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { - const list = builder.getListAppender({ + const list = builder.getListAppender({ name: SuggestionName.Table, pluginId: 'table', options: {}, diff --git a/public/app/plugins/panel/text/TextPanel.tsx b/public/app/plugins/panel/text/TextPanel.tsx index 17afa29cf27..6f34aed6190 100644 --- a/public/app/plugins/panel/text/TextPanel.tsx +++ b/public/app/plugins/panel/text/TextPanel.tsx @@ -7,13 +7,13 @@ import { GrafanaTheme2, PanelProps, renderTextPanelMarkdown, textUtil, Interpola import { CustomScrollbar, CodeEditor, useStyles2 } from '@grafana/ui'; import config from 'app/core/config'; -import { defaultCodeOptions, PanelOptions, TextMode } from './panelcfg.gen'; +import { defaultCodeOptions, Options, TextMode } from './panelcfg.gen'; -export interface Props extends PanelProps {} +export interface Props extends PanelProps {} export function TextPanel(props: Props) { const styles = useStyles2(getStyles); - const [processed, setProcessed] = useState({ + const [processed, setProcessed] = useState({ mode: props.options.mode, content: processContent(props.options, props.replaceVariables, config.disableSanitizeHtml), }); @@ -61,7 +61,7 @@ export function TextPanel(props: Props) { ); } -function processContent(options: PanelOptions, interpolate: InterpolateFunction, disableSanitizeHtml: boolean): string { +function processContent(options: Options, interpolate: InterpolateFunction, disableSanitizeHtml: boolean): string { let { mode, content } = options; if (!content) { return ''; diff --git a/public/app/plugins/panel/text/TextPanelEditor.tsx b/public/app/plugins/panel/text/TextPanelEditor.tsx index 490251000ed..d366458b05e 100644 --- a/public/app/plugins/panel/text/TextPanelEditor.tsx +++ b/public/app/plugins/panel/text/TextPanelEditor.tsx @@ -10,9 +10,9 @@ import { variableSuggestionToCodeEditorSuggestion, } from '@grafana/ui'; -import { PanelOptions, TextMode } from './panelcfg.gen'; +import { Options, TextMode } from './panelcfg.gen'; -export const TextPanelEditor = ({ value, onChange, context }: StandardEditorProps) => { +export const TextPanelEditor = ({ value, onChange, context }: StandardEditorProps) => { const language = useMemo(() => context.options?.mode ?? TextMode.Markdown, [context]); const styles = useStyles2(getStyles); diff --git a/public/app/plugins/panel/text/module.tsx b/public/app/plugins/panel/text/module.tsx index b4973f90a1b..ae1f9021363 100644 --- a/public/app/plugins/panel/text/module.tsx +++ b/public/app/plugins/panel/text/module.tsx @@ -2,10 +2,10 @@ import { PanelPlugin } from '@grafana/data'; import { TextPanel } from './TextPanel'; import { TextPanelEditor } from './TextPanelEditor'; -import { CodeLanguage, defaultCodeOptions, defaultPanelOptions, PanelOptions, TextMode } from './panelcfg.gen'; +import { CodeLanguage, defaultCodeOptions, defaultOptions, Options, TextMode } from './panelcfg.gen'; import { textPanelMigrationHandler } from './textPanelMigrationHandler'; -export const plugin = new PanelPlugin(TextPanel) +export const plugin = new PanelPlugin(TextPanel) .setPanelOptions((builder) => { builder .addRadio({ @@ -18,7 +18,7 @@ export const plugin = new PanelPlugin(TextPanel) { value: TextMode.Code, label: 'Code' }, ], }, - defaultValue: defaultPanelOptions.mode, + defaultValue: defaultOptions.mode, }) .addSelect({ path: 'code.language', @@ -49,7 +49,7 @@ export const plugin = new PanelPlugin(TextPanel) path: 'content', name: 'Content', editor: TextPanelEditor, - defaultValue: defaultPanelOptions.content, + defaultValue: defaultOptions.content, }); }) .setMigrationHandler(textPanelMigrationHandler); diff --git a/public/app/plugins/panel/text/panelcfg.cue b/public/app/plugins/panel/text/panelcfg.cue index 0a393afd819..6c83138392f 100644 --- a/public/app/plugins/panel/text/panelcfg.cue +++ b/public/app/plugins/panel/text/panelcfg.cue @@ -33,7 +33,7 @@ composableKinds: PanelCfg: { showMiniMap: bool | *false } @cuetsy(kind="interface") - PanelOptions: { + Options: { mode: TextMode & (*"markdown" | _) code?: CodeOptions content: string | *""" diff --git a/public/app/plugins/panel/text/panelcfg.gen.ts b/public/app/plugins/panel/text/panelcfg.gen.ts index 8dd74fce95d..4c12d4cd2f4 100644 --- a/public/app/plugins/panel/text/panelcfg.gen.ts +++ b/public/app/plugins/panel/text/panelcfg.gen.ts @@ -45,13 +45,13 @@ export const defaultCodeOptions: Partial = { showMiniMap: false, }; -export interface PanelOptions { +export interface Options { code?: CodeOptions; content: string; mode: TextMode; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { content: `# Title For markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)`, diff --git a/public/app/plugins/panel/text/textPanelMigrationHandler.test.ts b/public/app/plugins/panel/text/textPanelMigrationHandler.test.ts index 2d7dc6cb51c..cde26b73ef2 100644 --- a/public/app/plugins/panel/text/textPanelMigrationHandler.test.ts +++ b/public/app/plugins/panel/text/textPanelMigrationHandler.test.ts @@ -1,6 +1,6 @@ import { FieldConfigSource, PanelModel } from '@grafana/data'; -import { TextMode, PanelOptions } from './panelcfg.gen'; +import { TextMode, Options } from './panelcfg.gen'; import { textPanelMigrationHandler } from './textPanelMigrationHandler'; describe('textPanelMigrationHandler', () => { @@ -38,7 +38,7 @@ describe('textPanelMigrationHandler', () => { describe('when invoked and previous version was not old Angular text panel', () => { it('then should just pass options through', () => { - const panel: PanelModel = { + const panel: PanelModel = { id: 1, type: 'text', fieldConfig: {} as unknown as FieldConfigSource, @@ -64,7 +64,7 @@ describe('textPanelMigrationHandler', () => { describe('when invoked and previous version was using text mode', () => { it('then should switch to markdown', () => { const mode = 'text' as unknown as TextMode; - const panel: PanelModel = { + const panel: PanelModel = { id: 1, type: 'text', fieldConfig: {} as unknown as FieldConfigSource, diff --git a/public/app/plugins/panel/text/textPanelMigrationHandler.ts b/public/app/plugins/panel/text/textPanelMigrationHandler.ts index 77c52430620..3cd9c7fccfb 100644 --- a/public/app/plugins/panel/text/textPanelMigrationHandler.ts +++ b/public/app/plugins/panel/text/textPanelMigrationHandler.ts @@ -1,8 +1,8 @@ import { PanelModel } from '@grafana/data'; -import { TextMode, PanelOptions } from './panelcfg.gen'; +import { TextMode, Options } from './panelcfg.gen'; -export const textPanelMigrationHandler = (panel: PanelModel): Partial => { +export const textPanelMigrationHandler = (panel: PanelModel): Partial => { const previousVersion = parseFloat(panel.pluginVersion || '6.1'); let options = panel.options; diff --git a/public/app/plugins/panel/timeseries/TimeSeriesPanel.tsx b/public/app/plugins/panel/timeseries/TimeSeriesPanel.tsx index 9a094837587..c5d26d01a71 100644 --- a/public/app/plugins/panel/timeseries/TimeSeriesPanel.tsx +++ b/public/app/plugins/panel/timeseries/TimeSeriesPanel.tsx @@ -7,7 +7,7 @@ import { KeyboardPlugin, TimeSeries, TooltipPlugin, usePanelContext, ZoomPlugin import { config } from 'app/core/config'; import { getFieldLinksForExplore } from 'app/features/explore/utils/links'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; import { AnnotationEditorPlugin } from './plugins/AnnotationEditorPlugin'; import { AnnotationsPlugin } from './plugins/AnnotationsPlugin'; import { ContextMenuPlugin } from './plugins/ContextMenuPlugin'; @@ -17,7 +17,7 @@ import { ThresholdControlsPlugin } from './plugins/ThresholdControlsPlugin'; import { getPrepareTimeseriesSuggestion } from './suggestions'; import { getTimezones, prepareGraphableFields, regenerateLinksSupplier } from './utils'; -interface TimeSeriesPanelProps extends PanelProps {} +interface TimeSeriesPanelProps extends PanelProps {} export const TimeSeriesPanel = ({ data, diff --git a/public/app/plugins/panel/timeseries/migrations.ts b/public/app/plugins/panel/timeseries/migrations.ts index 15764cc3d8c..dd1884843eb 100644 --- a/public/app/plugins/panel/timeseries/migrations.ts +++ b/public/app/plugins/panel/timeseries/migrations.ts @@ -40,7 +40,7 @@ import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; import { GrafanaQuery, GrafanaQueryType } from 'app/plugins/datasource/grafana/types'; import { defaultGraphConfig } from './config'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; let dashboardRefreshDebouncer: ReturnType | null = null; @@ -87,7 +87,7 @@ export const graphPanelChangedHandler: PanelTypeChangedHandler = ( export function graphToTimeseriesOptions(angular: any): { fieldConfig: FieldConfigSource; - options: PanelOptions; + options: Options; annotations: AnnotationQuery[]; } { let annotations: AnnotationQuery[] = []; @@ -346,7 +346,7 @@ export function graphToTimeseriesOptions(angular: any): { y1.custom = omitBy(graph, isNil); y1.nullValueMode = angular.nullPointMode as NullValueMode; - const options: PanelOptions = { + const options: Options = { legend: { displayMode: LegendDisplayMode.List, showLegend: true, diff --git a/public/app/plugins/panel/timeseries/module.tsx b/public/app/plugins/panel/timeseries/module.tsx index fc8e5802fa7..f0f46f2b6a1 100644 --- a/public/app/plugins/panel/timeseries/module.tsx +++ b/public/app/plugins/panel/timeseries/module.tsx @@ -5,10 +5,10 @@ import { TimeSeriesPanel } from './TimeSeriesPanel'; import { TimezonesEditor } from './TimezonesEditor'; import { defaultGraphConfig, getGraphFieldConfig } from './config'; import { graphPanelChangedHandler } from './migrations'; -import { PanelFieldConfig, PanelOptions } from './panelcfg.gen'; +import { FieldConfig, Options } from './panelcfg.gen'; import { TimeSeriesSuggestionsSupplier } from './suggestions'; -export const plugin = new PanelPlugin(TimeSeriesPanel) +export const plugin = new PanelPlugin(TimeSeriesPanel) .setPanelChangeHandler(graphPanelChangedHandler) .useFieldConfig(getGraphFieldConfig(defaultGraphConfig)) .setPanelOptions((builder) => { diff --git a/public/app/plugins/panel/timeseries/panelcfg.cue b/public/app/plugins/panel/timeseries/panelcfg.cue index 04a862f01dc..e9c393dfac1 100644 --- a/public/app/plugins/panel/timeseries/panelcfg.cue +++ b/public/app/plugins/panel/timeseries/panelcfg.cue @@ -24,12 +24,12 @@ composableKinds: PanelCfg: { { schemas: [ { - PanelOptions: common.OptionsWithTimezones & { + Options: common.OptionsWithTimezones & { legend: common.VizLegendOptions tooltip: common.VizTooltipOptions } @cuetsy(kind="interface") - PanelFieldConfig: common.GraphFieldConfig & {} @cuetsy(kind="interface") + FieldConfig: common.GraphFieldConfig & {} @cuetsy(kind="interface") }, ] }, diff --git a/public/app/plugins/panel/timeseries/panelcfg.gen.ts b/public/app/plugins/panel/timeseries/panelcfg.gen.ts index ed39b770580..b3a27e06108 100644 --- a/public/app/plugins/panel/timeseries/panelcfg.gen.ts +++ b/public/app/plugins/panel/timeseries/panelcfg.gen.ts @@ -12,9 +12,9 @@ import * as common from '@grafana/schema'; export const PanelCfgModelVersion = Object.freeze([0, 0]); -export interface PanelOptions extends common.OptionsWithTimezones { +export interface Options extends common.OptionsWithTimezones { legend: common.VizLegendOptions; tooltip: common.VizTooltipOptions; } -export interface PanelFieldConfig extends common.GraphFieldConfig {} +export interface FieldConfig extends common.GraphFieldConfig {} diff --git a/public/app/plugins/panel/timeseries/suggestions.ts b/public/app/plugins/panel/timeseries/suggestions.ts index 6c490b0f885..2b44dd129bb 100644 --- a/public/app/plugins/panel/timeseries/suggestions.ts +++ b/public/app/plugins/panel/timeseries/suggestions.ts @@ -8,7 +8,7 @@ import { GraphDrawStyle, GraphFieldConfig, GraphGradientMode, LineInterpolation, import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; import { SuggestionName } from 'app/types/suggestions'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; export class TimeSeriesSuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { @@ -18,7 +18,7 @@ export class TimeSeriesSuggestionsSupplier { return; } - const list = builder.getListAppender({ + const list = builder.getListAppender({ name: SuggestionName.LineChart, pluginId: 'timeseries', options: { diff --git a/public/app/plugins/panel/trend/TrendPanel.tsx b/public/app/plugins/panel/trend/TrendPanel.tsx index b7797c905ce..30b02975154 100644 --- a/public/app/plugins/panel/trend/TrendPanel.tsx +++ b/public/app/plugins/panel/trend/TrendPanel.tsx @@ -9,7 +9,7 @@ import { findFieldIndex } from 'app/features/dimensions'; import { ContextMenuPlugin } from '../timeseries/plugins/ContextMenuPlugin'; import { prepareGraphableFields, regenerateLinksSupplier } from '../timeseries/utils'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; export const TrendPanel = ({ data, @@ -21,7 +21,7 @@ export const TrendPanel = ({ fieldConfig, replaceVariables, id, -}: PanelProps) => { +}: PanelProps) => { const { sync } = usePanelContext(); const info = useMemo(() => { diff --git a/public/app/plugins/panel/trend/module.tsx b/public/app/plugins/panel/trend/module.tsx index 11ba2d12b6d..422c263ee69 100644 --- a/public/app/plugins/panel/trend/module.tsx +++ b/public/app/plugins/panel/trend/module.tsx @@ -4,10 +4,10 @@ import { commonOptionsBuilder } from '@grafana/ui'; import { defaultGraphConfig, getGraphFieldConfig } from '../timeseries/config'; import { TrendPanel } from './TrendPanel'; -import { PanelFieldConfig, PanelOptions } from './panelcfg.gen'; +import { FieldConfig, Options } from './panelcfg.gen'; import { TrendSuggestionsSupplier } from './suggestions'; -export const plugin = new PanelPlugin(TrendPanel) +export const plugin = new PanelPlugin(TrendPanel) .useFieldConfig(getGraphFieldConfig(defaultGraphConfig)) .setPanelOptions((builder) => { const category = ['X Axis']; diff --git a/public/app/plugins/panel/trend/panelcfg.cue b/public/app/plugins/panel/trend/panelcfg.cue index a56352c17fe..9fc9019a969 100644 --- a/public/app/plugins/panel/trend/panelcfg.cue +++ b/public/app/plugins/panel/trend/panelcfg.cue @@ -25,7 +25,7 @@ composableKinds: PanelCfg: { schemas: [ { // Identical to timeseries... except it does not have timezone settings - PanelOptions: { + Options: { legend: common.VizLegendOptions tooltip: common.VizTooltipOptions @@ -33,7 +33,7 @@ composableKinds: PanelCfg: { xField?: string } @cuetsy(kind="interface") - PanelFieldConfig: common.GraphFieldConfig & {} @cuetsy(kind="interface") + FieldConfig: common.GraphFieldConfig & {} @cuetsy(kind="interface") }, ] }, diff --git a/public/app/plugins/panel/trend/panelcfg.gen.ts b/public/app/plugins/panel/trend/panelcfg.gen.ts index d72f0b5a583..1d09fab109a 100644 --- a/public/app/plugins/panel/trend/panelcfg.gen.ts +++ b/public/app/plugins/panel/trend/panelcfg.gen.ts @@ -15,7 +15,7 @@ export const PanelCfgModelVersion = Object.freeze([0, 0]); /** * Identical to timeseries... except it does not have timezone settings */ -export interface PanelOptions { +export interface Options { legend: common.VizLegendOptions; tooltip: common.VizTooltipOptions; /** @@ -24,4 +24,4 @@ export interface PanelOptions { xField?: string; } -export interface PanelFieldConfig extends common.GraphFieldConfig {} +export interface FieldConfig extends common.GraphFieldConfig {} diff --git a/public/app/plugins/panel/trend/suggestions.ts b/public/app/plugins/panel/trend/suggestions.ts index 4306d46b18b..7b028361251 100644 --- a/public/app/plugins/panel/trend/suggestions.ts +++ b/public/app/plugins/panel/trend/suggestions.ts @@ -2,7 +2,7 @@ import { VisualizationSuggestionsBuilder } from '@grafana/data'; import { GraphDrawStyle, GraphFieldConfig } from '@grafana/schema'; import { SuggestionName } from 'app/types/suggestions'; -import { PanelOptions } from './panelcfg.gen'; +import { Options } from './panelcfg.gen'; export class TrendSuggestionsSupplier { getSuggestionsForData(builder: VisualizationSuggestionsBuilder) { @@ -13,7 +13,7 @@ export class TrendSuggestionsSupplier { } // Super basic - const list = builder.getListAppender({ + const list = builder.getListAppender({ name: SuggestionName.LineChart, pluginId: 'trend', options: { diff --git a/public/app/plugins/panel/xychart/ManualEditor.tsx b/public/app/plugins/panel/xychart/ManualEditor.tsx index 91d13ce6e92..d038f65bd01 100644 --- a/public/app/plugins/panel/xychart/ManualEditor.tsx +++ b/public/app/plugins/panel/xychart/ManualEditor.tsx @@ -7,13 +7,13 @@ import { FieldNamePicker } from '@grafana/ui/src/components/MatchersUI/FieldName import { LayerName } from 'app/core/components/Layers/LayerName'; import { ColorDimensionEditor, ScaleDimensionEditor } from 'app/features/dimensions/editors'; -import { PanelOptions, ScatterSeriesConfig, defaultScatterFieldConfig } from './types'; +import { Options, ScatterSeriesConfig, defaultScatterFieldConfig } from './types'; export const ManualEditor = ({ value, onChange, context, -}: StandardEditorProps) => { +}: StandardEditorProps) => { const [selected, setSelected] = useState(0); const style = useStyles2(getStyles); diff --git a/public/app/plugins/panel/xychart/XYChartPanel2.tsx b/public/app/plugins/panel/xychart/XYChartPanel2.tsx index 3a2438fe219..fc24ff45163 100644 --- a/public/app/plugins/panel/xychart/XYChartPanel2.tsx +++ b/public/app/plugins/panel/xychart/XYChartPanel2.tsx @@ -28,9 +28,9 @@ import { CloseButton } from 'app/core/components/CloseButton/CloseButton'; import { TooltipView } from './TooltipView'; import { SeriesMapping } from './models.gen'; import { prepData, prepScatter, ScatterPanelInfo } from './scatter'; -import { PanelOptions, ScatterHoverEvent, ScatterSeries } from './types'; +import { Options, ScatterHoverEvent, ScatterSeries } from './types'; -type Props = PanelProps; +type Props = PanelProps; const TOOLTIP_OFFSET = 10; export const XYChartPanel2 = (props: Props) => { diff --git a/public/app/plugins/panel/xychart/module.tsx b/public/app/plugins/panel/xychart/module.tsx index 545e68ac02d..e1339325850 100644 --- a/public/app/plugins/panel/xychart/module.tsx +++ b/public/app/plugins/panel/xychart/module.tsx @@ -5,9 +5,9 @@ import { AutoEditor } from './AutoEditor'; import { ManualEditor } from './ManualEditor'; import { XYChartPanel2 } from './XYChartPanel2'; import { getScatterFieldConfig } from './config'; -import { defaultScatterFieldConfig, PanelOptions, ScatterFieldConfig } from './types'; +import { defaultScatterFieldConfig, Options, ScatterFieldConfig } from './types'; -export const plugin = new PanelPlugin(XYChartPanel2) +export const plugin = new PanelPlugin(XYChartPanel2) .useFieldConfig(getScatterFieldConfig(defaultScatterFieldConfig)) .setPanelOptions((builder) => { builder diff --git a/public/app/plugins/panel/xychart/panelcfg.cue b/public/app/plugins/panel/xychart/panelcfg.cue index ec1e0ab82e3..5e577aa1802 100644 --- a/public/app/plugins/panel/xychart/panelcfg.cue +++ b/public/app/plugins/panel/xychart/panelcfg.cue @@ -63,7 +63,7 @@ composableKinds: PanelCfg: { name?: string } @cuetsy(kind="interface") - PanelOptions: { + Options: { common.OptionsWithLegend common.OptionsWithTooltip diff --git a/public/app/plugins/panel/xychart/panelcfg.gen.ts b/public/app/plugins/panel/xychart/panelcfg.gen.ts index 74110143537..a2cc5e51569 100644 --- a/public/app/plugins/panel/xychart/panelcfg.gen.ts +++ b/public/app/plugins/panel/xychart/panelcfg.gen.ts @@ -55,12 +55,12 @@ export interface ScatterSeriesConfig extends ScatterFieldConfig { y?: string; } -export interface PanelOptions extends common.OptionsWithLegend, common.OptionsWithTooltip { +export interface Options extends common.OptionsWithLegend, common.OptionsWithTooltip { dims: XYDimensionConfig; series: Array; seriesMapping?: SeriesMapping; } -export const defaultPanelOptions: Partial = { +export const defaultOptions: Partial = { series: [], }; diff --git a/public/app/plugins/panel/xychart/scatter.ts b/public/app/plugins/panel/xychart/scatter.ts index 7c79b4d6467..c312cd42dea 100644 --- a/public/app/plugins/panel/xychart/scatter.ts +++ b/public/app/plugins/panel/xychart/scatter.ts @@ -34,7 +34,7 @@ import { defaultScatterFieldConfig, ScatterHoverCallback, ScatterSeries, - PanelOptions, + Options, ScatterShow, } from './types'; @@ -48,7 +48,7 @@ export interface ScatterPanelInfo { * This is called when options or structure rev changes */ export function prepScatter( - options: PanelOptions, + options: Options, getData: () => DataFrame[], theme: GrafanaTheme2, ttip: ScatterHoverCallback, @@ -204,7 +204,7 @@ function getScatterSeries( }; } -function prepSeries(options: PanelOptions, frames: DataFrame[]): ScatterSeries[] { +function prepSeries(options: Options, frames: DataFrame[]): ScatterSeries[] { let seriesIndex = 0; if (!frames.length) { throw 'Missing data'; diff --git a/public/app/plugins/panel/xychart/types.ts b/public/app/plugins/panel/xychart/types.ts index d60a60b9d79..c6302feff32 100644 --- a/public/app/plugins/panel/xychart/types.ts +++ b/public/app/plugins/panel/xychart/types.ts @@ -7,7 +7,7 @@ import { ScatterFieldConfig as GeneratedScatterFieldConfig, ScatterSeriesConfig as GeneratedScatterSeriesConfig, defaultScatterFieldConfig as generatedDefaultScatterFieldConfig, - PanelOptions as GeneratedPanelOptions, + Options as GeneratedOptions, } from './panelcfg.gen'; /** @@ -34,7 +34,7 @@ export const defaultScatterFieldConfig: Partial = { export interface ScatterSeriesConfig extends ScatterFieldConfig, GeneratedScatterSeriesConfig {} -export interface PanelOptions extends Omit { +export interface Options extends Omit { series: ScatterSeriesConfig[]; }