Skip to content

Commit

Permalink
#1179 Fixes complicated layout of vfb queries and #1180 fixes
Browse files Browse the repository at this point in the history
autocomplete results for circuit browser
  • Loading branch information
jrmartin committed Sep 15, 2021
1 parent 09fda4c commit e7649ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function refineResults(e) {
}

export const datasourceConfiguration = {
"url": "https://solr.virtualflybrain.org/solr/ontology/select",
"url": "https://solr-dev.virtualflybrain.org/solr/ontology/select",
"query_settings":
{
"q": "$SEARCH_TERM$ OR $SEARCH_TERM$* OR *$SEARCH_TERM$*",
Expand Down
15 changes: 3 additions & 12 deletions components/interface/VFBCircuitBrowser/Controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,10 @@ class AutocompleteResults extends Component {
*/
handleResults (status, data, value){
let results = {};
console.log("Status ", status)
console.log("Data ", data)
console.log("Value ", value)
data?.map(result => {
// Match results by short_form id
if ( result?.short_form?.toLowerCase().includes(value?.toLowerCase()) ){
results[result?.label] = result;
} else if ( result?.label?.toLowerCase().includes(value?.toLowerCase()) ){
results[result?.label] = result;
}
results[result?.label] = result;
});

console.log("Results ", results)


this.setState({ filteredResults : results });
}

Expand All @@ -176,6 +166,7 @@ class AutocompleteResults extends Component {

render () {
const label = "Neuron " + (this.props.index + 1) .toString();
console.log("Results ", this.state.filteredResults)

return (
<Autocomplete
Expand Down
4 changes: 3 additions & 1 deletion components/interface/VFBCircuitBrowser/QueryParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export function queryParser (e) {
if (allRelationships.get(parseInt(startNode)) === undefined) {
allRelationships.set(parseInt(startNode), new Array());
}
allRelationships?.get(parseInt(startNode))?.push( { target : parseInt(endNode), label : properties[e.data.params.configuration.resultsMapping.link.label], weight : properties[e.data.params.configuration.resultsMapping.link.weight] });
if ( data[0]?.row[3].includes(parseInt(id)) ) {
allRelationships?.get(parseInt(startNode))?.push( { target : parseInt(endNode), label : properties[e.data.params.configuration.resultsMapping.link.label], weight : properties[e.data.params.configuration.resultsMapping.link.weight] });
}
});
});

Expand Down

0 comments on commit e7649ae

Please sign in to comment.