Skip to content

Increase visibility of selected sample trace #23

@brwnj

Description

@brwnj

This is more apparent when you increase sample size:

Screen Shot 2020-10-26 at 2 49 29 PM

Reducing to 10% opacity helps while still preserving an aspect of background:

Screen Shot 2020-10-26 at 3 01 05 PM

function highlight_sample(sample) {
    setHashParams({'sample': sample})
    let d = document.getElementById("gene_plot")
    let vals = d.data.map((t, i) => {
        if (t.tracktype == "background") {
            return [1, 1.5]
        }
        if (t.tracktype != 'sample') {
            return [undefined, undefined]
        } else {
            if (t.name == sample) {
                return [1, 2]
            } else {
                return [0.10, 0.36]
            }
        }
    })

    Plotly.restyle(d, {'opacity': vals.map(i => i[0]), 'line.width': vals.map(i => i[1]), 'hovertemplate': vals.map(i => i[1] > 0.8 ? HOVER_TEMPLATE: null)})
}

Open to community suggestions for fixing cases like NEB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions