-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
const initialState = () => { | ||
return { | ||
mainTabName: "Flatmap", | ||
zIndex: 1, | ||
showDialogIcons: false, | ||
activeDockedId: 1, | ||
currentCount: 1, | ||
entries: [ | ||
{ | ||
resource: "Rat", | ||
type: "MultiFlatmap", | ||
zIndex:1, | ||
mode: "main", | ||
id: 1, | ||
state: undefined, | ||
label: "", | ||
discoverId: undefined | ||
} | ||
], | ||
sideBarVisibility: true, | ||
search: '', | ||
startUp: true | ||
} | ||
} | ||
|
||
const capitalise = term => { | ||
if (term) | ||
return term.charAt(0).toUpperCase() + term.slice(1); | ||
return term; | ||
}; | ||
|
||
const availableSpecies = () => { | ||
return { | ||
"Human Female":{taxo: "NCBITaxon:9606", biologicalSex: "PATO:0000383", iconClass:"mapicon-icon_human", displayWarning:true}, | ||
"Human Male":{taxo: "NCBITaxon:9606", biologicalSex: "PATO:0000384", iconClass:"mapicon-icon_human", displayWarning:true}, | ||
"Rat":{taxo: "NCBITaxon:10114", iconClass:"mapicon-icon_rat", displayLatestChanges: true}, | ||
"Mouse":{taxo: "NCBITaxon:10090", iconClass:"mapicon-icon_mouse", displayWarning: true}, | ||
"Pig":{taxo: "NCBITaxon:9823", iconClass:"mapicon-icon_pig", displayWarning: true}, | ||
"Cat":{taxo: "NCBITaxon:9685", iconClass:"mapicon-icon_cat", displayWarning: true}, | ||
} | ||
} | ||
|
||
const findSpeciesKey = condition => { | ||
if (condition) { | ||
const list = availableSpecies(); | ||
const keys = Object.keys(list); | ||
for (let i = 0; i < keys.length; i++) { | ||
if (condition.taxo === list[keys[i]].taxo) { | ||
if (condition.biologicalSex) { | ||
if (condition.biologicalSex === list[keys[i]].biologicalSex) | ||
return keys[i]; | ||
} else { | ||
return keys[i]; | ||
} | ||
} | ||
} | ||
} | ||
return ""; | ||
} | ||
|
||
exports.availableSpecies = availableSpecies; | ||
exports.capitalise = capitalise; | ||
exports.findSpeciesKey = findSpeciesKey; | ||
exports.initialState = initialState; |