Chart.js
Chart.js copied to clipboard
Consistent option naming for alignment
Feature Proposal
Comming from https://github.com/chartjs/Chart.js/pull/10106#discussion_r795044454 make all alginment's start
, center
and end
instead of left
, center
and right
.
Will also make it easyer to work with since its more consistent instead of 2 kind of naming scheme's
Possible Implementation
No response
@LeeLenaleee Hi. Let's discuss some specific cases:
- Text align -
left
andright
are more common values to my mind in this case - Same with four directions
'top' | 'left' | 'bottom' | 'right'
- Here https://github.com/chartjs/Chart.js/blob/eee1bf257bb49438a6fa57f21d951c91965241e5/types/index.d.ts#L1939 should be both namings
What do you think about it?
I don't have a hard opinion about this, I just wonder how this will evolve. Should these "alternative" options be kept indefinitely in the code? Or, should at some point the backward compatibility be broken so that everyone has to go and replace left
/right
to start
/end
in their options?
My wild guess is that this will never be a reason to break the compatibility so Chart.js will stay with these pair of alternative options forever. (And end users will have to deal with longer lists of options in the autocompletion.)
I believe the reason we have start
and end
is because some of the alignment options are for axes and apply for both horizontal and vertical axes. We wanted consistent names so that X and Y scales had the same options, hence choosing the alternate values.
Is there a list of what options still use left/right/top/bottom? Maybe some are in cases where is makes sense to keep those because they don't change orientation
@etimberg @LeeLenaleee I'm started to dig into this task and I see that it needs much time to implement, but I don't see much profit in it. Also, I can say, that if the codebase will be rewritten completely in TypeScript, it will much easier to implement. So my suggestion is to wait until we rewrite the whole project into TypeScript. What do you think?
That's fine by me