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

AG-10444 Increase axis ticks on zoom #3329

Merged
merged 10 commits into from
Jan 7, 2025
Merged

AG-10444 Increase axis ticks on zoom #3329

merged 10 commits into from
Jan 7, 2025

Conversation

jacobp100
Copy link
Contributor

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Snapshots automatically updated, please review before merge: diff

@jacobp100 jacobp100 requested a review from a team as a code owner January 6, 2025 14:47
Copy link
Contributor

github-actions bot commented Jan 6, 2025

Snapshots automatically updated, please review before merge: diff

1 similar comment
Copy link
Contributor

github-actions bot commented Jan 6, 2025

Snapshots automatically updated, please review before merge: diff

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Snapshots automatically updated, please review before merge: diff

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Snapshots automatically updated, please review before merge: diff

tickLayoutDomain = this.calculateTickLayout(domain, NiceMode.TickAndDomain, [0, 1]).niceDomain;
}

let niceMode: NiceMode;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes an issue where ticks would be in the wrong place. You do want to use a nice domain, but the nice domain of the zoomed out series. This means when generating the ticks, you'll still have nice ticks, but the domain won't be adjusted

@@ -9,7 +9,7 @@ export interface ScaleTickParams<I> {
}

export interface ScaleFormatParams<D> {
visibleTicks: D[];
domain: D[];
ticks: D[];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ticks is now the visible ticks

override ticks(
params: ScaleTickParams<TimeInterval | number>,
domain: Date[] = this.domain,
visibleRange: [number, number] = [0, 1]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All scales now use visible range, and will only return the visible ticks

Copy link
Member

@alantreadway alantreadway left a comment

Choose a reason for hiding this comment

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

LGTM, maybe @iMoses should review too?


let tickDomain: D[] = niceDomain;
let rawTicks: any[];

// @todo(xxx) - removing this references makes TS errors
const scaleStopTsComplaining = scale;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Is this still needed, I tried removing it locally and don't see any TS errors?

@alantreadway alantreadway requested a review from iMoses January 7, 2025 12:19
Copy link
Contributor

@iMoses iMoses left a comment

Choose a reason for hiding this comment

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

LGTM

}) {
const t = getTickInterval(start, stop, tickCount, minTickCount, maxTickCount);
return t ? t.range(new Date(start), new Date(stop)) : []; // inclusive stop
return t ? t.range(new Date(start), new Date(stop), undefined, visibleRange) : []; // inclusive stop
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: be explicit with the extend parameter and supply false instead of undefined
ditto for the other 2 cases on this file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passing in an options object instead

@@ -474,38 +474,56 @@ export abstract class Axis<
this.animatable = animatable;
}

_niceDomainRange: number = NaN;
_scaleNiceDomainRange: number = NaN;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe call it _scaleNiceDomainRangeExtent, not to be confused with a range, which is what we conventionally call an array of min, max?

this.dataDomain.domain,
visibleRange,
initialPrimaryTickCount
);

const range = findRangeExtent(this.range);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: rename to rangeExtent?

@jacobp100 jacobp100 merged commit b836f42 into latest Jan 7, 2025
26 checks passed
@jacobp100 jacobp100 deleted the AG-10444 branch January 7, 2025 15:30
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