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
2d4d1290
Commit
2d4d1290
authored
Nov 27, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrected functionality from the stat_contributors_graph
parent
be60cca9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
app/assets/javascripts/common_d3/index.js
app/assets/javascripts/common_d3/index.js
+1
-0
app/assets/javascripts/graphs/stat_graph_contributors.js
app/assets/javascripts/graphs/stat_graph_contributors.js
+14
-7
app/assets/javascripts/graphs/stat_graph_contributors_graph.js
...ssets/javascripts/graphs/stat_graph_contributors_graph.js
+10
-3
No files found.
app/assets/javascripts/common_d3/index.js
View file @
2d4d1290
export
{
export
{
select
,
select
,
selectAll
,
selectAll
,
event
,
}
from
'
d3-selection
'
;
}
from
'
d3-selection
'
;
export
{
export
{
...
...
app/assets/javascripts/graphs/stat_graph_contributors.js
View file @
2d4d1290
...
@@ -84,9 +84,12 @@ export default (function() {
...
@@ -84,9 +84,12 @@ export default (function() {
return
_
.
each
(
author_commits
,
(
function
(
_this
)
{
return
_
.
each
(
author_commits
,
(
function
(
_this
)
{
return
function
(
d
)
{
return
function
(
d
)
{
_this
.
redraw_author_commit_info
(
d
);
_this
.
redraw_author_commit_info
(
d
);
$
(
_this
.
authors
[
d
.
author_name
].
list_item
).
appendTo
(
"
ol
"
);
if
(
_this
.
authors
[
d
.
author_name
]
!=
null
)
{
_this
.
authors
[
d
.
author_name
].
set_data
(
d
.
dates
);
$
(
_this
.
authors
[
d
.
author_name
].
list_item
).
appendTo
(
"
ol
"
);
return
_this
.
authors
[
d
.
author_name
].
redraw
();
_this
.
authors
[
d
.
author_name
].
set_data
(
d
.
dates
);
return
_this
.
authors
[
d
.
author_name
].
redraw
();
}
return
''
;
};
};
})(
this
));
})(
this
));
};
};
...
@@ -108,10 +111,14 @@ export default (function() {
...
@@ -108,10 +111,14 @@ export default (function() {
};
};
ContributorsStatGraph
.
prototype
.
redraw_author_commit_info
=
function
(
author
)
{
ContributorsStatGraph
.
prototype
.
redraw_author_commit_info
=
function
(
author
)
{
var
author_commit_info
,
author_list_item
;
var
author_commit_info
,
author_list_item
,
$author
;
author_list_item
=
$
(
this
.
authors
[
author
.
author_name
].
list_item
);
$author
=
this
.
authors
[
author
.
author_name
];
author_commit_info
=
this
.
format_author_commit_info
(
author
);
if
(
$author
!=
null
)
{
return
author_list_item
.
find
(
"
span
"
).
html
(
author_commit_info
);
author_list_item
=
$
(
this
.
authors
[
author
.
author_name
].
list_item
);
author_commit_info
=
this
.
format_author_commit_info
(
author
);
return
author_list_item
.
find
(
"
span
"
).
html
(
author_commit_info
);
}
return
''
;
};
};
return
ContributorsStatGraph
;
return
ContributorsStatGraph
;
...
...
app/assets/javascripts/graphs/stat_graph_contributors_graph.js
View file @
2d4d1290
...
@@ -12,6 +12,7 @@ import {
...
@@ -12,6 +12,7 @@ import {
area
as
d3Area
,
area
as
d3Area
,
brushX
as
d3BrushX
,
brushX
as
d3BrushX
,
timeParse
as
d3TimeParse
,
timeParse
as
d3TimeParse
,
event
as
d3Event
,
}
from
'
../common_d3/index
'
;
}
from
'
../common_d3/index
'
;
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
(
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
;
};
...
@@ -166,7 +167,7 @@ export const ContributorsMasterGraph = (function(superClass) {
...
@@ -166,7 +167,7 @@ export const ContributorsMasterGraph = (function(superClass) {
};
};
ContributorsMasterGraph
.
prototype
.
create_brush
=
function
()
{
ContributorsMasterGraph
.
prototype
.
create_brush
=
function
()
{
return
this
.
brush
=
d3BrushX
(
this
.
x
).
on
(
"
end
"
,
this
.
update_content
);
return
this
.
brush
=
d3BrushX
(
this
.
x
).
extent
([[
this
.
x
.
range
()[
0
],
0
],
[
this
.
x
.
range
()[
1
],
this
.
height
]]).
on
(
"
end
"
,
this
.
update_content
);
};
};
ContributorsMasterGraph
.
prototype
.
draw_path
=
function
(
data
)
{
ContributorsMasterGraph
.
prototype
.
draw_path
=
function
(
data
)
{
...
@@ -178,7 +179,12 @@ export const ContributorsMasterGraph = (function(superClass) {
...
@@ -178,7 +179,12 @@ export const ContributorsMasterGraph = (function(superClass) {
};
};
ContributorsMasterGraph
.
prototype
.
update_content
=
function
()
{
ContributorsMasterGraph
.
prototype
.
update_content
=
function
()
{
ContributorsGraph
.
set_x_domain
(
this
.
brush
.
empty
()
?
this
.
x_max_domain
:
this
.
brush
.
extent
());
// d3Event.selection replaces the function brush.empty() calls
if
(
d3Event
.
selection
!=
null
)
{
ContributorsGraph
.
set_x_domain
(
d3Event
.
selection
.
map
(
this
.
x
.
invert
));
}
else
{
ContributorsGraph
.
set_x_domain
(
this
.
x_max_domain
);
}
return
$
(
"
#brush_change
"
).
trigger
(
'
change
'
);
return
$
(
"
#brush_change
"
).
trigger
(
'
change
'
);
};
};
...
@@ -260,7 +266,8 @@ export const ContributorsAuthorGraph = (function(superClass) {
...
@@ -260,7 +266,8 @@ export const ContributorsAuthorGraph = (function(superClass) {
};
};
ContributorsAuthorGraph
.
prototype
.
create_svg
=
function
()
{
ContributorsAuthorGraph
.
prototype
.
create_svg
=
function
()
{
this
.
list_item
=
document
.
querySelectorAll
(
'
.person
'
)[
0
];
var
persons
=
document
.
querySelectorAll
(
'
.person
'
);
this
.
list_item
=
persons
[
persons
.
length
-
1
];
return
this
.
svg
=
d3Select
(
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
=
d3Select
(
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