Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(interaction): emit brush axis highlight #5132

Merged
merged 1 commit into from
Jun 1, 2023
Merged

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented May 31, 2023

Brush Axis Highlight

brush-axis-highlight

获得数据

chart.on('brushAxis:highlight', (event) => {
  const { data, nativeEvent } = event;
  if (nativeEvent) console.log('brushAxis:highlight', data);
});

chart.on('brushAxis:remove', (event) => {
  const { data, nativeEvent } = event;
  if (nativeEvent) console.log('brushAxis:remove', data);
});

触发交互

chart.emit('brushAxis:highlight', {
  data: { selection: [[20, 30], undefined, [100, 300]] },
});

chart.emit('brushAxis:remove', {});

Breaking

之前写错了

chart.interval().interaction('brushHiglight', true);

// Before
chart.on('brush:end', () => {});

// After
chart.on('brush:remove', () => {});

@hustcc
Copy link
Member

hustcc commented May 31, 2023

叫 brush:reset 会不会更统一一些?交互名对应的一些状态是否可以收敛,比如在 4.x 交互语法就是定义了几个阶段。

@pearmini
Copy link
Member Author

叫 brush:reset 会不会更统一一些?交互名对应的一些状态是否可以收敛,比如在 4.x 交互语法就是定义了几个阶段。

可以,那可能有更多 break change?毕竟已经发过版本了。

@hustcc hustcc merged commit 534c1ef into v5 Jun 1, 2023
2 checks passed
@hustcc hustcc deleted the feat/brush-axis-highlight branch June 1, 2023 00:48
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.

None yet

2 participants