-
Notifications
You must be signed in to change notification settings - Fork 51
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
Component | Axis | Add rotate
label fit mode
#315
Conversation
20d54f6
to
59ff561
Compare
@yanneves Thank you for this wonderful contribution and sorry for the delayed response! That's a great idea, and we're definitely going to add that feature to the library. There are a few things we'd like to discuss before we proceed:
@reb-dev Would you like to add anything to it? |
Thanks @rokotyan glad you like it! Yeah that makes sense to me.
👍
That would be nice. d3fc's implementation rotates dynamically based on the width of the axis but I struggled to get all those attributes in one place to calculate. You can see the logic I used based on 30deg rotation for vertical and 60deg rotation for horizontal axes at packages/ts/src/utils/text.ts:508. |
Yeah, that's probably an overkill. But I think it would be nice to be able to specify a custom angle when you need it. |
As for keeping rotation separate from I propose that we add a new axis configuration property (and a property in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @reb-dev thanks for testing out the branch and sharing feedback! sorry it's taken me this long to follow up the anchoring proved the most challenging, my aim was to centre the tick labels but I think having these work consistently with the vertical axis and anchor the right-side looks more correct, so tick label alignment should always be treated as sorry to say I won't get the chance to take this further myself, but you're welcome to use my contribution as the basis for getting this implemented should you need it |
Closing this. See details here |
Adds a new option
tickTextFitMode="rotate"
on the Axis component. Inspired by d3fc/d3fc'sd3fc-axis
.