赞
踩
g.setNode()方法的几个参数的用法
g.setNode(id, { shape: "rect", label: '开始', labelType: 'html', class: "type-1" });
shape:表示节点的形状,可选参数有rect,circle,ellipse,默认值为rect
对应的css分别是
.node rect{}
.node circle{}
.node ellipse{}
labelType:表示标签类型,可选参数string、html,默认值为string
label:表示标签的内容,如果labelType为html,label的内容可以定义为html
class:表示节点的类型,可以通过class配置不同的样式
对应css的写法为
g.type-1 > rect {
fill: #fff;
stroke: #fff;
stroke-width: 1px;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。