VivaGraphJS icon indicating copy to clipboard operation
VivaGraphJS copied to clipboard

Cannot render graph

Open soccerdroid opened this issue 6 years ago • 2 comments
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>
`

soccerdroid avatar May 30 '19 13:05 soccerdroid

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 avatar May 30 '19 13:05 soccerdroid

@soccerdroid if you use the SVG, add the CSS in your code

html, body, svg { 
   width: 100%; 
   height: 100%;
}

The example contains the CSS

vincenzopalazzo avatar Oct 16 '19 17:10 vincenzopalazzo