antvis / antvis/G2

[Feat]: 建议支持“曲界线柱状图/相态碰撞判定”机制 (Curved-Boundary Phase Bar Spec)

Open
#8,003 0 comments 0 reactions 0 assignees View on GitHub
waiting for maintainer
Dominant language
TypeScript
Stars
12.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Describe the feature / 功能描述

### 核心诉求与背景
在物理建模(如热力学压强-温度 P-T 三相图)、化学实验模拟以及复杂的多阈值业务监控场景中,图表往往需要展示**二维参数空间下的动态柱体**与**非线性/弯曲判定边界**之间的实时交互与状态切换。

### 现有的痛点
1. **传统阈值线限制**:目前 G2 的 `lineX/lineY` 或 `annotation` 主要用于绘制水平或垂直的静态直线阈值,缺乏对复杂曲线(如多项式曲线、贝塞尔曲线等弯曲边界)的区划支持。
2. **自定义 Mark 开发成本高**:虽然可以通过 G2 的自定义 Shape / Mark 实现,但要计算平移柱体的顶点与弯曲临界线的动态交点(Collision/Cross Detection),并依据交点实时驱动柱体样式(颜色、标签、状态)变更,底层逻辑非常繁琐且难以通用。

### 期望的最终体验
希望 G2 未来能提供一种更优雅的相界/曲界判定机制,或拓展自定义图形的碰撞检测能力。当柱体在 X 轴位置(如压强 P)或 Y 轴高度(如温度 T)发生变化时,能够自动与预设的弯曲边界进行交点计算,并实时驱动柱体状态(如:固态、液态、气态或自定义业务区间)的样式变更。

---

### 🔗 原型演示与项目地址

* **在线演示 (Live Demo)**: https://cnlnr.github.io/Curved-Boundary-Bar-Chart/
* **源码仓库 (GitHub Repository)**: https://github.com/cnlnr/Curved-Boundary-Bar-Chart

### Are you willing to contribute? / 是否愿意参与贡献?

Please select / 请选择

Contributor guide

Open the contributing guide

Research direction

No project file or test is named. Start by reviewing G2's lineX, lineY, annotation, and custom Shape/Mark APIs, then compare them with the linked prototype. Done would require an agreed scope and API for curved-boundary collision handling, plus tests covering the proposed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.