Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/g6/src/behaviors/brush-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ export interface BrushSelectOptions extends BaseBehaviorOptions {
*
* <en/> Callback when brush select elements.
* @param states - 选中的元素状态
* @returns 选中的元素状态
*/
onSelect?: (states: Record<ID, State | State[]>) => Record<ID, State | State[]>;
onSelect?: (states: Record<ID, State | State[]>) => void;
}
/**
* <zh/> 框选一组元素
Expand Down Expand Up @@ -246,7 +245,7 @@ export class BrushSelect extends BaseBehavior<BrushSelectOptions> {

const selectedIds = this.selector(graph, points, enableElements);

let states: Record<ID, State | State[]> = {};
const states: Record<ID, State | State[]> = {};

switch (mode) {
case 'union':
Expand Down Expand Up @@ -274,7 +273,7 @@ export class BrushSelect extends BaseBehavior<BrushSelectOptions> {
break;
}

if (isFunction(onSelect)) states = onSelect(states);
if (isFunction(onSelect)) onSelect(states);

graph.setElementState(states, this.options.animation);
}
Expand Down
Loading