Skip to content

Commit

Permalink
more info on graph info limit
Browse files Browse the repository at this point in the history
  • Loading branch information
bricaud committed Apr 15, 2020
1 parent 219115a commit 3be7e76
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Graphexp: graph explorer with D3.js

Graphexp is a lightweight web interface to explore and display a graph stored in a Gremlin graph database, via the Gremlin server (version 3.2.x, 3.3.x or 3.4).
Graphexp is a lightweight web interface to explore and display a graph stored in a Gremlin graph database, via the Gremlin server (version 3.2.x, 3.3.x or 3.4.x).

Graphexp is under the Apache 2.0 license.

Expand Down Expand Up @@ -59,7 +59,7 @@ You may also try out a Graphexp demo on [joov's Github repository](https://githu
### Graphexp guidelines
To get some first visualization of your graph, you may click on the `Search` button, without filling any box. Graphexp will then send a query to the graph DB, asking for the first 50 nodes and their edges.

The node and edge properties can be automatically retrieved using the `get graph info` button. Pushing this button will also display some graph properties on the left side of the page. If it is not the case, check your configuration, it means Graphexp can not query the graphDB.
The node and edge properties can be automatically retrieved using the `get graph info` button. Pushing this button will also display some graph properties on the left side of the page. If it is not the case, check your configuration, it means Graphexp can not query the graphDB. To get the properties, Graphexp should consider all the nodes and edges. This may be overwhelming for the server if the graph is very large. A limit to the 10000 first nodes and edges is set to avoid that. You may change it in `graphConf.js` with the parameter `limit_graphinfo_request`.

When a node of the visualization is clicked, it will become 'active' with a circle surrounding it and its information will be displayed on the right side of the page. Moreover, this action will trigger the display of its neighbors.
Clicking on an edge will show its properties (without highlighting the edge).
Expand Down
5 changes: 3 additions & 2 deletions scripts/graphConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ const REST_USE_HTTPS = false;
const REST_TIMEOUT = 2000
// TODO: configuration for the secure server

// limit number for graph info (avoid overwhelming the server for large graphs)
const limit_request = 10000
// limit number of nodes and edges to query for graph info
// (avoid overwhelming the server for large graphs)
const limit_graphinfo_request = 10000

// Graph configuration
const default_nb_of_layers = 3;
Expand Down
8 changes: 4 additions & 4 deletions scripts/graphioGremlin.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ var graphioGremlin = (function(){
}

function get_graph_info(){
var gremlin_query_nodes = "nodes = " + traversal_source + ".V().limit(" + limit_request + ").groupCount().by(label);"
var gremlin_query_edges = "edges = " + traversal_source + ".E().limit(" + limit_request + ").groupCount().by(label);"
var gremlin_query_nodes_prop = "nodesprop = " + traversal_source + ".V().limit(" + limit_request + ").valueMap().select(keys).groupCount();"
var gremlin_query_edges_prop = "edgesprop = " + traversal_source + ".E().limit(" + limit_request + ").valueMap().select(keys).groupCount();"
var gremlin_query_nodes = "nodes = " + traversal_source + ".V().limit(" + limit_graphinfo_request + ").groupCount().by(label);"
var gremlin_query_edges = "edges = " + traversal_source + ".E().limit(" + limit_graphinfo_request + ").groupCount().by(label);"
var gremlin_query_nodes_prop = "nodesprop = " + traversal_source + ".V().limit(" + limit_graphinfo_request + ").valueMap().select(keys).groupCount();"
var gremlin_query_edges_prop = "edgesprop = " + traversal_source + ".E().limit(" + limit_graphinfo_request + ").valueMap().select(keys).groupCount();"

var gremlin_query = gremlin_query_nodes+gremlin_query_nodes_prop
+gremlin_query_edges+gremlin_query_edges_prop
Expand Down
2 changes: 1 addition & 1 deletion scripts/infobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var infobox = (function(){
function create(label_graph,label_graphElem){
var graph_bar = d3.select(label_graph);
graph_bar.append("h2").text("Graph Info");
graph_bar.append("h4").text("Limited to the first " + limit_request + " nodes and edges");
graph_bar.append("h4").text("Limited to the first " + limit_graphinfo_request + " nodes and edges");
_table_Graphinfo = graph_bar.append("table").attr("id","tableGraph");
init_table(_table_Graphinfo,["Type","Count"]);

Expand Down

0 comments on commit 3be7e76

Please sign in to comment.