Skip to content

Commit

Permalink
Merge branch 'ui-v2' of github.com:IGS/gEAR into ui-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
jorvis committed Jan 8, 2024
2 parents 8b7917d + ec8eac2 commit 855aef6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
7 changes: 7 additions & 0 deletions www/css/common.v2.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,10 @@ p.menu-label {
right: 10px;
z-index:999;
}

/* By default clicking the nice-select2 dropdown search closes it again. This
feels unintuitage. This CSS fixes that. */

.nice-select .nice-select-search-box {
pointer-events: unset;
}
24 changes: 20 additions & 4 deletions www/js/compare_datasets.v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,11 +654,13 @@ const plotDataToGraph = (data) => {
type: "scatter",
text: passing.labels,
marker: {
color: new Array(passing.x.length).fill(passColor, 0, passing.x.length),
size: 4,
},
}
// store original marker color as a deep copy
passingObj.marker.origColor = JSON.parse(JSON.stringify(passingObj.marker.color));

passingObj.marker.color = new Array(passingObj.x.length).fill(passColor, 0, passingObj.x.length);
const failingObj = {
id: failing.id,
pvals: failing.pvals,
Expand All @@ -670,10 +672,13 @@ const plotDataToGraph = (data) => {
type: "scatter",
text: failing.labels,
marker: {
color: new Array(failing.x.length).fill(failColor, 0, failing.x.length),
size: 4,
},
}
failingObj.marker.color = new Array(failingObj.x.length).fill(failColor, 0, failingObj.x.length);
// store original marker color as a deep copy
failingObj.marker.origColor = JSON.parse(JSON.stringify(failingObj.marker.color));

plotData.push(passingObj);
plotData.push(failingObj);
} else {
Expand All @@ -688,10 +693,13 @@ const plotDataToGraph = (data) => {
type: "scatter",
text: passing.labels,
marker: {
color: [].fill("#000000" , 0, passing.x.length),
color: new Array(passing.x.length).fill("#000000" , 0, passing.x.length),
size: 4,
},
}
// store original marker color as a deep copy
passingObj.marker.origColor = JSON.parse(JSON.stringify(passingObj.marker.color));

plotData.push(passingObj);
}

Expand All @@ -710,10 +718,13 @@ const plotDataToGraph = (data) => {
type: "scatter",
text: pointLabels,
marker: {
color: [].fill("#000000", 0, data.x.length),
color: new Array(data.x.length).fill("#000000", 0, data.x.length),
size: 4,
},
}
// store original marker color as a deep copy
dataObj.marker.origColor = JSON.parse(JSON.stringify(dataObj.marker.color));

plotData.push(dataObj);
}

Expand Down Expand Up @@ -1127,6 +1138,11 @@ const updatePlotAnnotations = (genes) => {

layout.annotations = [];

// Reset all trace colors
for (const trace of plotData) {
trace.marker.color = trace.marker.origColor;
}

genes.forEach((gene) => {
let found = false;
for (const trace of plotData) {
Expand Down
4 changes: 2 additions & 2 deletions www/js/curator_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ const curatorApiCallsMixin = {
}

// Make new display card and make it the default display
renderUserDisplayCard({id: display_id, label, plot_type, plotly_config: plotConfig}, display_id);
renderUserDisplayCard({id: display_id, label, plot_type: plotType, plotly_config: plotConfig}, display_id);

return display_id;
} catch (error) {
Expand Down Expand Up @@ -833,7 +833,7 @@ const createPlotTypeSelectInstance = (idSelector, plotTypeSelect=null) => {
// If object exists, just update it with the revised data and return
if (plotTypeSelect) {
plotTypeSelect.update();
return geneSelect;
return plotTypeSelect;
}

// Initialize fixed plot types
Expand Down

0 comments on commit 855aef6

Please sign in to comment.