mirror of
https://gitee.com/antv/g6.git
synced 2024-12-05 05:09:07 +08:00
chore(graph): revert default item style
This commit is contained in:
parent
279f3c5fdf
commit
828025f206
@ -108,25 +108,7 @@ class Graph extends EventEmitter {
|
||||
* 边直接连接到节点的中心,不再考虑锚点
|
||||
* @type {Boolean}
|
||||
*/
|
||||
linkCenter: false,
|
||||
/**
|
||||
* 节点默认样式,也可以添加状态样式
|
||||
* 例如:
|
||||
* const graph = new G6.Graph({
|
||||
* nodeStyle: {
|
||||
* default: { fill: '#fff' },
|
||||
* selected: { fill: '#ccc', stroke: '#666' },
|
||||
* active: { lineWidth: 2 }
|
||||
* },
|
||||
* ...
|
||||
* });
|
||||
*
|
||||
*/
|
||||
nodeStyle: {},
|
||||
/**
|
||||
* 边默认样式,用法同nodeStyle
|
||||
*/
|
||||
edgeStyle: {}
|
||||
linkCenter: false
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,6 @@ class Edge extends Item {
|
||||
}
|
||||
|
||||
getShapeCfg(model) {
|
||||
model = super.getShapeCfg(model);
|
||||
const linkCenter = this.get('linkCenter'); // 如果连接到中心,忽视锚点、忽视控制点
|
||||
const cfg = {};
|
||||
if (linkCenter) {
|
||||
|
@ -258,11 +258,6 @@ class Item {
|
||||
}
|
||||
|
||||
getShapeCfg(model) {
|
||||
const styles = this.get('styles');
|
||||
if (styles && styles.default) {
|
||||
// merge graph的item样式与数据模型中的样式
|
||||
model.style = Util.mix({}, styles.default, model.style);
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,7 @@ describe('all node link center', () => {
|
||||
graph.destroy();
|
||||
expect(graph.destroyed).eql(true);
|
||||
});
|
||||
it('default node & edge style', () => {
|
||||
/* it('default node & edge style', () => {
|
||||
const graph = new G6.Graph({
|
||||
container: div,
|
||||
width: 500,
|
||||
@ -341,5 +341,5 @@ describe('all node link center', () => {
|
||||
graph.setItemState(edge, 'selected', false);
|
||||
expect(edgeKeyShape.attr('stroke')).to.equal('blue');
|
||||
expect(edgeKeyShape.attr('strokeOpacity')).to.equal(0.5);
|
||||
});
|
||||
}); */
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user