【发布时间】:2016-09-06 06:10:09
【问题描述】:
我有一系列预创建的 SVG 符号,我想在 JointJS 中使用。 我搜索了有关使用预先创建的 SVG 的信息,发现可以通过将 SVG 放在“标记”属性中来使用 SVG 创建完整的自定义元素 - (https://groups.google.com/forum/#!topic/jointjs/pQvN_0lXPVk)。
以下是 SVG 的示例。非常感谢您对我如何在标记属性中嵌入此定义并向其添加端口提供帮助。
谢谢
<?xml version="1.0" standalone="no"?>
<svg viewBox="0 0 1024 768" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" xml:space="preserve" >
<defs >
<clipPath id="clipId0" >
<path d="M0,768 1024,768 1024,0 0,0 z" />
</clipPath>
</defs>
<g stroke-width="0.1" clip-path="url(#clipId0)" fill="none" stroke="rgb(0,0,0)" />
<g stroke-width="0.25" clip-path="url(#clipId0)" fill="rgb(0,0,0)" stroke="none" >
<path d="M1013.96,634.98 10.0392,634.98 1013.96,133.02 z" />
</g>
<g stroke-width="0.25" clip-path="url(#clipId0)" fill="none" stroke="rgb(0,0,0)" >
<polyline points="10.0392,133.02 1013.96,133.02 1013.96,634.98 10.0392,634.98 10.0392,133.02 " />
<polyline points="10.0392,634.98 1013.96,133.02 " />
</g>
</svg>
【问题讨论】: