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
45a08792
Commit
45a08792
authored
Jan 16, 2019
by
Hugo Häggmark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed small bug with entries outside the min max values
parent
f16a2c0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx
+4
-4
No files found.
packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx
View file @
45a08792
...
...
@@ -42,10 +42,10 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
});
// Setting value to a value between the previous thresholds
const
beforeThreshold
=
newThresholds
.
filter
(
t
hreshold
=>
threshold
.
index
===
index
-
1
)[
0
];
const
afterThreshold
=
newThresholds
.
filter
(
t
hreshold
=>
threshold
.
index
===
index
+
1
)[
0
];
const
beforeThresholdValue
=
beforeThreshold
!==
undefined
?
Math
.
max
(
beforeThreshold
.
value
,
minValue
)
:
minValue
;
const
afterThresholdValue
=
afterThreshold
!==
undefined
?
Math
.
min
(
afterThreshold
.
value
,
maxValue
)
:
maxValue
;
const
beforeThreshold
=
newThresholds
.
filter
(
t
=>
t
.
index
===
index
-
1
&&
t
.
index
!==
0
)[
0
];
const
afterThreshold
=
newThresholds
.
filter
(
t
=>
t
.
index
===
index
+
1
&&
t
.
index
!==
0
)[
0
];
const
beforeThresholdValue
=
beforeThreshold
!==
undefined
?
beforeThreshold
.
value
:
minValue
;
const
afterThresholdValue
=
afterThreshold
!==
undefined
?
afterThreshold
.
value
:
maxValue
;
const
value
=
afterThresholdValue
-
(
afterThresholdValue
-
beforeThresholdValue
)
/
2
;
// Set a color
...
...
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