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

types for xDomain #117

Closed
MCMattia opened this issue Mar 5, 2023 · 4 comments
Closed

types for xDomain #117

MCMattia opened this issue Mar 5, 2023 · 4 comments
Labels
awaiting-merge Finished in a branch, will be included in next release

Comments

@MCMattia
Copy link

MCMattia commented Mar 5, 2023

Hi guys, I have been using your library to make a simple 3 line graph. It works very good. Thank you for your work.

I'm using yDomain in the following way:
yDomain={[0, null]}

Since the types for yDomain are:
[min: ?Number, max: ?Number]
Typescript is warning that null is not assignable to a number.

I think that the types for xDomain or yDomain, should be:
Array:[min: ?Number|null, max: ?Number|null]|String[]|Number[]|Function
instead of:
Array:[min: ?Number, max: ?Number]|String[]|Number[]|Function

Basically adding the null option since as you document on your website:
If you want to inherit the value from the data's extent, set that value to null.

@mhkeller
Copy link
Owner

mhkeller commented Mar 5, 2023

Great catch – thanks! I'll put in a fix for this.

@mhkeller
Copy link
Owner

mhkeller commented Mar 6, 2023

@MCMattia this is done in this branch. Svelte kit has updated the way that it packages libraries and it requires changing the deployment and packing system, which I won't be able to do today. I need to make sure it doesn't mess a bunch of things up. Hopefully it won't be too much trouble and you can add a ts ignore for now.

@mhkeller mhkeller added the awaiting-merge Finished in a branch, will be included in next release label Mar 6, 2023
@MCMattia
Copy link
Author

MCMattia commented Mar 6, 2023

Hi @mhkeller thank you for this work. For now I have manually fixed it in the LayerCake.svelte.d.ts file

@mhkeller
Copy link
Owner

This is updated in 7.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-merge Finished in a branch, will be included in next release
Projects
None yet
Development

No branches or pull requests

2 participants