/* ports 样式 */
const portStyle = {
    attrs: {
        circle: {
            r: 5,
            magnet: true,
            stroke: '#333',
            strokeWidth: 1,
            fill: '#fff'
        }
    }
    }
//利用NodeTool实现角标
export const textTool = {
    name:'button',
    args:{
        x:'100%',
        y:'100%',
        offset:{x:-12,y:-5},
        markup:[{
            tagName:'text',
            textContent:'aaa',
            attrs:{
                fill: '#0052D9',
                fontSize: 12,
                textAnchor: 'middle',
                pointerEvents: 'none',
            }
        }]
    }
}
//基础节点
export const baseNode = {
    shape:'rect',
    width: 120,
    height: 50,
    attrs:{
        text:{ //文字换行
            textWrap: {
                width: -10,
                ellipsis: true,
            }
        },
        body:{
            fill:'#ECF2FE',//背景色
            stroke:'#0052D9',//边框色
            strokeWidth:1,//边框宽度
            strokeDasharray:'',//虚线,如果赋值为0保存缩略图时会省略掉边框
        },
        label:{ //与svg text属性相同
            fill:'#0052D9',//文字颜色
            fontSize:14,//文字大小
            fontWeight:'normal',//文字粗细
            fontStyle:'normal',//斜体
            textDecoration:'normal',//下划线
        }
    },
    ports: { //基础连接桩
        items: [
            { group: 'port-top', id: 'p_top' },
            { group: 'port-bottom', id: 'p_bottom' },
            { group: 'port-left', id: 'p_left' },
            { group: 'port-right', id: 'p_right' },
        ],
        groups: {
            "port-top": {
                    position: 'top',
                    zIndex: 20,
                    ...portStyle
            },
            "port-bottom": {
                    position: 'bottom',
                    zIndex: 20,
                    ...portStyle
            },
            "port-left": {
                    position: 'left',
                    zIndex: 20,
                    ...portStyle
            },
            "port-right": {
                    position: 'right',
                    zIndex: 20,
                    ...portStyle
            },
        }
    },
}
//基础线条
export const baseEdge = {
    attrs:{
        line:{
            stroke:'#333',//线条颜色
            strokeWidth:2,//线条宽
            strokeDasharray:0,//虚线
        }
    }
}

//字号
export const sizeOptions = [
    30,
    28,
    26,
    24,
    22,
    20,
    18,
    16,
    14,
    12,
    10,
]
//线框宽度
export const stokeWidthOptions = [1,2,3,4,5]
//行高
export const lineHeightOptions = [ //倍数 设置的值为 value*fontSize
    {
        label:'默认',
        value:''
    },
    {
        label:'1',
        value:1,
    },
    {
        label:'1.5',
        value:1.5
    },
    {
        label:'2',
        value:2
    }]
//对齐方式
export const textAnchorOptions = [
    {
        label:'居左',
        options:{
            refX:0,
            refY:0.5,
            textAnchor:'start',
        }
    },
    {
        label:'居中',
        options:{
            refX:0.5,
            refY:0.5,
            textAnchor:'middle',
        }
    },
    {
        label:'居右',
        options:{
            refX:0.99,
            refY:0.5,
            textAnchor:'end',
        }
    }]
