[Feature] Mark states: geometry keys (scale, translate, arc angles and radii)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 42/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- d3, typescript
调研方向
Read packages/charts-core/src/types.ts and packages/charts-core/src/mark-state.ts, then trace how state transitions apply and tween style values for area and polar marks. Check the polar mark implementation and related state tests to identify the geometry paths involved. Done means the proposed scale and translate keys work for area-kind marks, polar geometry keys are supported, and state transitions tween them.
由索引模型根据 Issue 内容生成。
描述
Version: @tanstack/charts 1.1.0 (57774e1). Split from #186 (comment section E) and #194 (section D) so it can be closed on its own; it also covers what remained of #126 after polar states shipped.
Common hover effects (an arc that grows 3%, a radar polygon at 1.05x, a funnel segment that pops) cannot be written as states; they need a custom spring on renderer-owned DOM.
What exists
ChartMarkStateStylehasr(dot),radiusandinset(bar, rect) anddx,dy,rotate(text), per the per-mark picks (types.ts:176-260, applied in mark-state.ts:205-235).- Marks that render as
areanodes (radialArc, sunburst sectors,areaY) have no geometry key at all (ChartAreaStateStyleis paint only), and no mark has a scale or translate key. - The group-states doc says the same: "Group states support paint; geometry properties such as dot radius and text rotation apply only to their corresponding leaves" (custom-extensions.md:221-223).
- Polar marks accept
states(polar.ts:229-230, polar.md:52-60), butChartMarkStateStylehas nostartAngle,endAngle,innerRadiusorouterRadius.
Ask
Add an optional scale (about the node's own centre or a given origin) and translate to ChartMarkStateStyle for area-kind marks, and for polar arcs innerRadius/outerRadius or startAngle/endAngle, resolved in applyStateStyle and tweened by the state transition.
Example (proposed API; outerRadius is the new key):
radialArc(rows, {
startAngle: 'start', endAngle: 'end', innerRadius: 60, outerRadius: 80,
states: [{ when: { focus: 'primary' }, style: { outerRadius: 84 }, transition: { type: 'spring', stiffness: 400, damping: 30 } }],
})
Read from source, not run.
Related: #186 (cost of state changes), #194 (arc motion), #126 (polar states).
- 主要语言
- TypeScript
- 星标
- 870
- 派生
- 57
- 平均合并
- 11 小时 58 分钟
- 30 天内合并 PR
- 18
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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
维护者通常 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 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
fb55/htmlparser2#2579 ·
维护者通常 1 天内回复
-
bug good first issue needs-review
难度 1/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
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 天内回复