Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
2b132128
Commit
2b132128
authored
Apr 28, 2018
by
Paul Vorbach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ES6 `const` more consistently
parent
6a20cf91
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js
...ges/projects/graphs/show/stat_graph_contributors_graph.js
+6
-9
No files found.
app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js
View file @
2b132128
/* eslint-disable func-names, space-before-function-paren,
no-var,
prefer-rest-params, max-len, no-restricted-syntax, vars-on-top, no-use-before-define, no-param-reassign, new-cap, no-underscore-dangle, wrap-iife, comma-dangle, no-return-assign, prefer-arrow-callback, quotes, prefer-template, newline-per-chained-call, no-else-return, no-shadow */
/* eslint-disable func-names, space-before-function-paren, prefer-rest-params, max-len, no-restricted-syntax, vars-on-top, no-use-before-define, no-param-reassign, new-cap, no-underscore-dangle, wrap-iife, comma-dangle, no-return-assign, prefer-arrow-callback, quotes, prefer-template, newline-per-chained-call, no-else-return, no-shadow */
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
...
@@ -13,7 +13,7 @@ import { dateTickFormat } from '~/lib/utils/tick_formats';
...
@@ -13,7 +13,7 @@ import { dateTickFormat } from '~/lib/utils/tick_formats';
const
d3
=
{
extent
,
max
,
select
,
scaleTime
,
scaleLinear
,
axisLeft
,
axisBottom
,
area
,
brushX
,
timeParse
};
const
d3
=
{
extent
,
max
,
select
,
scaleTime
,
scaleLinear
,
axisLeft
,
axisBottom
,
area
,
brushX
,
timeParse
};
const
extend
=
function
(
child
,
parent
)
{
for
(
var
key
in
parent
)
{
if
(
hasProp
.
call
(
parent
,
key
))
child
[
key
]
=
parent
[
key
];
}
function
ctor
()
{
this
.
constructor
=
child
;
}
ctor
.
prototype
=
parent
.
prototype
;
child
.
prototype
=
new
ctor
();
child
.
__super__
=
parent
.
prototype
;
return
child
;
};
const
extend
=
function
(
child
,
parent
)
{
for
(
const
key
in
parent
)
{
if
(
hasProp
.
call
(
parent
,
key
))
child
[
key
]
=
parent
[
key
];
}
function
ctor
()
{
this
.
constructor
=
child
;
}
ctor
.
prototype
=
parent
.
prototype
;
child
.
prototype
=
new
ctor
();
child
.
__super__
=
parent
.
prototype
;
return
child
;
};
const
hasProp
=
{}.
hasOwnProperty
;
const
hasProp
=
{}.
hasOwnProperty
;
export
const
ContributorsGraph
=
(
function
()
{
export
const
ContributorsGraph
=
(
function
()
{
...
@@ -122,8 +122,7 @@ export const ContributorsMasterGraph = (function(superClass) {
...
@@ -122,8 +122,7 @@ export const ContributorsMasterGraph = (function(superClass) {
}
}
ContributorsMasterGraph
.
prototype
.
process_dates
=
function
(
data
)
{
ContributorsMasterGraph
.
prototype
.
process_dates
=
function
(
data
)
{
var
dates
;
const
dates
=
this
.
get_dates
(
data
);
dates
=
this
.
get_dates
(
data
);
this
.
parse_dates
(
data
);
this
.
parse_dates
(
data
);
return
ContributorsGraph
.
set_dates
(
dates
);
return
ContributorsGraph
.
set_dates
(
dates
);
};
};
...
@@ -133,8 +132,7 @@ export const ContributorsMasterGraph = (function(superClass) {
...
@@ -133,8 +132,7 @@ export const ContributorsMasterGraph = (function(superClass) {
};
};
ContributorsMasterGraph
.
prototype
.
parse_dates
=
function
(
data
)
{
ContributorsMasterGraph
.
prototype
.
parse_dates
=
function
(
data
)
{
var
parseDate
;
const
parseDate
=
d3
.
timeParse
(
"
%Y-%m-%d
"
);
parseDate
=
d3
.
timeParse
(
"
%Y-%m-%d
"
);
return
data
.
forEach
(
function
(
d
)
{
return
data
.
forEach
(
function
(
d
)
{
return
d
.
date
=
parseDate
(
d
.
date
);
return
d
.
date
=
parseDate
(
d
.
date
);
});
});
...
@@ -252,8 +250,7 @@ export const ContributorsAuthorGraph = (function(superClass) {
...
@@ -252,8 +250,7 @@ export const ContributorsAuthorGraph = (function(superClass) {
ContributorsAuthorGraph
.
prototype
.
create_area
=
function
(
x
,
y
)
{
ContributorsAuthorGraph
.
prototype
.
create_area
=
function
(
x
,
y
)
{
return
this
.
area
=
d3
.
area
().
x
(
function
(
d
)
{
return
this
.
area
=
d3
.
area
().
x
(
function
(
d
)
{
var
parseDate
;
const
parseDate
=
d3
.
timeParse
(
"
%Y-%m-%d
"
);
parseDate
=
d3
.
timeParse
(
"
%Y-%m-%d
"
);
return
x
(
parseDate
(
d
));
return
x
(
parseDate
(
d
));
}).
y0
(
this
.
height
).
y1
((
function
(
_this
)
{
}).
y0
(
this
.
height
).
y1
((
function
(
_this
)
{
return
function
(
d
)
{
return
function
(
d
)
{
...
@@ -267,7 +264,7 @@ export const ContributorsAuthorGraph = (function(superClass) {
...
@@ -267,7 +264,7 @@ export const ContributorsAuthorGraph = (function(superClass) {
};
};
ContributorsAuthorGraph
.
prototype
.
create_svg
=
function
()
{
ContributorsAuthorGraph
.
prototype
.
create_svg
=
function
()
{
var
persons
=
document
.
querySelectorAll
(
'
.person
'
);
const
persons
=
document
.
querySelectorAll
(
'
.person
'
);
this
.
list_item
=
persons
[
persons
.
length
-
1
];
this
.
list_item
=
persons
[
persons
.
length
-
1
];
return
this
.
svg
=
d3
.
select
(
this
.
list_item
).
append
(
"
svg
"
).
attr
(
"
width
"
,
this
.
width
+
this
.
MARGIN
.
left
+
this
.
MARGIN
.
right
).
attr
(
"
height
"
,
this
.
height
+
this
.
MARGIN
.
top
+
this
.
MARGIN
.
bottom
).
attr
(
"
class
"
,
"
spark
"
).
append
(
"
g
"
).
attr
(
"
transform
"
,
"
translate(
"
+
this
.
MARGIN
.
left
+
"
,
"
+
this
.
MARGIN
.
top
+
"
)
"
);
return
this
.
svg
=
d3
.
select
(
this
.
list_item
).
append
(
"
svg
"
).
attr
(
"
width
"
,
this
.
width
+
this
.
MARGIN
.
left
+
this
.
MARGIN
.
right
).
attr
(
"
height
"
,
this
.
height
+
this
.
MARGIN
.
top
+
this
.
MARGIN
.
bottom
).
attr
(
"
class
"
,
"
spark
"
).
append
(
"
g
"
).
attr
(
"
transform
"
,
"
translate(
"
+
this
.
MARGIN
.
left
+
"
,
"
+
this
.
MARGIN
.
top
+
"
)
"
);
};
};
...
...
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