Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw all nodes in the tree using gl.TRIANGLES instead of gl.LINES? #332

Open
fedarko opened this issue Aug 15, 2020 · 2 comments
Open

Draw all nodes in the tree using gl.TRIANGLES instead of gl.LINES? #332

fedarko opened this issue Aug 15, 2020 · 2 comments

Comments

@fedarko
Copy link
Collaborator

fedarko commented Aug 15, 2020

I read through this article and thought that this might be a useful option to add in. A few reasons that stick out:

  • Users may want to increase the overall line thickness for the tree (not just for colored nodes)
    • This could be particularly important for people with vision impairments
  • Users may want to be able to "zoom in" on parts of the tree and see the lines / points increase in size. Lines / points aren't impacted by zooming (as far as I can tell), so zooming in can be a bit confusing.
    • Although I could also see "lines look the same at any zoom level" as being an upside to the current way of doing things...
  • Plain lines can apparently be inconsistently rendered across different browsers (I don't think this has been a problem, but as more people start using Empress it could be)
  • This looks closer to what other tree visualizers, e.g. iTOL / ggtree, do by default (so it makes Empress look less different; I guess this could be an upside or a downside depending on how you look at it)

In terms of the code, I think this'd just involve treating each line analogously to how "thick lines" are currently treated. I'm not sure if this will be a performance problem, but if so we could probably make this a configurable option.

I set up a quick and dirty prototype in this branch, where all nodes are treated as thick lines and all points are drawn as squares using two triangles -- it doesn't look that bad, although nodes overlapping is a problem since the line width used here is 5:
thicklines

The line thickness would need to be adjusted based on the dimensions of the tree (...so, the same problem as #276). On the other side of things, using too small of a thickness results in an invisible-looking tree when the user is zoomed out:
invisitree

... although using a default color of black, rather than gray, helps a bit:
black_invisitree

Anyway, not a big deal -- but something that we may want to consider.

@ElDeveloper
Copy link
Member

This is an interesting idea, I like it in general so as long as performance isn't impacted for large trees.

@kwcantrell
Copy link
Collaborator

This would be nice to have as a parameter users can toggle.

For large trees, this can become a bit expensive. However, as tree get larger, making all lines thicker greatly increases the amount of branch overlap. Even in the moving pictures tree, you can begin to see a fair amount of overlap. For tress > 100,000 nodes, I think we risk the tree looking like a single blob. I choose to only thicken colored branch because it them easier to see for large trees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants