diff --git a/web-app/src/assets/app.css b/web-app/src/assets/app.css index cdaf3ce2..52f22e56 100644 --- a/web-app/src/assets/app.css +++ b/web-app/src/assets/app.css @@ -115,6 +115,18 @@ code { 0 0 0 6px rgba(34, 237, 176, 0.2); } +.metakg-cy { + width: 300px; + height: 300px; + display: block; + overflow: hidden; + margin: auto; +} + +.metakg-card { + border-top: rgb(255, 115, 0) 5px solid !important; +} + .edge-table tr td { padding: 2px; } @@ -182,6 +194,10 @@ code { align-items: center; } +.p-0 { + padding: 0 !important; +} + .p-1 { padding: 1em !important; } @@ -492,6 +508,32 @@ a.middle-indicator-text { transition: 0.7s; } +.clearButtonSmall { + background-color: rgba(255, 255, 255, 0.1); + padding: 3px 5px; + border: solid rgb(250, 109, 0) 2px; + border-radius: 10px; + text-decoration: none; + color: rgb(250, 109, 0); + font-size: 0.9em; + font-weight: light; + font-variant: small-caps; +} + +.clearButtonSmall:hover { + background-color: rgba(33, 163, 255, 0.3); + border: solid #7eccf0 2px; + color: rgb(50, 50, 148); + transition: 0.3s; +} + +.clearButtonSmall:focus { + background-color: rgba(33, 163, 255, 0.3); + border: solid #7eccf0 2px; + color: rgb(39, 39, 39); + transition: 0.3s; +} + @media only screen and (max-width: 500px) { .hideOnSmall { display: none; @@ -1072,6 +1114,64 @@ body { opacity 300ms; } +.align-items-start { + align-items: start; +} + +.entityPill { + outline: none !important; + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; + display: flex; + align-items: stretch; + margin: 5px; + /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#eeeeee+0,eeeeee+100;Grey+Flat */ + background: linear-gradient( + to bottom, + #eeeeee 0%, + #eeeeee 100% + ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ + border-radius: 10px; +} + +.entityPill div:first-child { + color: white; + text-shadow: 1px 1px 1px rgb(104, 104, 104); + font-weight: bold; + font-size: 13px; + display: flex; + align-items: center; + padding: 5px; + border-top-left-radius: 10px; + border-bottom-left-radius: 10px; +} + +.entityPill div:nth-child(2) { + width: 20px; + background-color: rgb(208, 208, 208); + clip-path: polygon(0% 0%, 18% 0, 100% 50%, 17% 100%, 0% 100%); +} + +.entityPill div:nth-child(3) { + font-weight: bold; + font-size: 10px; + /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#eeeeee+0,eeeeee+100;Grey+Flat */ + background: linear-gradient( + to bottom, + #eeeeee 0%, + #eeeeee 100% + ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ + + display: flex; + align-items: center; + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; + padding: 5px; +} + .apiStatus { outline: none !important; -moz-user-select: none; diff --git a/web-app/src/components/EntityPill.vue b/web-app/src/components/EntityPill.vue new file mode 100644 index 00000000..aa96f3bf --- /dev/null +++ b/web-app/src/components/EntityPill.vue @@ -0,0 +1,30 @@ + + + + {{ object }} + + + + + {{ item }} + + + + + + diff --git a/web-app/src/components/RegistryItem.vue b/web-app/src/components/RegistryItem.vue index fce5a904..83366b4b 100644 --- a/web-app/src/components/RegistryItem.vue +++ b/web-app/src/components/RegistryItem.vue @@ -1,6 +1,6 @@ - + @@ -68,6 +68,8 @@ + + import SourceStatus from '../components/SourceStatus.vue'; import UptimeStatus from '../components/UptimeStatus.vue'; +import RegistryMetaKG from '../components/RegistryMetaKG.vue'; import CollapsibleText from '../components/CollapsibleText.vue'; import { truncate } from 'lodash'; import tippy from 'tippy.js'; @@ -289,7 +292,8 @@ export default { components: { SourceStatus, UptimeStatus, - CollapsibleText + CollapsibleText, + RegistryMetaKG }, data: function () { return { diff --git a/web-app/src/components/RegistryMetaKG.vue b/web-app/src/components/RegistryMetaKG.vue new file mode 100644 index 00000000..2d9ee423 --- /dev/null +++ b/web-app/src/components/RegistryMetaKG.vue @@ -0,0 +1,177 @@ + + + + View biomedical entity knowledge available + + {{ open ? 'CLOSE' : 'OPEN' }} + + + + Loading... + + + Entity Relationship Overview + + + + + + + + + + + + MetaKG Explorer + + + + + + Explore {{ api.info.title }}'s MetaKG + + + Try It Now + + + + + Oops...Can't load this right now... + + + + + + diff --git a/web-app/src/components/SimpleNetwork.vue b/web-app/src/components/SimpleNetwork.vue new file mode 100644 index 00000000..04b22221 --- /dev/null +++ b/web-app/src/components/SimpleNetwork.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/web-app/src/store/modules/registry.js b/web-app/src/store/modules/registry.js index caa736c9..2840304f 100644 --- a/web-app/src/store/modules/registry.js +++ b/web-app/src/store/modules/registry.js @@ -10,6 +10,47 @@ export const registry = { 'info.x-translator.component': [], 'info.x-trapi.version': [], 'tags.name': [] + }, + entityColors: { + Gene: '#3f84bb', + Disease: '#8d5bd4', + Plant: '#087a3c', + GrossAnatomicalStructure: 'coral', + Polypeptide: '#07566f', + AnatomicalEntity: '#d65042', + PathologicalProcess: '#262071', + Procedure: '#683682', + DiseaseOrPhenotypicFeature: '#8d5bd4', + Cell: '#ff6e54', + SmallMolecule: '#e91e62', + PhysiologicalProcess: '#07566f', + Device: '#25282a', + CellularComponent: '#224b80', + PhenotypicFeature: '#369ac1', + MolecularActivity: '#d65042', + Virus: '#642d87', + Bacterium: '#3684af', + Cohort: '#b5cb17', + Fungus: '#ff6e54', + OrganismAttribute: '#5046e4', + ChemicalEntity: 'orange', + Food: 'pink', + Pathway: 'teal', + OrganismTaxon: 'red', + Protein: 'lightblue', + MolecularMixture: 'hotpink', + NucleicAcidEntity: 'black', + Behavior: 'purple', + Organism: 'limegreen', + MolecularEntity: 'green', + Drug: '#fab670', + Drug: '#fab670', + CellLine: '#02838f', + Phenomenon: 'yellow', + ClinicalAttribute: '#a50202', + BiologicalProcess: '#b5cb17', + PairwiseGeneToGeneInteraction: '#444e86', + ClinicalFinding: 'brown' } }), mutations: { @@ -165,6 +206,21 @@ export const registry = { }, all_filters: (state) => { return state.all_filters; + }, + getEntityColor: (state) => (name) => { + // function getRandomColor() { + // var letters = "0123456789ABCDEF"; + // var color = "#"; + // for (var i = 0; i < 6; i++) { + // color += letters[Math.floor(Math.random() * 16)]; + // } + // return color; + // } + if (name in state.entityColors) { + return state.entityColors[name]; + } else { + return '#9c27b0'; + } } } }; diff --git a/web-app/src/views/Extensions.vue b/web-app/src/views/Extensions.vue index b60daa53..a6722aa0 100644 --- a/web-app/src/views/Extensions.vue +++ b/web-app/src/views/Extensions.vue @@ -2,8 +2,8 @@ - - Extend your SmartAPI + + Extend your SmartAPI Extend your OpenAPI SmartAPI specification with custom properties (extensions) to make your
+ View biomedical entity knowledge available + + {{ open ? 'CLOSE' : 'OPEN' }} + +
+ Explore {{ api.info.title }}'s MetaKG +
Oops...Can't load this right now...
Extend your OpenAPI SmartAPI specification with custom properties (extensions) to make your