question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

draw_svg() is buggy

See original GitHub issue

Looks like it’s dropping all unary and standalone nodes, and relabelling all of the other nodes accordingly. For example this code:

# Modify this code.
nodes_ex = io.StringIO("""\
id      is_sample   population      time
0       1       0               0.0
1       1       0               0.0
2       1       0               0.0
3       1       0               0.0
4       1       0               0.0
5       0       0               1.0
6       0       0               1.5
7       0       0               2.0
8       0       0               3.0
9       0       0               3.5
10      0       0               4.0
""")
edges_ex = io.StringIO("""\
id      left            right           parent  child
0       0.00000000      1.00000000      5       0
1       0.00000000      1.00000000      5       1
2       0.00000000      1.00000000      6       2
3       0.00000000      1.00000000      6       3
4       0.00000000      0.50000000      7       5
5       0.50000000      1.00000000      8       5
6       0.50000000      1.00000000      8       6
7       0.00000000      0.50000000      9       6
8       0.00000000      0.50000000      9       7
9       0.50000000      1.00000000      10      8
""")

# Load the tree sequence.
ts = tskit.load_text(nodes=nodes_ex, edges=edges_ex, strict=False)

# Test by plotting it.
display(SVG(ts.draw_svg()))

draws a tree sequence like this:

image

but it should look more like this:

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
gtsamboscommented, Sep 26, 2019

Yes; I’m happy to poke around, but I won’t have time for a few days. The height problem was logged in #319 also.

1reaction
jeromekellehercommented, Jun 26, 2019

Works for me I think… Can you reproduce with the latest master?

tmp

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flickering when dragging a group with an SVG in it · Issue #127
I have a group element containing several elements, there's always an and optionally other stuff. The drag and drop works but it flickers...
Read more >
Reveal SVG paths on scroll - GSAP - GreenSock
I've got an example but is very buggy ( for instance when you scroll to fast into the view the paths disappear and...
Read more >
Filters on SVG objects not being applied when they are drawn ...
Chrome is buggy in its way to get the external elements referenced with the xlink:href attribute, or with a <funcIRI> ( url(#xxx) )...
Read more >
Is there any simple way we can achieve this using CSS?
You can draw SVG with vector based drawing tools, no math needed here at all. ... does this design team code or just...
Read more >
Author: admin - OGDF
new GraphIO::readTsplibXml() for reading tsplib instances in XML format; drawSVG() now draws cluster labels; drawSVG() now draws arrows heads correctly ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found