src/javascript/lib/drawings/simple_graph.js
/**
     *  Create a node object and add it to the scene.
     */
Create a node object and add it to the scene.
Create a node object and add it to the scene .
function drawNode(node) {
        var draw_object = new THREE.Mesh(geometry, new THREE.MeshPhongMaterial({
            color: node.data.color,
            opacity: 0.5
        }));
        if (that.show_labels) {
            if (node.data.title != undefined) {
                var label_object = new THREE.Label(node.data.title);
            } else {
                var label_object = new THREE.Label(node.id);
            }
            node.data.label_object = label_object;
            scene.add(node.data.label_object);
        }
        var area = 5000;
        draw_object.position.x = Math.floor(Math.random() * (area + area + 1) - area);
        draw_object.position.y = Math.floor(Math.random() * (area + area + 1) - area);
        if (that.layout === "3d") {
            draw_object.position.z = Math.floor(Math.random() * (area + area + 1) - area);
        }
        draw_object.id = node.id;
        node.data.draw_object = draw_object;
        node.position = draw_object.position;
        scene.add(node.data.draw_object);
    }
function drawNode ( node ) { var draw_object = new THREE . Mesh ( geometry , new THREE . MeshPhongMaterial ( { color : node . data . color , opacity : 0.5 } ) ) ; if ( that . show_labels ) { if ( node . data . title != undefined ) { var label_object = new THREE . Label ( node . data . title ) ; } else { var label_object = new THREE . Label ( node . id ) ; } node . data . label_object = label_object ; scene . add ( node . data . label_object ) ; } var area = 5000 ; draw_object . position . x = Math . floor ( Math . random ( ) * ( area + area + 1 ) - area ) ; draw_object . position . y = Math . floor ( Math . random ( ) * ( area + area + 1 ) - area ) ; if ( that . layout === "3d" ) { draw_object . position . z = Math . floor ( Math . random ( ) * ( area + area + 1 ) - area ) ; } draw_object . id = node . id ; node . data . draw_object = draw_object ; node . position = draw_object . position ; scene . add ( node . data . draw_object ) ; }
Create a node object and add it to the scene.
Create a node object and add it to the scene .
//var draw_object = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({ //    color: node.data.color, //   // opacity: 0.5 //}));