Skip to content

Commit

Permalink
Merge pull request #1318 from VirtualFlyBrain/debug-sync-0806
Browse files Browse the repository at this point in the history
sync: debug  with debug-sync-0806
  • Loading branch information
Robbie1977 authored Mar 14, 2022
2 parents b234092 + 8d7fd0e commit 0b82bf5
Show file tree
Hide file tree
Showing 45 changed files with 1,857 additions and 519 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
- name: Setup local servers
id: local-servers
shell: bash
run: if [ "${GITHUB_REF#refs/heads/}" == master ] ; then
run: if [ "${GITHUB_REF#refs/heads/}" == master ] || [[ "${GITHUB_REF#refs/heads/}" == v* ]]; then
echo "::debug::Set to master setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb:7474";
echo "::set-output name=VFB_OWL_SERVER::http://owl:8080/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://ocpu:80/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb.v4.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
elif [ "${GITHUB_REF#refs/heads/}" == debug ] || [ "${GITHUB_REF#refs/heads/}" == pipeline2 ] || [ "${GITHUB_REF#refs/heads/}" == vfb_geppetto_application ] || [ "${GITHUB_REF#refs/heads/}" == development ] ; then
elif [ "${GITHUB_REF#refs/heads/}" == debug ] || [ "${GITHUB_REF#refs/heads/}" == pipeline2 ] || [ "${GITHUB_REF#refs/heads/}" == vfb_geppetto_application ] || [ "${GITHUB_REF#refs/heads/}" == development ] || [[ "${GITHUB_REF#refs/heads/}" == f* ]]; then
echo "::debug::Set to dev setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb:7474";
echo "::set-output name=VFB_OWL_SERVER::http://owl:8080/kbs/vfb/";
Expand Down Expand Up @@ -67,15 +67,15 @@ jobs:
- name: Setup remote servers
id: remote-servers
shell: bash
run: if [ "${GITHUB_REF#refs/heads/}" == master ] ; then
run: if [ "${GITHUB_REF#refs/heads/}" == master ] || [[ "${GITHUB_REF#refs/heads/}" == v* ]]; then
echo "::debug::Set to master setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb.v4.virtualflybrain.org";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb.v4.virtualflybrain.org";
echo "::set-output name=VFB_OWL_SERVER::http://owl.virtualflybrain.org/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://r.virtualflybrain.org/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=SOLR_SERVER::https://solr.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
elif [ "${GITHUB_REF#refs/heads/}" == debug ] || [ "${GITHUB_REF#refs/heads/}" == pipeline2 ] || [ "${GITHUB_REF#refs/heads/}" == vfb_geppetto_application ] || [ "${GITHUB_REF#refs/heads/}" == development ] ; then
elif [ "${GITHUB_REF#refs/heads/}" == debug ] || [ "${GITHUB_REF#refs/heads/}" == pipeline2 ] || [ "${GITHUB_REF#refs/heads/}" == vfb_geppetto_application ] || [ "${GITHUB_REF#refs/heads/}" == development ] || [[ "${GITHUB_REF#refs/heads/}" == f* ]]; then
echo "::debug::Set to dev setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb-dev.virtualflybrain.org";
echo "::set-output name=VFB_OWL_SERVER::http://owl-dev.virtualflybrain.org/kbs/vfb/";
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG geppettoSimulationRelease=vfb_20200604_a
ARG geppettoDatasourceRelease=vfb_20200604_a
ARG geppettoModelSwcRelease=v1.0.1
ARG geppettoFrontendRelease=development
ARG geppettoClientRelease=VFBv2.2.0.7
ARG geppettoClientRelease=VFBv2.2.2
ARG ukAcVfbGeppettoRelease=download

ARG mvnOpt="-Dhttps.protocols=TLSv1.2 -DskipTests --quiet -Pmaster"
Expand All @@ -38,6 +38,7 @@ ENV VFB_OWL_SERVER=${VFB_OWL_SERVER_ARG}
ENV VFB_R_SERVER=${VFB_R_SERVER_ARG}
ENV SOLR_SERVER=${SOLR_SERVER_ARG}
ENV googleAnalyticsSiteCode=${googleAnalyticsSiteCode_ARG}
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true

RUN /bin/echo -e "\e[1;35mORIGIN BRANCH ------------ $originBranch\e[0m" &&\
/bin/echo -e "\e[1;35mTARGET BRANCH ------------ $targetBranch\e[0m" &&\
Expand Down
79 changes: 20 additions & 59 deletions components/VFBMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import VFBTermInfoWidget from './interface/VFBTermInfo/VFBTermInfo';
import Logo from '@geppettoengine/geppetto-client/components/interface/logo/Logo';
import Canvas from '@geppettoengine/geppetto-client/components/interface/3dCanvas/Canvas';
import QueryBuilder from '@geppettoengine/geppetto-client/components/interface/query/queryBuilder';
import VFBDownloadContents from './interface/VFBDownloadContents/VFBDownloadContents';
import VFBUploader from './interface/VFBUploader/VFBUploader';
import HTMLViewer from '@geppettoengine/geppetto-ui/html-viewer/HTMLViewer';
import VFBListViewer from './interface/VFBListViewer/VFBListViewer';
Expand Down Expand Up @@ -52,6 +53,7 @@ class VFBMain extends React.Component {
quickHelpVisible: undefined,
UIUpdated: true,
wireframeVisible: false,
downloadContentsVisible : true,
uploaderContentsVisible : true
};

Expand Down Expand Up @@ -488,6 +490,12 @@ class VFBMain extends React.Component {
[buttonState]: !this.state[buttonState]
});
break;
case 'downloadContentsVisible':
this.refs.downloadContentsRef?.openDialog();
break;
case 'uploaderContentsVisible':
this.refs.uploaderContentsRef?.openDialog();
break;
case 'quickHelpVisible':
if (this.state[buttonState] === undefined) {
this.setState({
Expand Down Expand Up @@ -527,6 +535,9 @@ class VFBMain extends React.Component {
case 'triggerSetTermInfo':
this.handlerInstanceUpdate(click.value[0]);
break;
case 'downloadContentsVisible':
this.refs.downloadContentsRef?.openDialog();
break;
case 'uploaderContentsVisible':
this.refs.uploaderContentsRef?.openDialog();
break;
Expand Down Expand Up @@ -1286,63 +1297,6 @@ class VFBMain extends React.Component {
idsList += ",";
}
idsList += this.idFromURL;
// populate page meta for this term for indexing
try {
window.ga('vfb.send', 'pageview', window.location.href );
if ( window.XMLHttpRequest ) {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
try {
if (this.responseXML.title.indexOf("404 Not Found") < 0) {
document.title = 'Virtual Fly Brain (' + this.responseXML.title + ')';
document.body.style.font = "x-large";
document.querySelector('meta[property="og:title"]').setAttribute("content",this.responseXML.title);
document.querySelector('meta[name="description"]').setAttribute("content",this.responseXML.getElementById('json').innerText.substring(0, 4900));
document.querySelector('meta[property="og:description"]').setAttribute("content",this.responseXML.getElementById('json').innerText.substring(0, 4900));
if (document.getElementById('metaDesc') != null) {
if (this.responseXML.head != undefined && this.responseXML.head.getElementsByTagName('script') != undefined && this.responseXML.head.getElementsByTagName('script') != null && this.responseXML.head.getElementsByTagName('script')[1] != undefined) {
document.getElementById('metaDesc').innerHTML = this.responseXML.head.getElementsByTagName('script')[1].innerHTML;
}
} else {
if (this.responseXML.head != undefined && this.responseXML.head.getElementsByTagName('script') != undefined && this.responseXML.head.getElementsByTagName('script') != null && this.responseXML.head.getElementsByTagName('script')[1] != undefined) {
var script = document.createElement('script');
script.type = 'application/ld+json';
script.id = 'metaDesc';
script.innerHTML = this.responseXML.head.getElementsByTagName('script')[1].innerHTML;
document.getElementsByTagName('head')[0].appendChild(script);
}
}
var viewport = !!document.querySelector("meta[name='viewport']");
viewport = viewport ? document.querySelector("meta[name='viewport']") : document.createElement('meta');
viewport.setAttribute('name', 'viewport');
viewport.setAttribute('content', 'width=device-width, initial-scale=1');
document.head.appendChild(viewport);
}
} catch (err) {
console.log(err);
}
}
xhr.open( 'GET', 'https://virtualflybrain.org/data/VFB/json/' + this.idFromURL + '.html')
xhr.responseType = 'document';
xhr.send();
}
} catch (err) {
console.error(err);
}
try {
var link = !!document.querySelector("link[rel='amphtml']");
link = link ? document.querySelector("link[rel='amphtml']") : document.createElement('link');
link.setAttribute('rel', 'amphtml');
link.setAttribute('href', 'https://virtualflybrain.org/data/VFB/json/' + this.idFromURL + '.html');
document.head.appendChild(link);
var conlink = !!document.querySelector("link[rel='canonical']");
conlink = conlink ? document.querySelector("link[rel='canonical']") : document.createElement('link');
conlink.setAttribute('rel', 'canonical');
conlink.setAttribute('href', 'https://virtualflybrain.org/reports/' + this.idFromURL);
document.head.appendChild(conlink);
} catch (err) {
console.error(err);
}
} else if (idList[list].indexOf("i=") > -1) {
if (idsList.length > 0) {
idsList = "," + idsList;
Expand All @@ -1351,7 +1305,7 @@ class VFBMain extends React.Component {
} else if (idList[list].indexOf("q=") > -1) {
const multipleQueries = idList[list].replace("q=","").replace("%20", " ").split(";");
let that = this;
multipleQueries?.forEach( query => {
multipleQueries?.forEach( query => {
const querySplit = query.split(",");
that.urlQueryLoader.push({ id : querySplit[0].trim(), selection : querySplit[1].trim() });
});
Expand Down Expand Up @@ -1392,7 +1346,7 @@ class VFBMain extends React.Component {
GEPPETTO.on(GEPPETTO.Events.Instance_added, function (instance) {
that.props.instanceAdded(instance);
});

GEPPETTO.on(GEPPETTO.Events.Instances_created, function (instances) {
// Set template Instance to be not clickable in 3D viewer
if ( instances[0]?.id?.includes(window.templateID) ) {
Expand Down Expand Up @@ -1529,6 +1483,10 @@ class VFBMain extends React.Component {

GEPPETTO.on(GEPPETTO.Events.Websocket_disconnected, function () {
window.ga('vfb.send', 'event', 'disconnected', 'websocket-disconnect', (window.location.pathname + window.location.search));
if (GEPPETTO.MessageSocket.protocol == 'wss://' && location.protocol !== 'https:') {
console.log("%c Unsecure connection used reloading with HTTPS connection... ", 'background: #444; color: #bada55');
location.replace(`https:${location.href.substring(location.protocol.length)}`);
}
if (GEPPETTO.MessageSocket.socketStatus == GEPPETTO.Resources.SocketStatus.CLOSE) {
if (GEPPETTO.MessageSocket.attempts < 10) {
window.ga('vfb.send', 'event', 'reconnect-attempt:' + GEPPETTO.MessageSocket.attempts, 'websocket-disconnect', (window.location.pathname + window.location.search));
Expand Down Expand Up @@ -1752,7 +1710,10 @@ class VFBMain extends React.Component {
searchConfiguration={this.searchConfiguration}
datasourceConfiguration={this.datasourceConfiguration} />

<VFBDownloadContents ref="downloadContentsRef" open={false} />

<VFBUploader ref="uploaderContentsRef" open={false} />

{this.htmlToolbarRender}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,20 @@ var locationCypherQuery = ( instances, paths, weight ) => ({
+ " WITH * ORDER BY index DESC"
+ " UNWIND relationships(path) as sr"
+ " OPTIONAL MATCH cp=(x:Neuron:has_neuron_connectivity)-[:synapsed_to]-(y:Neuron:has_neuron_connectivity) WHERE x=apoc.rel.startNode(sr) AND y=apoc.rel.endNode(sr) OPTIONAL MATCH fp=(x)-[r:synapsed_to]->(y) WHERE r.weight[0] >= " + weight?.toString()
+ " RETURN distinct a as root, collect(distinct fp) as pp, collect(distinct cp) as p, collect(distinct id(r)) as fr, sourceNode as source, targetNode as target, max(length(path)) as maxHops, collect(distinct toString(id(r))+':'+toString(index)) as relationshipY ",
+ " OPTIONAL MATCH (x)-[xio:INSTANCEOF]->(xpc:Class) OPTIONAL MATCH (y)-[yio:INSTANCEOF]->(ypc:Class) WITH *,'\"'+ x.short_form+'\":{\"'+xpc.short_form+'\":\"' + xpc.label + '\"},\"'+ y.short_form+'\":{\"'+ypc.short_form+'\":\"' + ypc.label + '\"}' as Class"
+ " RETURN distinct a as root, collect(distinct fp) as pp, collect(distinct cp) as p, collect(distinct id(r)) as fr, sourceNode as source, targetNode as target, max(length(path)) as maxHops, collect(distinct toString(id(r))+':'+toString(index)) as relationshipY, "
+ " apoc.convert.fromJsonMap('{' + apoc.text.join(collect(Class),',') + '}') as class ",
"resultDataContents": ["row", "graph"]
}
]
});

var Neo4jLabels = {
FAFB : "FAFB",
L1EM : "L1EM",
FlyEM_HB : "FlyEM_HB"
}

// See query explanation on https://github.com/VirtualFlyBrain/graph_queries/blob/main/weighted_path.md

var configuration = {
Expand Down Expand Up @@ -63,46 +72,43 @@ var styling = {
// Color apply to target and source nodes when hovering over a link or a node.
defaultNeighborNodesHoverColor : "orange",
// Font used for text in nodes
defaultNodeFont : "5px sans-serif",
defaultNodeFont : "8px sans-serif",
// Color of font in node's text
defaultNodeFontColor : "black",
// Node border color
defaultBorderColor : "black",
// When hovering over a node, the node's border color changes to create a halo effect
defaultNodeHoverBoderColor : "red",
// Title bar (in node) background color
defaultNodeTitleBackgroundColor : "#11bffe",
defaultNodeTitleBackgroundColor : "grey",
// Description area (in node) background color
defaultNodeDescriptionBackgroundColor : "white",
nodeColorsByLabel : {
"Template" : "#ff6cc8",
"GABAergic" : "#9551ff",
"Dopaminergic" : "#3551ff",
"Cholinergic" : "#95515f",
"Glutamatergic" : "#95f1ff",
"Octopaminergic" : "#f3511f",
"Serotonergic" : "#9501f0",
"Motor_neuron" : "#fffa30",
"Sensory_neuron" : "#ff3a3a",
"Peptidergic_neuron" : "#5f6a3a",
"Glial_cell" : "#ff3a6a",
"Clone" : "#d6007d",
"Synaptic_neuropil" : "#00a2aa",
"License" : "#0164d8",
"Person" : "#023f00",
"Neuron" : "#7f2100",
"Neuron_projection_bundle" : "#d6327d",
"Resource" : "#005f1d",
"Site" : "#005f1d",
"Expression_pattern" : "#534700",
"Split" : "#e012e3",
"DataSet" : "#b700b5",
"Ganglion" : "#d6007d",
"Neuromere" : "#d6507d",
"Cell" : "#ff6a3a",
"Property" : "#005f1d",
"Anatomy" : "#00a2aa",
"_Class" : "#0164d8"
"Adult" : "#ffffb3",
"Anatomy" : "#33a02c",
"Cholinergic" : "#bebada",
"Clone" : "#cab2d6",
"Cluster" : "#ffed6f",
"Dopaminergic" : "#fdbf6f",
"Expression_pattern" : "#b3de69",
"Expression_pattern_fragment" : "#6a3d9a",
"GABAergic" : "#1f78b4",
"Ganglion" : "#ff7f00",
"Glutamatergic" : "#b2df8a",
"Larva" : "#ccebc5",
"Motor_neuron" : "#e31a1c",
"Muscle" : "#a6cee3",
"Nervous_system" : "#fdb462",
"Neuromere" : "#8dd3c7",
"Neuron" : "#b15928",
"Neuron_projection_bundle" : "#bc80bd",
"Octopaminergic" : "#ffff99",
"Peptidergic_neuron" : "#80b1d3",
"Sensory_neuron" : "#fb9a99",
"Serotonergic" : "#d9d9d9",
"Synaptic_neuropil_block" : "#fccde5",
"Synaptic_neuropil_domain" : "#fb8072",
"Synaptic_neuropil_subdomain" : "#88ffb3"
},
controlIcons : {
home : "fa fa-home",
Expand All @@ -112,13 +118,14 @@ var styling = {
}

var restPostConfig = {
url: "https://pdb-dev.virtualflybrain.org/db/neo4j/tx/commit",
url: "https://pdb.v4.virtualflybrain.org/db/neo4j/tx/commit",
contentType: "application/json"
};

module.exports = {
configuration,
styling,
restPostConfig,
locationCypherQuery
locationCypherQuery,
Neo4jLabels
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios';

const globalConfiguration:any = {
"url": "https://solr-dev.virtualflybrain.org/solr/ontology/select",
"url": "https://solr.virtualflybrain.org/solr/ontology/select",
"query_settings":
{
"q": "$SEARCH_TERM$ OR $SEARCH_TERM$* OR *$SEARCH_TERM$*",
Expand Down Expand Up @@ -197,7 +197,7 @@ function refineResults(e) {
}

export const datasourceConfiguration = {
"url": "https://solr-dev.virtualflybrain.org/solr/ontology/select",
"url": "https://solr.virtualflybrain.org/solr/ontology/select",
"query_settings":
{
"q": "$SEARCH_TERM$ OR $SEARCH_TERM$* OR *$SEARCH_TERM$*",
Expand Down
34 changes: 34 additions & 0 deletions components/configuration/VFBDownloadContents/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"postURL":"https://zip.virtualflybrain.org/download",
"contentType": "application/json",
"zipName" : "VFB Files.zip",
"options" :{
"obj": {
"label" : "OBJ",
"tooltip" : "Download OBJ"
},
"swc": {
"label" : "SWC",
"tooltip" : "Download SWC"
},
"nrrd": {
"label" : "NRRD",
"tooltip" : "Download NRRD"
},
"reference": {
"label" : "References",
"tooltip" : "Download References"
}
},
"text" : {
"title" : "Download Data",
"typesSubtitle" : "Please select the desired types",
"variablesSubtitle" : "Please select Variables:",
"noVariablesSubtitle" : "No loaded variables",
"errorMessage" : "Something went wrong... We were not able to download the data. Please try again.",
"noEntriesFound" : "No entries found for the types and variables selected.",
"cancelButton" : "Cancel",
"downloadButton" : "Download",
"tryAgainButton" : "Try Again"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added components/configuration/VFBDownloadContents/obj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0b82bf5

Please sign in to comment.