Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vitaliiU opened this issue May 28, 2021 · 0 comments
Open

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

vitaliiU opened this issue May 28, 2021 · 0 comments

Comments

@vitaliiU
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant