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
3ae6ba03
Unverified
Commit
3ae6ba03
authored
Sep 25, 2020
by
Ryan McKinley
Committed by
GitHub
Sep 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graph NG: make series color easy to clear (#27778)
parent
8a22111a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
packages/grafana-ui/src/components/OptionsUI/color.tsx
+2
-2
packages/grafana-ui/src/index.ts
+1
-1
public/app/plugins/panel/graph3/module.tsx
+16
-3
No files found.
packages/grafana-ui/src/components/OptionsUI/color.tsx
View file @
3ae6ba03
...
@@ -22,7 +22,7 @@ export const ColorValueEditor: React.FC<FieldConfigEditorProps<FieldColor, Color
...
@@ -22,7 +22,7 @@ export const ColorValueEditor: React.FC<FieldConfigEditorProps<FieldColor, Color
const
theme
=
getTheme
();
const
theme
=
getTheme
();
const
styles
=
getStyles
(
theme
);
const
styles
=
getStyles
(
theme
);
const
color
=
value
.
fixedColor
||
item
.
defaultValue
?.
fixedColor
;
const
color
=
value
?
.
fixedColor
||
item
.
defaultValue
?.
fixedColor
;
const
onValueChange
=
useCallback
(
const
onValueChange
=
useCallback
(
color
=>
{
color
=>
{
...
@@ -41,7 +41,7 @@ export const ColorValueEditor: React.FC<FieldConfigEditorProps<FieldColor, Color
...
@@ -41,7 +41,7 @@ export const ColorValueEditor: React.FC<FieldConfigEditorProps<FieldColor, Color
ref=
{
ref
}
ref=
{
ref
}
onClick=
{
showColorPicker
}
onClick=
{
showColorPicker
}
onMouseLeave=
{
hideColorPicker
}
onMouseLeave=
{
hideColorPicker
}
color=
{
color
?
getColorFromHexRgbOrName
(
color
,
theme
.
type
)
:
''
}
color=
{
color
?
getColorFromHexRgbOrName
(
color
,
theme
.
type
)
:
theme
.
colors
.
formInputBorder
}
/>
/>
</
div
>
</
div
>
<
div
className=
{
styles
.
colorText
}
onClick=
{
showColorPicker
}
>
<
div
className=
{
styles
.
colorText
}
onClick=
{
showColorPicker
}
>
...
...
packages/grafana-ui/src/index.ts
View file @
3ae6ba03
...
@@ -10,4 +10,4 @@ export * from './themes';
...
@@ -10,4 +10,4 @@ export * from './themes';
export
*
from
'./slate-plugins'
;
export
*
from
'./slate-plugins'
;
// Exposes standard editors for registries of optionsUi config and panel options UI
// Exposes standard editors for registries of optionsUi config and panel options UI
export
{
getStandardFieldConfigs
,
getStandardOptionEditors
}
from
'./utils/
/
standardEditors'
;
export
{
getStandardFieldConfigs
,
getStandardOptionEditors
}
from
'./utils/standardEditors'
;
public/app/plugins/panel/graph3/module.tsx
View file @
3ae6ba03
import
{
import
{
FieldColor
,
FieldColor
,
FieldCo
lorMode
,
FieldCo
nfigProperty
,
identityOverrideProcessor
,
identityOverrideProcessor
,
PanelPlugin
,
PanelPlugin
,
standardEditorsRegistry
,
standardEditorsRegistry
,
...
@@ -11,6 +11,16 @@ import { Options } from './types';
...
@@ -11,6 +11,16 @@ import { Options } from './types';
export
const
plugin
=
new
PanelPlugin
<
Options
,
GraphCustomFieldConfig
>
(
GraphPanel
)
export
const
plugin
=
new
PanelPlugin
<
Options
,
GraphCustomFieldConfig
>
(
GraphPanel
)
.
useFieldConfig
({
.
useFieldConfig
({
standardOptions
:
[
// FieldConfigProperty.Min,
// FieldConfigProperty.Max,
FieldConfigProperty
.
Unit
,
FieldConfigProperty
.
DisplayName
,
FieldConfigProperty
.
Decimals
,
// NOT: FieldConfigProperty.Thresholds,
FieldConfigProperty
.
Mappings
,
],
useCustomConfig
:
builder
=>
{
useCustomConfig
:
builder
=>
{
builder
builder
// TODO: Until we fix standard color property let's do it the custom editor way
// TODO: Until we fix standard color property let's do it the custom editor way
...
@@ -19,8 +29,11 @@ export const plugin = new PanelPlugin<Options, GraphCustomFieldConfig>(GraphPane
...
@@ -19,8 +29,11 @@ export const plugin = new PanelPlugin<Options, GraphCustomFieldConfig>(GraphPane
id
:
'line.color'
,
id
:
'line.color'
,
name
:
'Series color'
,
name
:
'Series color'
,
shouldApply
:
()
=>
true
,
shouldApply
:
()
=>
true
,
settings
:
{},
settings
:
{
defaultValue
:
{
mode
:
FieldColorMode
.
Fixed
},
allowUndefined
:
true
,
textWhenUndefined
:
'Automatic'
,
},
defaultValue
:
undefined
,
editor
:
standardEditorsRegistry
.
get
(
'color'
).
editor
as
any
,
editor
:
standardEditorsRegistry
.
get
(
'color'
).
editor
as
any
,
override
:
standardEditorsRegistry
.
get
(
'color'
).
editor
as
any
,
override
:
standardEditorsRegistry
.
get
(
'color'
).
editor
as
any
,
process
:
identityOverrideProcessor
,
process
:
identityOverrideProcessor
,
...
...
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