Skip to content

Commit

Permalink
Add fname to plot_network to specify output filename.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
larsgrobe authored Jan 3, 2024
1 parent cd270b4 commit 48c5a83
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions litstudy/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -152,7 +153,7 @@ def plot_network(
)
)

return v.show("citation.html")
return v.show(fname)


def build_base_network(
Expand Down

0 comments on commit 48c5a83

Please sign in to comment.