Skip to content

SVG IDs not unique and being cached by Jupyter #467

Description

@gtsambos

Hi everyone! I keep finding that when I use draw_svg several times in the same Jupyter notebook, I get odd (wrong) drawings that are always wrong in the same way. An example is below:

Screen Shot 2020-03-09 at 5 04 00 pm

In the notebook shown above, I have two difference tree sequence objects, ts0 and ts1, that I wish to draw. Using draw_svg with ts0 first produces the correct output, but when I try to draw ts1 in the following cell, you can see that the first few trees are just copied over from ts0.

Without digging into it further I'm not totally sure what's going on, but I'm wondering whether draw_svg is inadvertently adding something to some global object each time it is called, without checking to see if it already exists beforehand and clearing it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions