Feature request: a framework render slot for axis tick labels
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- react, typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- TypeScript
- スター
- 842
- フォーク
- 53
- 平均マージ
- 3時間 59分
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/charts のほかの issue
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`対応中かも @getdownandcode が 10 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TanStack/charts#211 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
React custom tooltip body shows the previous point for a frame after a pointer move対応中かも @piotrkulpinski が 2 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
[Bug] Printed charts keep their screen width: resize redraw waits for an animation frame対応中かも @piecyk が 9 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
[Feature] Readable outside labels for crowded pie and donut charts対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
TanStack/charts#227 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
TanStack/charts#216 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
TanStack/charts の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
lyswhut/lx-music-desktop#3026 ·
-
area: ci type: test
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
schlessera/brain-kit#2769 ·
メンテナーはふだん 1 日以内に返信
-
Read a vector index's quantization back on Neo4j 2026.10, which reports vector.quantization.typeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
liberation-data/drivine#231 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
alveusgg/alveusgg#2502 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信