vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

225 lines
9.5 KiB

<!DOCTYPE html>
<html lang="en">
<head><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-61231638-1', 'auto');ga('send', 'pageview');</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Graph3d Examples</title>
<link rel="icon" HREF="favicon.ico">
<!-- Bootstrap -->
<link href="./css/bootstrap.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="./css/prettify.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./js/prettify/prettify.js"></script>
<script src="./dist/vis.js"></script>
<link href="./dist/vis.css" rel="stylesheet" type="text/css" />
<link href="./css/examples.css" rel="stylesheet" type="text/css" />
<style>
</style>
<script language="JavaScript">
function loadVis() {
// Create and populate a data table.
var data = new vis.DataSet();
// create some nice looking data with sin/cos
var counter = 0;
var steps = 50; // number of datapoints will be steps*steps
var axisMax = 314;
var axisStep = axisMax / steps;
for (var x = 0; x < axisMax; x+=axisStep) {
for (var y = 0; y < axisMax; y+=axisStep) {
var value = (Math.sin(x/50) * Math.cos(y/50) * 50 + 50);
data.add({id:counter++,x:x,y:y,z:value,style:value});
}
}
// specify options
var options = {
width: '500px',
height: '552px',
style: 'surface',
showPerspective: true,
showGrid: true,
showShadow: false,
keepAspectRatio: true,
verticalRatio: 0.5
};
// Instantiate our graph object.
var container = document.getElementById('visualization');
var graph3d = new vis.Graph3d(container, data, options);
}
</script>
</head>
<body onload="prettyPrint(); loadVis();">
<div class="navbar-wrapper">
<div class="container">
<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="./index.html#modules">Modules</a></li>
<li><a href="./index.html#download_install">Download</a></li>
<li><a href="./showcase/index.html">Showcase</a></li>
<li><a href="./index.html#contribute">Contribute</a></li>
<li><a href="./index.html#licenses">License</a></li>
</ul>
</div>
</div>
</nav>
</div>
</div>
<div class="contentWrapper">
<h1>Graph3d Examples</h1><a class="btn btn-default" href="#allExamples" role="button">View all examples »</a> <a class="btn btn-primary" href="./docs/graph3d/" role="button">View docs »</a>
<div class="textHTMLContent">This small code example shows the easiest way to get a Graph2d up and running. This code has been taken from example 1. The working example is shown next to it. Click it to start the interaction.</div>
<pre class="prettyprint lang-html">
&lt;div id="visualization"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
// Create and populate a data table.
var data = new vis.DataSet();
// create some nice looking data with sin/cos
var counter = 0;
var steps = 50; // number of datapoints will be steps*steps
var axisMax = 314;
var axisStep = axisMax / steps;
for (var x = 0; x < axisMax; x+=axisStep) {
for (var y = 0; y < axisMax; y+=axisStep) {
var value = (Math.sin(x/50) * Math.cos(y/50) * 50 + 50);
data.add({id:counter++,x:x,y:y,z:value,style:value});
}
}
// specify options
var options = {
width: '500px',
height: '552px',
style: 'surface',
showPerspective: true,
showGrid: true,
showShadow: false,
keepAspectRatio: true,
verticalRatio: 0.5
};
// Instantiate our graph object.
var container = document.getElementById('visualization');
var graph3d = new vis.Graph3d(container, data, options);
&lt;/script&gt;
</pre>
<div id="visualization"></div>
<h2 id="allExamples">All examples</h2>
<div class="container-fluid">
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/01_basics.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/1.png">
<div class="exampleTitle">basis</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/02_camera.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/2.png">
<div class="exampleTitle">camera</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/03_filter_data.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/3.png">
<div class="exampleTitle">filter</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/04_animation.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/4.png">
<div class="exampleTitle">animate</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/05_line.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/5.png">
<div class="exampleTitle">line</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/06_moving_dots.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/6.png">
<div class="exampleTitle">moving dots</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/07_dot_cloud_colors.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/7.png">
<div class="exampleTitle">dot cloud colors</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/08_dot_cloud_size.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/8.png">
<div class="exampleTitle">dot cloud size</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/09_mobile.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/9.png">
<div class="exampleTitle">mobile</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/10_styling.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/10.png">
<div class="exampleTitle">styles</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/11_tooltips.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/11.png">
<div class="exampleTitle">tooltips</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/12_custom_labels.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/12.png">
<div class="exampleTitle">custom labels</div>
</a>
</div>
<div class="col-lg-2 col-md-3 col-sm-6">
<a href="examples/graph3d/playground/index.html">
<img class="example img-responsive" src="./images/exampleScreenshots/graph3d/playground.png">
<div class="exampleTitle">playground</div>
</a>
</div>
</div>
<br />
<br />
<br />
<br />
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>