[Feature] Readable outside labels for crowded pie and donut charts
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 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 },
]
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).
- 主要言語
- TypeScript
- スター
- 819
- フォーク
- 49
- 平均マージ
- 4時間 40分
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/charts のほかの issue
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`対応中かも @getdownandcode が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TanStack/charts#211 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Printed charts keep their screen width: resize redraw waits for an animation frame対応中かも @piecyk が 2 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
TanStack/charts#216 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 57/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
TanStack/charts#214 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
TanStack/charts の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 75/100
siyuan-note/siyuan#20629 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Volume eject does not refuse system, root or /home mounts対応中かも @bernardopg が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
spacedriveapp/spacedrive#3159 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
melgarafael/DeskcommCRM#3000 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
callstackincubator/simlock#639 ·
メンテナーはふだん 1 日以内に返信