From 48c5a8352544ddc697ecbf1914eda2162831680f Mon Sep 17 00:00:00 2001 From: Lars O Grobe <38878584+larsgrobe@users.noreply.github.com> Date: Wed, 3 Jan 2024 06:21:51 +0300 Subject: [PATCH] Add fname to plot_network to specify output filename. plot_network() is used to plot various types of networks. However, the name of the produced html-file was hard-coded to "citation.html". This change introduces a fname-parameter, that allows to specify other file-names. It defaults to "citation.html" to keep compability with previous versions. --- litstudy/network.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litstudy/network.py b/litstudy/network.py index 7b4fed5..99319da 100644 --- a/litstudy/network.py +++ b/litstudy/network.py @@ -40,7 +40,8 @@ def plot_network( controls=False, scale=1, iterations=1000, - gravity=1 + gravity=1, + fname='citation.html' ): """Plot a `networkx.Graph` generated by one of the `build_X_graph` functions in this module. Plotting is done using the `pyvis` library. @@ -152,7 +153,7 @@ def plot_network( ) ) - return v.show("citation.html") + return v.show(fname) def build_base_network(