Skip to content

Cluster labels are clipped at initializtion of plot #6

Description

@chasemc

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)

Activity

  1. gamcil commented on Mar 8, 2021

    @gamcil
    Owner

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions