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
770e8e4a
Unverified
Commit
770e8e4a
authored
Dec 08, 2020
by
Ryan McKinley
Committed by
GitHub
Dec 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DataFrame: add path and description metadata (#29695)
parent
3de091ed
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
59 additions
and
1 deletions
+59
-1
packages/grafana-data/src/types/data.ts
+10
-0
packages/grafana-data/src/types/dataFrame.ts
+14
-0
packages/grafana-ui/src/components/uPlot/config.ts
+12
-0
packages/grafana-ui/src/components/uPlot/plugins/AnnotationsEditorPlugin.tsx
+3
-0
packages/grafana-ui/src/components/uPlot/plugins/ClickPlugin.tsx
+3
-0
packages/grafana-ui/src/components/uPlot/plugins/ContextMenuPlugin.tsx
+3
-0
packages/grafana-ui/src/components/uPlot/plugins/CursorPlugin.tsx
+5
-1
packages/grafana-ui/src/components/uPlot/plugins/SelectionPlugin.tsx
+3
-0
packages/grafana-ui/src/components/uPlot/plugins/TooltipPlugin.tsx
+3
-0
packages/grafana-ui/src/components/uPlot/plugins/ZoomPlugin.tsx
+3
-0
No files found.
packages/grafana-data/src/types/data.ts
View file @
770e8e4a
...
@@ -54,6 +54,16 @@ export interface QueryResultMeta {
...
@@ -54,6 +54,16 @@ export interface QueryResultMeta {
executedQueryString
?:
string
;
executedQueryString
?:
string
;
/**
/**
* A browsable path on the datasource
*/
path
?:
string
;
/**
* defaults to '/'
*/
pathSeparator
?:
string
;
/**
* Legacy data source specific, should be moved to custom
* Legacy data source specific, should be moved to custom
* */
* */
gmdMeta
?:
any
[];
// used by cloudwatch
gmdMeta
?:
any
[];
// used by cloudwatch
...
...
packages/grafana-data/src/types/dataFrame.ts
View file @
770e8e4a
...
@@ -35,6 +35,20 @@ export interface FieldConfig<TOptions extends object = any> {
...
@@ -35,6 +35,20 @@ export interface FieldConfig<TOptions extends object = any> {
displayNameFromDS
?:
string
;
displayNameFromDS
?:
string
;
/**
/**
* Human readable field metadata
*/
description
?:
string
;
/**
* An explict path to the field in the datasource. When the frame meta includes a path,
* This will default to `${frame.meta.path}/${field.name}
*
* When defined, this value can be used as an identifier within the datasource scope, and
* may be used to update the results
*/
path
?:
string
;
/**
* True if data source field supports ad-hoc filters
* True if data source field supports ad-hoc filters
*/
*/
filterable
?:
boolean
;
filterable
?:
boolean
;
...
...
packages/grafana-ui/src/components/uPlot/config.ts
View file @
770e8e4a
...
@@ -28,6 +28,9 @@ export enum LineInterpolation {
...
@@ -28,6 +28,9 @@ export enum LineInterpolation {
StepAfter
=
'stepAfter'
,
StepAfter
=
'stepAfter'
,
}
}
/**
* @alpha
*/
export
interface
LineConfig
{
export
interface
LineConfig
{
lineColor
?:
string
;
lineColor
?:
string
;
lineWidth
?:
number
;
lineWidth
?:
number
;
...
@@ -35,11 +38,17 @@ export interface LineConfig {
...
@@ -35,11 +38,17 @@ export interface LineConfig {
spanNulls
?:
boolean
;
spanNulls
?:
boolean
;
}
}
/**
* @alpha
*/
export
interface
AreaConfig
{
export
interface
AreaConfig
{
fillColor
?:
string
;
fillColor
?:
string
;
fillOpacity
?:
number
;
fillOpacity
?:
number
;
}
}
/**
* @alpha
*/
export
interface
PointsConfig
{
export
interface
PointsConfig
{
showPoints
?:
PointVisibility
;
showPoints
?:
PointVisibility
;
pointSize
?:
number
;
pointSize
?:
number
;
...
@@ -54,6 +63,9 @@ export interface AxisConfig {
...
@@ -54,6 +63,9 @@ export interface AxisConfig {
axisWidth
?:
number
;
// pixels ideally auto?
axisWidth
?:
number
;
// pixels ideally auto?
}
}
/**
* @alpha
*/
export
interface
GraphFieldConfig
extends
LineConfig
,
AreaConfig
,
PointsConfig
,
AxisConfig
{
export
interface
GraphFieldConfig
extends
LineConfig
,
AreaConfig
,
PointsConfig
,
AxisConfig
{
drawStyle
?:
DrawStyle
;
drawStyle
?:
DrawStyle
;
}
}
...
...
packages/grafana-ui/src/components/uPlot/plugins/AnnotationsEditorPlugin.tsx
View file @
770e8e4a
...
@@ -8,6 +8,9 @@ interface AnnotationsEditorPluginProps {
...
@@ -8,6 +8,9 @@ interface AnnotationsEditorPluginProps {
onAnnotationCreate
:
()
=>
void
;
onAnnotationCreate
:
()
=>
void
;
}
}
/**
* @alpha
*/
export
const
AnnotationsEditorPlugin
:
React
.
FC
<
AnnotationsEditorPluginProps
>
=
({
onAnnotationCreate
})
=>
{
export
const
AnnotationsEditorPlugin
:
React
.
FC
<
AnnotationsEditorPluginProps
>
=
({
onAnnotationCreate
})
=>
{
const
pluginId
=
'AnnotationsEditorPlugin'
;
const
pluginId
=
'AnnotationsEditorPlugin'
;
...
...
packages/grafana-ui/src/components/uPlot/plugins/ClickPlugin.tsx
View file @
770e8e4a
...
@@ -18,6 +18,9 @@ interface ClickPluginAPI {
...
@@ -18,6 +18,9 @@ interface ClickPluginAPI {
clearSelection
:
()
=>
void
;
clearSelection
:
()
=>
void
;
}
}
/**
* @alpha
*/
interface
ClickPluginProps
extends
PlotPluginProps
{
interface
ClickPluginProps
extends
PlotPluginProps
{
onClick
:
(
e
:
{
seriesIdx
:
number
|
null
;
dataIdx
:
number
|
null
})
=>
void
;
onClick
:
(
e
:
{
seriesIdx
:
number
|
null
;
dataIdx
:
number
|
null
})
=>
void
;
children
:
(
api
:
ClickPluginAPI
)
=>
React
.
ReactElement
|
null
;
children
:
(
api
:
ClickPluginAPI
)
=>
React
.
ReactElement
|
null
;
...
...
packages/grafana-ui/src/components/uPlot/plugins/ContextMenuPlugin.tsx
View file @
770e8e4a
...
@@ -9,6 +9,9 @@ interface ContextMenuPluginProps {
...
@@ -9,6 +9,9 @@ interface ContextMenuPluginProps {
onClose
?:
()
=>
void
;
onClose
?:
()
=>
void
;
}
}
/**
* @alpha
*/
export
const
ContextMenuPlugin
:
React
.
FC
<
ContextMenuPluginProps
>
=
({
onClose
})
=>
{
export
const
ContextMenuPlugin
:
React
.
FC
<
ContextMenuPluginProps
>
=
({
onClose
})
=>
{
const
[
isOpen
,
setIsOpen
]
=
useState
(
false
);
const
[
isOpen
,
setIsOpen
]
=
useState
(
false
);
...
...
packages/grafana-ui/src/components/uPlot/plugins/CursorPlugin.tsx
View file @
770e8e4a
...
@@ -30,7 +30,11 @@ interface Coords {
...
@@ -30,7 +30,11 @@ interface Coords {
y
:
number
;
y
:
number
;
}
}
// Exposes API for Graph cursor position
/**
* Exposes API for Graph cursor position
*
* @alpha
*/
export
const
CursorPlugin
:
React
.
FC
<
CursorPluginProps
>
=
({
id
,
children
,
capture
=
'mousemove'
,
lock
=
false
})
=>
{
export
const
CursorPlugin
:
React
.
FC
<
CursorPluginProps
>
=
({
id
,
children
,
capture
=
'mousemove'
,
lock
=
false
})
=>
{
const
pluginId
=
`CursorPlugin:
${
id
}
`
;
const
pluginId
=
`CursorPlugin:
${
id
}
`
;
const
plotCanvas
=
useRef
<
HTMLDivElement
>
(
null
);
const
plotCanvas
=
useRef
<
HTMLDivElement
>
(
null
);
...
...
packages/grafana-ui/src/components/uPlot/plugins/SelectionPlugin.tsx
View file @
770e8e4a
...
@@ -30,6 +30,9 @@ interface SelectionPluginProps extends PlotPluginProps {
...
@@ -30,6 +30,9 @@ interface SelectionPluginProps extends PlotPluginProps {
children
?:
(
api
:
SelectionPluginAPI
)
=>
JSX
.
Element
;
children
?:
(
api
:
SelectionPluginAPI
)
=>
JSX
.
Element
;
}
}
/**
* @alpha
*/
export
const
SelectionPlugin
:
React
.
FC
<
SelectionPluginProps
>
=
({
onSelect
,
onDismiss
,
lazy
,
id
,
children
})
=>
{
export
const
SelectionPlugin
:
React
.
FC
<
SelectionPluginProps
>
=
({
onSelect
,
onDismiss
,
lazy
,
id
,
children
})
=>
{
const
pluginId
=
`SelectionPlugin:
${
id
}
`
;
const
pluginId
=
`SelectionPlugin:
${
id
}
`
;
const
plotCtx
=
usePlotContext
();
const
plotCtx
=
usePlotContext
();
...
...
packages/grafana-ui/src/components/uPlot/plugins/TooltipPlugin.tsx
View file @
770e8e4a
...
@@ -12,6 +12,9 @@ interface TooltipPluginProps {
...
@@ -12,6 +12,9 @@ interface TooltipPluginProps {
timeZone
:
TimeZone
;
timeZone
:
TimeZone
;
}
}
/**
* @alpha
*/
export
const
TooltipPlugin
:
React
.
FC
<
TooltipPluginProps
>
=
({
mode
=
'single'
,
timeZone
})
=>
{
export
const
TooltipPlugin
:
React
.
FC
<
TooltipPluginProps
>
=
({
mode
=
'single'
,
timeZone
})
=>
{
const
pluginId
=
'PlotTooltip'
;
const
pluginId
=
'PlotTooltip'
;
const
plotContext
=
usePlotContext
();
const
plotContext
=
usePlotContext
();
...
...
packages/grafana-ui/src/components/uPlot/plugins/ZoomPlugin.tsx
View file @
770e8e4a
...
@@ -8,6 +8,9 @@ interface ZoomPluginProps {
...
@@ -8,6 +8,9 @@ interface ZoomPluginProps {
// min px width that triggers zoom
// min px width that triggers zoom
const
MIN_ZOOM_DIST
=
5
;
const
MIN_ZOOM_DIST
=
5
;
/**
* @alpha
*/
export
const
ZoomPlugin
:
React
.
FC
<
ZoomPluginProps
>
=
({
onZoom
})
=>
{
export
const
ZoomPlugin
:
React
.
FC
<
ZoomPluginProps
>
=
({
onZoom
})
=>
{
return
(
return
(
<
SelectionPlugin
<
SelectionPlugin
...
...
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