antvis / Graphin

A React toolkit for graph visualization based on G6
https://graphin.antv.antgroup.com
MIT License
980 stars 263 forks source link

Type definition incorrect in LassoSelect behavior onSelect callback #477

Open msnyder-msft opened 1 year ago

msnyder-msft commented 1 year ago

Describe the bug

The type definition for the onSelect callback in the LassoSelect component is () => void but the real G6 behavior definition (defined here) is (nodes, edges)=>void.

image

image

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.

<LassoSelect
    includeEdges={false}
    onSelect={(nodes, edges) => {
        console.log('nodes', nodes);
        console.log('edges', edges);
    }}
/>

Expected behavior

Should not get a typing error. image

Screenshots or Videos

image

Platform

Additional context

No response

pomelo-nwu commented 11 months ago

@msnyder-msft I'm sorry that I just noticed your problem. It should be the wrong type of Graphin. Could you give me a PR to help fix it?