SVG形状而不是模板 [英] SVG shapes instead of stencils

查看:74
本文介绍了SVG形状而不是模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是mxGraph世界的新手,并试图找出如何在JS中使用mxGraph的SVG符号。我有许多SVG文件,我想与mxGraph一起使用,而不是将每个文件转换为模板。有没有办法做到这一点?我已经尝试过将SVG符号用作形状中的图像但是我遇到的问题是连接不会一直进入符号。

I'm new in mxGraph world and trying to find out how to use SVG symbols with mxGraph in JS. I have a number of SVG files that I would like to use with mxGraph instead of converting each of these to stencils. Is there a way to do that? I have tried using SVG symbol as image in shapes but then I have the problem with connections not going all the way into the symbol.

有什么建议吗?提前完成。

Any suggestions? Thanx in advance.

推荐答案

如果您只是想将它用作图像 mxImage 可以帮助你。

If you just want to use it as an image mxImage can help you.

如果你想要一个特殊形状的svg,你自己定义为自定义形状

If you want a special shape for your svg, define it by yourself as a custom shape

或使用 svg2xml 创建模板xml。

or use svg2xml to create a stencil xml.

这篇关于SVG形状而不是模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆