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
Remi PLANEL
bioviz-js
Commits
97741a58
Commit
97741a58
authored
Apr 04, 2019
by
Remi PLANEL
Browse files
Format code
parent
2203c674
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scripts/component/sequence/gene.ts
View file @
97741a58
...
@@ -4,7 +4,7 @@ import { arrowShape } from "./gene-shapes";
...
@@ -4,7 +4,7 @@ import { arrowShape } from "./gene-shapes";
import
linearGene
from
"
../../layout/linear-gene
"
;
import
linearGene
from
"
../../layout/linear-gene
"
;
import
{
of
}
from
"
rxjs
"
;
import
{
of
}
from
"
rxjs
"
;
import
{
mergeMap
}
from
"
rxjs/operators
"
;
import
{
mergeMap
}
from
"
rxjs/operators
"
;
import
{
drag
}
from
"
d3-drag
"
;
type
Strand
=
"
+
"
|
"
-
"
;
type
Strand
=
"
+
"
|
"
-
"
;
export
interface
GeneData
{
export
interface
GeneData
{
...
@@ -57,19 +57,24 @@ export default function () {
...
@@ -57,19 +57,24 @@ export default function () {
updateGenes
.
attr
(
"
transform
"
,
d
=>
"
translate(
"
+
d
.
position
.
x
+
"
,
"
+
d
.
position
.
y
+
"
)
"
);
updateGenes
.
attr
(
"
transform
"
,
d
=>
"
translate(
"
+
d
.
position
.
x
+
"
,
"
+
d
.
position
.
y
+
"
)
"
);
updateGenes
updateGenes
.
select
<
SVGPathElement
>
(
"
path
"
)
.
select
<
SVGPathElement
>
(
"
path
"
)
.
style
(
"
fill
"
,
d
=>
d
.
strand
===
"
+
"
?
"
darkred
"
:
"
darkblue
"
)
.
style
(
"
fill
"
,
d
=>
d
.
strand
===
"
+
"
?
"
darkred
"
:
"
darkblue
"
)
.
attr
(
.
attr
(
"
transform
"
,
"
transform
"
,
({
strand
,
position
:
{
width
}
})
=>
(
strand
===
"
-
"
)
({
strand
,
position
:
{
width
}
})
=>
(
strand
===
"
-
"
)
?
"
translate(0,
"
+
(
geneHeight
+
5
)
+
"
) translate(
"
+
width
+
"
,
"
+
geneHeight
+
"
) rotate(180)
"
?
"
translate(0,
"
+
(
geneHeight
+
5
)
+
"
) translate(
"
+
width
+
"
,
"
+
geneHeight
+
"
) rotate(180)
"
:
null
:
null
)
)
.
attr
(
"
d
"
,
d
=>
arrowShape
(
d
,
geneHeight
))
.
attr
(
"
d
"
,
d
=>
arrowShape
(
d
,
geneHeight
))
.
on
(
"
click
"
,
d
=>
of
(
d
).
pipe
(
.
on
(
"
click
"
,
d
=>
of
(
d
)
mergeMap
(
d
=>
of
<
[
number
,
number
]
>
([
d
.
begin
,
d
.
end
])
.
pipe
(
mergeMap
(
d
=>
of
<
[
number
,
number
]
>
([
d
.
begin
,
d
.
end
])))
)
.
subscribe
(
d
.
eventHandler
.
click
)
).
subscribe
(
d
.
eventHandler
.
click
)
)
.
call
(
drag
().
on
(
"
start
"
,
d
=>
console
.
log
(
event
))
.
on
(
"
drag
"
,
d
=>
console
.
log
(
event
))
.
on
(
"
end
"
,
d
=>
console
.
log
(
event
))
);
);
;
})
})
}
}
return
gene
;
return
gene
;
...
...
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