[Feature] Readable outside labels for crowded pie and donut charts
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- d3, typescript
- Ambito
- data-visualization
Direzione di ricerca
Start with the existing radialRule and radialText marks and the pie(...) helper used in the snippet, to see how outside labels are positioned by slice angle today. The proposed radialLabels mark would need a side-by-side stacking and collision-resolution layout, so the API shape (new mark or a radialText option) should be agreed with maintainers before any code. Done means labels on both sides of the pie do not overlap, stay within chart bounds, hide lowest-priority labels first, and respect maxShift, with tests.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
When a pie has many small, adjacent slices, outside labels made with
radialRule + radialText are placed on their slice angle and overlap.
There is no built-in way to spread or hide them, so apps must write their own
pixel layout.
const browsers = [
{ name: 'Chrome', share: 64.2 }, { name: 'Safari', share: 18.9 },
{ name: 'Edge', share: 5.4 }, { name: 'Firefox', share: 3.1 },
{ name: 'Samsung', share: 2.4 }, { name: 'Opera', share: 2.0 },
{ name: 'UC', share: 1.2 }, { name: 'Yandex', share: 0.9 },
{ name: 'Vivaldi', share: 0.7 }, { name: 'Brave', share: 0.6 },
{ name: 'Other', share: 0.6 },
]
Proposal
A radialLabels polar mark that draws outside labels with elbow connectors:
- labels stack on each side of the pie, in slice order;
- overlapping labels move apart as little as possible, inside the chart bounds;
- when a side is full, the lowest-
prioritylabels hide first (default:value, so the smallest slices); - optional
maxShifthides labels that would move too far from their slice.
radialLabels(pie(browsers, { value: 'share' }), {
text: (row) => `${row.name} ${row.share}%`,
key: 'name',
color: 'name',
maxShift: 24,
})
I have a working implementation with tests and docs, and can open a PR if this direction fits.
Happy to change the API shape (for example, an option on radialText instead of a new mark).
- Lingua principale
- TypeScript
- Stelle
- 819
- Fork
- 49
- Merge medio
- 4h 58m
- PR unite (30g)
- 15
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi 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 TanStack/charts
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`Forse già presa @getdownandcode l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TanStack/charts#211 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Printed charts keep their screen width: resize redraw waits for an animation frameForse già presa @piecyk l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 57/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TanStack/charts
Issue simili
-
useFragment does not require `variables` when the fragment's variables type has required fieldsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apollographql/apollo-client#13493 ·
I maintainer di solito rispondono entro 1 giorno
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backendsForse già presa @roboomp l’ha presa oggi. Apertabug prio:p2 providers triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
can1357/oh-my-pi#15798 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
code-yeongyu/oh-my-openagent#10172 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
PDFCraftTool/pdfcraft#189 ·
-
Add the Yahoo chart API duplicate last-day row (yfinance#573) to incidents.md (about 1 hour)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertadata docs good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
pacocartones/market-data-sanity-checker#160 ·
I maintainer di solito rispondono entro 1 giorno