Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
4b005947
Unverified
Commit
4b005947
authored
Apr 26, 2020
by
Dominik Prokop
Committed by
GitHub
Apr 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs: Add doc comments for PanelPlugin (#23896)
parent
fd6502b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
40 deletions
+39
-40
packages/grafana-data/src/types/panel.ts
+38
-33
public/app/features/dashboard/components/PanelEditor/PanelOptionsTab.tsx
+1
-7
No files found.
packages/grafana-data/src/types/panel.ts
View file @
4b005947
...
...
@@ -12,87 +12,86 @@ import { OptionsEditorItem } from './OptionsUIRegistryBuilder';
export
type
InterpolateFunction
=
(
value
:
string
,
scopedVars
?:
ScopedVars
,
format
?:
string
|
Function
)
=>
string
;
export
interface
PanelPluginMeta
extends
PluginMeta
{
/** Indicates that panel does not issue queries */
skipDataQuery
?:
boolean
;
/** Indicates that panel should not be available in visualisation picker */
hideFromList
?:
boolean
;
/** Sort order */
sort
:
number
;
}
export
interface
PanelData
{
/**
* State of the data (loading, done, error, streaming)
*/
/** State of the data (loading, done, error, streaming) */
state
:
LoadingState
;
/**
* Contains data frames with field overrides applied
*/
/** Contains data frames with field overrides applied */
series
:
DataFrame
[];
/**
* Request contains the queries and properties sent to the datasource
*/
/** Request contains the queries and properties sent to the datasource */
request
?:
DataQueryRequest
;
/**
* Timing measurements
*/
/** Timing measurements */
timings
?:
DataQueryTimings
;
/**
* Any query errors
*/
/** Any query errors */
error
?:
DataQueryError
;
/**
* Contains the range from the request or a shifted time range if a request uses relative time
*/
/** Contains the range from the request or a shifted time range if a request uses relative time */
timeRange
:
TimeRange
;
}
export
interface
PanelProps
<
T
=
any
>
{
id
:
number
;
// ID within the current dashboard
/** ID of the panel within the current dashboard */
id
:
number
;
/** Result set of panel queries */
data
:
PanelData
;
/** Time range of the current dashboard */
timeRange
:
TimeRange
;
/** Time zone of the current dashboard */
timeZone
:
TimeZone
;
/** Panel options */
options
:
T
;
/** Panel options change handler */
onOptionsChange
:
(
options
:
T
)
=>
void
;
/**
Panel field
s configuration */
/**
Field option
s configuration */
fieldConfig
:
FieldConfigSource
;
/**
Enables panel field config manipulation
*/
/**
Field config change handler
*/
onFieldConfigChange
:
(
config
:
FieldConfigSource
)
=>
void
;
renderCounter
:
number
;
/** Indicathes whether or not panel should be rendered transparent */
transparent
:
boolean
;
/** Current width of the panel */
width
:
number
;
/** Current height of the panel */
height
:
number
;
/** Template variables interpolation function */
replaceVariables
:
InterpolateFunction
;
/** Time range change handler */
onChangeTimeRange
:
(
timeRange
:
AbsoluteTimeRange
)
=>
void
;
/** @internal */
renderCounter
:
number
;
}
export
interface
PanelEditorProps
<
T
=
any
>
{
/** Panel options */
options
:
T
;
/** Panel options change handler */
onOptionsChange
:
(
options
:
T
,
// callback can be used to run something right after update.
callback
?:
()
=>
void
)
=>
void
;
/** Result set of panel queries */
data
:
PanelData
;
/**
* Panel fields configuration - temporart solution
* TODO[FieldConfig]: Remove when we switch old editor to new
*/
fieldConfig
:
FieldConfigSource
;
/**
* Enables panel field config manipulation
* TODO[FieldConfig]: Remove when we switch old editor to new
*/
onFieldConfigChange
:
(
config
:
FieldConfigSource
)
=>
void
;
}
export
interface
PanelModel
<
TOptions
=
any
>
{
/** ID of the panel within the current dashboard */
id
:
number
;
/** Panel options */
options
:
TOptions
;
/** Field options configuration */
fieldConfig
:
FieldConfigSource
;
/** Version of the panel plugin */
pluginVersion
?:
string
;
scopedVars
?:
ScopedVars
;
}
...
...
@@ -160,6 +159,9 @@ export interface PanelOptionsEditorConfig<TOptions, TSettings = any, TValue = an
showIf
?:
(
currentConfig
:
TOptions
)
=>
boolean
;
}
/**
* @internal
*/
export
interface
PanelMenuItem
{
type
?:
'submenu'
|
'divider'
;
text
?:
string
;
...
...
@@ -170,6 +172,9 @@ export interface PanelMenuItem {
subMenu
?:
PanelMenuItem
[];
}
/**
* @internal
*/
export
interface
AngularPanelMenuItem
{
click
:
Function
;
icon
:
string
;
...
...
public/app/features/dashboard/components/PanelEditor/PanelOptionsTab.tsx
View file @
4b005947
...
...
@@ -74,13 +74,7 @@ export const PanelOptionsTab: FC<Props> = ({
if
(
plugin
.
editor
&&
panel
&&
!
plugin
.
optionEditors
)
{
elements
.
push
(
<
OptionsGroup
title=
"Display"
id=
"legacy react editor"
key=
"legacy react editor"
>
<
plugin
.
editor
data=
{
data
}
options=
{
panel
.
getOptions
()
}
onOptionsChange=
{
onPanelOptionsChanged
}
fieldConfig=
{
panel
.
getFieldConfig
()
}
onFieldConfigChange=
{
onFieldConfigsChange
}
/>
<
plugin
.
editor
data=
{
data
}
options=
{
panel
.
getOptions
()
}
onOptionsChange=
{
onPanelOptionsChanged
}
/>
</
OptionsGroup
>
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment