antvis / antvis/Graphin

Type definition incorrect in LassoSelect behavior onSelect callback

Open
#477 1 comment 0 reactions 1 assignee Claimed by @pomelo-nwu View on GitHub
bug Typing Error
Dominant language
TypeScript
Stars
1.1k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

The type definition for the `onSelect` callback in the [LassoSelect](https://github.com/antvis/Graphin/blob/0a3e4a5a5d501fc071007152e9462b50548287f5/packages/graphin/src/behaviors/LassoSelect.tsx) component is `() => void` but the real G6 behavior definition (defined [here](https://antv-g6.gitee.io/en/docs/manual/middle/states/defaultBehavior#lasso-select)) is `(nodes, edges)=>void`.

![image](https://user-images.githubusercontent.com/57726991/228652283-36da0b5e-c86f-4172-b5c3-966fb11138a3.png)

![image](https://user-images.githubusercontent.com/57726991/228652345-28ff75e1-2677-4a37-9061-49a48954c4f6.png)

### Your Example Website or App

N/A

### Steps to Reproduce the Bug or Issue

Use the LassoSelect component
Provide the `onSelect` callback and try to acces the selected nodes or edges.

```ts
{
console.log('nodes', nodes);
console.log('edges', edges);
}}
/>
```

### Expected behavior

Should not get a typing error.
![image](https://user-images.githubusercontent.com/57726991/228652534-c2407d75-a447-4de3-8f6e-ff96a8554b3e.png)

### Screenshots or Videos

![image](https://user-images.githubusercontent.com/57726991/228652546-d20d91d4-b42e-4de4-ab7b-bc8ed54e2d33.png)

### Platform

- OS: Windows

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.