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
11c41956
Commit
11c41956
authored
Apr 11, 2019
by
Remi PLANEL
Browse files
Format the selectedChromosome interval values
parent
9b7af3ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scripts/index.ts
View file @
11c41956
...
@@ -3,12 +3,12 @@ import { select, event } from "d3-selection";
...
@@ -3,12 +3,12 @@ import { select, event } from "d3-selection";
import
{
scaleOrdinal
}
from
"
d3-scale
"
;
import
{
scaleOrdinal
}
from
"
d3-scale
"
;
import
GenomeBrowser
from
"
./component/genome-browser
"
;
import
GenomeBrowser
from
"
./component/genome-browser
"
;
import
{
color
}
from
"
d3
"
;
import
{
color
}
from
"
d3
"
;
import
{
format
as
d3Format
}
from
"
d3-format
"
;
import
{
schemeSet1
,
schemeDark2
,
schemeCategory10
}
from
"
d3-scale-chromatic
"
;
import
{
schemeSet1
,
schemeDark2
,
schemeCategory10
}
from
"
d3-scale-chromatic
"
;
const
width
=
1500
;
const
width
=
1500
;
const
height
=
300
;
const
height
=
300
;
const
genomeBrowserComponent
=
GenomeBrowser
();
const
genomeBrowserComponent
=
GenomeBrowser
();
const
geneColor
=
scaleOrdinal
(
const
geneColor
=
scaleOrdinal
(
// schemeDark2
// schemeDark2
// schemeCategory10
// schemeCategory10
...
@@ -129,7 +129,7 @@ function getGenomeBrowserData(state: State) {
...
@@ -129,7 +129,7 @@ function getGenomeBrowserData(state: State) {
chromosome
:
{
title
:
chromosomeTitle
},
chromosome
:
{
title
:
chromosomeTitle
},
selectedChromosome
:
{
title
:
selectedChromosomeTitle
}
selectedChromosome
:
{
title
:
selectedChromosomeTitle
}
}
=
state
;
}
=
state
;
const
intervalFormatter
=
d3Format
(
"
.3s
"
);
// Callback when brushed => modify data and redraw the genome + axis
// Callback when brushed => modify data and redraw the genome + axis
const
brushedCallback
=
function
(
scale
:
any
)
{
const
brushedCallback
=
function
(
scale
:
any
)
{
if
(
!
event
.
sourceEvent
)
return
;
if
(
!
event
.
sourceEvent
)
return
;
...
@@ -182,7 +182,7 @@ function getGenomeBrowserData(state: State) {
...
@@ -182,7 +182,7 @@ function getGenomeBrowserData(state: State) {
}),
}),
rule
:
{
rule
:
{
title
:
selectedChromosomeTitle
title
:
selectedChromosomeTitle
+
"
[
"
+
window
[
0
]
+
"
,
"
+
window
[
1
]
+
"
]
"
,
+
"
[
"
+
intervalFormatter
(
window
[
0
]
)
+
"
,
"
+
intervalFormatter
(
window
[
1
]
)
+
"
]
"
,
interval
:
window
interval
:
window
}
}
},
},
...
...
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