[FEATURE]: Flexible tick label positioning on categorical axes (anchoring + between-category placement)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 38/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- javascript
- Bereich
- data-visualization
Rechercherichtung
Das Issue nennt keine Dateien, Tests oder Einstiegspunkte; beginne damit, die Darstellung von Tick-Labels einer kategorialen Achse und die vorhandenen Tests dafür in plotly.js zu finden. Lege den Umfang zwischen horizontaler Verankerung und fraktionaler Positionierung fest und überprüfe anschließend, dass gruppierte kategoriale Labels links, zentriert oder rechts ausgerichtet werden können und dass Positionen zwischen Kategorien korrekt funktionieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.3k
- Forks
- 2k
- Ø Merge
- 2 T. 12 Std.
- Gemergte PRs (30 T.)
- 28
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus plotly/plotly.js
-
chore P3 plotly-internal size: 3 task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
-
bug P2 size: 1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
plotly/plotly.js#8057 · 3 Kommentare · 1 zugewiesene Person ·
-
chore P1 plotly-internal size: 1 task
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
-
chore P3 plotly-internal size: 1 task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Alle Issues in plotly/plotly.js
Ähnliche Issues
-
bot:ai-assisted component:compact-js status:untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
midnightntwrk/midnight-sdk#403 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 86/100
DavidAnson/markdownlint-cli2#940 ·
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100