From 13c2274905067bb8c665f16d90ec74860756a729 Mon Sep 17 00:00:00 2001 From: zenador Date: Mon, 29 Jan 2018 01:16:45 +0800 Subject: [PATCH] return vis network object so it's easier to manipulate outside the library e.g. when adding click handlers --- visJS2jupyter/visJS_module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/visJS2jupyter/visJS_module.py b/visJS2jupyter/visJS_module.py index 90359be..1c02b3d 100644 --- a/visJS2jupyter/visJS_module.py +++ b/visJS2jupyter/visJS_module.py @@ -415,7 +415,7 @@ def visjs_network(nodes_dict, edges_dict, script = """ {} function setUpFrame() {{ - window.runVis({}, {}); + return window.runVis({}, {}); }}{} """.format(result["script"], dumps(nodes_dict), dumps(edges_dict), (("\n" + result["run"]) if output == "zeppelin" else "")) head = """ @@ -1203,6 +1203,7 @@ def stringify_bool(var): console.log( "ready!" ); + return myNetwork; } """