Skip to content

Improve streamtree layouts #1969

@jameshadfield

Description

@jameshadfield

The current layout alrogithm is relatively simple and achieves its goal of avoiding crossings of branches and (other) streamtrees. The basic idea (implemented in calcRenderingOrder() and setDisplayOrder()) is, e.g.:

  1. given a set of 3 connected streamtrees stream $i$ with child streams $j,k$
  2. Create a structure encoding each streamtrees as nodes in a (non-bifurcating) tree structure
  3. Order child nodes by the divergence/temporal value of where they branch off the parent, e.g. $[j, k]$ where $j$ branches off $i$ earlier than $k$
  4. Post-order traversal of this structure to determine rendering order of $[j, k, i]$ which avoids any crossings

One side effect of this is that the earliest child streams will always be positioned higher than any subsequent children. For instance in this flu example 3C.2a2 and 3C.2a3 are rendered at the top of the tree (LHS of figure), however there is a better positioning available for them (RHS):

Image

This improvement should be achievable within calcRenderingOrder() - while we haven't yet calculated display orders we shouldn't need these, only the span of divergence/temporal values occupied by each streamtree which is simply the streamPivots array.


Separately, all child streamtrees ($j,k$ in the above example) are always positioned above their parent, but we can (conceptually) rotate these to improve the appearance. For instance, we can choose to draw the {1,1a,1a.1} connected set of streamtrees below the parent (orange stream):

Image

I'm less certain about how to choose when to rotate nodes, so this is more of a speculative "something to look into" topic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: lowTo be resolved after high and moderate priority issuesstreamtrees

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions