Skip to content
Snippets Groups Projects
Commit b5fc34eb authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

add threshold color when below 0.3

parent 566910f8
No related branches found
No related tags found
No related merge requests found
Pipeline #127765 waiting for manual action with stages
in 7 minutes and 5 seconds
...@@ -108,8 +108,12 @@ const groupedPdocks = computed(() => { ...@@ -108,8 +108,12 @@ const groupedPdocks = computed(() => {
} else { return [] } } else { return [] }
}) })
const computedPDocksMatrixPlotOptions = computed(() => { const computedPDocksMatrixPlotOptions = computed(() => {
const domain = [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
const scaleLinear = d3.scaleLinear([0.3, 0.9], [1, 0])
const range = domain.map(d => {
return d3.interpolatePlasma(scaleLinear(d))
})
const { marginBottom, marginLeft, marginRight, marginTop } = toValue(margin) const { marginBottom, marginLeft, marginRight, marginTop } = toValue(margin)
return toValue(groupedPdocks).map((matrix) => { return toValue(groupedPdocks).map((matrix) => {
return { return {
...@@ -126,7 +130,7 @@ const computedPDocksMatrixPlotOptions = computed(() => { ...@@ -126,7 +130,7 @@ const computedPDocksMatrixPlotOptions = computed(() => {
x: { axis: "top", label: "Protein on x", tickRotate: 45 }, x: { axis: "top", label: "Protein on x", tickRotate: 45 },
y: { label: "Proteins on y" }, y: { label: "Proteins on y" },
legend: { label: matrix[0] }, legend: { label: matrix[0] },
color: { scheme: "plasma", legend: true, reverse: true, domain: [0, 1] }, color: { type: "threshold", domain: [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], range: ["lightgrey", ...range], legend: true },
marks: [ marks: [
// Plot.frame(), // Plot.frame(),
on(Plot.cell(toValue(matrix[1]), { on(Plot.cell(toValue(matrix[1]), {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment