Merge pull request #936 from antvis/fix-minimap-state-20191120

Fix minimap state 20191120
This commit is contained in:
Moyee 2019-11-20 14:21:25 +08:00 committed by GitHub
commit fa582df969
8 changed files with 59 additions and 25 deletions

View File

@ -5,3 +5,6 @@ dist/
mocks/
node_modules/
demos/
.cache
public
bin

View File

@ -32,11 +32,20 @@ module.exports = {
return;
}
const { item } = e;
const { item, target } = e;
const hasLocked = item.hasLocked();
if (hasLocked) {
return;
}
// 如果拖动的target 是linkPoints / anchorPoints 则不允许拖动
if (target) {
const isAnchorPoint = target.get('isAnchorPoint');
if (isAnchorPoint) {
return;
}
}
const graph = this.graph;
this.targets = [];

View File

@ -79,10 +79,12 @@ class State {
}
});
val.forEach(item => {
const id = item.get('id');
if (!map[id] && !item.destroyed) {
map[id] = true;
states[key].push(item);
if (!item.destroyed) {
const id = item.get('id');
if (!map[id]) {
map[id] = true;
states[key].push(item);
}
}
});
}

View File

@ -108,7 +108,8 @@ Shape.registerNode('circle', {
y: 0,
r: markSize
},
className: 'circle-mark-left'
className: 'circle-mark-left',
isAnchorPoint: true
});
}
@ -121,7 +122,8 @@ Shape.registerNode('circle', {
y: 0,
r: markSize
},
className: 'circle-mark-right'
className: 'circle-mark-right',
isAnchorPoint: true
});
}
@ -134,7 +136,8 @@ Shape.registerNode('circle', {
y: -r,
r: markSize
},
className: 'circle-mark-top'
className: 'circle-mark-top',
isAnchorPoint: true
});
}
@ -147,7 +150,8 @@ Shape.registerNode('circle', {
y: r,
r: markSize
},
className: 'circle-mark-bottom'
className: 'circle-mark-bottom',
isAnchorPoint: true
});
}
},

View File

@ -107,7 +107,8 @@ Shape.registerNode('diamond', {
y: 0,
r: markSize
},
className: 'diamond-mark-left'
className: 'diamond-mark-left',
isAnchorPoint: true
});
}
@ -120,7 +121,8 @@ Shape.registerNode('diamond', {
y: 0,
r: markSize
},
className: 'diamond-mark-right'
className: 'diamond-mark-right',
isAnchorPoint: true
});
}
@ -133,7 +135,8 @@ Shape.registerNode('diamond', {
y: -height / 2,
r: markSize
},
className: 'diamond-mark-top'
className: 'diamond-mark-top',
isAnchorPoint: true
});
}
@ -146,7 +149,8 @@ Shape.registerNode('diamond', {
y: height / 2,
r: markSize
},
className: 'diamond-mark-bottom'
className: 'diamond-mark-bottom',
isAnchorPoint: true
});
}
},

View File

@ -113,7 +113,8 @@ Shape.registerNode('ellipse', {
y: 0,
r: markSize
},
className: 'ellipse-mark-left'
className: 'ellipse-mark-left',
isAnchorPoint: true
});
}
@ -126,7 +127,8 @@ Shape.registerNode('ellipse', {
y: 0,
r: markSize
},
className: 'ellipse-mark-right'
className: 'ellipse-mark-right',
isAnchorPoint: true
});
}
@ -139,7 +141,8 @@ Shape.registerNode('ellipse', {
y: -ry,
r: markSize
},
className: 'ellipse-mark-top'
className: 'ellipse-mark-top',
isAnchorPoint: true
});
}
@ -152,7 +155,8 @@ Shape.registerNode('ellipse', {
y: ry,
r: markSize
},
className: 'ellipse-mark-bottom'
className: 'ellipse-mark-bottom',
isAnchorPoint: true
});
}
},

View File

@ -202,7 +202,8 @@ Shape.registerNode('modelRect', {
y: 0,
r: markSize
},
className: 'rect-mark-left'
className: 'rect-mark-left',
isAnchorPoint: true
});
}
@ -215,7 +216,8 @@ Shape.registerNode('modelRect', {
y: 0,
r: markSize
},
className: 'rect-mark-right'
className: 'rect-mark-right',
isAnchorPoint: true
});
}
@ -228,7 +230,8 @@ Shape.registerNode('modelRect', {
y: -height / 2,
r: markSize
},
className: 'rect-mark-top'
className: 'rect-mark-top',
isAnchorPoint: true
});
}
@ -241,7 +244,8 @@ Shape.registerNode('modelRect', {
y: height / 2,
r: markSize
},
className: 'rect-mark-bottom'
className: 'rect-mark-bottom',
isAnchorPoint: true
});
}
},

View File

@ -84,7 +84,8 @@ Shape.registerNode('rect', {
y: 0,
r: markSize
},
className: 'rect-mark-left'
className: 'rect-mark-left',
isAnchorPoint: true
});
}
@ -97,7 +98,8 @@ Shape.registerNode('rect', {
y: 0,
r: markSize
},
className: 'rect-mark-right'
className: 'rect-mark-right',
isAnchorPoint: true
});
}
@ -110,7 +112,8 @@ Shape.registerNode('rect', {
y: -height / 2,
r: markSize
},
className: 'rect-mark-top'
className: 'rect-mark-top',
isAnchorPoint: true
});
}
@ -123,7 +126,8 @@ Shape.registerNode('rect', {
y: height / 2,
r: markSize
},
className: 'rect-mark-bottom'
className: 'rect-mark-bottom',
isAnchorPoint: true
});
}
},