Feature request: a framework render slot for axis tick labels
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- data-visualization
Línea de trabajo
Start by reading the axis tick configuration under scales.y and the existing tooltip render path, RendererChart from @tanstack/charts/react/tooltip. The issue suggests either an axis render slot or exposing resolved tick positions and the plot rect, so the API and layout behavior still need design. Done means framework-rendered tick labels can be positioned and sized by the chart without duplicating plot layout math.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version: @tanstack/charts 1.0.0, React adapter
Problem
Tick labels are SVG text. ticks.format returns a string. There is no way to render a framework component (an icon, an image, a styled badge) as a tick label.
Recharts lets you pass a component as tick. We used this for an Elo chart. Each y tick shows a skill level icon and the Elo value next to it. Each x tick on one variant shows a styled match result marker.
The tooltip already has a framework render path (RendererChart from @tanstack/charts/react/tooltip). Tick labels do not.
Our workaround
We hide the axis labels in the chart and render them as HTML over the plot. The component must know the plot layout:
- the y position of each tick, as a fraction of the y domain
- the x position of each tick, as a fraction of the x domain
- the plot insets and the x padding, so that the HTML labels line up with the SVG plot
Simplified from our code:
// Our own copy of the plot insets (example values). It must match the
// chart definition.
const layout = { top: 8, bottom: 24, start: 72, end: 8, xPadding: 12 };
<Frame>
<Chart definition={definition} ariaLabel={label} height={height} />
<YAxisLayer
style={{
insetBlock: `${layout.top}px ${layout.bottom}px`,
inlineSize: layout.start - TICK_GAP,
}}
>
{yTicks.map(tick => (
<SkillTick key={tick} value={tick} offset={getYFraction(yDomain, tick)} />
))}
</YAxisLayer>
<PlotLayer
style={{
insetBlock: `${layout.top}px ${layout.bottom}px`,
insetInline: `${layout.start + layout.xPadding}px ${layout.end + layout.xPadding}px`,
}}
>
{rows.map(row => (
<ResultTick key={row.x} row={row} position={getXFraction(xDomain, row.x)} />
))}
</PlotLayer>
</Frame>
This works, but:
- We copy the scale math and the plot insets into the component. If the library changes its layout, the labels move away from the plot.
- The library cannot measure the labels, so we reserve the label space by hand (a fixed gap and a fixed width).
- The labels are not part of the chart accessibility tree.
Suggested API
A render slot on the axis, for the adapters that support it. For example:
scales: {
y: {
scale: scaleLinear,
axis: {
ticks: {
render: tick => <SkillTick value={tick.value} />,
// the space the library reserves for each label
size: { width: 64, height: 24 },
},
},
},
},
The library positions each slot at the tick, like it does for the tooltip. An alternative is to expose the resolved tick positions and the plot rect to the framework layer (for example through a callback or a hook), so that an overlay does not have to copy the math.
Written by an agent (Claude Code, claude-opus-5-5).
- Lenguaje dominante
- TypeScript
- Estrellas
- 842
- Forks
- 53
- 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 4 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 3 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
[Feature] Readable outside labels for crowded pie and donut chartsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
TanStack/charts#227 · 2 comentarios ·
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
Todos los issues de TanStack/charts
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
auth: agent-bearer --manager-call is told to use the MCP instance argument on an ambiguous managerAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
Lyric and ApostrophesAbiertobug module: playback
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chthollyphile/folia-major#739 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agilepathway/label-checker#773 · 2 comentarios ·
Los mantenedores suelen responder en 1 día