Fixed a big performance issue

master
Rohan Vazarkar 2016-07-27 14:17:28 -04:00
parent ffec7edf96
commit c5068c507e
5 changed files with 28 additions and 21 deletions

View File

@ -6,7 +6,8 @@
"scripts": { "scripts": {
"start": "set ENV=development & electron .", "start": "set ENV=development & electron .",
"server": "babel-node server.js", "server": "babel-node server.js",
"build": "webpack --config webpack.config.production.js && electron-packager . Bloodhound --platform=all --arch=all --overwrite --prune" "build": "webpack --config webpack.config.production.js && electron-packager . Bloodhound --platform=all --arch=all --overwrite --prune",
"winbuild": "webpack --config webpack.config.production.js && electron-packager . Bloodhound --platform=win32 --arch=all --overwrite --prune"
}, },
"babel": { "babel": {
"presets": [ "presets": [

View File

@ -170,7 +170,7 @@ export default class GroupNodeData extends Component {
value={this.state.sessions} value={this.state.sessions}
click={function(){ click={function(){
emitter.emit('query', "MATCH (n:User), (m:Group {name: '{}'}), p=allShortestPaths((n)-[r:MemberOf*1..]->(m)) WITH n,m,r MATCH (n)-[s:HasSession]-(o:Computer) RETURN m,n,r,o,s".format(this.state.label), emitter.emit('query', "MATCH (n:User), (m:Group {name: '{}'}), p=allShortestPaths((n)-[r:MemberOf*1..]->(m)) WITH n,m,r MATCH (n)-[s:HasSession]-(o:Computer) RETURN m,n,r,o,s".format(this.state.label),
this.state.label) "",this.state.label)
}.bind(this)} /> }.bind(this)} />
</dd> </dd>
</dl> </dl>

View File

@ -123,7 +123,7 @@ body {
top: 1em; top: 1em;
left: 1em; left: 1em;
overflow: visible; overflow: visible;
width: 45%; width: 52%;
background-color: white; background-color: white;
} }
} }

BIN
src/img/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

View File

@ -42,26 +42,32 @@ export function setNodeData(sigmaInstance, startLabel, endLabel){
if (node.neo4j_data.name === startLabel){ if (node.neo4j_data.name === startLabel){
appStore.startNode = node; appStore.startNode = node;
node.glyphs.push({
'position': 'bottom-right',
'font': 'FontAwesome',
'content': '\uF21D',
'fillColor': '#3399FF',
'fontScale': 1.5
})
} }
if (node.neo4j_data.name === endLabel){ if (node.neo4j_data.name === endLabel){
appStore.endNode = node; appStore.endNode = node;
node.glyphs.push({
'position': 'bottom-right',
'font': 'FontAwesome',
'fillColor': '#990000',
'content': '\uF05B',
'fontScale': 1.5
})
} }
}); });
if (appStore.startNode !== null){
appStore.startNode.glyphs.push({
'position': 'bottom-right',
'font': 'FontAwesome',
'content': '\uF21D',
'fillColor': '#3399FF',
'fontScale': 1.5
})
}
if (appStore.endNode !== null){
appStore.endNode.glyphs.push({
'position': 'bottom-right',
'font': 'FontAwesome',
'fillColor': '#990000',
'content': '\uF05B',
'fontScale': 1.5
})
}
return sigmaInstance return sigmaInstance
} }
@ -102,12 +108,12 @@ export function collapseEdgeNodes(sigmaInstance){
node.folded.edges.push(edge) node.folded.edges.push(edge)
appStore.spotlightData[anode.id] = [anode.neo4j_data.name, node.id, node.neo4j_data.name]; appStore.spotlightData[anode.id] = [anode.neo4j_data.name, node.id, node.neo4j_data.name];
sigmaInstance.graph.dropNode(anode.id); sigmaInstance.graph.dropNode(anode.id);
node.glyphs.push({
'position': 'bottom-left',
'content': node.folded.nodes.length
})
} }
}); });
node.glyphs.push({
'position': 'bottom-left',
'content': node.folded.nodes.length
})
}) })
return sigmaInstance return sigmaInstance