Streamline xanchor and yanchor names for center/middle
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
The 'xanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'left', 'center', 'right']
The 'yanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'top', 'middle', 'bottom']
This is for plotly 6.3.0 trying to use fig.add_annotations() but it likely applies everywhere where xanchor and yanchor are used.
It does make sense that for the extremes of the bounding box left right top bottom, the names are different, but why is 'center' used for x direction and 'middle' for y direction? This distinction seems artifical to me and I wonder why this was chosen?
I propose to streamline the naming conventions, but now for backwards compatibility to at least accept both center/middle for x/yanchor.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the fig.add_annotations() entry point and locate how xanchor and yanchor values are validated. Check whether the same validation is shared elsewhere, then review any related tests. Done should include backward-compatible acceptance of both center and middle where appropriate, with existing values still working.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100