Skip to content

how to make hyperlink <a href > from node #261

@vitaliiU

Description

@vitaliiU

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions