diff --git a/.gitignore b/.gitignore index c3ea58a..bb21bdd 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,6 @@ $RECYCLE.BIN/ Thumbs.db UserInterfaceState.xcuserstate .env + + +debug.html \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json index 7ca3a28..e9ffda5 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -10,4 +10,4 @@ "tabWidth": 2, "trailingComma": "all", "useTabs": false -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a09a1db..9235ad6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "1.1.0-beta.0", "license": "BSD-3", "dependencies": { - "@geneontology/dbxrefs": "^1.0.16", "@stencil/core": "^4.1.0", "bbop-graph-noctua": "0.0.35", "cytoscape": "^3.16.1", @@ -17,6 +16,7 @@ "cytoscape-cose-bilkent": "^4.1.0", "cytoscape-dagre": "^2.4.0", "graphlib": "^2.1.8", + "js-yaml": "^4.1.0", "lodash": "^4.17.21", "moment": "^2.30.1", "uuid": "^8.3.2" @@ -24,18 +24,10 @@ "devDependencies": { "@rollup/plugin-image": "^3.0.3", "@stencil/sass": "^3.0.5", + "@types/js-yaml": "^4.0.9", "rollup-plugin-node-polyfills": "^0.2.1" } }, - "node_modules/@geneontology/dbxrefs": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/@geneontology/dbxrefs/-/dbxrefs-1.0.16.tgz", - "integrity": "sha512-zKvbcfs+LU4ZnUo00A5ae0V+FVMIM4ftxcfKtJWmtnLKwWy1sOn2y36HGcz/rEmLwd2zBApKJ0ojmgBH416Q5Q==", - "dependencies": { - "axios": "^0.21.1", - "js-yaml": "^4.0.0" - } - }, "node_modules/@rollup/plugin-image": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-image/-/plugin-image-3.0.3.tgz", @@ -116,19 +108,17 @@ "integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==", "dev": true }, + "node_modules/@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", + "dev": true + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, - "node_modules/axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", - "dependencies": { - "follow-redirects": "^1.10.0" - } - }, "node_modules/bbop-core": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/bbop-core/-/bbop-core-0.0.5.tgz", @@ -287,25 +277,6 @@ "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true }, - "node_modules/follow-redirects": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", - "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, "node_modules/graphlib": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", @@ -446,15 +417,6 @@ } }, "dependencies": { - "@geneontology/dbxrefs": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/@geneontology/dbxrefs/-/dbxrefs-1.0.16.tgz", - "integrity": "sha512-zKvbcfs+LU4ZnUo00A5ae0V+FVMIM4ftxcfKtJWmtnLKwWy1sOn2y36HGcz/rEmLwd2zBApKJ0ojmgBH416Q5Q==", - "requires": { - "axios": "^0.21.1", - "js-yaml": "^4.0.0" - } - }, "@rollup/plugin-image": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-image/-/plugin-image-3.0.3.tgz", @@ -502,19 +464,17 @@ "integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==", "dev": true }, + "@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", + "dev": true + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, - "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", - "requires": { - "follow-redirects": "^1.10.0" - } - }, "bbop-core": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/bbop-core/-/bbop-core-0.0.5.tgz", @@ -645,11 +605,6 @@ "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true }, - "follow-redirects": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", - "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==" - }, "graphlib": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", diff --git a/package.json b/package.json index 54ba0bc..734e56d 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "generate": "stencil generate" }, "dependencies": { - "@geneontology/dbxrefs": "^1.0.16", "@stencil/core": "^4.1.0", "bbop-graph-noctua": "0.0.35", "cytoscape": "^3.16.1", @@ -30,6 +29,7 @@ "cytoscape-cose-bilkent": "^4.1.0", "cytoscape-dagre": "^2.4.0", "graphlib": "^2.1.8", + "js-yaml": "^4.1.0", "lodash": "^4.17.21", "moment": "^2.30.1", "uuid": "^8.3.2" @@ -37,6 +37,7 @@ "devDependencies": { "@rollup/plugin-image": "^3.0.3", "@stencil/sass": "^3.0.5", + "@types/js-yaml": "^4.0.9", "rollup-plugin-node-polyfills": "^0.2.1" }, "repository": { diff --git a/src/components/genes-panel/genes-panel.tsx b/src/components/genes-panel/genes-panel.tsx index 38d4a89..d1f7dd1 100644 --- a/src/components/genes-panel/genes-panel.tsx +++ b/src/components/genes-panel/genes-panel.tsx @@ -169,7 +169,7 @@ export class GenesPanel { renderActivity(activity: Activity) { const nodes = activity.nodes.filter((node: ActivityNode) => ( - node.type !== ActivityNodeType.GoMolecularFunction) + node.predicate?.edge?.id !== '' && node.predicate?.edge?.id !== noctuaFormConfig.edge.enabledBy.id) ); return ( @@ -177,14 +177,14 @@ export class GenesPanel {
{ activity.gpNode && - {activity.gpNode?.term.label} + {activity.gpNode?.term.label} }
- {activity.mfNode && + {activity.rootNode &&
- - {activity.mfNode?.term.label} + + {activity.rootNode?.term.label}
diff --git a/src/components/gocam-legend/assets/legend.png b/src/components/gocam-legend/assets/legend.png deleted file mode 100644 index bce52db..0000000 Binary files a/src/components/gocam-legend/assets/legend.png and /dev/null differ diff --git a/src/components/gocam-legend/assets/legendv2.png b/src/components/gocam-legend/assets/legendv2.png deleted file mode 100644 index fbf94e5..0000000 Binary files a/src/components/gocam-legend/assets/legendv2.png and /dev/null differ diff --git a/src/components/gocam-legend/assets/relation/direct_regulation.png b/src/components/gocam-legend/assets/relation/direct_regulation.png deleted file mode 100644 index 64c82ca..0000000 Binary files a/src/components/gocam-legend/assets/relation/direct_regulation.png and /dev/null differ diff --git a/src/components/gocam-legend/assets/relation/has_output.png b/src/components/gocam-legend/assets/relation/has_output.png deleted file mode 100644 index 62227df..0000000 Binary files a/src/components/gocam-legend/assets/relation/has_output.png and /dev/null differ diff --git a/src/components/gocam-legend/assets/relation/indirect_regulation.png b/src/components/gocam-legend/assets/relation/indirect_regulation.png deleted file mode 100644 index e5ffc7c..0000000 Binary files a/src/components/gocam-legend/assets/relation/indirect_regulation.png and /dev/null differ diff --git a/src/components/gocam-legend/assets/relation/input_of.png b/src/components/gocam-legend/assets/relation/input_of.png deleted file mode 100644 index ad5a300..0000000 Binary files a/src/components/gocam-legend/assets/relation/input_of.png and /dev/null differ diff --git a/src/components/gocam-legend/assets/relation/negative_regulation.png b/src/components/gocam-legend/assets/relation/negative_regulation.png deleted file mode 100644 index 2d906a0..0000000 Binary files a/src/components/gocam-legend/assets/relation/negative_regulation.png and /dev/null differ diff --git a/src/components/gocam-legend/assets/relation/neutral.png b/src/components/gocam-legend/assets/relation/neutral.png deleted file mode 100644 index addc8fd..0000000 Binary files a/src/components/gocam-legend/assets/relation/neutral.png and /dev/null differ diff --git a/src/components/gocam-legend/assets/relation/positive_regulation.png b/src/components/gocam-legend/assets/relation/positive_regulation.png deleted file mode 100644 index a1e2804..0000000 Binary files a/src/components/gocam-legend/assets/relation/positive_regulation.png and /dev/null differ diff --git a/src/components/gocam-legend/assets/relation/provides_input_for.png b/src/components/gocam-legend/assets/relation/provides_input_for.png deleted file mode 100644 index a1ae3bf..0000000 Binary files a/src/components/gocam-legend/assets/relation/provides_input_for.png and /dev/null differ diff --git a/src/components/gocam-legend/gocam-legend.scss b/src/components/gocam-legend/gocam-legend.scss index 24cbae0..bafcb58 100644 --- a/src/components/gocam-legend/gocam-legend.scss +++ b/src/components/gocam-legend/gocam-legend.scss @@ -32,29 +32,29 @@ margin-bottom: 0.5em; } -.sections { +.item { display: flex; -} + align-items: center; + margin-bottom: 0.2em; + gap: 0.25em; -.section { - flex: 1 1 auto; + svg { + flex-shrink: 0; + } } -img { +.item-label { display: inline-block; - max-height: 1.25em; - min-width: 3.5em; - max-width: 3.75em; - object-fit: scale-down; + margin-left: 0.2em; } -.item { +.sections { display: flex; - align-items: center; - margin-bottom: 0.5em; -} + gap: 0.25em; -.item-label { - display: inline-block; - margin-left: 0.5em; + .section { + flex: 1; + display: flex; + flex-direction: column; + } } diff --git a/src/components/gocam-legend/gocam-legend.tsx b/src/components/gocam-legend/gocam-legend.tsx index e82459e..edf15a5 100644 --- a/src/components/gocam-legend/gocam-legend.tsx +++ b/src/components/gocam-legend/gocam-legend.tsx @@ -1,37 +1,12 @@ -import { Component, Host, h } from '@stencil/core'; -import { legend } from '../../globals/constants'; +import { Component, Fragment, Host, h } from '@stencil/core'; +import { RELATION_MAP, STYLES } from '../../globals/relations'; +import { LEGEND_COLUMNS } from '../../globals/legend'; -import direct_regulation from './assets/relation/direct_regulation.png'; -import indirect_regulation from './assets/relation/indirect_regulation.png'; -import positive_regulation from './assets/relation/positive_regulation.png'; -import negative_regulation from './assets/relation/negative_regulation.png'; -import provides_input_for from './assets/relation/provides_input_for.png'; -import neutral from './assets/relation/neutral.png'; -import input_of from './assets/relation/input_of.png'; -import has_output from './assets/relation/has_output.png'; - -// Stencil's Assets feature[1] makes client applications jump through a lot of hoops[2] in order -// to get the assets served from the right location if they choose to the NPM package instead of -// a