antvis / antvis/G2

坐标轴可以画在绘制区域

Open
#4,593 1 comment 0 reactions 0 assignees View on GitHub
v5
Dominant language
TypeScript
Stars
12.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

# 坐标轴灵活布局

希望坐标轴可以画在如下图蓝色位置。

![image](https://user-images.githubusercontent.com/49330279/212854749-2cb1f7a5-cb4c-4139-a28b-4268d078f7de.png)

## 实现思路

坐标轴也是一种 Mark,这里和 ruleX 很像。可以通过设置 position 来指定绘制区域。

```js
G2.render({
type: 'point',
axis: {
y: {
position: 'plot', // 在 plot 区域绘制
x: [3], // 数据驱动的位置
},
},
});
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing how axes are represented as Marks and how ruleX handles positioning, then inspect the position API shown in the example. Done means an axis can render inside the plot region at a data-driven coordinate while existing axis layouts continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.