Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

通过npm安装的包 添加anchor为菱形不生效? #123

Open
gzhanghui opened this issue Jul 21, 2019 · 1 comment
Open

通过npm安装的包 添加anchor为菱形不生效? #123

gzhanghui opened this issue Jul 21, 2019 · 1 comment

Comments

@gzhanghui
Copy link

gzhanghui commented Jul 21, 2019

var modelInputNodeCfg = {
 shape: 'marker', // 可选值 marker,image
 symbol: 'diamond', // square: diamond:  triangle:  "triangle-down"
 type: 'input',
 style: {
   // fill: 'red',
   // fillOpacity: 1,
   // stroke: 'blue'
 }
};
// 设置锚点
 anchor: [
   [0.5, 0,modelInputNodeCfg ], // 上面边的中点
   [0.5, 1] // 下边边的中点

 ]
@gzhanghui
Copy link
Author

把源码格式化后看到源码中是有备选项的,就是不知道怎么设置

 u.Symbols = {
                circle: function(t, e, n) {
                   /* return [
                        ["M", t, e],
                        ["m", -n, 0],
                        ["a", n, n, 0, 1, 0, 2 * n, 0],
                        ["a", n, n, 0, 1, 0, 2 * -n, 0]
                    ]*/
                    return [
                       ["M", t - n, e],
                        ["L", t, e - n],
                        ["L", t + n, e],
                        ["L", t, e + n],
                        ["Z"]
                    ]
                },
                square: function(t, e, n) {
                    return [
                        ["M", t - n, e - n],
                        ["L", t + n, e - n],
                        ["L", t + n, e + n],
                        ["L", t - n, e + n],
                        ["Z"]
                    ]
                },
                diamond: function(t, e, n) {
                    return [
                        ["M", t - n, e],
                        ["L", t, e - n],
                        ["L", t + n, e],
                        ["L", t, e + n],
                        ["Z"]
                    ]
                }
...
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant