0

I am using the following definition for the generation of a graph with pyvis:

g = net.Network(notebook=True, width="100%", height="1500px", heading ="THIS APPEARS DOUBLE...", cdn_resources="in_line", select_menu=True)

However on the resulted graph I get the heading twice!

I am sure that I am creating only one graph though.

Any hint what happens there?

Thanks a lot

1 Answers1

0

Yes seems issue induced in recent updates, issue created.
https://github.com/WestHealth/pyvis/issues/219

as a temporary solution, you may need to post process the generated html file to remove duplicate Header.

html_str = nt.html.replace('</center>', 'xxxxxxx' + '</p>\n</center>')
# this actually edits heading, change code to remove second occurance
h = open(path,'w')
h.write(html_str)
h.close()
  • use this for removing 1 occurrence `re.sub(r'
    .+?<\/h1>\s+<\/center>', '', nt.html, 1, re.DOTALL)`
    –  Mar 18 '23 at 08:48