OpenTreeOfLife / tree-illustrator

Generate repeatable, data-driven, publication quality figures of trees.
BSD 2-Clause "Simplified" License
7 stars 3 forks source link

Watch for ugly paths at high magnification #8

Open jimallman opened 9 years ago

jimallman commented 9 years ago

So far we're getting pretty good results with the rectangular and circular layouts, but in some cases (like the root node of this cladogram) things are a little clunky: screen shot 2015-04-08 at 11 54 36 am

@jar398 suggests that we might remedy this by simply extending edges, or using more complex paths instead of isolated segments.

rhr commented 9 years ago

Is it possible to specify a rounded cap style? That would improve the terminal branches as well.

Using paths is probably more efficient for rendering - at least that's what we found with the interactive SVGs in phylografter.

jimallman commented 9 years ago

Using paths is probably more efficient for rendering - at least that's what we found with the interactive SVGs in phylografter.

We do actually use path elements (vs lines) all the current layouts. But each edge is a distinct path, so there are just some edge cases where multiple edges converge on a single node and their paths don't visually "merge" nicely (see the root node above).

Is it possible to specify a rounded cap style? That would improve the terminal branches as well.

Yes, the stroke-linecap options are shown here. This style is applied per-path, so we can't have one square and one rounded end on a path.

Note also the stroke-linejoin attribute on the same page, which is how we could tailor the appearance of the root node example above. If we're stubborn about wanting mitered joints here. But that would require combining all edges that join at the node into a single path. It's far easier to use the rounded cap!

rhr commented 9 years ago

I think that many paths of 1 line segment each is more expensive to render than 1 path of many segments. A consequence is that segments can't be individually styled, so e.g. to thicken well-supported branches an additional path would need to be overlain.

jimallman commented 9 years ago

A consequence is that segments can't be individually styled

Right. I think we have the right balance already: a single path for each edge in the tree, which might include several points, segments and arcs (see attached). screen shot 2015-04-08 at 1 31 15 pm