anvaka / anvaka/VivaGraphJS

Node SVG not displaying after customization

Open
#284 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.9k
Forks
418
PR merge metrics
No merged PRs in 30d

Description

I was trying to follow the example codes to customize the node appearance.
I have following code:
```javascript
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](https://github.com/user-attachments/assets/0b77cd23-3652-4df5-b7c5-e7eb14d6fa9a)

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

![Image](https://github.com/user-attachments/assets/19655117-26a1-4cb8-8f89-5cd7cb970da1)

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the example with Viva.Graph.View.webglGraphics(), graphics.node(), Viva.Graph.svg("rect"), and renderer.run(). Trace how the customized SVG node is handled by the WebGL graphics path; done means customized rectangular nodes render in graphDiv while links still display.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.