Skip to content

Node SVG not displaying after customization #284

@arne-fuchs

Description

@arne-fuchs

I was trying to follow the example codes to customize the node appearance.
I have following code:

    var graphics = Viva.Graph.View.webglGraphics();
    graphics.node(function(node) {
        console.log(node.id);
        return Viva.Graph.svg("rect")
            .attr("width", 10)
            .attr("height", 10)
            .attr("fill", "#00a2e8");
    });

    // specify where it should be rendered:
    var renderer = Viva.Graph.View.renderer(graph, {
        container: document.getElementById('graphDiv'),
        layout : layout,
        graphics: graphics,
        renderLinks : true
    });
    renderer.run();

and nodes disappear:

Image

Removing graphics.node(... reveals the nodes again:

Image

Behind Viva.Graph.svg("rect") is a valid object.

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