Mon 21 Jul 22:43:21 CEST 2025
This commit is contained in:
parent
6b95bd50bc
commit
3fbdd2bc79
68
js/dos/ext/vis/examples/graph3d/07_dot_cloud_colors.html
Normal file
68
js/dos/ext/vis/examples/graph3d/07_dot_cloud_colors.html
Normal file
|
@ -0,0 +1,68 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Graph 3D cloud with colored dots</title>
|
||||
|
||||
<style>
|
||||
body {font: 10pt arial;}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" src="../../dist/vis.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var data = null;
|
||||
var graph = null;
|
||||
|
||||
|
||||
// Called when the Visualization API is loaded.
|
||||
function drawVisualization() {
|
||||
// create the data table.
|
||||
data = new vis.DataSet();
|
||||
|
||||
// create some shortcuts to math functions
|
||||
var sqrt = Math.sqrt;
|
||||
var pow = Math.pow;
|
||||
var random = Math.random;
|
||||
|
||||
// create the animation data
|
||||
var imax = 100;
|
||||
for (var i = 0; i < imax; i++) {
|
||||
var x = pow(random(), 2);
|
||||
var y = pow(random(), 2);
|
||||
var z = pow(random(), 2);
|
||||
var dist = sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2));
|
||||
|
||||
data.add({x:x,y:y,z:z,style:dist});
|
||||
}
|
||||
|
||||
// specify options
|
||||
var options = {
|
||||
width: '600px',
|
||||
height: '600px',
|
||||
style: 'dot-color',
|
||||
showPerspective: true,
|
||||
showGrid: true,
|
||||
keepAspectRatio: true,
|
||||
verticalRatio: 1.0,
|
||||
legendLabel: 'distance',
|
||||
cameraPosition: {
|
||||
horizontal: -0.35,
|
||||
vertical: 0.22,
|
||||
distance: 1.8
|
||||
}
|
||||
};
|
||||
|
||||
// create our graph
|
||||
var container = document.getElementById('mygraph');
|
||||
graph = new vis.Graph3d(container, data, options);
|
||||
}
|
||||
</script>
|
||||
<script src="../googleAnalytics.js"></script>
|
||||
</head>
|
||||
|
||||
<body onload="drawVisualization()">
|
||||
<div id="mygraph"></div>
|
||||
|
||||
<div id="info"></div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user