When I use memory_graph by render()
, I can get two image files correctly: 'mutable1.png', 'mutable2.png'
import memory_graph as mg
a = [4, 3, 2]
b = a
mg.render(locals(), 'mutable1.png')
b += [1]
mg.render(locals(), 'mutable2.png')
but when I use show()
, PDF viewer is stopping at first PDF file:
import memory_graph as mg
a = [4, 3, 2]
b = a
mg.show(locals())
b += [1]
mg.show(locals())
How can I avoid to stop on first PDF file?
Follow up: My problem was because using Adobe Acrobat Reader that block updates to PDF file it is opening, Sumatra PDF works now: https://github.com/bterwijn/memory_graph?tab=readme-ov-file#troubleshooting
I tested it on Linux Mint and normally it shows me only last file. Probably first it opens first file but next it opens second file in the same viewer and it replaces previous file (and it do it so fast so I can't even see previous file).
But if I add different names for files then I can see both files in two viewers.
import memory_graph as mg
a = [4, 3, 2]
b = a
mg.show(locals(), outfile="file1.pdf")
b += [1]
mg.show(locals(), outfile="file2.pdf")
Source code suggests that show()
uses render()
to create both files with the same names and probably viewer simply replaces content when files have the same names. So it seems problem was making external viewer.