3dgraph 中文文档教程
3dgraph
演示
Install
npm install --save 3dgraph
Usage
```js
从'3dgraph'导入{ReactGraph,Node,generateRandomNodes};
让道具 = { 图形颜色:0x050505, edgesHighlightColor:0xF54848, onSelectColor:0xF54848, onHoverColor : 0xBBF548, 高亮边缘:真实的, 标签颜色:0x0ff003, showLabels : true,
handleError : (错误) => console.log(JSON.stringify(err)), onReady : () => {},
handleClick:(节点:节点)=> {}, handleDoubleClick :(节点:节点)=> {}, handleMouseOver :(节点:节点)=> {},
变换布局:假的, 布局生成器:未定义, 班级名称 : '', 节点:生成随机节点(30、500), /*
接口节点{
id : 节点ID, 位置:Vector3, 连接:连接[], incomingConnections : 连接 [], 半径:数字, 标签:标签,
color? : number,
nodeObject? : Mesh,
dx? : number,
dy? : number,
dz? : number,
weight? : number,
repulsiveForce? : number,
attractiveForce? : number
};
*/
};
ReactDOM.render(
<反应图 {…props}="">,
document.getElementById('图表') )
```
License
[npm-image]: https://img.shields.io/npm/v /live-xxx.svg [npm-url]: https://npmjs.org/package/live-xxx [特拉维斯形象]:https://img.shields.io/travis/live-js/live-xxx/master.svg [特拉维斯网址]:https://travis-ci.org/live-js/live-xxx [工作服图片]:https://img.shields.io/coveralls/live-js/live-xxx/master.svg [coveralls-url]:https://coveralls.io/r/live-js/live-xxx?branch=master
3dgraph
Demo
Install
npm install --save 3dgraph
Usage
```js
import {ReactGraph, Node, generateRandomNodes} from '3dgraph';
let props = { graphColor : 0x050505, edgesHighlightColor : 0xF54848, onSelectColor : 0xF54848, onHoverColor : 0xBBF548, highlightEdges : true, labelsColor : 0x0ff003, showLabels : true,
handleError : (err) => console.log(JSON.stringify(err)), onReady : () => {},
handleClick : (node : Node) => {}, handleDoubleClick : (node : Node) => {}, handleMouseOver : (node : Node) => {},
transformLayout : false, layoutGenerator : undefined, className : '', nodes : generateRandomNodes(30, 500), /*
interface Node{
id : NodeID, position:Vector3, connections : Connection[], incomingConnections : Connection[], radius : number, label : Label,
color? : number,
nodeObject? : Mesh,
dx? : number,
dy? : number,
dz? : number,
weight? : number,
repulsiveForce? : number,
attractiveForce? : number
};
*/
};
ReactDOM.render(
document.getElementById('graph') )
```
License
[npm-image]: https://img.shields.io/npm/v/live-xxx.svg [npm-url]: https://npmjs.org/package/live-xxx [travis-image]: https://img.shields.io/travis/live-js/live-xxx/master.svg [travis-url]: https://travis-ci.org/live-js/live-xxx [coveralls-image]: https://img.shields.io/coveralls/live-js/live-xxx/master.svg [coveralls-url]: https://coveralls.io/r/live-js/live-xxx?branch=master