Closed fpayer closed 9 years ago
Also, is there a way to set the size of the svg during creation? If I try to do so after it is created, the elements inside the svg do not fit to the new dimensions.
To place the graph in a div, assuming the div is named 'diagram':
var renderer = Viva.Graph.View.renderer(graph, {
graphics: graphics,
layout: layout,
container: document.getElementById('diagram'),
});
renderer.run();
@fpayer the answer given by @Tatermen is correct. Vivagraph should also adjust its view based on window size. You can style parent container before attaching vivagraph to it. Or alternatively call reset()
method of the renderer.
First off - This is a great graphing library. I've been searching for a while to find something that had physics and created consistent graphs. All the other force-driven graphing I have seen use math.random to place nodes.
I was wondering if there is a way to choose where to place the svg element when it gets added to the DOM. It looks the SVG will always get place inside the body tag. Is there a way for me to place it in a div?