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
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
index.js
app/assets/javascripts/common_d3/index.js
+1
-0
stat_graph_contributors.js
app/assets/javascripts/graphs/stat_graph_contributors.js
+14
-7
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
{
select
,
selectAll
,
event
,
}
from
'd3-selection'
;
export
{
...
...
app/assets/javascripts/graphs/stat_graph_contributors.js
View file @
2d4d1290
...
...
@@ -84,9 +84,12 @@ export default (function() {
return
_
.
each
(
author_commits
,
(
function
(
_this
)
{
return
function
(
d
)
{
_this
.
redraw_author_commit_info
(
d
);
$
(
_this
.
authors
[
d
.
author_name
].
list_item
).
appendTo
(
"ol"
);
_this
.
authors
[
d
.
author_name
].
set_data
(
d
.
dates
);
return
_this
.
authors
[
d
.
author_name
].
redraw
();
if
(
_this
.
authors
[
d
.
author_name
]
!=
null
)
{
$
(
_this
.
authors
[
d
.
author_name
].
list_item
).
appendTo
(
"ol"
);
_this
.
authors
[
d
.
author_name
].
set_data
(
d
.
dates
);
return
_this
.
authors
[
d
.
author_name
].
redraw
();
}
return
''
;
};
})(
this
));
};
...
...
@@ -108,10 +111,14 @@ export default (function() {
};
ContributorsStatGraph
.
prototype
.
redraw_author_commit_info
=
function
(
author
)
{
var
author_commit_info
,
author_list_item
;
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
);
var
author_commit_info
,
author_list_item
,
$author
;
$author
=
this
.
authors
[
author
.
author_name
];
if
(
$author
!=
null
)
{
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
;
...
...
app/assets/javascripts/graphs/stat_graph_contributors_graph.js
View file @
2d4d1290
...
...
@@ -12,6 +12,7 @@ import {
area
as
d3Area
,
brushX
as
d3BrushX
,
timeParse
as
d3TimeParse
,
event
as
d3Event
,
}
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
;
};
...
...
@@ -166,7 +167,7 @@ export const ContributorsMasterGraph = (function(superClass) {
};
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
)
{
...
...
@@ -178,7 +179,12 @@ export const ContributorsMasterGraph = (function(superClass) {
};
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'
);
};
...
...
@@ -260,7 +266,8 @@ export const ContributorsAuthorGraph = (function(superClass) {
};
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
+
")"
);
};
...
...
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