Skip to content
GitLab
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
66ebea22
Commit
66ebea22
authored
Apr 08, 2019
by
Remi PLANEL
Browse files
Pass the gene color through the data
parent
79feea86
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scripts/component/sequence/gene.ts
View file @
66ebea22
...
...
@@ -14,7 +14,9 @@ export interface GeneData {
strand
:
Strand
,
begin
:
number
,
end
:
number
,
gene
:
string
gene
:
string
,
fill
?:
string
,
stroke
?:
string
}
export
interface
PositionedGeneData
extends
GeneData
{
position
:
{
...
...
@@ -56,7 +58,11 @@ export default function () {
updateGenes
.
attr
(
"
transform
"
,
d
=>
"
translate(
"
+
d
.
position
.
x
+
"
,
"
+
d
.
position
.
y
+
"
)
"
);
updateGenes
.
select
<
SVGPathElement
>
(
"
path
"
)
.
style
(
"
fill
"
,
d
=>
d
.
strand
===
"
+
"
?
"
darkred
"
:
"
darkblue
"
)
.
style
(
"
fill
"
,
d
=>
d
.
fill
||
null
)
.
style
(
"
fill-opacity
"
,
0.85
)
.
style
(
"
stroke
"
,
d
=>
d
.
stroke
||
null
)
.
style
(
"
stroke-width
"
,
'
1px
'
)
.
style
(
"
stroke-opacity
"
,
0.8
)
.
attr
(
"
transform
"
,
({
strand
,
position
:
{
width
}
})
=>
(
strand
===
"
-
"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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