biocore/empress

Support adjusting end angle of circular layout

开放

#509 创建于 2021年4月7日

 (2 条评论) (3 个反应) (0 位负责人)JavaScript (32 个派生)auto 404
feature requestgood first issuenice to have

仓库指标

星标
 (56 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

I thought we already had an issue for this, but apparently not!

Motivation: Lots of tree figures (e.g. Figure 1a in this paper I was reading) have a "gap" between between the start and end angle in the circular layout, which can look nice. In EMPress, we don't have this sort of gap by default, so the tree takes up an entire 360 degrees (or 2pi radians) of space:

lol

Changing this when re-doing the circular layout is actually pretty simple -- we should only need to adjust one line:

https://github.com/biocore/empress/blob/e543610c5654399aa1dcbbede09b45b45c4170d0/empress/support_files/js/layouts-util.js#L561

Changing the numerator in this line from 2*pi to 1.9*pi gives us this:

image

...And just 1*pi, for reference:

image

This even works well with barplots out of the box:

image

It should be possible to add a UI element (ideally the sort of thing that is only visible when the circular layout is active) that adjusts this value -- I guess it would be most user-friendly to take inputs in degrees and then transform them to radians internally.

A solution to this issue would pair really well with #359, although the issues aren't necessarily dependent on each other or anything.

贡献者指南