VivaGraphJS
VivaGraphJS copied to clipboard
Cannot render graph
trafficstars
I have just found this library, but I cannot get to render a simple graph from the readme example. I am not using any web framework. Here is my code: `
</head>
<body>
</body>
<script type='text/javascript'>
var graph = Viva.Graph.graph();
graph.addLink(1, 2);
var graphics = Viva.Graph.View.svgGraphics();
var renderer = Viva.Graph.View.renderer(graph, {
graphics : graphics
});
renderer.run();
</script>
`
Ok so the graph was there, but it is so tiny I hade to make a 400%zoom to see it a little bit. How can I set the container size?
@soccerdroid if you use the SVG, add the CSS in your code
html, body, svg {
width: 100%;
height: 100%;
}
The example contains the CSS