Wiki

Clone wiki

Tree Visualization API / Starting With the API

Getting Started with TreeVis API

  • Download treevis.js
  • Open notepad or any text editor and save it as Example.htm.
  • Include the trevis.js in head section of HTML file.
  • Inside the HTML file
  • Add placeholder area [SVG Element] for displaying the visualization.
  • Load your data [TreeML format].
  • Select the tree visualization layout.

Example.htm

<html>
	<head>
		<script type="text/javascript" src="treevis.js"></script>   <!--Add Library treevis.js -->
	</head>
	<body>
		<svg id="explicitTree" width="800" height="800"></svg> <!--Placeholderor drawing area for displaying the visualization -->
		<svg id="implicitTree" width="800" height="800"></svg>
		<script>
			tree=loadTreeML("data/aseLab.xml"); /*Load the dataset*/
			useDesignSpace("explicitTree","implicitTree",tree,"sqtreemap"); /*Render the visualization in Squarified treemap layout*/
		</script>
		
	</body>
</html>

Updated