Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Wiki
Commits
a22772c2
Commit
a22772c2
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
add small coef to align text in genes
parent
2d8fe0e4
No related branches found
No related tags found
1 merge request
!25
Draft: Resolve "Add genome browser in wiki instead of svg"
Pipeline
#114164
passed
1 year ago
Stage: build
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pages/gb.vue
+12
-4
12 additions, 4 deletions
pages/gb.vue
with
12 additions
and
4 deletions
pages/gb.vue
+
12
−
4
View file @
a22772c2
...
@@ -3,7 +3,7 @@ import * as d3 from "d3";
...
@@ -3,7 +3,7 @@ import * as d3 from "d3";
import
{
useDisplay
}
from
'
vuetify
'
import
{
useDisplay
}
from
'
vuetify
'
import
{
useElementSize
}
from
'
@vueuse/core
'
import
{
useElementSize
}
from
'
@vueuse/core
'
const
{
width
}
=
useDisplay
()
const
{
width
}
=
useDisplay
()
const
height
=
ref
(
20
0
)
const
height
=
ref
(
15
0
)
const
color
=
d3
.
scaleOrdinal
([
-
1
,
1
],
d3
.
schemeSet1
);
const
color
=
d3
.
scaleOrdinal
([
-
1
,
1
],
d3
.
schemeSet1
);
const
data
=
ref
([
const
data
=
ref
([
{
start
:
20
,
end
:
30
,
strand
:
1
,
name
:
"
toto
"
},
{
start
:
20
,
end
:
30
,
strand
:
1
,
name
:
"
toto
"
},
...
@@ -21,10 +21,14 @@ const computedWidth = computed(() => {
...
@@ -21,10 +21,14 @@ const computedWidth = computed(() => {
const
marginLeftGb
=
ref
(
10
)
const
marginLeftGb
=
ref
(
10
)
const
marginRightGb
=
ref
(
10
)
const
marginRightGb
=
ref
(
10
)
const
marginBottomGb
=
ref
(
10
)
const
innerWidth
=
computed
(()
=>
{
const
innerWidth
=
computed
(()
=>
{
return
computedWidth
.
value
-
marginLeftGb
.
value
-
marginRightGb
.
value
return
computedWidth
.
value
-
marginLeftGb
.
value
-
marginRightGb
.
value
})
})
const
innerHeigth
=
computed
(()
=>
{
return
height
.
value
-
marginBottomGb
.
value
})
const
minRange
=
ref
(
0
)
const
minRange
=
ref
(
0
)
const
maxRange
=
ref
(
innerWidth
.
value
)
const
maxRange
=
ref
(
innerWidth
.
value
)
...
@@ -40,7 +44,7 @@ const xScale = ref(d3.scaleLinear()
...
@@ -40,7 +44,7 @@ const xScale = ref(d3.scaleLinear()
);
);
const
yScale
=
ref
(
d3
.
scaleLinear
()
const
yScale
=
ref
(
d3
.
scaleLinear
()
.
domain
([
-
1
,
1
])
.
domain
([
-
1
,
1
])
.
range
([
0
,
h
eig
h
t
.
value
]));
.
range
([
0
,
innerH
eigt
h
.
value
]));
...
@@ -55,7 +59,7 @@ const computedData = computed(() => {
...
@@ -55,7 +59,7 @@ const computedData = computed(() => {
const
width
=
xScale
.
value
(
gene
.
end
)
-
xScale
.
value
(
gene
.
start
)
const
width
=
xScale
.
value
(
gene
.
end
)
-
xScale
.
value
(
gene
.
start
)
const
height
=
yScale
.
value
(
-
0.5
)
const
height
=
yScale
.
value
(
-
0.5
)
const
x
=
xScale
.
value
(
gene
.
start
)
+
marginLeftGb
.
value
const
x
=
xScale
.
value
(
gene
.
start
)
+
marginLeftGb
.
value
const
y
=
gene
.
strand
<
0
?
yScale
.
value
(
0.25
)
:
yScale
.
value
(
-
0.75
)
const
y
=
gene
.
strand
<
0
?
yScale
.
value
(
0.25
)
-
marginBottomGb
.
value
:
yScale
.
value
(
-
0.75
)
-
marginBottomGb
.
value
return
{
return
{
...
gene
,
...
gene
,
...
@@ -97,7 +101,10 @@ function positionText(selection) {
...
@@ -97,7 +101,10 @@ function positionText(selection) {
d3
.
select
(
this
)
d3
.
select
(
this
)
.
text
(
''
)
.
text
(
''
)
}
else
{
}
else
{
const
x
=
d
.
width
/
2
-
textWidth
/
2
const
halfW
=
d
.
width
/
2
const
halfTw
=
textWidth
/
2
const
k
=
d
.
height
/
8
const
x
=
d
.
strand
>
0
?
halfW
-
halfTw
-
k
:
halfW
-
halfTw
+
k
d3
.
select
(
this
)
d3
.
select
(
this
)
.
attr
(
"
transform
"
,
`translate(
${
x
}
,
${
d
.
height
/
2
}
)`
)
.
attr
(
"
transform
"
,
`translate(
${
x
}
,
${
d
.
height
/
2
}
)`
)
}
}
...
@@ -114,6 +121,7 @@ function drawGenes(genesSelection) {
...
@@ -114,6 +121,7 @@ function drawGenes(genesSelection) {
g
.
append
(
"
path
"
)
g
.
append
(
"
path
"
)
g
.
append
(
"
text
"
)
g
.
append
(
"
text
"
)
.
attr
(
"
fill
"
,
"
white
"
)
.
attr
(
"
fill
"
,
"
white
"
)
.
attr
(
"
dominant-baseline
"
,
"
middle
"
)
g
.
append
(
"
title
"
)
g
.
append
(
"
title
"
)
},
},
update
=>
{
update
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment