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

Update stale documentation for axis titles #9683

Merged
merged 4 commits into from Nov 29, 2021
Merged

Update stale documentation for axis titles #9683

merged 4 commits into from Nov 29, 2021

Conversation

carsonalh
Copy link
Contributor

@carsonalh carsonalh commented Sep 25, 2021

Updated the documentation for the types on axis labels.

In the corresponding index.esm.d.ts file, put JSDoc descriptions for the properties to match the now-updated documentation.

Closes #9682

Updated the documentation for the types on axis labels.

In the corresponding `index.esm.d.ts` file, put JSDoc descriptions for
the properties to match the now-updated documentation.
@carsonalh carsonalh changed the title Update stale documentation for axis titles (#9682) Update stale documentation for axis titles (closes #9682) Sep 25, 2021
@carsonalh carsonalh changed the title Update stale documentation for axis titles (closes #9682) Update stale documentation for axis titles Sep 25, 2021
@LeeLenaleee
Copy link
Collaborator

The links in the docs shouldn't be changed, the reason it's done like this is because from a lot of places in the docs there are links to those places so if the typing changes you only have to adjust it in 1 place.

While looking at the docs and the types it seems that according to the typing the padding can either be a number or on object like so: {top, bottom} while according to the docs it should be either a number, object containing {top, bottom, left, right} or an object containing {x, y}.

If you could confirm if all of those work and update the typefile accordingly it would be nice

@etimberg etimberg added this to the Np&j4HJ milestone Sep 25, 2021
Inserted extra information in the documentation for the type of the
padding, inserted missing full stops.

In the type file, added JSDoc for undocumented properties.
@carsonalh
Copy link
Contributor Author

The links in the docs shouldn't be changed, the reason it's done like this is because from a lot of places in the docs there are links to those places so if the typing changes you only have to adjust it in 1 place.

While looking at the docs and the types it seems that according to the typing the padding can either be a number or on object like so: {top, bottom} while according to the docs it should be either a number, object containing {top, bottom, left, right} or an object containing {x, y}.

If you could confirm if all of those work and update the typefile accordingly it would be nice

The old version of the documentation made it clear that the left and right properties are not implemented, so they weren't in the type file. I tested in version 3.5.1 and the {x, y} format for padding doesn't seem to work either, so I've left the type unchanged, in both the type file and the documentation.

@etimberg
Copy link
Member

I looked at the code. It should support x/y assignment as well for padding

export function toTRBL(value) {
return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});
}
so the documentation is correct. The correct change will be to update the typescript types to support X/Y assignment

@etimberg etimberg removed this from the ? milestone Sep 30, 2021
docs/axes/labelling.md Outdated Show resolved Hide resolved
types/index.esm.d.ts Show resolved Hide resolved
@kurkle kurkle added this to the Version 3.6.1 milestone Nov 29, 2021
@kurkle kurkle merged commit 5e5339d into chartjs:master Nov 29, 2021
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.

Documentation for axis titles is out-of-date
4 participants