VivaGraphJS
VivaGraphJS copied to clipboard
how to make hyperlink <a href > from node
Good day. Trying to make in SVG something hyperlink like this:
in VivaGraphJS code i try:
graphics.node(function(node) {
var ui = Viva.Graph.svg("g"),
svgText = Viva.Graph.svg("text").attr("y", "-4px").text(node.id),
img = Viva.Graph.svg("image")
.attr("width", nodeSize)
.attr("height", nodeSize)
.link("https://secure.gravatar.com/avatar/" + node.data),
a = Viva.Graph.svg("a").attr("href", "https://vitalii-u.com/");
// .text('some text')
ui.append(svgText);
ui.append(a);
ui.append(img);
return ui;
})
and in browser i see:
function text(textContent) { if (textContent !== undefined) { svgElement.textContent = textContent; return svgElement; } return svgElement.textContent; }I don't understand, what need to wrap image or text or thomething be giperlink ? Thank you.