Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Fractalis
fractal.js
Commits
36e0031a
Commit
36e0031a
authored
Sep 27, 2017
by
Sascha Herzinger
Browse files
Added subset column
parent
ed12d3ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/vue/charts/Heatmap.vue
View file @
36e0031a
...
...
@@ -171,6 +171,7 @@
width
:
0
,
height
:
0
,
colorScale
:
d3
.
interpolateCool
,
subsetColors
:
d3
.
schemeCategory10
,
numericArrayDataIds
:
[],
rankingMethod
:
'
mean
'
,
cluster
:
{
...
...
@@ -255,7 +256,7 @@
return
cols
},
rows
()
{
let
rows
=
[
'
$cluster_row$
'
,
'
$padding_row$
'
]
let
rows
=
[
'
$subset_row$
'
,
'
$cluster_row$
'
,
'
$padding_row$
'
]
if
(
this
.
cluster
.
results
.
rows
.
length
)
{
rows
=
rows
.
concat
(
this
.
cluster
.
results
.
rows
.
map
(
d
=>
d
[
0
]))
}
else
{
...
...
@@ -267,7 +268,6 @@
const
maxWidth
=
this
.
padded
.
width
/
this
.
cols
.
length
let
maxHeight
=
this
.
padded
.
height
/
this
.
rows
.
length
const
gridSize
=
maxWidth
<
maxHeight
?
maxWidth
:
maxHeight
// noinspection JSSuspiciousNameCombination
return
{
main
:
{
height
:
gridSize
,
width
:
gridSize
},
rowCluster
:
{
height
:
gridSize
,
width
:
gridSize
},
...
...
@@ -329,11 +329,32 @@
<p>Value:
${
this
.
results
.
data
.
value
[
i
]}
</p>
<p>z-Score
${
this
.
results
.
data
.
zscore
[
i
]}
</p>
</div>
`
})
})
const
idSubsetMap
=
this
.
results
.
data
.
id
.
map
((
d
,
i
)
=>
{
return
{
id
:
d
,
subset
:
this
.
results
.
data
.
subset
[
i
]}
})
.
reduce
((
acc
,
curr
)
=>
{
if
(
typeof
acc
[
curr
.
id
]
===
'
undefined
'
)
{
acc
[
curr
.
id
]
=
curr
.
subset
}
return
acc
},
{})
Object
.
keys
(
idSubsetMap
).
forEach
(
d
=>
{
cells
.
push
({
x
:
this
.
scales
.
x
(
d
),
y
:
this
.
scales
.
y
(
'
$subset_row$
'
),
width
:
this
.
grid
.
main
.
width
,
height
:
this
.
grid
.
main
.
height
,
fill
:
this
.
subsetColors
[
idSubsetMap
[
d
]
%
this
.
subsetColors
.
length
],
tooltip
:
`
<div>
<p>Col:
${
d
}
</p>
<p>Subset:
${
idSubsetMap
[
d
]}
</p>
</div>
`
})
})
this
.
cluster
.
results
.
rows
.
forEach
(
d
=>
{
// noinspection JSSuspiciousNameCombination
cells
.
push
({
x
:
this
.
scales
.
x
(
'
$cluster_col$
'
),
y
:
this
.
scales
.
y
(
d
[
0
]),
...
...
@@ -349,7 +370,6 @@
})
})
this
.
cluster
.
results
.
cols
.
forEach
(
d
=>
{
// noinspection JSSuspiciousNameCombination
cells
.
push
({
x
:
this
.
scales
.
x
(
d
[
0
]),
y
:
this
.
scales
.
y
(
'
$cluster_row$
'
),
...
...
test/charts/multi/multi-chart.html
View file @
36e0031a
...
...
@@ -38,40 +38,44 @@
return
credentials1
}
})
fjs
.
setSubsets
([[...
new
Array
(
250
).
keys
()],
[...
new
Array
(
500
).
keys
()].
slice
(
250
,
500
)])
fjs
.
setSubsets
([
[...
new
Array
(
100
).
keys
()],
[...
new
Array
(
500
).
keys
()].
slice
(
100
,
200
),
[...
new
Array
(
500
).
keys
()].
slice
(
200
,
300
)
])
function
loadData
()
{
fjs
.
loadData
([
{
data_type
:
'
numerical_array
'
,
label
:
'
Expression Data
'
,
num_samples
:
2
00
,
num_samples
:
3
00
,
num_features
:
100
},
{
data_type
:
'
numerical
'
,
label
:
'
Numerical Data 1
'
,
num_samples
:
5
00
num_samples
:
3
00
},
{
data_type
:
'
numerical
'
,
label
:
'
Numerical Data 2
'
,
num_samples
:
5
00
num_samples
:
3
00
},
{
data_type
:
'
numerical
'
,
label
:
'
Numerical Data 3
'
,
num_samples
:
5
00
num_samples
:
3
00
},
{
data_type
:
'
categorical
'
,
label
:
'
Categorical Data 1
'
,
num_samples
:
5
00
,
num_samples
:
3
00
,
values
:
[
'
A
'
,
'
B
'
,
'
C
'
,
'
D
'
]
},
{
data_type
:
'
categorical
'
,
label
:
'
Categorical Data 2
'
,
num_samples
:
5
00
,
num_samples
:
3
00
,
values
:[
'
X
'
,
'
Y
'
]
}
])
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment