|
157 | 157 | padding: 0; |
158 | 158 | font-size: 95%; |
159 | 159 | } |
| 160 | +.current-model { |
| 161 | + font-weight: bold; |
| 162 | +} |
160 | 163 | .popper-div { |
161 | 164 | position: relative; |
162 | 165 | background-color: #eee; |
|
204 | 207 |
|
205 | 208 | let url = '/api/v1/dataset/latest/data/go-cam-cytoscape/' + gocamId; |
206 | 209 |
|
| 210 | +let gocamIdNoFlags = gocamId; |
207 | 211 | let flags = []; |
208 | 212 |
|
209 | 213 | if (gocamId.includes(':')) { |
210 | 214 | const parts = gocamId.split(':'); |
211 | 215 | flags = parts[1].split(','); |
| 216 | + gocamIdNoFlags = parts[0]; |
212 | 217 | } |
213 | 218 |
|
214 | 219 | if (flags.includes('retain_genes') || flags.includes('trim_models')) { |
|
776 | 781 | if (nodeId) { |
777 | 782 | showCyPanel(); |
778 | 783 |
|
779 | | - const makeLink = (id, label) => { |
| 784 | + const makeLink = (id, label, title) => { |
| 785 | + if (!title) { |
| 786 | + title = ""; |
| 787 | + } |
780 | 788 | const bits = id.split(":"); |
781 | 789 | if (bits.length == 2) { |
782 | 790 | if (bits[0] == 'PomBase') { |
783 | | - return `<a target="_blank" href="/gene/${bits[1]}">${label}</a>`; |
| 791 | + return `<a title="${title}" target="_blank" href="/gene/${bits[1]}">${label}</a>`; |
784 | 792 | } else { |
785 | 793 | if (bits[0] == 'CHEBI') { |
786 | | - return `<a target="_blank" href="https://www.ebi.ac.uk/chebi/chebiOntology.do?chebiId=${id}">${label} (${id})</a>`; |
| 794 | + return `<a title="${title}" target="_blank" href="https://www.ebi.ac.uk/chebi/chebiOntology.do?chebiId=${id}">${label} (${id})</a>`; |
787 | 795 | } else { |
788 | 796 | if (bits[0] == 'GO') { |
789 | | - return `<a target="_blank" href="/term/${id}">${label} (${id})</a>`; |
| 797 | + return `<a title="${title}" target="_blank" href="/term/${id}">${label} (${id})</a>`; |
790 | 798 | } else { |
791 | 799 | if (bits[0].startsWith('gomodel')) { |
792 | 800 | const modelId = bits[1]; |
793 | | - const modelDetails = findModel(modelId); |
794 | | - |
795 | | - if (modelDetails) { |
796 | | - return `<a target="_blank" href="/gocam/pombase-view/docs/${modelId}">${modelDetails.title}</a>`; |
797 | | - } else { |
798 | | - return modelId; |
| 801 | + let href = `/gocam/pombase-view/docs/${modelId}`; |
| 802 | + const highlightArray = |
| 803 | + [...highlightGeneIds].filter(g => g !== ''); |
| 804 | + if (highlightArray.length > 0) { |
| 805 | + href += '/' + highlightArray.join(','); |
799 | 806 | } |
| 807 | + return `<a title="${title}" target="_blank" href="${href}">${label}</a>`; |
800 | 808 | } |
801 | 809 | } |
802 | 810 | } |
|
880 | 888 | } |
881 | 889 |
|
882 | 890 | if (nodeType !== 'model') { |
883 | | - if (isMergedModel) { |
| 891 | + if (isMergedModel || currentData.is_connecting_node) { |
884 | 892 | newContent += '<div class="models">models:</div><ul class="model-list">'; |
885 | | - for (const longModelId of currentData.model_ids) { |
886 | | - newContent += '<li class="model-id">' + makeLink(longModelId) + '</li>'; |
| 893 | + for (const [longModelId, modelTitle] of currentData.models) { |
| 894 | + let extraClass = ''; |
| 895 | + let linkTitle = ''; |
| 896 | + if (!isMergedModel) { |
| 897 | + if (longModelId == 'gomodel:' + gocamIdNoFlags) { |
| 898 | + extraClass = 'current-model'; |
| 899 | + linkTitle = 'Current model: '; |
| 900 | + } else { |
| 901 | + linkTitle = 'Connected model: '; |
| 902 | + } |
| 903 | + } |
| 904 | + linkTitle += modelTitle + ' (click to view)'; |
| 905 | + newContent += '<li class="model-id ' + extraClass + '">' + makeLink(longModelId, modelTitle, linkTitle) + '</li>'; |
887 | 906 | } |
888 | 907 | newContent += '</ul>'; |
889 | 908 | } |
|
0 commit comments