Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Feature] Readable outside labels for crowded pie and donut charts

オープン
#227 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@hshoja がすでに取り組んでいます。

2026年10月14日 から。

  • #231 @hshoja による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
d3, typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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 },
]
Image
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-priority labels hide first (default: value, so the smallest slices);
  • optional maxShift hides 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,
})
Image Image

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).

主要言語
TypeScript
スター
819
フォーク
49
平均マージ
4時間 40分
マージ済み PR(30日)
16

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/charts のほかの issue

TanStack/charts の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。