[Feature] Guide lines: a `shapeRendering` option for crisp hairlines
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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
- 平均合并
- 12 小时 9 分钟
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/charts 的其他 Issue
-
[Bug] Focus guides: `url(#id)` paints ignore `idPrefix`可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
brushX with `values` can shorten the selection range when it’s dragged to the plot edge可能已有人在做 @andersk 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 42/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 57/100
维护者通常 1 天内回复
相似的 Issue
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 72/100
redhat-developer/rhdh-plugin-export-overlays#4391 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
Luligu/matterbridge#655 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
software-mansion/argent#1457 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
schmayterling/hibi#245 ·
维护者通常 1 天内回复
-
ai-driven-qa bug claude Minor
难度 2/5 1-3 小时 新手友好度 70/100
linagora/twake-contacts-frontend#241 ·
维护者通常 1 天内回复