0

有没有办法用已经定义的形状制作自定义形状?我想用已经定义的单元格形状制作新的单元格形状

例如......(它不是工作代码,我想要这样)

{
    type: 'usercustom.Images',
    size: { width: 53, height: 42 },
    attrs: [
        {
            type: 'standard.Image',
            size: { width: 53, height: 42 },
            attrs: {
                root: {
                    dataTooltip: 'Image1',
                    dataTooltipPosition: 'left',
                    dataTooltipPositionSelector: '.joint-stencil'
                },
                image: {
                    xlinkHref: '/assets/imageIcons/Image1.png'
                },
                body: {
                    fill: 'transparent',
                    stroke: '#31d0c6',
                    strokeWidth: 2,
                    strokeDasharray: '0'
                },
                label: {
                    text: 'Image1',
                    fontFamily: 'Roboto Condensed',
                    fontWeight: 'Normal',
                    fontSize: 11,
                    fill: '#c6c7e2'
                }
            }
        },
        {
            type: 'standard.Image',
            size: { width: 53, height: 42 },
            attrs: {
                root: {
                    dataTooltip: 'Image2',
                    dataTooltipPosition: 'left',
                    dataTooltipPositionSelector: '.joint-stencil'
                },
                image: {
                    xlinkHref: '/assets/imageIcons/Image2.png'
                },
                body: {
                    fill: 'transparent',
                    stroke: '#31d0c6',
                    strokeWidth: 2,
                    strokeDasharray: '0'
                },
                label: {
                    text: 'Image2',
                    fontFamily: 'Roboto Condensed',
                    fontWeight: 'Normal',
                    fontSize: 11,
                    fill: '#c6c7e2'
                }
            }
        }
    ],
    markup: [{
        tagName: 'g',
        children: [{
            tagName: 'image',
            selector: 'image'
        },{
            tagName: 'image',
            selector: 'image2'
        }]
    }, {
        tagName: 'text',
        selector: 'label'
    }]
}

在此示例代码中,自定义元素的类型(usercustom.Images)有两个已定义的类型形状(标准图像)。

standard.Image 类型已经存在。我想在两个(或三个,四个......)周围制作一个外壳。

你有什么好主意吗?

先感谢您。

4

0 回答 0