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
70687cd5
Commit
70687cd5
authored
Jan 23, 2013
by
Sato Hiroyuki
Committed by
GitLab
Jan 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve network graph
parent
65737bd5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
lib/gitlab/graph/json_builder.rb
lib/gitlab/graph/json_builder.rb
+6
-4
vendor/assets/javascripts/branch-graph.js
vendor/assets/javascripts/branch-graph.js
+2
-2
No files found.
lib/gitlab/graph/json_builder.rb
View file @
70687cd5
...
@@ -16,6 +16,7 @@ module Gitlab
...
@@ -16,6 +16,7 @@ module Gitlab
@commits
=
collect_commits
@commits
=
collect_commits
@days
=
index_commits
@days
=
index_commits
@space
=
0
end
end
def
to_json
(
*
args
)
def
to_json
(
*
args
)
...
@@ -97,8 +98,8 @@ module Gitlab
...
@@ -97,8 +98,8 @@ module Gitlab
if
leaves
.
empty?
if
leaves
.
empty?
return
return
end
end
space
=
find_free_space
(
leaves
,
map
)
@
space
=
find_free_space
(
leaves
,
map
)
leaves
.
each
{
|
l
|
l
.
space
=
space
}
leaves
.
each
{
|
l
|
l
.
space
=
@
space
}
# and mark it as reserved
# and mark it as reserved
min_time
=
leaves
.
last
.
time
min_time
=
leaves
.
last
.
time
parents
=
leaves
.
last
.
parents
.
collect
parents
=
leaves
.
last
.
parents
.
collect
...
@@ -115,7 +116,7 @@ module Gitlab
...
@@ -115,7 +116,7 @@ module Gitlab
else
else
max_time
=
parent_time
-
1
max_time
=
parent_time
-
1
end
end
mark_reserved
(
min_time
..
max_time
,
space
)
mark_reserved
(
min_time
..
max_time
,
@
space
)
# Visit branching chains
# Visit branching chains
leaves
.
each
do
|
l
|
leaves
.
each
do
|
l
|
...
@@ -139,9 +140,10 @@ module Gitlab
...
@@ -139,9 +140,10 @@ module Gitlab
reserved
+=
@_reserved
[
day
]
reserved
+=
@_reserved
[
day
]
end
end
space
=
base_space
(
leaves
,
map
)
space
=
base_space
(
leaves
,
map
)
while
reserved
.
include?
space
do
while
(
reserved
.
include?
space
)
||
(
space
==
@space
)
do
space
+=
1
space
+=
1
end
end
space
space
end
end
...
...
vendor/assets/javascripts/branch-graph.js
View file @
70687cd5
...
@@ -121,7 +121,7 @@
...
@@ -121,7 +121,7 @@
if
(
c
.
space
==
this
.
commits
[
i
].
space
)
{
if
(
c
.
space
==
this
.
commits
[
i
].
space
)
{
r
.
path
([
r
.
path
([
"
M
"
,
x
,
y
,
"
M
"
,
x
,
y
,
"
L
"
,
x
-
20
*
(
c
.
time
+
1
),
y
"
L
"
,
cx
,
c
y
]).
attr
({
]).
attr
({
stroke
:
this
.
colors
[
c
.
space
],
stroke
:
this
.
colors
[
c
.
space
],
"
stroke-width
"
:
2
"
stroke-width
"
:
2
...
...
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