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

Fix TypeScript errors in Axis components #221

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

rgieseke
Copy link
Contributor

Here are fixes for the Axis components. I think they wouldn't be too overwhelming for non-Typescript users as discussed in #218

If you're fine with that level of additional typing I could try and see where else I could make similar changes (probably in bits whenever I have some time).

One thing I'm not sure about in this PR is the whether this is correct. Can the Array only contain numbers, or also potentially strings?

/** @type {Number|Array<Number>|Function|undefined} [ticks] - If this is a number, it passes that along to the [d3Scale.ticks](https://github.com/d3/d3-scale) function. If this is an array, hardcodes the ticks to those values. If it's a function, passes along the default tick values and expects an array of tick values in return. If nothing, it uses the default ticks supplied by the D3 function. */
export let ticks = undefined;

@mhkeller
Copy link
Owner

These look great. I had thought we'd have to do more inline type definitions such as function thing (d /* type stuff here*/) { } which would visually throw some folks off.

@rgieseke
Copy link
Contributor Author

These look great. I had thought we'd have to do more inline type definitions such as function thing (d /* type stuff here*/) { } which would visually throw some folks off.

Yes, fully agreeing!

I need to give this more thought, I think the different ticks, tickVals and format function types need to be properly aligned.

@rgieseke rgieseke marked this pull request as draft June 27, 2024 21:37
@rgieseke rgieseke marked this pull request as ready for review June 28, 2024 14:46
@mhkeller mhkeller merged commit d3beb5e into mhkeller:main Jun 28, 2024
4 checks passed
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