-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1144 Disable node coloring when uploading file with no expression #1153
Changes from 4 commits
c8c22bb
05cd4bb
eed34ff
e94143a
d071741
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -512,6 +512,15 @@ const toggleLayout = (on, off) => { | |||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const hasExpressionData = (sheets) => { | ||||||||||||||||||||||||||||
for (var property in sheets) { | ||||||||||||||||||||||||||||
if (property.match(ENDS_IN_EXPRESSION_REGEXP)) { | ||||||||||||||||||||||||||||
return true; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
return false; | ||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn’t functionally incorrect, but along the lines of more current idioms when processing lists or objects, see if this can be written as a Using
Suggested change
…which to me sounds more concise, and objectively does not use side effects as well as easier for an optimizer to parallelize I realize There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just modified it to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You certainly modified it in graph.js, but does that mean that lines 515–522 above are duplicated? |
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const updatetoForceGraph = () => {}; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const updatetoGridLayout = () => {}; | ||||||||||||||||||||||||||||
|
@@ -552,7 +561,9 @@ const updateModeViews = () =>{ | |||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const checkWorkbookModeSettings = () => { | ||||||||||||||||||||||||||||
if (grnState.mode === NETWORK_PPI_MODE) { | ||||||||||||||||||||||||||||
const hasExpression = hasExpressionData(grnState.workbook.expression); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (grnState.mode === NETWORK_PPI_MODE || !hasExpression) { | ||||||||||||||||||||||||||||
grnState.nodeColoring.nodeColoringEnabled = false; | ||||||||||||||||||||||||||||
grnState.nodeColoring.showMenu = true; | ||||||||||||||||||||||||||||
grnState.colorOptimal = false; | ||||||||||||||||||||||||||||
|
@@ -598,15 +609,6 @@ const shortenExpressionSheetName = (name) => { | |||||||||||||||||||||||||||
(name.slice(0, MAX_NUM_CHARACTERS_DROPDOWN) + "...") : name; | ||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const hasExpressionData = (sheets) => { | ||||||||||||||||||||||||||||
for (var property in sheets) { | ||||||||||||||||||||||||||||
if (property.match(ENDS_IN_EXPRESSION_REGEXP)) { | ||||||||||||||||||||||||||||
return true; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
return false; | ||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const updateSpeciesMenu = () => { | ||||||||||||||||||||||||||||
$(SPECIES_DISPLAY).val(grnState.genePageData.species); | ||||||||||||||||||||||||||||
$(SPECIES_BUTTON_CRESS + " span").removeClass("glyphicon-ok"); | ||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good! But it looks like this function is duplicated in update-app.js? (see line 515 below) Should these functions be consolidated into one?
Sorry I didn’t notice this before…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice it either ....