[Feature] Crosshair label: a background box, and a way to paint it above the tooltip
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
issue にはファイル名もテスト名も記載されていません。まず crosshair ラベルの renderer と SVG/export パスを見つけ、次に関連するテストを確認してください。ボックスが設定されていない場合に halo をデフォルトとして維持しながら、ラベルが要求された角丸背景のオプションをレンダリングできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Version: reported on @tanstack/charts 0.16.0; still absent in 1.1.0 (57774e1).
crosshair({ x: { label } }) renders the axis label as two <text> nodes: a stroked halo (stroke, strokeWidth, strokeOpacity, round joins) beneath the filled text. That is right for a label over gridlines, but a common tooltip idiom is a "date pill": the focused x value in a rounded box with its own background, padding: 4px 16px, border-radius: 9999px, and a contrasting text colour (Recharts users hand-roll this, Nivo's crosshair has none, ECharts axisPointer.label ships backgroundColor, padding, borderRadius).
Migrating such a component with the halo alone leaves a glyph-shaped blob: with fontSize: 14, strokeWidth: 20 the halo measures 62×30 px where the box was 77×32 px, and the outline follows the letter shapes instead of a rounded rectangle. strokeWidth trades width against height, so no value reproduces the box, and there is no way to give the label horizontal padding different from vertical.
Would it be possible to add a background (or box) option to the crosshair label — fill, fillOpacity, padding (number or { x, y }), radius, stroke — rendered as a <rect> sized from the measured text and emitted through the same SVG/export path as the halo? The halo could stay as the default when no box is set.
Paint order (moved here from #188 C)
The same pill also has to sit above the tooltip, which it cannot today:
- Guide labels are SVG nodes in
g.ts-chart__focus-guide-layer--under|over(svg-renderer.ts:81).placementonly orders them against marks (scene.ts:422-425). - The tooltip is an HTML element appended after the SVG (tooltip.ts:176) with
z-index: 1(tooltip.ts:419-421), so it covers all SVG content. - Not testable in jsdom (needs layout).
Expected: an opt-in way to paint the crosshair label above the tooltip. An HTML label layer would give both the box and the order; a tooltip layer option would give the order alone.
- 主要言語
- TypeScript
- スター
- 870
- フォーク
- 57
- 平均マージ
- 11時間 58分
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/charts のほかの issue
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`対応中かも @getdownandcode が 37 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TanStack/charts#211 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add reverse options to waffleY and waffleX対応中かも @tannerlinsley が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
TanStack/charts の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
fb55/htmlparser2#2579 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue needs-review
難易度 1/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
Add Module DB Rulesオープンdocumentation public
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
midnightntwrk/umbradb#65 ·
メンテナーはふだん 2 日以内に返信
-
area/channels kind/bug priority/medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nanocoai/nanoclaw#4501 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs verification
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 13 日以内に返信