docs: add common configuration link#3005
Conversation
📝 WalkthroughWalkthrough本次更新主要在各类图表组件的中文文档“配置项”部分,统一新增了一行通用属性参考链接,指向通用配置项的总览页面。此外,部分配置示例代码由底层 G2 API 改为使用更高层的 React 组件(如 Line、Column),代码风格更现代化,使用了 React 的函数式组件和 createRoot 渲染方式。 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Docs
participant ReactComponent
User->>Docs: 打开配置项文档
Docs->>User: 展示配置项内容
Docs-->>User: 提供“通用配置”链接
User->>Docs: 查看代码示例
Docs->>ReactComponent: 加载 React 示例组件
ReactComponent->>User: 渲染图表(如 Line/Column)
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (27)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (24)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 21
♻️ Duplicate comments (4)
site/docs/components/plots/gauge.zh.md (1)
44-45: 同上:请使用绝对路径并验证锚点与
venn.zh.md中的意见一致。
参见该文件的修改建议。site/docs/components/plots/sankey.zh.md (1)
41-42: 同上:请使用绝对路径并验证锚点与
venn.zh.md中的意见一致。
参见该文件的修改建议。site/docs/components/plots/area.zh.md (1)
65-66: 同上:请使用绝对路径并验证锚点与
venn.zh.md中的意见一致。
参见该文件的修改建议。site/docs/components/plots/radar.zh.md (1)
45-46: 同上:请使用绝对路径并验证锚点与
venn.zh.md中的意见一致。
参见该文件的修改建议。
🧹 Nitpick comments (3)
site/docs/components/plots/bullet.zh.md (1)
43-44: 链接路径需统一为绝对路径此前文档中的内部链接均以
/开头(如上方的/examples#statistics-bullet、/options/plots/title等)。这里缺少前导/,可能导致在某些部署环境下解析为相对路径而 404。建议保持一致性。-通用属性参考:[通用配置](components/plots/overview#通用配置项) +通用属性参考:[通用配置](/components/plots/overview#通用配置项)site/docs/components/plots/scatter.zh.md (1)
47-48: 统一链接写法,避免路由解析异常前面同一文件已有
"/examples#statistics-scatter"这种以/开头的绝对路径,而此处漏掉了/,容易在某些路由器或部署路径下解析成相对地址导致 404。建议保持一致写绝对路径。-通用属性参考:[通用配置](components/plots/overview#通用配置项) +通用属性参考:[通用配置](/components/plots/overview#通用配置项)site/docs/options/plots/slider.zh.md (1)
338-346: DOM 选择器过于宽泛,示例在多 Slider 场景下可能失效
document.querySelector('.slider')仅返回首个匹配节点,若页面同时存在多个图表/缩略轴将捕获到错误实例。
建议限定到当前图表容器,或直接使用 G2 事件,而不依赖 DOM:-document.querySelector('.slider').addEventListener('valuechange', (evt) => { - console.info(evt.detail); -}); +const slider = chart.getContainer().querySelector('.slider'); +slider?.addEventListener('valuechange', (evt) => { + console.info(evt.detail); +});如果 G2 已暴露
slider:valuechange事件,可进一步精简为:chart.on('slider:valuechange', ({ range }) => console.info(range));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (31)
site/docs/components/plots/area.zh.md(1 hunks)site/docs/components/plots/bar.zh.md(1 hunks)site/docs/components/plots/bidirectional-bar.zh.md(1 hunks)site/docs/components/plots/box.zh.md(1 hunks)site/docs/components/plots/bullet.zh.md(1 hunks)site/docs/components/plots/circle-packing.zh.md(1 hunks)site/docs/components/plots/column.zh.md(1 hunks)site/docs/components/plots/dual-axes.zh.md(1 hunks)site/docs/components/plots/funnel.zh.md(1 hunks)site/docs/components/plots/gauge.zh.md(1 hunks)site/docs/components/plots/heatmap.zh.md(1 hunks)site/docs/components/plots/histogram.zh.md(1 hunks)site/docs/components/plots/line.zh.md(1 hunks)site/docs/components/plots/liquid.zh.md(1 hunks)site/docs/components/plots/pie.zh.md(1 hunks)site/docs/components/plots/radar.zh.md(1 hunks)site/docs/components/plots/radial-bar.zh.md(1 hunks)site/docs/components/plots/rose.zh.md(1 hunks)site/docs/components/plots/sankey.zh.md(1 hunks)site/docs/components/plots/scatter.zh.md(1 hunks)site/docs/components/plots/stock.zh.md(1 hunks)site/docs/components/plots/sunburst.zh.md(1 hunks)site/docs/components/plots/treemap.zh.md(1 hunks)site/docs/components/plots/venn.zh.md(1 hunks)site/docs/components/plots/violin.zh.md(1 hunks)site/docs/components/plots/waterfall.zh.md(1 hunks)site/docs/components/plots/word-cloud.zh.md(1 hunks)site/docs/options/plots/animate/overview.en.md(0 hunks)site/docs/options/plots/interaction/brushHighlight.zh.md(1 hunks)site/docs/options/plots/scale/ordinal.zh.md(1 hunks)site/docs/options/plots/slider.zh.md(1 hunks)
💤 Files with no reviewable changes (1)
- site/docs/options/plots/animate/overview.en.md
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: deploy
- GitHub Check: test (latest)
- GitHub Check: test (latest)
🔇 Additional comments (3)
site/docs/options/plots/interaction/brushHighlight.zh.md (2)
112-141: 无明显问题,可留作示例。
146-175: 同上。site/docs/options/plots/scale/ordinal.zh.md (1)
233-262: 示例代码逻辑正确,未发现阻碍阅读的问题。
Summary by CodeRabbit