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

Blend branch coloring #896

Closed
trvrb opened this issue Feb 14, 2020 · 6 comments
Closed

Blend branch coloring #896

trvrb opened this issue Feb 14, 2020 · 6 comments

Comments

@trvrb
Copy link
Member

trvrb commented Feb 14, 2020

Right now, a branch inherits tip color as shown here:

Screen Shot 2020-02-13 at 4 13 15 PM

However, this color is only really true at the right-most edge of the branch. Ie each of these tips is definitely in their place of sampling at the time of sampling but as we go back things should get more uncertain. In fact the left-most edge of the branch should be the same gray as the right-most edge of the parent branch. This should appear as a continuous process.

I actually think it shouldn't be too difficult to have a SVG gradient for each branch line (https://stackoverflow.com/questions/42874203/linear-gradient-across-svg-line). The gradient end points would be chosen as:

  • right: current branch color
  • left: parent branch color

I suspect this will result in a more natural, interpretable visualization.

@jameshadfield
Copy link
Member

Yes -- the way we draw branches can often be misleading like this (see discussion on #200 for our thoughts 2 years ago!). SVG computation / rendering is a sizeable bottleneck in animations, so perhaps we'd have to fall-back to the current method if this slows things down, but I don't see a problem there. Seems to be pretty simple to implement in d3.

@trvrb
Copy link
Member Author

trvrb commented Feb 14, 2020

I didn't think of this animation issue. Thanks James!

@jameshadfield
Copy link
Member

Update -- this issue has a partial solution, but is in need of further work to complete, as detailed in #897 (comment). Contributions on top of this PR #897 are very welcome -- please leave a comment there if you start work on it!

@cpsandbox
Copy link
Contributor

Contributed pr #947 for this

@cpsandbox
Copy link
Contributor

updated pr #947

@jameshadfield
Copy link
Member

closed by the merge of #947

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

4 participants