BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
851ada82
Commit
851ada82
authored
Sep 07, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addressed code quality observations
parent
a2d10937
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
25 deletions
+12
-25
multiple_time_series.js
...sets/javascripts/monitoring/utils/multiple_time_series.js
+12
-25
No files found.
app/assets/javascripts/monitoring/utils/multiple_time_series.js
View file @
851ada82
...
...
@@ -41,12 +41,10 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
const
maxValueFromSeries
=
_
.
max
(
maxValues
,
val
=>
val
.
maxValue
);
let
timeSeriesNumber
=
1
;
return
queryData
.
result
.
map
((
timeSeries
)
=>
{
return
queryData
.
result
.
map
((
timeSeries
,
timeSeriesNumber
)
=>
{
let
metricTag
=
''
;
let
lineColor
=
'
#1f78d1
'
;
let
areaColor
=
'
#8fbce8
'
;
let
lineColor
=
''
;
let
areaColor
=
''
;
const
timeSeriesScaleX
=
d3
.
time
.
scale
()
.
range
([
0
,
graphWidth
-
70
]);
...
...
@@ -69,27 +67,16 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
.
y0
(
graphHeight
-
graphHeightOffset
)
.
y1
(
d
=>
timeSeriesScaleY
(
d
.
value
));
if
(
queryData
.
series
!=
null
)
{
const
timeSeriesMetricLabel
=
timeSeries
.
metric
[
Object
.
keys
(
timeSeries
.
metric
)[
0
]];
const
seriesCustomizationData
=
_
.
findWhere
(
queryData
.
series
[
0
].
series
,
{
value
:
timeSeriesMetricLabel
});
if
(
seriesCustomizationData
!=
null
)
{
metricTag
=
seriesCustomizationData
.
value
||
timeSeriesMetricLabel
;
if
(
seriesCustomizationData
.
color
!=
null
)
{
[
lineColor
,
areaColor
]
=
pickColor
(
seriesCustomizationData
.
color
);
}
else
{
[
lineColor
,
areaColor
]
=
pickColor
();
}
}
else
{
metricTag
=
timeSeriesMetricLabel
||
`series
${
timeSeriesNumber
}
`
;
[
lineColor
,
areaColor
]
=
pickColor
();
}
}
if
(
timeSeriesNumber
<=
5
)
{
timeSeriesNumber
=
timeSeriesNumber
+=
1
;
const
timeSeriesMetricLabel
=
timeSeries
.
metric
[
Object
.
keys
(
timeSeries
.
metric
)[
0
]];
const
seriesCustomizationData
=
queryData
.
series
!=
null
&&
_
.
findWhere
(
queryData
.
series
[
0
].
series
,
{
value
:
timeSeriesMetricLabel
});
if
(
seriesCustomizationData
!=
null
)
{
metricTag
=
seriesCustomizationData
.
value
||
timeSeriesMetricLabel
;
[
lineColor
,
areaColor
]
=
pickColor
(
seriesCustomizationData
.
color
);
}
else
{
timeSeriesNumber
=
1
;
metricTag
=
timeSeriesMetricLabel
||
`series
${
timeSeriesNumber
+
1
}
`
;
[
lineColor
,
areaColor
]
=
pickColor
();
}
return
{
...
...
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