[Feature] Readable outside labels for crowded pie and donut charts
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- d3, typescript
- Área
- data-visualization
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- TypeScript
- Estrellas
- 819
- Forks
- 49
- Merge medio
- 4 h 40 min
- PR fusionados (30 d)
- 16
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/charts
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`Posiblemente ocupada @getdownandcode la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TanStack/charts#211 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug] Printed charts keep their screen width: resize redraw waits for an animation framePosiblemente ocupada @piecyk la tomó hace 2 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
TanStack/charts#216 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
TanStack/charts#214 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/charts
Issues similares
-
Endpoint links in the tag operations list are below the 24px target sizePosiblemente ocupada @AdzerKI la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
ai-driven-qa bug Minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
linagora/twake-tasks#435 ·
Los mantenedores suelen responder en 1 día
-
bug domain: database priority: p1 Stellar Wave
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
StellarState/SS-backend#632 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
A2A audit timestamps end in +00:00Z (invalid ISO 8601)Posiblemente ocupada @O1sumitkumar la tomó hoy. Abiertobug good first issue help wanted python
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
`cf complete zsh >> .zshrc` fails on vanilla zshQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cloudflare/cf#340 ·
Los mantenedores suelen responder en 1 día