Skip to content

Commit

Permalink
Merge pull request #463 from VirtualFlyBrain/vfb_geppetto_application
Browse files Browse the repository at this point in the history
Updating latest changes from Vfb geppetto application
  • Loading branch information
ddelpiano authored Dec 6, 2019
2 parents 27604b1 + a8bbba4 commit 6a65949
Show file tree
Hide file tree
Showing 11 changed files with 520 additions and 289 deletions.
2 changes: 1 addition & 1 deletion components/VFBMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ export default class VFBMain extends React.Component {
instance={this.instanceOnFocus}
size={{ height: _height, width: _width }}
ref={ref => this.treeBrowserReference = ref}
selectionHandler={this.addVfbId}/>
selectionHandler={this.addVfbId} />
</div>);
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/configuration/buttonBarConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var buttonBarConfig = {
"queryBuilderVisible": {
"icon": "fa fa-quora",
"label": "",
"tooltip": "Open Query"
"tooltip": "Query Results"
},
"controlPanelVisible": {
"icon": "fa fa-list",
Expand Down
39 changes: 33 additions & 6 deletions components/configuration/queryBuilderConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,26 @@ var queryResultsColMeta = [
"locked": false,
"visible": true,
"displayName": "Stage",
"cssClassName": "query-results-stage-column"
"cssClassName": "query-results-stage-column",
"sortDirectionCycle": ['asc', 'desc', null]
},
{
"columnName": "controls",
"columnName": "license",
"order": 8,
"locked": false,
"visible": true,
"customComponent": QueryLinkComponent,
"actions": "window.addVfbId('$entity$');",
"entityIndex": 1,
"entityDelimiter": "----",
"displayName": "License",
"cssClassName": "query-results-license-column",
"sortDirectionCycle": ['asc', 'desc', null]
},
{
"columnName": "controls",
"order": 9,
"locked": false,
"visible": false,
"customComponent": QueryResultsControlsComponent,
"displayName": "Controls",
Expand All @@ -91,7 +105,7 @@ var queryResultsColMeta = [
},
{
"columnName": "images",
"order": 9,
"order": 10,
"locked": false,
"visible": true,
"customComponent": SlideshowImageComponent,
Expand All @@ -102,17 +116,26 @@ var queryResultsColMeta = [
},
{
"columnName": "score",
"order": 10,
"order": 11,
"locked": false,
"visible": true,
"displayName": "Score",
"cssClassName": "query-results-score-column",
"sortDirectionCycle": ['desc', 'asc', null]
},
{
"columnName": "image_count",
"order": 12,
"locked": false,
"visible": true,
"displayName": "Image_count",
"cssClassName": "query-results-image_count-column",
"sortDirectionCycle": ['desc', 'asc', null]
}
];

// which columns to display in the results
var queryResultsColumns = ['name', 'expressed_in', 'description', 'reference', 'type', 'stage', 'images', 'score'];
var queryResultsColumns = ['name', 'expressed_in', 'description', 'reference', 'type', 'stage', 'license', 'images', 'score','image_count'];

var queryResultsControlConfig = {
"Common": {
Expand Down Expand Up @@ -140,7 +163,7 @@ var queryResultsControlConfig = {

var queryBuilderDatasourceConfig = {
VFB: {
url: "https://solr.virtualflybrain.org/solr/ontology/select?fl=short_form,label,synonym,id,type,has_narrow_synonym_annotation,has_broad_synonym_annotation&start=0&fq=ontology_name:(vfb)&fq=shortform_autosuggest:VFB*%20OR%20shortform_autosuggest:FB*%20OR%20is_defining_ontology:true&rows=100&bq=is_obsolete:false%5E100.0%20shortform_autosuggest:VFB*%5E110.0%20shortform_autosuggest:FBbt*%5E100.0%20is_defining_ontology:true%5E100.0%20label_s:%22%22%5E2%20synonym_s:%22%22%20in_subset_annotation:BRAINNAME%5E3%20short_form:FBbt_00003982%5E2&q=$SEARCH_TERM$%20OR%20$SEARCH_TERM$*%20OR%20*$SEARCH_TERM$*&defType=edismax&qf=label%20synonym%20label_autosuggest_ws%20label_autosuggest_e%20label_autosuggest%20synonym_autosuggest_ws%20synonym_autosuggest_e%20synonym_autosuggest%20shortform_autosuggest%20has_narrow_synonym_annotation%20has_broad_synonym_annotation&wt=json&indent=true",
url: "https://solr.virtualflybrain.org/solr/ontology/select?fl=short_form,label,synonym,id,type,has_narrow_synonym_annotation,has_broad_synonym_annotation&start=0&fq=ontology_name:(vfb)&fq=shortform_autosuggest:VFB*%20OR%20shortform_autosuggest:FB*%20OR%20is_defining_ontology:true&rows=100&bq=is_obsolete:false%5E100.0%20shortform_autosuggest:VFB*%5E110.0%20shortform_autosuggest:FBbt*%5E100.0%20is_defining_ontology:true%5E100.0%20label_s:%22%22%5E2%20synonym_s:%22%22%20in_subset_annotation:BRAINNAME%5E3%20short_form:FBbt_00003982%5E2&q=$SEARCH_TERM$%20OR%20$SEARCH_TERM$*%20OR%20*$SEARCH_TERM$*&defType=edismax&qf=label%20synonym%20label_autosuggest_ws%20label_autosuggest_e%20label_autosuggest%20synonym_autosuggest_ws%20synonym_autosuggest_e%20synonym_autosuggest%20shortform_autosuggest%20has_narrow_synonym_annotation%20has_broad_synonym_annotation&wt=json&indent=true",
crossDomain: true,
id: "short_form",
label: { field: "label", formatting: "$VALUE$" },
Expand Down Expand Up @@ -280,6 +303,10 @@ var sorterColumns = [
column: "score",
order: "DESC"
},
{
column: "image_count",
order: "DESC"
},
{
column: "images",
order: "DESC"
Expand Down
22 changes: 19 additions & 3 deletions components/configuration/treeWidgetConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,30 @@ var restPostConfig = {
contentType: "application/json"
};

/*
* var treeCypherQuery = instance => ({
* "statements": [
* {
* "statement": "MATCH (root:Class)<-[:INSTANCEOF]-(t:Individual {short_form:'" + instance + "'})"
* + "<-[:depicts]-(tc:Individual)<-[ie:in_register_with]-(c:Individual)-[:depicts]->(image:"
* + "Individual)-[r:INSTANCEOF]->(anat:Class) WHERE has(ie.index) WITH root, anat,r,image"
* + " MATCH p=allShortestPaths((root)<-[:SUBCLASSOF|part_of*..]-(anat:Class)) RETURN p,r,image",
* "resultDataContents": ["graph"]
* }
* ]
* });
*/

var treeCypherQuery = instance => ({
"statements": [
{
"statement": "MATCH (root:Class)<-[:INSTANCEOF]-(t:Individual {short_form:'" + instance + "'})"
+ "<-[:depicts]-(tc:Individual)<-[ie:in_register_with]-(c:Individual)-[:depicts]->(image:"
+ "Individual)-[r:INSTANCEOF]->(anat:Class) WHERE has(ie.index) WITH root, anat,r,image"
+ " MATCH p=allShortestPaths((root)<-[:SUBCLASSOF|part_of*..]-(anat:Class)) RETURN p,r,image",
"resultDataContents": ["graph"]
+ " MATCH p=allShortestPaths((root)<-[:SUBCLASSOF|part_of*..]-(anat)) "
+ "RETURN collect(distinct { node_id: id(anat), short_form: anat.short_form, image: image.short_form })"
+ " AS image_nodes, id(root) AS root, collect(p)",
"resultDataContents": ["row", "graph"]
}
]
});
Expand All @@ -19,4 +35,4 @@ var treeCypherQuery = instance => ({
module.exports = {
restPostConfig,
treeCypherQuery
};
};
2 changes: 1 addition & 1 deletion components/interface/ErrorCatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ErrorCatcher extends React.Component {

handleClose = () => {
var customMessage = "Steps to reproduce the problem: \n\nPlease fill the below with the necessary steps to reproduce the problem\n\n\n\nError Information:\n\n"
var url = "https://github.com/VirtualFlyBrain/VFB2/issues/new?body=" + customMessage + this.state.error.message + "\n\n" + this.state.error.stack.replace("#",escape("#")) + "\n\n```diff\n" + window.console.logs.slice(-10).join('\n').replace("#",escape("#")) + "\n```\n";
var url = "https://github.com/VirtualFlyBrain/VFB2/issues/new?body=" + customMessage + this.state.error.message + "\n\n" + this.state.error.stack.replace("#",escape("#")) + "\n\n```diff\n" + window.console.logs.slice(-8).join('\n').replace("#",escape("#")) + "\n```\n";
var win = window.open(encodeURI(url), '_blank');
win.focus();
};
Expand Down
4 changes: 2 additions & 2 deletions components/interface/FocusTerm.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,14 +498,14 @@ export default class FocusTerm extends React.Component {
}} />
</Tooltip>
<Tooltip placement="top-end"
title="Open query results">
title="Query results">
<i className="fa fa-quora arrowsStyle"
onClick={() => {
this.props.UIUpdateManager("queryBuilderVisible");
}} />
</Tooltip>
<Tooltip placement="top-end"
title="Open the control panel">
title="Layers">
<i className="fa fa-list arrowsStyle"
onClick={() => {
this.props.UIUpdateManager("controlPanelVisible");
Expand Down
Loading

0 comments on commit 6a65949

Please sign in to comment.