@graspologic/renderer
Contains the graspologic-js graph renderer.
React bindings are also available here.
Basic Usage
// Simple graph datasetconst GRAPH_DATA = nodes: id: 'A' x: -10 y: 10 z: 0 radius: 5 // Format 0xBBGGRR color: 0x00ff00 id: 'B' x: 10 y: 10 z: 0 radius: 5 // Format 0xBBGGRR color: 0xff0000 edges: source: 'A' target: 'B' weight: 1 { // Create a renderer and add it to the container const renderer = WebGLGraphRenderer // Load the dataset renderer // Start rendering rendererstart return renderer} { // Create the renderer const renderer = // Return the renderer's canvas to the docs site, so it can be viewed return rendererview}
Extended Usage
{ // Create a renderer and add it to the container const renderer = WebGLGraphRenderer // A function which takes a "group" property from a node and returns a color const categoricalColorizer = utils // Load the dataset renderer // Enable the click events // Add a renderer that highlights hovered nodes const renderable = renderergl renderablecolor = 05 05 08 1 rendererscene renderer // Start rendering rendererstart return renderer} const GRAPH_DATA = exampleData { // Create the renderer const renderer = let selectedNodeIds = renderer // Return the renderer's canvas to the docs site, so it can be viewed return rendererview}
See the API documentation or examples for additional examples.