Support adjusting scale factors of the tree
- Dominant language
- JavaScript
- Stars
- 56
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
From talking with @kwcantrell about this recently (IIRC), I don't think the actual 4020 x 4020 width x height values matter given how the Empress drawer works -- what matters is the ratio between them (so setting e.g. 4020 x 2010 will make the plot wider than it is tall, the opposite will make the plot taller than it is wide, etc.)
I think this should only? make a difference for the rectangular layout, since it'll allow us to stretch out the vertical distance between tips. The current distance is pretty small, so when ultrametric trees are used (like the Qemistree example in Fig. 2B)...

... The tips look kind of like a blob.
Setting the width to 1005 (so the ratio is now 1005 x 4020, aka 1 x 4) makes the tree look _a lot_ prettier:

Steps required for this, I think:
- [ ] Change the (default) width/height from 4020 x 4020 to 1 x 1, so it's easier for users to understand
- [ ] Create UI elements that allow user to change these values (should be in layout options) -- maybe changing them auto-relayouts the tree, or there's an update button (idk)
- [ ] have side panel? detect when the ratio values change and update these as Empress.js attributes
- [ ] add tests with different ratios I guess
Contributor guide
Research direction
Start by tracing the layout options UI and the code that passes dimensions to Empress.js. Check how the rectangular layout currently uses the 4020 x 4020 scale factors, then add controls and tests for differing width-to-height ratios. Done means users can adjust the ratio and the rectangular tree visibly relayouts with the requested proportions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100