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

For text, allow x and y to be specified as constant numbers #523

Closed
mbostock opened this issue Aug 24, 2021 · 4 comments
Closed

For text, allow x and y to be specified as constant numbers #523

mbostock opened this issue Aug 24, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

For manual labels, it’d be nice if you could specify x and y as constant numbers. Currently they can either be a channel or null; in the latter case the labels are placed in the center of the chart.

Related, it might also be nice to have an anchor option which allows the text to be positioned somewhere else relative to the surrounding frame; this would eliminate the need to hard-code dx and dy (e.g., in the geofacet example). The anchor option could accept values such as top, top-left, top-right, right, etc.

@mbostock mbostock added the enhancement New feature or request label Aug 24, 2021
Fil added a commit that referenced this issue Nov 24, 2021
… the anchor

anchor can be any of "top", "bottom", "left", "right" or combinations such as "top-left"

closes #523
Fil added a commit that referenced this issue Dec 17, 2021
… the anchor

anchor can be any of "top", "bottom", "left", "right" or combinations such as "top-left"

closes #523
@Fil
Copy link
Contributor

Fil commented Jan 6, 2022

Related #153

@mbostock
Copy link
Member Author

Related multi-line text #677 #313 #327. Specifically #677 introduces a lineAnchor property which controls vertical position of lines relative to the anchor point.

@mbostock
Copy link
Member Author

I don’t think we want to introduce this convention of literal positioning, and especially that we’d want x and y to behave differently for text marks. But I could see a frameAnchor option that controls the position for otherwise position-less marks; it would default to middle for the current behavior.

@mbostock
Copy link
Member Author

Closing in favor of #683.

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

Successfully merging a pull request may close this issue.

2 participants