Skip to content

Conversation

@lzxue
Copy link
Contributor

@lzxue lzxue commented Nov 25, 2025

[English Template / 英文模板]

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 工作流程
  • 版本更新
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

语言 更新描述
🇺🇸 英文
🇨🇳 中文

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@changeset-bot
Copy link

changeset-bot bot commented Nov 25, 2025

⚠️ No Changeset found

Latest commit: 101326e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lzxue, 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 delivers a significant visual enhancement by adding a new 'arrow line' feature to the LineLayer component. This allows users to easily integrate directional indicators into their line visualizations, which is crucial for applications requiring path guidance or flow representation. The changes encompass core rendering logic, API updates, and extensive documentation to support this new functionality.

Highlights

  • New Arrow Line Feature: Introduced a new capability to display directional arrows on line layers, enhancing visualization for navigation, paths, and flow directions.
  • Customizable Arrow Styles: Arrows are highly customizable with properties such as enable, spacing, width, height, strokeWidth, and color, allowing for flexible visual configurations.
  • Shader-Based Rendering: The arrow effect is implemented directly in GLSL shaders, ensuring efficient rendering of V-shaped, anti-aliased arrows that can be independently styled from the main line.
  • Documentation and Examples: Comprehensive documentation in both English and Chinese has been added, along with new examples (arrow.ts, arrow-debug.ts, line_arrow.js) to demonstrate the usage and capabilities of the arrow feature.
  • Line Style Property Renaming: Refactored existing line style properties borderWidth and borderColor to strokeWidth and stroke respectively, for improved clarity and consistency across the API and documentation.
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.

Copy link
Contributor

@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 引入了线图层的箭头功能,这是一个很棒的新特性。整体实现看起来不错,包括核心逻辑、着色器代码和相关文档。
我发现了一些可以改进的地方,主要集中在以下几个方面:

  1. 类型安全和接口定义:在示例中使用了未在接口中定义的 count 属性,同时 LineTriangulation 函数的参数可以有更严格的类型定义。
  2. 代码健壮性:在片段着色器中存在一个潜在的除零风险,可能导致渲染失败。
  3. 示例代码配置arrow.ts 示例中 whiteArrowLayer 的箭头配置似乎不正确,单位可能用错了。
  4. 文档结构:中文文档中新加内容的位置可以调整得更合理。

详细的建议请见具体的代码审查评论。修复这些问题后,代码质量会更高。

Comment on lines 118 to 124
arrow: {
enable: true,
count: 2,
width: 0.003,
height: 0.004,
},
});
Copy link
Contributor

Choose a reason for hiding this comment

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

high

这里的 arrow 配置存在几个问题:

  1. 未定义的 count 属性:配置中使用了 count: 2,但 arrow 的接口定义(ILineLayerStyleOptions)中并没有 count 这个属性。这是一个未记录、未类型化的属性,请在接口中添加并提供文档。
  2. 不正确的 widthheight 单位widthheight 的值(0.0030.004)非常小,看起来像是地理坐标单位。然而,文档和实现都表明这些值应该是像素单位。这会导致箭头无法正确渲染。请将其修改为合理的像素值。
  3. (次要)另外,在第 88 行的注释中,rgba(255, 94, 0, 1) 是橙色,而不是“黄色箭头”。

Comment on lines 107 to 108
// ...existing code...

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

这个注释似乎是编辑过程中遗留的,建议删除。

Comment on lines 253 to 288
## 箭头效果(arrow)
支持在线图层上显示方向箭头,常用于导航、路径方向标识。
### 配置项
| 属性 | 类型 | 说明 |
| ----------- | ------- | -------------------- |
| enable | boolean | 是否显示箭头 |
| spacing | number | 箭头间距(像素) |
| width | number | 箭头宽度(像素) |
| height | number | 箭头高度(像素) |
| strokeWidth | number | 箭头线条宽度(像素) |
| color | string | 箭头颜色(CSS 色值) |
### 效果说明
- 箭头为 V 形轮廓,非实心三角。
- 箭头叠加在线本身之上,线和箭头可分别设置颜色。
- 适用于导航、路径方向等场景。
### 示例代码
```ts
layer.style({
color: '#0000FF', // 线颜色
arrow: {
enable: true,
spacing: 80,
width: 30,
height: 40,
strokeWidth: 4,
color: '#FFFF00', // 箭头颜色
},
});
```
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

为了保持文档结构的清晰和一致性,建议将新增的“箭头效果(arrow)”章节移动到更合适的位置。目前它位于文件末尾,但在英文版文档(style.en.md)中,该部分位于 ### linear 章节之前。建议将此部分也移到 ### linear 之前,与其他线图层特性保持一致。

lzxue and others added 9 commits November 26, 2025 11:46
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