Export to image WebGL
- Dominant language
- JavaScript
- Stars
- 3.9k
- Forks
- 418
- PR merge metrics
- No merged PRs in 30d
Description
Hi! this is my code:
` graph = Viva.Graph.graph();
var layout = Viva.Graph.Layout.forceDirected(graph, {
springLength: 100,
springCoeff: 0.0008,
dragCoeff: 0.02,
gravity: -1.2
});
for (var i = 0; i < 100; ++i) {
layout.step();
}
for (var i = 0; i < nodos.length; ++i) {
graph.addNode(nodos[i].IDNodo, nodos[i]);
}
var dic = new Object();
for (var i = 0; i < enlaces.length; i++) {
if (isNaN(dic[enlaces[i].From + "**" + enlaces[i].To])) {
dic[enlaces[i].From + "**" + enlaces[i].To] = 1;
graph.addLink(enlaces[i].From, enlaces[i].To, enlaces[i].IDEnlace);
}
}
var container = document.getElementById('editorUltraLite');
var graphics = Viva.Graph.View.webglGraphics();
var nodeColor = 0x009ee8;// hex rrggbb
var circleNode = buildCircleNodeShader();
graphics.setNodeProgram(circleNode);
tamaño = 13;
graphics.node(function (node) {
return new WebglCircle(tamaño, nodeColor);
});
var events = Viva.Graph.webglInputEvents(graphics, graph);
events.mouseEnter(function (node) {
}).click(function (node) {
layout.pinNode(node, !layout.isNodePinned(node));
});
renderer = Viva.Graph.View.renderer(graph, {
layout: layout,
graphics: graphics,
container: container
});
renderer.run();
$("canvas").attr("id", "diagramaWebGL")`
I need to export to png image... how i can do this?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at Viva.Graph.View.webglGraphics(), renderer.run(), and the canvas assigned the id diagramaWebGL; determine how the WebGL output should be captured. Done means the rendered graph can be exported as a PNG with the expected browser behavior documented or tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100