Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Feature] Scene: an HTML / `foreignObject` node for per-datum icons and badges

未关闭
#200 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
react, typescript

调研方向

Start with the SceneNode definitions in packages/charts-core/src/types.ts and the renderSvg implementation mentioned in the issue. Trace how scene nodes are rendered and how layout, clipping, and enter/exit motion are handled. Done means choosing and documenting a supported way to render per-datum HTML or foreignObject content with the described layout and motion behavior.

由索引模型根据 Issue 内容生成。

描述

A chart that needs a per-datum icon, badge or other HTML inside the plot has no scene node for it.

  • SceneNode is group | rule | polyline | area | dot | rect | label (types.ts:1599-1606). None embeds HTML or foreign content, and foreignObject is not emitted anywhere in charts-core.
  • SceneLabel carries a plain text: string (types.ts:1582-1586).
  • The only HTML slots are the tooltip body and the tooltip portal extension (types.ts:1666). Neither follows the scene's layout, clipping or enter/exit motion.

Use case: marker discs on a time-series chart, each holding a caller-supplied icon (an SVG or React element), sized to fill the disc or inset from it. Today the icon can only be drawn as label text, so element icons cannot be shown.

Repro

Nothing to run; this is an absence. A mark that emits a SceneNode with kind: 'html' (or any non-listed kind) is not part of the type, and renderSvg has no branch for it.

Proposal

Either:

  1. A scene node that hosts HTML or foreignObject content (position, size, a child), rendered by the SVG renderer and skipped or rasterised by canvas; or
  2. a documented custom-renderer slot for per-datum HTML that receives the resolved layout and takes part in enter and exit motion.

Checked against 57774e14a1a86081eddb3a23523724a40da05640 (v1.1.0).

主要语言
TypeScript
星标
819
派生
49
平均合并
12 小时 9 分钟
30 天内合并 PR
6

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TanStack/charts 的其他 Issue

查看 TanStack/charts 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。