Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Consistent option naming for alignment

Open LeeLenaleee opened this issue 2 years ago • 5 comments

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 avatar Jan 29 '22 12:01 LeeLenaleee

@LeeLenaleee Hi. Let's discuss some specific cases:

  1. Text align - left and right are more common values to my mind in this case
  2. Same with four directions 'top' | 'left' | 'bottom' | 'right'
  3. Here https://github.com/chartjs/Chart.js/blob/eee1bf257bb49438a6fa57f21d951c91965241e5/types/index.d.ts#L1939 should be both namings

What do you think about it?

dangreen avatar Aug 31 '22 18:08 dangreen

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.)

igorlukanin avatar Sep 02 '22 08:09 igorlukanin

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 avatar Sep 02 '22 12:09 etimberg

@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?

dangreen avatar Sep 07 '22 12:09 dangreen

That's fine by me

etimberg avatar Sep 07 '22 12:09 etimberg