Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-qtl-db
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Operate
Environments
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
cc-qtl
cc-qtl-db
Merge requests
!92
Experiements box plot per genotypes 104
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Experiements box plot per genotypes 104
experiements-box-plot-per-genotypes-104
into
dev
Overview
0
Commits
4
Pipelines
4
Changes
4
Merged
Remi PLANEL
requested to merge
experiements-box-plot-per-genotypes-104
into
dev
3 years ago
Overview
0
Commits
4
Pipelines
4
Changes
2
Expand
0
0
Merge request reports
Compare
version 2
version 2
14251314
3 years ago
version 1
0062ea78
3 years ago
dev (base)
and
latest version
latest version
11641980
4 commits,
3 years ago
version 2
14251314
2 commits,
3 years ago
version 1
0062ea78
1 commit,
3 years ago
Show latest version
2 files
+
158
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
client-nuxt/components/charts/PhenotypeBoxPlot.vue
0 → 100644
+
124
−
0
Options
<
template
>
<v-card
flat
><highcharts
ref=
"chart"
:options=
"sanitizedchartOptions"
:update-args=
"[true, true, true]"
></highcharts>
</v-card>
</
template
>
<
script
>
import
*
as
d3Array
from
'
d3-array
'
export
default
{
props
:
{
phenotypePerGenotype
:
{
type
:
Map
,
default
:
()
=>
new
Map
([])
},
phenotypeName
:
{
type
:
String
,
default
:
()
=>
''
},
},
data
()
{
return
{
chartOptions
:
{
title
:
{
text
:
'
Boxplot
'
},
chart
:
{
type
:
'
boxplot
'
,
height
:
500
,
},
legend
:
{
enabled
:
false
},
xAxis
:
{
title
:
{
text
:
'
Genotypes
'
,
},
},
yAxis
:
{
title
:
{
text
:
'
Phenotype
'
},
},
exporting
:
{
sourceWidth
:
1600
,
sourceHeight
:
900
,
// buttons: {
// contextButton: {
// menuItems: [
// 'viewFullscreen',
// 'printChart',
// 'separator',
// 'downloadPNG',
// 'downloadJPEG',
// 'downloadPDF',
// 'downloadSVG',
// 'separator',
// 'downloadCSV',
// 'downloadXLS',
// ],
// },
// },
},
credits
:
false
,
},
}
},
computed
:
{
sanitizedchartOptions
()
{
const
entries
=
Array
.
from
(
this
.
phenotypePerGenotype
.
entries
())
// const categories = entries.map((d) => d[0].split('-')[0])
// const phenotypePerGenotypeSeries = entries.map((d) =>
// d[1].map((d) => d.y)
// )
const
sortedPhenotypeByMeans
=
entries
.
map
((
d
)
=>
[
d
[
0
],
d3Array
.
mean
(
d
[
1
].
map
((
e
)
=>
e
.
y
))])
.
sort
((
a
,
b
)
=>
a
[
1
]
-
b
[
1
])
return
{
...
this
.
chartOptions
,
title
:
{
...
this
.
chartOptions
.
title
,
text
:
`Boxplot for <b>
${
this
.
phenotypeName
}
</b>`
,
},
xAxis
:
{
...
this
.
chartOptions
.
xAxis
,
categories
:
sortedPhenotypeByMeans
.
map
((
d
)
=>
d
[
0
]),
},
yAxis
:
{
title
:
{
text
:
`
${
this
.
phenotypeName
}
`
,
},
},
series
:
[
{
name
:
'
Observations
'
,
data
:
sortedPhenotypeByMeans
.
map
(([
key
,
mean
],
i
)
=>
{
const
sortedPhenotype
=
this
.
phenotypePerGenotype
.
get
(
key
)
.
map
((
d
)
=>
d
.
y
)
.
sort
()
return
{
x
:
i
,
low
:
d3Array
.
min
(
sortedPhenotype
),
q1
:
d3Array
.
quantileSorted
(
sortedPhenotype
,
0.25
),
median
:
d3Array
.
quantileSorted
(
sortedPhenotype
,
0.5
),
q3
:
d3Array
.
quantileSorted
(
sortedPhenotype
,
0.75
),
high
:
d3Array
.
max
(
sortedPhenotype
),
count
:
sortedPhenotype
.
length
,
name
:
key
,
}
}),
tooltip
:
{
headerFormat
:
null
,
pointFormat
:
'
<span style="color:{point.color}">●</span> <b> {point.name}</b><br/>
'
+
'
Maximum: {point.high}<br/>
'
+
'
Upper quartile: {point.q3}<br/>
'
+
'
Median: {point.median}<br/>
'
+
'
Lower quartile: {point.q1}<br/>
'
+
'
Minimum: {point.low}<br/>
'
+
'
Count: {point.count}
'
,
},
},
],
}
},
},
}
</
script
>
<
style
></
style
>