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
117ae95f
Commit
117ae95f
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
let user configure distribution plot
parent
2a191c64
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#127731
waiting for manual action with stages
in 6 minutes and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/content/ArticleSystemDistributionPlot.vue
+71
-17
71 additions, 17 deletions
components/content/ArticleSystemDistributionPlot.vue
with
71 additions
and
17 deletions
components/content/ArticleSystemDistributionPlot.vue
+
71
−
17
View file @
117ae95f
...
...
@@ -37,8 +37,21 @@ const msIndexName = ref<string>("refseqsanitized")
const
client
=
useMeiliSearchRef
()
const
genomeCountDomain
=
ref
<
[
number
|
null
,
number
|
null
]
>
([
null
,
null
])
const
genomeCountValue
=
ref
<
[
number
,
number
]
>
([
0
,
0
])
const
resetCount
=
ref
<
Fn
|
null
>
(
null
)
const
genomePercentDomain
=
ref
<
[
number
,
number
]
>
([
0
,
100
])
const
genomePercentValue
=
ref
<
[
number
,
number
]
>
([
0
,
0
])
const
resetPercent
=
ref
<
Fn
|
null
>
(
null
)
const
axisOptions
=
ref
<
string
[]
>
([
"
percent
"
,
"
size
"
])
const
plotY
=
ref
<
string
>
(
"
percent
"
)
const
plotFill
=
ref
<
string
>
(
"
size
"
)
// onBeforeMount(() => {
// fetchSystemHits()
// fetchRefSeqTaxo()
...
...
@@ -56,10 +69,6 @@ const computedWidth = computed(() => {
return
Math
.
max
(
screenWidth
,
550
);
});
const
computedDistribution
=
computed
(()
=>
{
const
toValSelectedTaxoRank
=
toValue
(
selectedTaxoRank
)
const
toValSystemHits
=
toValue
(
systemHits
)
...
...
@@ -84,9 +93,10 @@ const computedDistribution = computed(() => {
const
filteredDistribution
=
computed
(()
=>
{
const
toValDistribution
=
toValue
(
computedDistribution
)
const
[
min
,
max
]
=
toValue
(
genomeCountValue
)
const
[
minCount
,
maxCount
]
=
toValue
(
genomeCountValue
)
const
[
minPercent
,
maxPercent
]
=
toValue
(
genomePercentValue
)
return
toValDistribution
.
filter
(
d
=>
{
return
d
.
size
>=
min
&&
d
.
size
<=
max
return
d
.
size
>=
min
Count
&&
d
.
size
<=
max
Count
&&
d
.
percent
>=
minPercent
&&
d
.
percent
<=
maxPercent
})
})
...
...
@@ -119,24 +129,24 @@ const distributionOptions = computed(() => {
const
{
marginLeft
,
marginRight
}
=
toValue
(
margin
)
return
{
...
toValue
(
margin
),
y
:
{
label
:
`
Number
of genomes encoding
${
toValue
(
page
)?.
title
??
'
the system
'
}
`
},
y
:
{
label
:
`
%
of genomes encoding
${
toValue
(
page
)?.
title
??
'
the system
'
}
`
},
x
:
{
label
:
selectedTaxoRank
.
value
,
tickRotate
:
45
},
color
:
{
scheme
:
"
plasma
"
,
legend
:
true
,
reverse
:
true
,
domain
:
[
0
,
100
],
//
domain: [0, 100],
marginLeft
:
10
,
label
:
`
%
of genomes encoding
${
toValue
(
page
)?.
title
??
'
the system
'
}
`
,
label
:
`
Nb
of genomes encoding
${
toValue
(
page
)?.
title
??
'
the system
'
}
`
,
},
width
:
computedWidth
.
value
-
marginRight
-
marginLeft
,
marks
:
[
Plot
.
barY
(
toValue
(
filteredDistribution
),
{
y
:
"
size
"
,
y
:
toValue
(
plotY
)
,
x
:
"
taxo
"
,
fill
:
"
percent
"
,
fill
:
toValue
(
plotFill
)
,
tip
:
true
,
sort
:
{
x
:
"
-y
"
},
},
...
...
@@ -156,8 +166,9 @@ watchEffect(() => {
if
(
toValDistribution
?.
length
>
0
)
{
genomeCountDomain
.
value
=
toValDistribution
.
reduce
((
acc
,
curr
)
=>
{
const
[
min
,
max
]
=
acc
if
(
min
===
null
||
curr
.
size
<
min
)
acc
[
0
]
=
curr
.
size
if
(
max
===
null
||
curr
.
size
>
max
)
acc
[
1
]
=
curr
.
size
const
currVal
=
curr
.
size
if
(
min
===
null
||
currVal
<
min
)
acc
[
0
]
=
currVal
if
(
max
===
null
||
currVal
>
max
)
acc
[
1
]
=
currVal
return
acc
},
[
null
,
null
])
...
...
@@ -165,8 +176,12 @@ watchEffect(() => {
}
else
{
genomeCountDomain
.
value
=
[
null
,
null
]
}
const
{
range
,
reset
}
=
useNumericalFilter
(
"
distribution
"
,
genomeCountDomain
.
value
[
0
]
||
0
,
genomeCountDomain
.
value
[
1
]
||
0
)
genomeCountValue
.
value
=
range
.
value
const
{
range
:
rangeCount
,
reset
:
rCount
}
=
useNumericalFilter
(
"
count
"
,
genomeCountDomain
.
value
[
0
],
genomeCountDomain
.
value
[
1
])
const
{
range
:
rangePercent
,
reset
:
rPercent
}
=
useNumericalFilter
(
"
percent
"
,
0
,
100
)
genomeCountValue
.
value
=
rangeCount
.
value
genomePercentValue
.
value
=
rangePercent
.
value
resetCount
.
value
=
rCount
resetPercent
.
value
=
rPercent
})
...
...
@@ -217,10 +232,49 @@ async function fetchRefSeqTaxo() {
hide-details=
"auto"
class=
"mx-2"
></v-select>
</v-card-text>
<v-card-text>
<v-row>
<v-col>
<v-select
v-model=
"plotY"
:items=
"axisOptions"
density=
"compact"
label=
"Y using"
hide-details=
"auto"
class=
"mx-2"
></v-select>
</v-col>
<v-col><v-select
v-model=
"plotFill"
:items=
"axisOptions"
density=
"compact"
label=
"Fill using"
hide-details=
"auto"
class=
"mx-2"
></v-select></v-col>
</v-row>
<v-range-slider
v-model=
"genomeCountValue"
step=
"1"
thumb-label=
"always"
:min=
"genomeCountDomain[0]"
:max=
"genomeCountDomain[1]"
></v-range-slider>
</v-card-text>
<v-row
class=
"d-flex"
>
<v-col>
<v-card
flat
>
<v-card-item
class=
"mb-4"
>
<v-card-title>
Genome Count
</v-card-title>
</v-card-item>
<v-card-text
class=
"pr-0"
>
<v-range-slider
v-model=
"genomeCountValue"
step=
"1"
thumb-label=
"always"
:min=
"genomeCountDomain[0]"
:max=
"genomeCountDomain[1]"
>
<template
#append
>
<v-btn
variant=
"text"
density=
"compact"
icon=
"md:restart_alt"
@
click=
"resetCount()"
></v-btn>
</
template
></v-range-slider>
</v-card-text>
</v-card>
</v-col>
<v-col>
<v-card
flat
>
<v-card-item
class=
"mb-4"
>
<v-card-title>
Genome Percent
</v-card-title>
</v-card-item>
<v-card-text
class=
"pr-0"
>
<v-range-slider
v-model=
"genomePercentValue"
step=
"1"
thumb-label=
"always"
:min=
"genomePercentDomain[0]"
:max=
"genomePercentDomain[1]"
>
<
template
#append
>
<v-btn
variant=
"text"
density=
"compact"
icon=
"md:restart_alt"
@
click=
"resetPercent()"
></v-btn>
</
template
></v-range-slider>
</v-card-text>
</v-card>
</v-col>
</v-row>
<PlotFigure
ref=
"systemsDistributionPlot"
:options=
"unref(distributionOptions)"
defer
></PlotFigure>
</v-card>
</template>
\ No newline at end of file
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