From 3be7e76c970aec771d639c451323dc6b1005d769 Mon Sep 17 00:00:00 2001 From: bricaud Date: Wed, 15 Apr 2020 17:01:01 +0200 Subject: [PATCH] more info on graph info limit --- README.md | 4 ++-- scripts/graphConf.js | 5 +++-- scripts/graphioGremlin.js | 8 ++++---- scripts/infobox.js | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1564d24..2dda79a 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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). diff --git a/scripts/graphConf.js b/scripts/graphConf.js index 5f13c1d..6d2ae01 100644 --- a/scripts/graphConf.js +++ b/scripts/graphConf.js @@ -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; diff --git a/scripts/graphioGremlin.js b/scripts/graphioGremlin.js index b35675e..fbecff3 100644 --- a/scripts/graphioGremlin.js +++ b/scripts/graphioGremlin.js @@ -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 diff --git a/scripts/infobox.js b/scripts/infobox.js index 505649f..9608dcd 100644 --- a/scripts/infobox.js +++ b/scripts/infobox.js @@ -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"]);