Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
6a4d3356
Commit
6a4d3356
authored
Oct 03, 2014
by
Marc Duez
Browse files
graph.js : use clone object
parent
ca411584
Changes
1
Hide whitespace changes
Inline
Side-by-side
browser/js/graph.js
View file @
6a4d3356
...
...
@@ -398,12 +398,12 @@ Graph.prototype = {
this
.
data_res
[
0
].
path
=
this
.
constructPathR
(
this
.
resolution1
);
this
.
data_res
[
1
].
path
=
this
.
constructPathR
(
this
.
resolution5
);
for
(
var
i
=
0
;
i
<
this
.
m
.
windows
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
m
.
n_
windows
;
i
++
)
{
for
(
var
j
=
0
;
j
<
this
.
m
.
clones
[
i
].
cluster
.
length
;
j
++
)
{
this
.
data_graph
[
this
.
m
.
clones
[
i
].
cluster
[
j
]].
path
=
this
.
constructPath
(
i
,
false
);
}
}
for
(
var
i
=
0
;
i
<
this
.
m
.
windows
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
m
.
n_
windows
;
i
++
)
{
var
cloneID
=
i
for
(
var
j
=
0
;
j
<
this
.
m
.
clones
[
cloneID
].
cluster
.
length
;
j
++
)
{
var
seqID
=
this
.
m
.
clones
[
cloneID
].
cluster
[
j
]
...
...
@@ -426,7 +426,7 @@ Graph.prototype = {
console
.
log
(
"
bam
"
)
var
stack
=
new
Stack
(
this
.
m
)
stack
.
compute
();
for
(
var
i
=
0
;
i
<
this
.
m
.
windows
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
m
.
n_
length
;
i
++
)
{
this
.
data_graph
[
i
].
path
=
this
.
constructStack
(
i
,
stack
);
}
},
...
...
@@ -472,7 +472,7 @@ Graph.prototype = {
//volumes
this
.
g_graph
.
style
(
"
fill
"
,
function
(
d
)
{
return
self
.
m
.
windows
[
d
.
id
].
c
olor
;
return
self
.
m
.
clone
(
d
.
id
).
getC
olor
()
;
})
.
style
(
"
stroke
"
,
"
none
"
)
.
transition
()
...
...
@@ -493,10 +493,10 @@ Graph.prototype = {
}
})
.
attr
(
"
class
"
,
function
(
p
)
{
var
clone
=
self
.
m
.
windows
[
p
.
id
]
if
(
!
clone
.
a
ctive
)
return
"
graph_inactive
"
;
if
(
clone
.
s
elect
)
return
"
graph_select
"
;
if
(
p
.
id
==
self
.
m
.
f
ocus
)
return
"
graph_focus
"
;
var
clone
=
self
.
m
.
clone
(
p
.
id
)
if
(
!
clone
.
isA
ctive
()
)
return
"
graph_inactive
"
;
if
(
clone
.
isS
elect
ed
()
)
return
"
graph_select
"
;
if
(
clone
.
isF
ocus
()
)
return
"
graph_focus
"
;
if
(
clone
.
top
>
self
.
display_limit
)
return
"
graph_inactive
"
;
return
"
graph_line
"
;
})
...
...
@@ -508,7 +508,7 @@ Graph.prototype = {
this
.
g_graph
.
style
(
"
fill
"
,
"
none
"
)
.
style
(
"
stroke
"
,
function
(
d
)
{
return
self
.
m
.
windows
[
d
.
id
].
c
olor
;
return
self
.
m
.
clone
(
d
.
id
).
getC
olor
()
;
})
.
transition
()
.
duration
(
speed
)
...
...
@@ -528,10 +528,10 @@ Graph.prototype = {
}
})
.
attr
(
"
class
"
,
function
(
p
)
{
var
clone
=
self
.
m
.
windows
[
p
.
id
]
if
(
!
clone
.
a
ctive
)
return
"
graph_inactive
"
;
if
(
clone
.
s
elect
)
return
"
graph_select
"
;
if
(
p
.
id
==
self
.
m
.
f
ocus
)
return
"
graph_focus
"
;
var
clone
=
self
.
m
.
clone
(
p
.
id
)
if
(
!
clone
.
isA
ctive
()
)
return
"
graph_inactive
"
;
if
(
clone
.
isS
elect
ed
()
)
return
"
graph_select
"
;
if
(
clone
.
isF
ocus
()
)
return
"
graph_focus
"
;
if
(
clone
.
top
>
self
.
display_limit
)
return
"
graph_inactive
"
;
return
"
graph_line
"
;
})
...
...
@@ -780,8 +780,8 @@ Graph.prototype = {
var
size
=
[]
for
(
var
i
=
0
;
i
<
this
.
graph_col
.
length
;
i
++
)
{
if
(
seq_size
)
size
[
i
]
=
this
.
m
.
getSequenceSize
(
id
,
this
.
m
.
samples
.
order
[
i
])
else
size
[
i
]
=
this
.
m
.
getSize
(
id
,
this
.
m
.
samples
.
order
[
i
])
if
(
seq_size
)
size
[
i
]
=
this
.
m
.
clone
(
id
).
getSequenceSize
(
this
.
m
.
samples
.
order
[
i
])
else
size
[
i
]
=
this
.
m
.
clone
(
id
).
getSize
(
this
.
m
.
samples
.
order
[
i
])
}
var
x
=
this
.
graph_col
[
0
];
...
...
@@ -893,11 +893,11 @@ Stack.prototype = {
this
.
total_size
=
[];
for
(
j
=
0
;
j
<
this
.
m
.
samples
.
number
;
j
++
){
this
.
total_size
[
j
]
=
0
for
(
i
=
0
;
i
<
this
.
m
.
windows
.
length
;
i
++
){
if
(
this
.
m
.
windows
[
i
].
a
ctive
)
this
.
total_size
[
j
]
+=
this
.
m
.
getSize
(
i
,
j
);
//active clones
for
(
i
=
0
;
i
<
this
.
m
.
n_
windows
;
i
++
){
if
(
this
.
m
.
clone
(
i
).
isA
ctive
()
)
this
.
total_size
[
j
]
+=
this
.
m
.
clone
(
i
).
getSize
(
j
);
//active clones
}
this
.
total_size
[
j
]
+=
this
.
m
.
getSiz
e
(
this
.
m
.
windows
.
length
-
1
,
j
);
//other clones
this
.
total_size
[
j
]
+=
this
.
m
.
clon
e
(
this
.
m
.
windows
.
length
-
1
).
getSize
(
j
);
//other clones
}
},
...
...
@@ -910,14 +910,14 @@ Stack.prototype = {
this
.
sum
[
j
]
=
1
}
for
(
i
=
0
;
i
<
this
.
m
.
windows
.
length
;
i
++
){
for
(
i
=
0
;
i
<
this
.
m
.
n_
windows
;
i
++
){
this
.
min
[
i
]
=
[]
this
.
max
[
i
]
=
[]
//active clones
if
(
this
.
m
.
windows
[
i
].
a
ctive
)
{
if
(
this
.
m
.
clone
(
i
).
isA
ctive
()
)
{
for
(
j
=
0
;
j
<
this
.
m
.
samples
.
number
;
j
++
){
this
.
min
[
i
][
j
]
=
this
.
sum
[
j
]
this
.
sum
[
j
]
-=
this
.
m
.
getSize
(
i
,
j
)
this
.
sum
[
j
]
-=
this
.
m
.
clone
(
i
).
getSize
(
j
)
this
.
max
[
i
][
j
]
=
this
.
sum
[
j
]
}
}
else
{
...
...
@@ -931,7 +931,7 @@ Stack.prototype = {
//other
for
(
j
=
0
;
j
<
this
.
m
.
samples
.
number
;
j
++
){
this
.
min
[
this
.
m
.
windows
.
length
-
1
][
j
]
=
this
.
sum
[
j
]
this
.
sum
[
this
.
m
.
windows
.
length
-
1
]
+=
this
.
m
.
getSiz
e
(
this
.
m
.
windows
.
length
-
1
,
j
)
this
.
sum
[
this
.
m
.
windows
.
length
-
1
]
+=
this
.
m
.
clon
e
(
this
.
m
.
windows
.
length
-
1
).
getSize
(
j
)
this
.
max
[
this
.
m
.
windows
.
length
-
1
][
j
]
=
this
.
sum
[
j
]
}
...
...
Write
Preview
Supports
Markdown
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