Skip to content

Commit

Permalink
Merge pull request antvis#4944 from liaodalin19903/v5-plugin-snapline
Browse files Browse the repository at this point in the history
V5 plugin snapline
  • Loading branch information
Yanyan-Wang authored Sep 8, 2023
2 parents c35aca9 + 1585117 commit ae8713a
Show file tree
Hide file tree
Showing 10 changed files with 1,541 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ yarn-error.log*
lerna-debug.log*
yarn.lock
package-lock.json
pnpm-lock.yaml
pnpm-workspace.yaml

# Sys
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion packages/g6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"@antv/layout-gpu": "^1.1.5",
"@antv/layout-wasm": "1.3.1",
"@antv/matrix-util": "^3.0.4",
"@antv/util": "~2.0.5",
"@antv/path-util": "3.0.1",
"@antv/util": "~2.0.5",
"color": "^4.2.3",
"insert-css": "^2.0.0",
"stats-js": "^1.0.1",
Expand Down
14 changes: 6 additions & 8 deletions packages/g6/src/runtime/controller/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,12 @@ export class ItemController {
if (!item || item.destroyed) return;
const type = item.getType();
const innerModel = graphCore.getNode(id);
if (
onlyMove &&
type === 'node' &&
isNaN(current.x) &&
isNaN(current.y)
) {
callback(innerModel, true);
return;
if (type === 'node' && onlyMove) {
const { x, y, fx, fy } = current;
if (isNaN(x) && isNaN(y) && isNaN(fx) && isNaN(fy)) {
callback(innerModel, true);
return;
}
}

const nodeRelatedIdsToUpdate: Set<ID> = new Set<ID>();
Expand Down
2 changes: 2 additions & 0 deletions packages/g6/src/stdlib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const {
Legend,
Toolbar,
Timebar,
Snapline,
} = Plugins;

const {
Expand Down Expand Up @@ -280,6 +281,7 @@ const Extensions = {
Legend,
Timebar,
Hull,
Snapline,
};

export default registery;
Expand Down
2 changes: 1 addition & 1 deletion packages/g6/src/stdlib/item/node/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
NodeShapeStyles,
} from '../../../types/node';
import { convertToNumber } from '../../../util/type';
import { BaseNode } from './base';
import { ComboModelData, ComboShapeMap } from '../../../types/combo';
import { ShapeTagMap } from '../../../util/shape';
import { BaseNode } from './base';

export class ImageNode extends BaseNode {
override defaultStyles = {
Expand Down
1 change: 1 addition & 0 deletions packages/g6/src/stdlib/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export * from './minimap';
export * from './toolbar';
export * from './tooltip';
export * from './timebar';
export * from './snapline';
Loading

0 comments on commit ae8713a

Please sign in to comment.