VivaGraphJS icon indicating copy to clipboard operation
VivaGraphJS copied to clipboard

how to make hyperlink <a href > from node

Open vitaliiU opened this issue 3 years ago • 0 comments

Good day. Trying to make in SVG something hyperlink like this:

circle

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.

vitaliiU avatar May 28 '21 07:05 vitaliiU