Skip to content

Conversation

@huaxiabuluo
Copy link
Contributor

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Description of change

ian.lxl and others added 11 commits December 25, 2025 19:17
为 markerBackgroundStyle 参数添加了使用场景说明,明确指出其主要用于柱状图,尤其是分组柱状图。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Line: 添加 endView 属性,修正 size callback 类型签名为 (value, record) => string
- Interval: 添加 sizeZoom/showLabel/labelCfg 属性,修正 size callback 类型,补充 labelCfg 适用范围说明(仅 pyramid/funnel)
- Point: 修正 size callback 类型,修正 shape 属性为实际支持的 3 种形状(circle/hollowCircle/rect)
- Area: 修正 size callback 类型
- Candlestick: 修正 color 属性为仅支持对象形式,删除不支持的数组形式说明

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- 新增 selectedStyle/unSelectedStyle 详细格式说明
- 补充 record 参数结构文档
- 新增函数形式示例
- 添加常用样式属性表格

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- 新增 TypeScript 类型定义(AxisProps、StyleProps、Tick、TickLineProps、MarkerStyleProps)
- 添加 JSDoc 格式注释
- Props 表格化,按功能分组,补充默认值
- 新增用法示例(格式化、回调函数、symbol 配置、旋转标签等)
- 修正 LabelCallback/GirdCallback 参数签名(与源码一致)
- 补充默认样式值章节及源码链接
- 精简 Tick 接口为开发者实际使用的属性

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
主要变更:
- 修复 TypeScript 类型定义:style 函数签名从 (record?) 改为 (points: Point[], chart: Chart)
- 新增 TypeScript 类型定义章节,提供准确的类型签名
- 新增 records 特殊值说明(min/max/median/百分比)
- 优化 textAlign 和 textBaseline 描述,使用标准术语"文本对齐"和"文本基线对齐"
- 修正默认值标注:textAlign 默认为 'start',textBaseline 默认为 'middle'
- 新增典型组合示例和多个实用场景示例
- 新增折线图数据点标注、使用偏移量等场景示例
- 恢复完整动画配置示例

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- 新增 TypeScript 类型定义
- Props 表格化,补充默认值
- 新增 records 特殊值说明(min/max/median/%)
- 新增 style 属性说明(对象/函数形式)
- 新增数组偏移特性说明
- 新增 7 个用法示例
- 完善动画属性说明

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@gemini-code-assist
Copy link

Summary of Changes

Hello @huaxiabuluo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the documentation for various chart components and guides within the F2 library. The changes aim to provide more detailed, structured, and user-friendly information, including expanded property descriptions, TypeScript definitions, and practical usage examples. The overall goal is to improve the clarity and accessibility of the F2 documentation for developers.

Highlights

  • Comprehensive Documentation Expansion: Detailed property explanations, TypeScript type definitions, and extensive usage examples have been added for Area, Candlestick, Interval, Line, Point, Axis, LineGuide, TextGuide, and Tooltip components.
  • Geometry Documentation Revamp: The Geometry component documentation has been restructured to serve as an overview and navigation hub, outlining architecture, inheritance, unified properties, and methods, while directing users to individual component pages for specific details.
  • Enhanced Tooltip Configuration: The Tooltip component now includes TypeScript definitions, categorized properties, default style values, and a wide array of usage examples covering crosshairs, custom styles, axis tips, custom content, event listeners, and programmatic control.
  • Improved Guide Components: Both LineGuide and TextGuide components received significant updates, including TypeScript definitions, support for special values in records (e.g., 'min', 'max'), flexible style attributes (object or function), and numerous examples for various use cases and animations.
  • Minor Corrections and Typos: Several minor typos and inconsistencies were corrected across the documentation, such as innnerRadius to innerRadius, marign to margin, backgroud to background, and funtion to function.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@huaxiabuluo huaxiabuluo changed the title Docs structure improve docs: structure improve Dec 31, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

本次 PR 对文档结构进行了大幅优化,特别是针对几何标记(Geometry)及其子组件(Area, Line, Interval, Point, Candlestick)、坐标轴(Axis)、辅助标记(Guide)和提示(Tooltip)的文档。通过使用表格、TypeScript 类型定义和丰富的代码示例,文档的可读性和实用性得到了极大的提升。这种结构化的文档将大大方便开发者的查阅和使用。此外,PR 还修复了一些文档中的拼写错误和不准确之处。

我提出了一些关于文档格式的建议,旨在进一步提升文档的简洁性和可读性。

整体来看,这是一次非常高质量的文档重构工作。

I am having trouble creating individual review comments. Click here to see my feedback.

site/docs/api/chart/area.zh.md (207-227)

medium

animation 属性的文档中,您提到 三个阶段(appear/update/leave)支持相同的属性结构,但下方的表格重复了三次相同的属性列表,这显得有些冗余。为了使文档更简洁,建议将表格结构优化一下。可以先列出三个阶段,然后用一个共享的表格来说明它们共同的属性。这不仅能减少重复,也更符合您在前面作出的说明。

此建议同样适用于 line.zh.md, interval.zh.md, point.zh.md, candlestick.zh.md 中类似的动画属性表格。

| 阶段       | 描述     |
|------------|----------|
| **appear** | 元素进场 |
| **update** | 数据更新 |
| **leave**  | 元素离场 |

这三个阶段均支持以下属性:

| 属性     | 类型                   | 必填 | 默认值     | 描述                                   |
|----------|------------------------|:-----|:-----------|----------------------------------------|
| easing   | `string` \| `function` | 否   | `'linear'` | 缓动函数,[可选值见下方](#缓动函数)     |
| duration | `number`               | 否   | `300`      | 动画时长 (ms)                          |
| delay    | `number`               | 否   | `0`        | 延迟时间 (ms)                          |
| property | `string[]`             | 否   | -          | 变化的属性数组,如 `['x', 'y']`        |
| start    | `object`               | 否   | -          | 起始状态,[结构见下表](#动画状态对象) |
| end      | `object`               | 否   | -          | 结束状态,[结构见下表](#动画状态对象) |

site/docs/api/chart/axis.zh.md (268-272)

medium

此处的列表使用了代码块格式,导致其显示为预格式化文本。为了更好的可读性和语义化,建议将其修改为标准的 Markdown 有序列表。同时,labelAutoRotate 应该用反引号包裹起来,以表示它是一个属性名。

1. `labelAutoRotate`(推荐)
2. 旋转 45°
3. 旋转 90°(谨慎)

site/docs/api/chart/chart.zh.md (71)

medium

此处存在拼写错误 innnerRadius,应为 innerRadius。本次提交已修复该问题,做得很好!

site/docs/api/chart/scroll-bar.zh.md (64-65)

medium

此处存在拼写错误 marignmarignTop,应为 marginmarginTop。本次提交已修复该问题,做得很好!

site/docs/api/chart/scroll-bar.zh.md (68)

medium

此处存在拼写错误 backgroud,应为 background。本次提交已修复该问题,做得很好!

site/docs/tutorial/event.zh.md (12-26)

medium

在类型列中,funtion 是一个拼写错误,正确的应为 function。本次提交已修复该问题,做得很好!

@github-actions
Copy link

github-actions bot commented Dec 31, 2025

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
f2/dist/index.js = 1,706.38 kB 1,706.38 kB = 323.03 kB 323.03 kB
f2/dist/index.min.js = 532.93 kB 532.93 kB = 160.21 kB 160.21 kB

Significant size changes

Includes any change greater than 0.2%:
(No significant changes)

Generated by 🚫 dangerJS against f3fce8b

ian.lxl and others added 6 commits January 4, 2026 13:59
- 新增 TypeScript 类型定义和 Props 表格
- 新增 precise、visible、onClick 属性说明
- 新增 background 属性独立章节
- 新增分组柱状图精确定位示例(支持负数动态方向)
- 新增点击事件、条件控制显示示例
- 移除代码内联注释,符合主流文档规范

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- 新增 TypeScript 类型定义
- 完善 Props 表格,补充默认值和类型
- 新增 attrs vs style 说明
- 新增 records 特殊值说明
- 新增 style 属性说明(对象/函数形式)
- 新增 6 个用法示例(基础用法、偏移量、特殊值、style 函数、onClick、多图片组合、动画)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
主要改进:
- 新增 onClick、visible、precise 属性文档
- 补充 TypeScript 类型定义(Point、RecordItem)
- 新增默认样式值说明
- style 函数参数说明更详细
- 优化用法示例结构

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
主要改进:
- 新增 onClick、visible、precise 属性文档
- 补充 TypeScript 类型定义(Point 接口)
- 新增 records 特殊值说明和示例
- style 属性章节补充函数签名详细说明
- 新增多个用法示例(点击事件、条件显示、chart 实例)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- 新增 TypeScript 类型定义和泛型说明
- 新增 scale 属性详细说明(通用属性、linear/cat/timeCat 度量)
- 新增 coord 属性详细说明(rect/polar 坐标系)
- 新增 style 和 theme 属性说明
- 修正文档链接格式为相对 docs 目录
- 精简代码示例,移除冗余注释
- 补充默认值和已弃用属性说明
- API 文档优化 (Canvas, Legend, Magnifier, PieLabel, ScrollBar, Tooltip 等)
- 教程文档优化 (getting-started, grammar, understanding, coordinate, data, scale 等)
- 组件文档优化
- 框架集成教程优化

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly updates and expands the documentation for various F2 components, including Canvas, Chart, Axis, Legend, Tooltip, Timeline, Gauge, Sunburst, Treemap, and all Geometry and Guide components (Area, Candlestick, ImageGuide, LineGuide, PointGuide, RectGuide, TagGuide, TextGuide). The changes primarily involve restructuring property descriptions into detailed tables, adding TypeScript type definitions, providing comprehensive usage examples for different scenarios, and clarifying component behaviors and common issues. For instance, Canvas documentation now includes usage examples for pixelRatio and dimensions, Chart details scale and coordinate configurations, and Axis documentation features extensive style and label handling examples. Geometry components now have dedicated sections for color, size, style, and animation properties with numerous examples. The top-level F2 API documentation has been rewritten to provide more context and examples for Children, createElement/jsx, and createRef. Tutorial sections on animation, component usage, data handling, coordinate systems, and framework integrations (React, Vue, Mini-program, Node.js, SVG Renderer) have also been thoroughly revised with updated content, code examples, and explanations. Review comments highlighted a missing definition for y0 in a Candlestick animation example, an extra semicolon in an Axis TypeScript definition, and an incorrect MDN link in an English documentation file.

/** 放大镜半径,支持像素值(如 '50px')或数字 */
radius?: number | string;
/** 放大镜中心位置 [x, y],支持数字或带 px 的字符串 */
position?: [number, number] | [string, string] ;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

在 TypeScript 类型定义中,position 属性的类型声明末尾多了一个分号,建议移除。

Suggested change
position?: [number, number] | [string, string] ;
position?: [number, number] | [string, string];

---

F2 是基于 [CanvasRenderingContext2D](https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D) 的标准接口绘制的,所以只要能提供标准 [CanvasRenderingContext2D](https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D) 接口的实现对象,F2 就能进行图表绘制
F2 是基于 [CanvasRenderingContext2D](https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D) 的标准接口绘制的,所以只要能提供标准 [CanvasRenderingContext2D](https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D) 接口的实现对象,F2 就能进行图表绘制

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In this English documentation, the link to MDN for CanvasRenderingContext2D points to the Chinese version (zh-CN). It would be more appropriate to link to the English version for consistency.

Suggested change
F2 是基于 [CanvasRenderingContext2D](https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D) 的标准接口绘制的,所以只要能提供标准 [CanvasRenderingContext2D](https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D) 接口的实现对象,F2 就能进行图表绘制。
F2 is based on the standard interface of [CanvasRenderingContext2D](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D), so as long as an implementation object of the standard [CanvasRenderingContext2D](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) interface can be provided, F2 can perform chart drawing.

- 将动画配置注释中的 y0 改为 baseline,更清晰表达其含义
- 添加说明:baseline 为 y 轴基线位置,柱子从底部向上展开

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@huaxiabuluo huaxiabuluo marked this pull request as ready for review January 9, 2026 08:02
- 修正 Candlestick 组件数组格式说明
- 将 changeData API 更新为 update 方法
- 修正 CDN 路径为 index.min.js
@huaxiabuluo huaxiabuluo merged commit ebbad36 into master Jan 9, 2026
6 of 7 checks passed
@huaxiabuluo huaxiabuluo deleted the docs-structure-improve branch January 9, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants