【发布时间】:2015-07-02 11:43:05
【问题描述】:
我用 GoJS 创建了一个图表。 我需要每个节点都包含一个 href。
var template = GO(go.Node, "Auto", {
desiredSize: new go.Size(width, height)
},
GO(go.Shape, shapeMap.getValue(shape), new go.Binding("fill", "fill")),
GO(go.TextBlock, {
textAlign: 'center',
margin: 4
}, new go.Binding("stroke", "color"), new go.Binding("text", "text")));
var node = {
key: src,
color: textColor,
fill: backgroundColor,
category: shape,
text: "www.google.com"
};
diagram.model.addNodeData(node);
我尝试插入一个 Html 内容。
var node = {
key: src,
color: textColor,
fill: backgroundColor,
category: shape,
text: <a href='www.google.com'>href</a>
};
但它不起作用。我该怎么做?
【问题讨论】:
标签: javascript href gojs