Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bioviz-js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Remi PLANEL
bioviz-js
Commits
1521f1d3
Commit
1521f1d3
authored
Jun 04, 2019
by
Remi PLANEL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put genome browser in a svg group
parent
9fa7ea91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
src/scripts/component/genome-browser.ts
src/scripts/component/genome-browser.ts
+6
-7
src/scripts/main-genome-browser.ts
src/scripts/main-genome-browser.ts
+5
-3
No files found.
src/scripts/component/genome-browser.ts
View file @
1521f1d3
...
...
@@ -17,24 +17,23 @@ export default function () {
const
selectedChromosomeComponent
=
SelectedChromosome
();
let
width
=
900
;
let
genomesBrowserU
:
Selection
<
SVGElement
,
GenomeBrowserData
,
SVGElement
,
any
>
|
null
=
null
;
let
genomesBrowserU
:
Selection
<
SVG
G
Element
,
GenomeBrowserData
,
SVGElement
,
any
>
|
null
=
null
;
function
genomeBrowser
(
_selection
:
Selection
<
SVGElement
,
Array
<
GenomeBrowserData
>
,
HTMLElement
,
any
>
,
w
:
number
,
height
:
number
_selection
:
Selection
<
SVGGElement
,
Array
<
GenomeBrowserData
>
,
HTMLElement
,
any
>
)
{
width
=
w
;
//
width = w;
_selection
.
each
(
function
(
_data
:
Array
<
GenomeBrowserData
>
)
{
const
container
=
select
(
this
);
const
genomeBrowser
=
container
.
selectAll
<
SVGElement
,
GenomeBrowserData
>
(
"
.genome-browser
"
)
.
selectAll
<
SVG
G
Element
,
GenomeBrowserData
>
(
"
.genome-browser
"
)
.
data
(
_data
);
//ENTER
const
genomeBrowserE
=
genomeBrowser
.
enter
()
.
append
<
SVGElement
>
(
"
g
"
)
.
append
<
SVG
G
Element
>
(
"
g
"
)
.
classed
(
"
genome-browser
"
,
true
);
genomeBrowserE
.
append
(
"
g
"
).
classed
(
classes
.
chromosomeRuler
,
true
);
...
...
src/scripts/main-genome-browser.ts
View file @
1521f1d3
...
...
@@ -90,9 +90,11 @@ const state: State = {
}
const
svg
=
select
<
SVGElement
,
any
>
(
"
svg
"
)
const
genomeBrowsers
=
select
<
SVGElement
,
any
>
(
"
svg
"
)
.
attr
(
"
width
"
,
width
+
1
)
.
attr
(
"
height
"
,
height
);
.
attr
(
"
height
"
,
height
)
.
append
<
SVGGElement
>
(
"
g
"
)
.
classed
(
"
genome-browsers
"
,
true
);
draw
();
...
...
@@ -114,7 +116,7 @@ function draw() {
//
const
computedGenomeBrowserData
:
GenomeBrowserData
=
getGenomeBrowserData
(
state
);
svg
genomeBrowsers
.
datum
([
computedGenomeBrowserData
])
.
call
(
genomeBrowserComponent
,
width
,
height
);
...
...
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