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

[Feature] Guide lines: a `shapeRendering` option for crisp hairlines

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

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

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

Start with packages/charts-core/src/types.ts to trace ChartGuideLineStyle and SceneStyle, then read packages/charts-core/src/scene.ts and packages/charts-core/src/svg-renderer.ts to follow guide-line styles into SVG output. Use the issue’s renderChartSvg repro as the starting check. Done when the requested rendering hint is emitted for grid, axis, and guide lines, and the repro passes.

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

説明

Version: @tanstack/charts 1.1.0 (57774e1).

ChartGuideLineStyle exposes stroke, strokeOpacity, strokeWidth, strokeDasharray and lineCap (types.ts:419-425). It has no rendering hint, and SceneStyle has none either (types.ts:1394-1404). The SVG renderer writes only those channels (svg-renderer.ts:206-216), and guideLineStyle copies only those five fields (scene.ts:1719-1735).

A 1px hairline grid on a fractional device offset is therefore anti-aliased across two rows at half intensity. Charts built on visx (whose GridRows defaults to shapeRendering="crispEdges") paint one crisp row. The only way to match that today is a CSS rule on the renderer's .ts-chart__grid line elements, which keys on a class name the docs do not promise.

Repro
import { renderChartSvg } from './svg'
// scene from any chart with a y axis grid, e.g. lineY with scales.y.grid: { strokeWidth: 1 }
expect(renderChartSvg(scene, { ariaLabel: 'c' })).toMatch(/shape-rendering="crispEdges"/)

There is no option that makes this pass; grep -ri shape-rendering packages/charts-core/src docs returns nothing.

Proposal

Add shapeRendering?: 'auto' | 'crispEdges' | 'geometricPrecision' | 'optimizeSpeed' to ChartGuideLineStyle, emitted as the SVG attribute on grid, axis and guide lines (ignored by canvas). A generic SVG presentation-attribute passthrough on guide lines would also work.

Follows #131, which added ChartGuideLineStyle. Checked against 57774e14a1a86081eddb3a23523724a40da05640 (v1.1.0).

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

環境構築

はじめの一歩

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

TanStack/charts のほかの issue

TanStack/charts の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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