import { BezierEdge, BezierEdgeModel } from '@logicflow/core'
import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil'

// 贝塞尔曲线
class Model extends BezierEdgeModel {
    constructor(data, graphModel) {
        super(data, graphModel)
        this.strokeWidth = 1
    }
    getTextStyle() {
        const style = super.getTextStyle()
        return getTextStyleFunction(style, this.properties)
    }

    getEdgeStyle() {
        const attributes = super.getEdgeStyle()
        const properties = this.properties
        const style = getShapeStyleFuction(attributes, properties)
        style.stroke = 'rgb(24, 125, 255)'
        return { ...style, fill: 'none' }
    }
}
export default {
    type: 'pro-bezier',
    view: BezierEdge,
    model: Model
}
