mirror of
https://gitee.com/antv/g6.git
synced 2024-12-02 11:48:29 +08:00
fix: unnecessary console
This commit is contained in:
parent
b6d4822b8e
commit
3fb089b472
@ -52,9 +52,7 @@ const ShapeFactoryBase = {
|
||||
*/
|
||||
draw(type: string, cfg: ModelConfig, group: G.Group): G.Shape {
|
||||
const shape = this.getShape(type)
|
||||
console.log('drawdraw', type, shape);
|
||||
const rst = shape.draw(cfg, group)
|
||||
console.log('keyshapekeyshape', rst);
|
||||
shape.afterDraw(cfg, group, rst)
|
||||
return rst
|
||||
},
|
||||
@ -135,7 +133,6 @@ export default class Shape {
|
||||
const className = ucfirst(factoryType)
|
||||
const factoryBase = ShapeFactoryBase
|
||||
const shapeFactory = Object.assign({}, factoryBase, cfg)
|
||||
console.log('shapeFactoryshapeFactory', shapeFactory);
|
||||
Shape[className] = shapeFactory
|
||||
shapeFactory.className = className
|
||||
// addRegister(shapeFactory)
|
||||
@ -162,7 +159,6 @@ export default class Shape {
|
||||
extendShapeType = extendShapeType ? extendShapeType : 'single-edge'
|
||||
const extendShape = shapeFactory.getShape(extendShapeType);
|
||||
const shapeObj = Object.assign({}, extendShape, edgeDefinition)
|
||||
console.log('shapeObjshapeObjshapeObj', shapeObj, extendShape);
|
||||
shapeObj['type'] = shapeType
|
||||
shapeObj['itemType'] = 'edge'
|
||||
shapeFactory[shapeType] = shapeObj
|
||||
|
@ -32,13 +32,11 @@ export const shapeBase: ShapeOptions = {
|
||||
* @return {G.Shape} 绘制的图形
|
||||
*/
|
||||
draw(cfg: ModelConfig, group: G.Group): G.Shape {
|
||||
console.log('draw in single shape mixin');
|
||||
const shape: G.Shape = this.drawShape(cfg, group)
|
||||
shape.set('className', this.itemType + CLS_SHAPE_SUFFIX)
|
||||
if (cfg.label) {
|
||||
const label = this.drawLabel(cfg, group)
|
||||
label.set('className', this.itemType + CLS_LABEL_SUFFIX)
|
||||
console.log('after drawing label', label);
|
||||
}
|
||||
return shape
|
||||
},
|
||||
@ -56,15 +54,12 @@ export const shapeBase: ShapeOptions = {
|
||||
|
||||
const labelCfg = merge({}, defaultLabelCfg, cfg.labelCfg)
|
||||
const labelStyle = this.getLabelStyle(cfg, labelCfg, group)
|
||||
console.log('drawing label', labelStyle);
|
||||
const label = group.addShape('text', {
|
||||
attrs: labelStyle
|
||||
})
|
||||
console.log('groupgroup', group);
|
||||
return label
|
||||
},
|
||||
getLabelStyleByPosition(cfg?: ModelConfig, labelCfg?: ILabelConfig, group?: G.Group): LabelStyle {
|
||||
console.log('base get label by positions');
|
||||
return {};
|
||||
},
|
||||
/**
|
||||
@ -79,7 +74,6 @@ export const shapeBase: ShapeOptions = {
|
||||
const calculateStyle = this.getLabelStyleByPosition(cfg, labelCfg, group)
|
||||
calculateStyle.text = cfg.label
|
||||
const attrName = this.itemType + 'Label' // 取 nodeLabel,edgeLabel 的配置项
|
||||
console.log('global', attrName);
|
||||
const defaultStyle = Global[attrName] ? Global[attrName].style : null
|
||||
const labelStyle = Object.assign({}, defaultStyle, calculateStyle, labelCfg.style)
|
||||
return labelStyle
|
||||
|
Loading…
Reference in New Issue
Block a user