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
f5a0b004
Unverified
Commit
f5a0b004
authored
Oct 24, 2018
by
Alexander Zobnin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graph legend: minor refactor
parent
8a292139
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
public/app/plugins/panel/graph/Legend/Legend.tsx
+6
-6
public/app/plugins/panel/graph/Legend/LegendSeriesItem.tsx
+4
-4
No files found.
public/app/plugins/panel/graph/Legend/Legend.tsx
View file @
f5a0b004
import
_
from
'lodash'
;
import
React
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
TimeSeries
}
from
'app/core/core'
;
import
CustomScrollbar
from
'app/core/components/CustomScrollbar/CustomScrollbar'
;
import
{
LegendItem
,
LEGEND_STATS
}
from
'./LegendSeriesItem'
;
...
...
@@ -61,7 +61,7 @@ interface LegendState {
hiddenSeries
:
{
[
seriesAlias
:
string
]:
boolean
};
}
export
class
GraphLegend
extends
React
.
PureComponent
<
GraphLegendProps
,
LegendState
>
{
export
class
GraphLegend
extends
PureComponent
<
GraphLegendProps
,
LegendState
>
{
static
defaultProps
:
Partial
<
GraphLegendProps
>
=
{
values
:
false
,
min
:
false
,
...
...
@@ -205,7 +205,7 @@ export class GraphLegend extends React.PureComponent<GraphLegendProps, LegendSta
}
}
class
LegendSeriesList
extends
React
.
PureComponent
<
LegendComponentProps
>
{
class
LegendSeriesList
extends
PureComponent
<
LegendComponentProps
>
{
render
()
{
const
{
seriesList
,
hiddenSeries
,
values
,
min
,
max
,
avg
,
current
,
total
}
=
this
.
props
;
const
seriesValuesProps
=
{
values
,
min
,
max
,
avg
,
current
,
total
};
...
...
@@ -225,7 +225,7 @@ class LegendSeriesList extends React.PureComponent<LegendComponentProps> {
}
}
class
LegendTable
extends
React
.
PureComponent
<
Partial
<
LegendComponentProps
>>
{
class
LegendTable
extends
PureComponent
<
Partial
<
LegendComponentProps
>>
{
onToggleSort
=
stat
=>
{
let
sortDesc
=
this
.
props
.
sortDesc
;
let
sortBy
=
this
.
props
.
sort
;
...
...
@@ -289,7 +289,7 @@ interface LegendTableHeaderProps {
onClick
?:
(
statName
:
string
)
=>
void
;
}
class
LegendTableHeaderItem
extends
React
.
PureComponent
<
LegendTableHeaderProps
&
LegendSortProps
>
{
class
LegendTableHeaderItem
extends
PureComponent
<
LegendTableHeaderProps
&
LegendSortProps
>
{
onClick
=
()
=>
this
.
props
.
onClick
(
this
.
props
.
statName
);
render
()
{
...
...
@@ -303,7 +303,7 @@ class LegendTableHeaderItem extends React.PureComponent<LegendTableHeaderProps &
}
}
export
class
Legend
extends
React
.
PureComponent
<
GraphLegendProps
>
{
export
class
Legend
extends
PureComponent
<
GraphLegendProps
>
{
render
()
{
return
(
<
CustomScrollbar
>
...
...
public/app/plugins/panel/graph/Legend/LegendSeriesItem.tsx
View file @
f5a0b004
import
React
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
classNames
from
'classnames'
;
import
{
TimeSeries
}
from
'app/core/core'
;
import
{
SeriesColorPicker
}
from
'app/core/components/colorpicker/SeriesColorPicker'
;
...
...
@@ -29,7 +29,7 @@ interface LegendItemState {
yaxis
:
number
;
}
export
class
LegendItem
extends
React
.
PureComponent
<
LegendItemProps
,
LegendItemState
>
{
export
class
LegendItem
extends
PureComponent
<
LegendItemProps
,
LegendItemState
>
{
static
defaultProps
=
{
asTable
:
false
,
hidden
:
false
,
...
...
@@ -119,7 +119,7 @@ interface LegendSeriesLabelProps {
onLabelClick
?:
(
event
)
=>
void
;
}
class
LegendSeriesLabel
extends
React
.
PureComponent
<
LegendSeriesLabelProps
&
LegendSeriesIconProps
>
{
class
LegendSeriesLabel
extends
PureComponent
<
LegendSeriesLabelProps
&
LegendSeriesIconProps
>
{
static
defaultProps
=
{
yaxis
:
undefined
,
onLabelClick
:
()
=>
{},
...
...
@@ -158,7 +158,7 @@ function SeriesIcon(props) {
return
<
i
className=
"fa fa-minus pointer"
style=
{
{
color
:
props
.
color
}
}
/>;
}
class
LegendSeriesIcon
extends
React
.
PureComponent
<
LegendSeriesIconProps
,
LegendSeriesIconState
>
{
class
LegendSeriesIcon
extends
PureComponent
<
LegendSeriesIconProps
,
LegendSeriesIconState
>
{
static
defaultProps
=
{
yaxis
:
undefined
,
onColorChange
:
()
=>
{},
...
...
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