Skip to content

Commit

Permalink
Minor look&feel changes
Browse files Browse the repository at this point in the history
  • Loading branch information
frmichel committed Jan 15, 2024
1 parent 775f93b commit e7205ca
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
5 changes: 2 additions & 3 deletions src/Component/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ class NavBar extends Component {
<Navbar bg="" variant="">
<Navbar.Brand href=""></Navbar.Brand>
<img className="mt-4 me-5" id="logo_d2kab" src={logo_d2kab} alt="D2KAB"></img>
<div className="mt-4 me-0 col-sm-6">
<div className="mt-4 me-0 col-sm-8">
<div className="title">Wheat Genomics SLKG</div>
<div>Visualization interface for the <b>Wheat Genomics Scientific Literature Knowledge Graph</b></div>
<div>Developed by the <a href="https://www.d2kab.org/">D2KAB</a> project.</div>
<div>Search interface for the <a href="https://github.com/Wimmics/WheatGenomicsSLKG">Wheat Genomics Scientific Literature Knowledge Graph</a>.</div>
</div>
<Nav className="mr-auto flex-column">
<Nav.Item>
Expand Down
12 changes: 10 additions & 2 deletions src/Component/search/SearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,22 @@ function SearchForm() {
* @param {Object} e - event
*/
const handleInputKeyUp = (e) => {
//alert('Key: ' + e.keyCode + " " + e.key);
if (e.key === 'Escape') {
setSuggestions([]); // Clear suggestions on Escape
}

// if (e.key === 'Enter' && input.trim() !== '') {
// // @TODO - possible to use the arrows to navigate the suggestions and enter to select one?
// setInput('');
// setSuggestions([]); // Clear suggestions when an item is added
// }

// if (e.key === 'ArrowDown' ) {
// // use the arrows to navigate the suggestions and enter to select one
// }
// if (e.key === 'ArrowUp' ) {
// // use the arrows to navigate the suggestions and enter to select one
// }
};

/**
Expand Down Expand Up @@ -227,7 +234,7 @@ function SearchForm() {
return (
<>
<div className="component">
<h1 className="">Search documents by named entities</h1>
<h1 className="">Search articles by named entities</h1>
<div className="multiple-inputs-container">

{ /* List of the search entities that have already been selected */}
Expand All @@ -252,6 +259,7 @@ function SearchForm() {
value={input}
onChange={(e) => setInput(e.target.value)}
onKeyUp={handleInputKeyUp}
autoFocus
/>
</Col>
<Col xs={2}>
Expand Down
10 changes: 4 additions & 6 deletions src/Component/search/SuggestionEntity.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import ListGroup from 'react-bootstrap/ListGroup';
import Badge from 'react-bootstrap/Badge';
import './SearchForm.css';

/**
Expand Down Expand Up @@ -47,17 +48,14 @@ const SuggestionEntity = (props) => {
}

return (
<ListGroup.Item key={id} className="suggestion-item" action variant="light"
onClick={() => handleSelect(id)}>

<ListGroup.Item key={id} className="suggestion-item" action variant="light" onClick={() => handleSelect(id)}>
<span>{entityLabel}</span>
&nbsp;
<span className={"suggestion-pref-label"}>{entityPrefLabel}</span>
&nbsp;
<span className={"suggestion-pref-label"}>({entityCount})</span>
&nbsp;
<span className={"suggestion-pref-label"}>[{entityType}]</span>

&nbsp;
<Badge bg="secondary">{entityCount}</Badge>
</ListGroup.Item>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/config/knowledge_bases.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"name": "NCBITaxon",
"namespace": "purl.obolibrary.org/obo/NCBITaxon",
"endpoint": "http://sparql.bioontology.org/",
"endpoint": "http://d2kab.i3s.unice.fr/sparql",
"used_for": [
"named_entity"
]
Expand All @@ -19,15 +19,15 @@
{
"name": "GENE",
"namespace": "ns.inria.fr/d2kab/gene",
"endpoint": "http://sparql.bioontology.org/",
"endpoint": "http://d2kab.i3s.unice.fr/sparql",
"used_for": [
"named_entity"
]
},
{
"name": "Variety",
"namespace": "ns.inria.fr/d2kab/variety",
"endpoint": "http://sparql.bioontology.org/",
"endpoint": "http://d2kab.i3s.unice.fr/sparql",
"used_for": [
"named_entity"
]
Expand Down

0 comments on commit e7205ca

Please sign in to comment.