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

Use dynamic category axis tick spacing #3590

Merged
merged 3 commits into from
Nov 17, 2021
Merged

Conversation

michael-yx-wu
Copy link
Contributor

Spacing is based on font size
@blueprint-bot
Copy link

Lint

Demo: quicktests | fiddle

@@ -160,7 +160,7 @@ export class Category extends Axis<string> {
public getDownsampleInfo(scale: Scales.Category = <Scales.Category> this._scale, domain = scale.invertRange()): IDownsampleInfo {
// account for how shearing tightens the space between vertically oriented ticks
const shearFactor = this._tickLabelAngle === 0 ? 1 : 1 / Math.cos(this._tickLabelShearAngle / 180 * Math.PI);
const shearedMinimumWidth = Category._MINIMUM_WIDTH_PER_LABEL_PX * shearFactor;
const shearedMinimumWidth = Category._MINIMUM_WIDTH_PER_LABEL_PX * shearFactor;// + 2 * (this.tickLabelFontSize() - Label._MIN_FONT_SIZE_PX);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks nonfunctional, just a code comment...?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that was from trying to generate the screenshots. sorry about that

@blueprint-bot
Copy link

uncomment

Demo: quicktests | fiddle

@michael-yx-wu michael-yx-wu merged commit 6de5d3c into develop Nov 17, 2021
@michael-yx-wu michael-yx-wu deleted the mw/category-tick-spacing branch November 17, 2021 21:57
@michael-yx-wu michael-yx-wu changed the title Use dynamic cateogry axis tick spacing Use dynamic category axis tick spacing Jan 6, 2022
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

Successfully merging this pull request may close these issues.

3 participants