Nothing Special   »   [go: up one dir, main page]

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

Type abscissaScale and ordinateScale more strictly #1443

Merged
merged 2 commits into from
Jun 8, 2023
Merged

Conversation

axelboc
Copy link
Contributor
@axelboc axelboc commented Jun 7, 2023

Follow-up to #1431 to enforce stricter types for the internal createScale and getCanvasScale utility functions, and therefore for abscissaScale and ordinateScale (exposed through VisCanvasContext).

To do so, I've added a generic to Scale, in order for abscissaScale and ordinateScale to be typed as Scale<AxisScaleType>, and I've reintroduced AxisScale (removed in #1431, as before it incorrectly meant "any of the supported scales") as an alias to this type.

The Storybook was still saying that the type of abscissaScale and ordinateScale was AxisScale even though it had basically been renamed to Scale in #1431. But with the stronger typing and the reintroduction of AxisScale, it is now correct.

packages/lib/src/index.ts Show resolved Hide resolved
packages/lib/src/vis/models.ts Show resolved Hide resolved
packages/lib/src/vis/utils.ts Show resolved Hide resolved
@axelboc axelboc requested a review from loichuder June 7, 2023 11:07
@axelboc axelboc merged commit 6474a32 into main Jun 8, 2023
@axelboc axelboc deleted the stricter-scale branch June 8, 2023 06:39
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.

2 participants