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

Cluster labels are clipped at initializtion of plot #6

Open
chasemc opened this issue Feb 25, 2021 · 1 comment
Open

Cluster labels are clipped at initializtion of plot #6

chasemc opened this issue Feb 25, 2021 · 1 comment

Comments

@chasemc
Copy link
Contributor

chasemc commented Feb 25, 2021

Cluster labels are clipped off left side of plot area:
image

It seems to be caused by the static-setting of the translation below, but I'm not yet well-versed in D3 so I'm not going to suggest a fix:

.translate(20, 50)

@gamcil
Copy link
Owner

gamcil commented Mar 8, 2021

Yeah, you're correct - currently it's just the arbitrary translation with the expectation that the user will click/drag the figure into view. It's a little tricky since I use x=0 as the base point for gene clusters to get drawn, with labels being right aligned from that point (therefore going negative to varying degrees for each label). The easiest way around this is probably to implement some bounding box check after the figure is generated for the first time, then setting the zoom translation on the base element (perhaps similar to https://observablehq.com/@d3/zoom-to-bounding-box). Either that or just a more generous initial translation to account for longer labels. I don't have a lot of time right now to implement something, so please feel free to have a stab at it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants