Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
53
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
8ca970f2
Commit
8ca970f2
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
try to have a better ratio h, w for cell
parent
a0cce9bd
Branches
dev
No related tags found
No related merge requests found
Pipeline
#127326
waiting for manual action with stages
in 10 minutes and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/content/RefseqDb.vue
+42
-6
42 additions, 6 deletions
components/content/RefseqDb.vue
with
42 additions
and
6 deletions
components/content/RefseqDb.vue
+
42
−
6
View file @
8ca970f2
...
@@ -18,7 +18,12 @@ const itemValue = ref("id");
...
@@ -18,7 +18,12 @@ const itemValue = ref("id");
const
{
width
}
=
useDisplay
();
const
{
width
}
=
useDisplay
();
const
dbName
=
ref
(
"
refseq
"
)
const
dbName
=
ref
(
"
refseq
"
)
const
taxonomyFacet
=
ref
<
Record
<
string
,
any
>
|
undefined
>
(
undefined
)
const
taxonomyFacet
=
ref
<
Record
<
string
,
any
>
|
undefined
>
(
undefined
)
const
cellPlotMargin
=
ref
({
marginLeft
:
150
,
marginBottom
:
200
,
marginTop
:
0
,
marginRight
:
50
})
onBeforeMount
(
async
()
=>
{
onBeforeMount
(
async
()
=>
{
...
@@ -150,7 +155,7 @@ const availableTaxo: Ref<string[]> = ref([
...
@@ -150,7 +155,7 @@ const availableTaxo: Ref<string[]> = ref([
"
Superkingdom
"
"
Superkingdom
"
]);
]);
const
scaleTypes
=
ref
<
string
[]
>
([
'
linear
'
,
'
sqrt
'
,
'
log
'
,
'
symlog
'
])
const
scaleTypes
=
ref
<
string
[]
>
([
'
linear
'
,
'
sqrt
'
,
'
symlog
'
])
const
selectedTaxoRank
=
ref
<
"
species
"
|
"
genus
"
|
"
family
"
|
"
order
"
|
"
class
"
|
"
phylum
"
|
"
Superkingdom
"
>
(
"
Superkingdom
"
);
const
selectedTaxoRank
=
ref
<
"
species
"
|
"
genus
"
|
"
family
"
|
"
order
"
|
"
class
"
|
"
phylum
"
|
"
Superkingdom
"
>
(
"
Superkingdom
"
);
const
headers
=
ref
([
const
headers
=
ref
([
...
@@ -190,7 +195,18 @@ const computedWidth = computed(() => {
...
@@ -190,7 +195,18 @@ const computedWidth = computed(() => {
return
Math
.
max
(
currentWidth
,
550
);
return
Math
.
max
(
currentWidth
,
550
);
});
});
const
cellPlotComputedDimension
=
computed
(()
=>
{
const
{
marginLeft
,
marginBottom
,
marginRight
,
marginTop
}
=
toValue
(
cellPlotMargin
)
const
toValWidth
=
toValue
(
width
)
const
widthFixCell
=
countSystem
.
value
*
50
+
marginLeft
+
marginRight
const
heigthFix
=
countClade
.
value
*
50
+
marginTop
+
marginBottom
if
(
widthFixCell
>
toValWidth
)
{
return
{
width
:
toValWidth
-
marginLeft
-
marginRight
,
height
:
undefined
}
}
else
{
return
{
width
:
widthFixCell
,
height
:
heigthFix
}
}
})
const
allHits
:
Ref
<
Record
<
string
,
any
>
|
undefined
>
=
ref
(
undefined
)
const
allHits
:
Ref
<
Record
<
string
,
any
>
|
undefined
>
=
ref
(
undefined
)
...
@@ -360,17 +376,33 @@ const sortedCellDomain = computed(() => {
...
@@ -360,17 +376,33 @@ const sortedCellDomain = computed(() => {
}
}
})
})
const
binPlotOptions
=
computed
(()
=>
{
const
binPlotOptions
=
computed
(()
=>
{
const
{
marginLeft
,
marginBottom
}
=
toValue
(
cellPlotMargin
)
const
{
height
}
=
toValue
(
cellPlotComputedDimension
)
return
{
return
{
marginLeft
:
150
,
marginLeft
,
marginBottom
:
200
,
marginBottom
,
padding
:
0
,
padding
:
0
,
grid
:
true
,
grid
:
true
,
aspectRatio
:
true
,
aspectRatio
:
height
?
undefined
:
1
,
x
:
{
tickRotate
:
90
,
label
:
"
Systems
"
,
domain
:
toValue
(
sortedCellDomain
)
},
x
:
{
tickRotate
:
90
,
label
:
"
Systems
"
,
domain
:
toValue
(
sortedCellDomain
)
},
color
:
{
scheme
:
"
plasma
"
,
legend
:
true
,
label
:
`Proportion per
${
selectedTaxoRank
.
value
}
`
,
domain
:
[
0
,
100
]
},
color
:
{
scheme
:
"
plasma
"
,
legend
:
true
,
label
:
`Proportion per
${
selectedTaxoRank
.
value
}
`
,
domain
:
[
0
,
100
]
},
}
}
})
})
const
countSystem
=
computed
(()
=>
{
const
toValueAllHits
=
toValue
(
allHits
)
const
data
=
toValueAllHits
?.
hits
??
[]
const
setSystem
=
new
Set
(
data
.
map
(
d
=>
d
.
type
))
return
setSystem
.
size
})
const
countClade
=
computed
(()
=>
{
const
toValueAllHits
=
toValue
(
allHits
)
const
data
=
toValueAllHits
?.
hits
??
[]
const
setSystem
=
new
Set
(
data
.
map
(
d
=>
d
[
selectedTaxoRank
.
value
]))
return
setSystem
.
size
})
const
binPlotGroup
=
computed
(()
=>
{
const
binPlotGroup
=
computed
(()
=>
{
return
Plot
.
group
(
return
Plot
.
group
(
...
@@ -419,9 +451,13 @@ const binPlotDataOptions = computed(() => {
...
@@ -419,9 +451,13 @@ const binPlotDataOptions = computed(() => {
const
toValBinPlotGroup
=
toValue
(
binPlotGroup
)
const
toValBinPlotGroup
=
toValue
(
binPlotGroup
)
const
data
=
toValueAllHits
?.
hits
??
[]
const
data
=
toValueAllHits
?.
hits
??
[]
const
plotCellMark
=
Plot
.
cell
(
data
,
toValBinPlotGroup
)
const
plotCellMark
=
Plot
.
cell
(
data
,
toValBinPlotGroup
)
const
{
width
,
height
}
=
toValue
(
cellPlotComputedDimension
)
const
dim
=
height
?
{
width
,
height
}
:
{
width
}
return
toValueAllHits
?.
hits
?.
length
>
0
?
{
return
toValueAllHits
?.
hits
?.
length
>
0
?
{
...
binPlotOptions
.
value
,
...
binPlotOptions
.
value
,
width
:
width
.
value
,
...
dim
,
title
:
`Proportion of genomes with defense system X per
${
selectedTaxoRank
.
value
}
taxonomic rank`
,
title
:
`Proportion of genomes with defense system X per
${
selectedTaxoRank
.
value
}
taxonomic rank`
,
color
:
{
color
:
{
...
binPlotOptions
.
value
.
color
,
...
binPlotOptions
.
value
.
color
,
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment