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

fix(graph): user cursor has higher priority #16867

Merged
merged 2 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions src/chart/graph/GraphSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export interface GraphNodeItemOption extends SymbolOptionMixin, GraphNodeStateOp
category?: number | string

draggable?: boolean
cursor?: string
}

export interface GraphEdgeStateOption {
Expand Down
2 changes: 1 addition & 1 deletion src/chart/graph/GraphView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class GraphView extends ChartView {
}
});
}
el.setDraggable(draggable && !!forceLayout);
el.setDraggable(draggable && !!forceLayout, !!itemModel.get('cursor'));

const focus = itemModel.get(['emphasis', 'focus']);

Expand Down
4 changes: 2 additions & 2 deletions src/chart/helper/Symbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ class Symbol extends graphic.Group {
symbolPath.z = z;
}

setDraggable(draggable: boolean) {
setDraggable(draggable: boolean, hasCursorOption?: boolean) {
const symbolPath = this.childAt(0) as ECSymbol;
symbolPath.draggable = draggable;
symbolPath.cursor = draggable ? 'move' : symbolPath.cursor;
symbolPath.cursor = hasCursorOption ? symbolPath.cursor : draggable ? 'move' : symbolPath.cursor;
susiwen8 marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
2 changes: 2 additions & 0 deletions test/graph-symbol.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.