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
5897a8c4
Commit
5897a8c4
authored
May 29, 2019
by
Remi PLANEL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add brushable-chromosome tests
parent
acbe5b39
Pipeline
#12076
passed with stage
in 55 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
src/scripts/component/genome-browser.ts
src/scripts/component/genome-browser.ts
+1
-1
src/scripts/component/ruler/brushable-chromosome.ts
src/scripts/component/ruler/brushable-chromosome.ts
+1
-1
tests/brushable-chromosome.test.ts
tests/brushable-chromosome.test.ts
+32
-0
No files found.
src/scripts/component/genome-browser.ts
View file @
5897a8c4
...
...
@@ -73,7 +73,7 @@ export default function () {
function
updateWholeChromosomeAxis
(
axis
:
BrushableAxisData
)
{
if
(
genomesBrowserU
)
{
genomesBrowserU
.
select
<
SVGElement
>
(
"
.
"
+
classes
.
chromosomeRule
)
.
select
<
SVG
G
Element
>
(
"
.
"
+
classes
.
chromosomeRule
)
.
datum
(
axis
)
.
call
(
wholeChromosomeRule
,
width
,
0
);
}
...
...
src/scripts/component/ruler/brushable-chromosome.ts
View file @
5897a8c4
...
...
@@ -16,7 +16,7 @@ export default function () {
const
tickFormat
=
format
(
"
.3s
"
);
const
brushHeight
=
50
;
function
globalGenomeAxis
(
_selection
:
Selection
<
SVG
Element
,
BrushableAxisData
,
SVGElement
,
any
>
,
_selection
:
Selection
<
SVG
GElement
,
BrushableAxisData
,
any
,
any
>
,
width
:
number
,
yPosition
:
number
,
)
{
...
...
tests/brushable-chromosome.test.ts
0 → 100644
View file @
5897a8c4
import
BrushableChromosomeRuler
from
"
../src/scripts/component/ruler/brushable-chromosome
"
;
import
{
BrushableAxisData
}
from
"
../src/scripts/types
"
;
import
{
select
}
from
"
d3-selection
"
;
describe
(
"
Test Chromosome Ruler
"
,
()
=>
{
const
result
=
'
<g class="whole-chromosome-rule"><g class="generic-rule" transform="translate(0,20)"><g class="genome-axis"><g class="title"><text style="fill: black; font-family: monospace;" transform="translate(830,20)">brushable chromosome</text></g><g class="axis-elems" transform="translate(0, 50)" fill="none" font-size="10" font-family="sans-serif" text-anchor="middle"><path class="domain" stroke="currentColor" d="M0.5,-6V0.5H1500.5V-6"></path><g class="tick" opacity="1" transform="translate(0.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">0.00</text></g><g class="tick" opacity="1" transform="translate(150.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">100k</text></g><g class="tick" opacity="1" transform="translate(300.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">200k</text></g><g class="tick" opacity="1" transform="translate(450.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">300k</text></g><g class="tick" opacity="1" transform="translate(600.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">400k</text></g><g class="tick" opacity="1" transform="translate(750.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">500k</text></g><g class="tick" opacity="1" transform="translate(900.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">600k</text></g><g class="tick" opacity="1" transform="translate(1050.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">700k</text></g><g class="tick" opacity="1" transform="translate(1200.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">800k</text></g><g class="tick" opacity="1" transform="translate(1350.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">900k</text></g><g class="tick" opacity="1" transform="translate(1500.5,0)"><line stroke="currentColor" y2="-6"></line><text fill="currentColor" y="-9" dy="0em">1.00M</text></g></g></g></g><g transform="translate(0,25)"><g class="brush-selection" fill="none" pointer-events="all"><rect class="overlay" pointer-events="all" cursor="crosshair" x="0" y="0" width="1500" height="50"></rect><rect class="selection" cursor="move" fill="#777" fill-opacity="0.3" stroke="#fff" shape-rendering="crispEdges" style="" x="150" y="0" width="75" height="50"></rect><rect class="handle handle--e" cursor="ew-resize" style="" x="222" y="-3" width="6" height="56"></rect><rect class="handle handle--w" cursor="ew-resize" style="" x="147" y="-3" width="6" height="56"></rect></g><g style="font-size: 9;" class="brush-selection-boundaries"><text class="start" style="text-anchor: end;" transform="translate(150,60)">100k</text><text class="end" transform="translate(225,60)" style="text-anchor: start;">150k</text></g></g></g>
'
const
brushableChromosomeRulerComponent
=
BrushableChromosomeRuler
();
document
.
body
.
innerHTML
=
'
<div><svg width="500"><g id="container"></g></svg></div>
'
;
const
data
:
BrushableAxisData
=
{
title
:
"
brushable chromosome
"
,
interval
:
[
0
,
1000000
],
window
:
[
100000
,
150000
],
maxWindowSize
:
500000
};
// Start tests
test
(
"
Test data to DOM Element
"
,
()
=>
{
const
container
=
select
(
"
svg
"
)
.
select
<
SVGGElement
>
(
"
g
"
);
container
.
datum
<
BrushableAxisData
>
(
data
)
.
call
(
brushableChromosomeRulerComponent
,
1500
,
20
);
expect
(
container
.
html
()).
toBe
(
result
);
})
});
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