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
31e9f82e
Commit
31e9f82e
authored
Aug 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve repository graph
parent
7825830c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
17 deletions
+29
-17
app/assets/javascripts/stat_graph_contributors.js.coffee
app/assets/javascripts/stat_graph_contributors.js.coffee
+8
-6
app/assets/javascripts/stat_graph_contributors_graph.js.coffee
...ssets/javascripts/stat_graph_contributors_graph.js.coffee
+2
-2
app/assets/javascripts/stat_graph_contributors_util.js.coffee
...assets/javascripts/stat_graph_contributors_util.js.coffee
+10
-8
app/assets/stylesheets/sections/graph.scss
app/assets/stylesheets/sections/graph.scss
+5
-0
app/views/projects/graphs/show.html.haml
app/views/projects/graphs/show.html.haml
+4
-1
No files found.
app/assets/javascripts/stat_graph_contributors.js.coffee
View file @
31e9f82e
...
@@ -16,7 +16,7 @@ class window.ContributorsStatGraph
...
@@ -16,7 +16,7 @@ class window.ContributorsStatGraph
_
.
each
(
limited_author_data
,
(
d
)
=>
_
.
each
(
limited_author_data
,
(
d
)
=>
author_header
=
@
create_author_header
(
d
)
author_header
=
@
create_author_header
(
d
)
$
(
".contributors-list"
).
append
(
author_header
)
$
(
".contributors-list"
).
append
(
author_header
)
@
authors
[
d
.
author
]
=
author_graph
=
new
ContributorsAuthorGraph
(
d
.
dates
)
@
authors
[
d
.
author
_name
]
=
author_graph
=
new
ContributorsAuthorGraph
(
d
.
dates
)
author_graph
.
draw
()
author_graph
.
draw
()
)
)
format_author_commit_info
:
(
author
)
->
format_author_commit_info
:
(
author
)
->
...
@@ -46,13 +46,15 @@ class window.ContributorsStatGraph
...
@@ -46,13 +46,15 @@ class window.ContributorsStatGraph
class
:
'person'
class
:
'person'
style
:
'display: block;'
style
:
'display: block;'
})
})
author_name
=
$
(
'<h4>'
+
author
.
author
+
'</h4>'
)
author_name
=
$
(
'<h4>'
+
author
.
author_name
+
'</h4>'
)
author_email
=
$
(
'<p class="graph-author-email">'
+
author
.
author_email
+
'</p>'
)
author_commit_info_span
=
$
(
'<span/>'
,
{
author_commit_info_span
=
$
(
'<span/>'
,
{
class
:
'commits'
class
:
'commits'
})
})
author_commit_info
=
@
format_author_commit_info
(
author
)
author_commit_info
=
@
format_author_commit_info
(
author
)
author_commit_info_span
.
html
(
author_commit_info
)
author_commit_info_span
.
html
(
author_commit_info
)
list_item
.
append
(
author_name
)
list_item
.
append
(
author_name
)
list_item
.
append
(
author_email
)
list_item
.
append
(
author_commit_info_span
)
list_item
.
append
(
author_commit_info_span
)
list_item
list_item
redraw_master
:
->
redraw_master
:
->
...
@@ -65,9 +67,9 @@ class window.ContributorsStatGraph
...
@@ -65,9 +67,9 @@ class window.ContributorsStatGraph
author_commits
=
ContributorsStatGraphUtil
.
get_author_data
(
@
parsed_log
,
@
field
,
x_domain
)
author_commits
=
ContributorsStatGraphUtil
.
get_author_data
(
@
parsed_log
,
@
field
,
x_domain
)
_
.
each
(
author_commits
,
(
d
)
=>
_
.
each
(
author_commits
,
(
d
)
=>
@
redraw_author_commit_info
(
d
)
@
redraw_author_commit_info
(
d
)
$
(
@
authors
[
d
.
author
].
list_item
).
appendTo
(
"ol"
)
$
(
@
authors
[
d
.
author
_name
].
list_item
).
appendTo
(
"ol"
)
@
authors
[
d
.
author
].
set_data
(
d
.
dates
)
@
authors
[
d
.
author
_name
].
set_data
(
d
.
dates
)
@
authors
[
d
.
author
].
redraw
()
@
authors
[
d
.
author
_name
].
redraw
()
)
)
set_current_field
:
(
field
)
->
set_current_field
:
(
field
)
->
@
field
=
field
@
field
=
field
...
@@ -77,6 +79,6 @@ class window.ContributorsStatGraph
...
@@ -77,6 +79,6 @@ class window.ContributorsStatGraph
print
=
print_date_format
(
x_domain
[
0
])
+
" - "
+
print_date_format
(
x_domain
[
1
])
print
=
print_date_format
(
x_domain
[
0
])
+
" - "
+
print_date_format
(
x_domain
[
1
])
$
(
"#date_header"
).
text
(
print
)
$
(
"#date_header"
).
text
(
print
)
redraw_author_commit_info
:
(
author
)
->
redraw_author_commit_info
:
(
author
)
->
author_list_item
=
$
(
@
authors
[
author
.
author
].
list_item
)
author_list_item
=
$
(
@
authors
[
author
.
author
_name
].
list_item
)
author_commit_info
=
@
format_author_commit_info
(
author
)
author_commit_info
=
@
format_author_commit_info
(
author
)
author_list_item
.
find
(
"span"
).
html
(
author_commit_info
)
author_list_item
.
find
(
"span"
).
html
(
author_commit_info
)
app/assets/javascripts/stat_graph_contributors_graph.js.coffee
View file @
31e9f82e
...
@@ -90,9 +90,9 @@ class window.ContributorsMasterGraph extends ContributorsGraph
...
@@ -90,9 +90,9 @@ class window.ContributorsMasterGraph extends ContributorsGraph
y
(
d
.
commits
=
d
.
commits
?
d
.
additions
?
d
.
deletions
)
y
(
d
.
commits
=
d
.
commits
?
d
.
additions
?
d
.
deletions
)
).
interpolate
(
"basis"
)
).
interpolate
(
"basis"
)
create_brush
:
->
create_brush
:
->
@
brush
=
d3
.
svg
.
brush
().
x
(
@
x
).
on
(
"brushend"
,
@
update_content
)
;
@
brush
=
d3
.
svg
.
brush
().
x
(
@
x
).
on
(
"brushend"
,
@
update_content
)
draw_path
:
(
data
)
->
draw_path
:
(
data
)
->
@
svg
.
append
(
"path"
).
datum
(
data
).
attr
(
"class"
,
"area"
).
attr
(
"d"
,
@
area
)
;
@
svg
.
append
(
"path"
).
datum
(
data
).
attr
(
"class"
,
"area"
).
attr
(
"d"
,
@
area
)
add_brush
:
->
add_brush
:
->
@
svg
.
append
(
"g"
).
attr
(
"class"
,
"selection"
).
call
(
@
brush
).
selectAll
(
"rect"
).
attr
(
"height"
,
@
height
);
@
svg
.
append
(
"g"
).
attr
(
"class"
,
"selection"
).
call
(
@
brush
).
selectAll
(
"rect"
).
attr
(
"height"
,
@
height
);
update_content
:
=>
update_content
:
=>
...
...
app/assets/javascripts/stat_graph_contributors_util.js.coffee
View file @
31e9f82e
...
@@ -4,9 +4,9 @@ window.ContributorsStatGraphUtil =
...
@@ -4,9 +4,9 @@ window.ContributorsStatGraphUtil =
by_author
=
{}
by_author
=
{}
for
entry
in
log
for
entry
in
log
@
add_date
(
entry
.
date
,
total
)
unless
total
[
entry
.
date
]
?
@
add_date
(
entry
.
date
,
total
)
unless
total
[
entry
.
date
]
?
@
add_author
(
entry
.
author
,
by_author
)
unless
by_author
[
entry
.
author
]
?
@
add_author
(
entry
,
by_author
)
unless
by_author
[
entry
.
author_name
]
?
@
add_date
(
entry
.
date
,
by_author
[
entry
.
author
])
unless
by_author
[
entry
.
author
][
entry
.
date
]
@
add_date
(
entry
.
date
,
by_author
[
entry
.
author
_name
])
unless
by_author
[
entry
.
author_name
][
entry
.
date
]
@
store_data
(
entry
,
total
[
entry
.
date
],
by_author
[
entry
.
author
][
entry
.
date
])
@
store_data
(
entry
,
total
[
entry
.
date
],
by_author
[
entry
.
author
_name
][
entry
.
date
])
total
=
_
.
toArray
(
total
)
total
=
_
.
toArray
(
total
)
by_author
=
_
.
toArray
(
by_author
)
by_author
=
_
.
toArray
(
by_author
)
total
:
total
,
by_author
:
by_author
total
:
total
,
by_author
:
by_author
...
@@ -16,8 +16,9 @@ window.ContributorsStatGraphUtil =
...
@@ -16,8 +16,9 @@ window.ContributorsStatGraphUtil =
collection
[
date
].
date
=
date
collection
[
date
].
date
=
date
add_author
:
(
author
,
by_author
)
->
add_author
:
(
author
,
by_author
)
->
by_author
[
author
]
=
{}
by_author
[
author
.
author_name
]
=
{}
by_author
[
author
].
author
=
author
by_author
[
author
.
author_name
].
author_name
=
author
.
author_name
by_author
[
author
.
author_name
].
author_email
=
author
.
author_email
store_data
:
(
entry
,
total
,
by_author
)
->
store_data
:
(
entry
,
total
,
by_author
)
->
@
store_commits
(
total
,
by_author
)
@
store_commits
(
total
,
by_author
)
...
@@ -71,10 +72,11 @@ window.ContributorsStatGraphUtil =
...
@@ -71,10 +72,11 @@ window.ContributorsStatGraphUtil =
parse_log_entry
:
(
log_entry
,
field
,
date_range
)
->
parse_log_entry
:
(
log_entry
,
field
,
date_range
)
->
parsed_entry
=
{}
parsed_entry
=
{}
parsed_entry
.
author
=
log_entry
.
author
parsed_entry
.
author_name
=
log_entry
.
author_name
parsed_entry
.
author_email
=
log_entry
.
author_email
parsed_entry
.
dates
=
{}
parsed_entry
.
dates
=
{}
parsed_entry
.
commits
=
parsed_entry
.
additions
=
parsed_entry
.
deletions
=
0
parsed_entry
.
commits
=
parsed_entry
.
additions
=
parsed_entry
.
deletions
=
0
_
.
each
(
_
.
omit
(
log_entry
,
'author'
),
(
value
,
key
)
=>
_
.
each
(
_
.
omit
(
log_entry
,
'author
_name'
,
'author_email
'
),
(
value
,
key
)
=>
if
@
in_range
(
value
.
date
,
date_range
)
if
@
in_range
(
value
.
date
,
date_range
)
parsed_entry
.
dates
[
value
.
date
]
=
value
[
field
]
parsed_entry
.
dates
[
value
.
date
]
=
value
[
field
]
parsed_entry
.
commits
+=
value
.
commits
parsed_entry
.
commits
+=
value
.
commits
...
@@ -88,4 +90,4 @@ window.ContributorsStatGraphUtil =
...
@@ -88,4 +90,4 @@ window.ContributorsStatGraphUtil =
true
true
else
else
false
false
\ No newline at end of file
app/assets/stylesheets/sections/graph.scss
View file @
31e9f82e
...
@@ -22,6 +22,11 @@
...
@@ -22,6 +22,11 @@
.graph-author-commits-count
{
.graph-author-commits-count
{
}
}
.graph-author-email
{
float
:
right
;
color
:
#777
;
}
.graph-additions
{
.graph-additions
{
color
:
#4a2
;
color
:
#4a2
;
}
}
...
...
app/views/projects/graphs/show.html.haml
View file @
31e9f82e
.loading-graph
.loading-graph
%center
%center
.loading
.loading
%h3
.page-title
Building repository graph. Please wait a moment.
%h3
.page-title
Building repository graph.
%p
Please wait a moment, this page will automatically refresh when ready.
.stat-graph
.stat-graph
.header.clearfix
.header.clearfix
...
@@ -11,6 +12,8 @@
...
@@ -11,6 +12,8 @@
%option
{
:value
=>
"additions"
}
Additions
%option
{
:value
=>
"additions"
}
Additions
%option
{
:value
=>
"deletions"
}
Deletions
%option
{
:value
=>
"deletions"
}
Deletions
%h3
#date_header
.page-title
%h3
#date_header
.page-title
%p
.light
Commits to
#{
@project
.
default_branch
}
, excluding merge commits. Limited by 8,000 commits
%input
#brush_change
{
:type
=>
"hidden"
}
%input
#brush_change
{
:type
=>
"hidden"
}
.graphs
.graphs
#contributors-master
#contributors-master
...
...
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