diff --git a/api_routes/routes.js b/api_routes/routes.js index f00caf90..3cef6424 100644 --- a/api_routes/routes.js +++ b/api_routes/routes.js @@ -10,7 +10,7 @@ const services = require('./services'); const external_apis = require('./external'); const samples = JSON.parse(fs.readFileSync(path.join(__dirname, './sample-query-cache.json'))); -const drugDiseasePairs = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/drug-disease-mappings-subset.json'))).slice(0, 500); +const drugDiseasePairs = JSON.parse(fs.readFileSync(path.join(__dirname, '../data/drug-disease-mappings-subset.json'))).slice(0, 1000); router.use('/', external_apis); diff --git a/src/App.jsx b/src/App.jsx index a32c1f9f..edf3516d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -11,7 +11,7 @@ import Guide from '~/pages/Guide'; import Tutorial from '~/pages/Tutorial'; import TermsofService from '~/pages/TermsofService'; import QueryBuilder from '~/pages/queryBuilder/QueryBuilder'; -import Explore from '~/pages/Explore'; +import Explore from '~/pages/explore/Explore'; import Answer from '~/pages/answer/Answer'; import QuestionList from '~/pages/questionList/QuestionList'; diff --git a/src/pages/Explore.jsx b/src/pages/explore/DrugDiseasePairs.jsx similarity index 84% rename from src/pages/Explore.jsx rename to src/pages/explore/DrugDiseasePairs.jsx index a9bbdc4a..11963d4f 100644 --- a/src/pages/Explore.jsx +++ b/src/pages/explore/DrugDiseasePairs.jsx @@ -4,9 +4,9 @@ import React from 'react'; import { Grid, Row, Col, } from 'react-bootstrap'; -import { useHistory } from 'react-router-dom'; +import { useHistory, Link } from 'react-router-dom'; import QueryBuilderContext from '~/context/queryBuilder'; -import useQueryBuilder from './queryBuilder/useQueryBuilder'; +import useQueryBuilder from '../queryBuilder/useQueryBuilder'; const useStyles = makeStyles({ hover: { @@ -25,7 +25,7 @@ const fetchPairs = async () => { return res.json(); }; -export default function Explore() { +export default function DrugDiseasePairs() { const [pairs, setPairs] = React.useState([]); const [isLoading, setIsLoading] = React.useState(true); @@ -94,6 +94,7 @@ export default function Explore() { + ← View all datasets

Drug - Disease Pairs

These drug-disease pairs were generated using a machine learning model to align with the nodes @@ -102,6 +103,11 @@ export default function Explore() { can serve as a starting point for a new query by hovering over a pair and clicking “Start a Query”.

+

+ Scores with an asterisk and underline means the drug-disease pair is already known. The score is still + predicted using the trained model. +

+
{isLoading ? 'Loading...' : ( @@ -132,7 +138,15 @@ export default function Explore() { {pair.drug.id} - {pair.score.toFixed(6)}{pair.known ? * : null} + { + pair.known ? ( + + {pair.score.toFixed(6)}* + + ) : ( + pair.score.toFixed(6) + ) + }