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

Support xOffset and yOffset as encoding channels #230

Open
tuner opened this issue Jan 29, 2024 · 0 comments
Open

Support xOffset and yOffset as encoding channels #230

tuner opened this issue Jan 29, 2024 · 0 comments
Labels
core Related to the Core package good first issue Good for newcomers Improvement Improve an existing functionality, don't introduce a new feature

Comments

@tuner
Copy link
Member

tuner commented Jan 29, 2024

Current situation

xOffset and yOffset are supported as mark properties and they translate the viewport. In addition, dx and dy are are sometimes supported as channels ("point" mark), sometimes as mark properties ("text" mark), and sometimes not at all. This is incompatible with Vega-Lite, which supports dx and dy as a mark properties in its "text" mark but not elsewhere. And nowhere as an encoding channel.

What to do

It might make sense to support xOffset and yOffset as channels instead and also implement x2Offset and y2Offset. In addition, dx and dy would be mark properties solely in "text" mark. However, the gene annotation track relies on dx as a channel to adjust the strand triangles' placement. Thus, this would be a breaking change.

Use cases

Lollipops

The y2Offset property would be useful with "lollipop" plots, where the bottom of the "stick" should be moved outside the scale to make a contact with the protein:

image
(source: https://www.mdpi.com/1422-0067/20/14/3442)

SV paws

The paws of the SV arcs can be implemented using the "point" mark. However, controlling the paw's "stroke width" is impossible and getting it's size to align nicely with the arc's stroke width is tricky. An alternative approach would be to use the "rule" mark and map the strand (paw direction) to xOffset with a nominal scale and a range comprising a negative and a positive value. Thus, xOffset would shift x to either left or right side of the arc's endpoint. In this case, x2Offset should be set to zero.

image

@tuner tuner added Improvement Improve an existing functionality, don't introduce a new feature core Related to the Core package good first issue Good for newcomers labels Jan 29, 2024
@tuner tuner changed the title Fix dx and dy channels Support xOffset and yOffset as encoding channels Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the Core package good first issue Good for newcomers Improvement Improve an existing functionality, don't introduce a new feature
Projects
None yet
Development

No branches or pull requests

1 participant