[FEATURE]: Flexible tick label positioning on categorical axes (anchoring + between-category placement)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript
- Ambito
- data-visualization
Direzione di ricerca
La issue non indica file, test o punti di ingresso; inizia individuando il rendering delle etichette dei tick dell’asse categoriale e i relativi test esistenti in plotly.js. Definisci l’ambito tra l’ancoraggio orizzontale e il posizionamento frazionario, quindi verifica che le etichette categoriali raggruppate possano essere allineate a sinistra, al centro o a destra e che le posizioni tra le categorie si comportino correttamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Add support for more flexible positioning of tick labels on categorical axes, to correctly handle grouped or hierarchical categories—especially when groups contain an even number of items.
Specifically, this request proposes:
- Configurable horizontal text anchoring for tick labels (left, center, right), and
- Optional placement of tick labels at fractional (non‑data) axis positions, i.e. between two categorical ticks.
Currently, tick labels are always centre‑anchored on discrete tick positions, which prevents accurate or visually correct centring for even‑sized groups.
Why should this feature be added?
This is a recurring UX limitation in real‑world charts that use:
- grouped or hierarchical categorical axes,
- experimental or test‑matrix layouts,
- manufacturing and operational visualisations.
For even‑sized groups, the true visual centre lies between two categories, but:
- tick labels cannot be placed between ticks,
- text anchoring cannot be adjusted,
- whitespace or HTML hacks are neutralised by automatic centring,
- annotations are not a clean substitute for tick labels.
Providing:
- anchor control (left / centre / right) would address many alignment issues with minimal complexity, while
- fractional tick‑label positioning would solve the problem exactly for grouped categories.
Together, these features would significantly improve readability, reduce workarounds, and enable precise hierarchical labelling without breaking Plotly’s axis model.
Mocks / Designs
Conceptually:
- a grouped label whose left edge aligns with a group boundary (e.g. at x = 1.5),
- or a label centred between two categorical ticks rather than on a data point.
A simple screenshot of a grouped categorical axis with an even number of categories clearly illustrates the current limitation.
Notes
- Applicable to plotly.js and all language bindings (Python, R, etc.).
- Most visible when compressing or centring hierarchical tick labels.
- Proposed as:
- Primary feature: tick‑label horizontal anchoring
- Advanced extension: fractional / between‑category tick placement
- Lingua principale
- JavaScript
- Stelle
- 18.3k
- Fork
- 2k
- Merge medio
- 2g 12h
- PR unite (30g)
- 28
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di plotly/plotly.js
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
chore P1 plotly-internal size: 1 task
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
-
chore P3 plotly-internal size: 1 task
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug infrastructure P2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
Tutte le issue di plotly/plotly.js
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy-website#2595 ·