A high-performance modern set of graph rendering components, which enables users to visualize large graph datasets on the web.
Перейти к файлу
Chris Trevino f67fb849d4
Merge pull request #26 from microsoft/release/v0_7_0
Release v0.7.0
2021-12-09 10:18:43 -08:00
.devcontainer update codespace 2021-12-03 19:33:58 +00:00
.github/workflows update ci 2021-12-02 15:33:00 -08:00
.vscode
.yarn rebuild yarn lock 2021-12-08 19:00:32 +00:00
__mocks__/@luma.gl
examples
packages add access: public to published libraries' publishConfig 2021-12-08 18:32:28 +00:00
scripts remove unused script 2021-11-30 17:28:24 -08:00
.docsignore
.docsrc
.editorconfig
.eslintignore
.eslintrc update eslint configuration 2021-12-01 12:22:31 -08:00
.gitattributes
.gitignore run clean, update gitignore 2021-11-30 16:21:03 -08:00
.huskyrc.json
.pnp.cjs rebuild yarn lock 2021-12-08 19:00:32 +00:00
.pnp.loader.mjs update yarn 2021-11-17 16:31:43 -08:00
.prettierignore update yarn 2021-11-17 16:31:43 -08:00
.prettierrc
.spelling
.vsts-ci.yml
.yarnrc update yarn 2021-11-17 16:31:43 -08:00
.yarnrc.bak update yarn 2021-11-17 16:31:43 -08:00
.yarnrc.yml update .yarnrc 2021-12-08 13:04:45 -08:00
CODE_OF_CONDUCT.md
LICENSE
README.md
SECURITY.md
babel.config.js add react 17 enzyme adapter 2021-12-02 17:04:27 -08:00
jest.config.js get tests running 2021-12-01 12:07:37 -08:00
jest.setup.js add react 17 enzyme adapter 2021-12-02 17:04:27 -08:00
licenses-to-fail-config.js
package.json add access: public to published libraries' publishConfig 2021-12-08 18:32:28 +00:00
tsconfig.json add react 17 enzyme adapter 2021-12-02 17:04:27 -08:00
yarn.lock rebuild yarn lock 2021-12-08 19:00:32 +00:00

README.md

graspologic-js

CI

📄Overview

graspologic-js is a high-performance graph toolkit for the web.

Features

  • A fast, memory-efficient, graph renderer.
    • WebGL based engine that can handle hundreds of thousands or even millions of nodes.
    • Utilizes SharedArrayBuffer for efficient and fast memory storage that can be shared between the UI thread and Web Workers, allowing for blazing fast layout algorithms that display output in real-time.
    • Supports ReactJS or standalone.
  • Contains experimental implementations of a few popular graph layout algorithms that work directly with the graph renderer.

graspologic-js is a companion library to graspologic, which is a python library for intelligently building networks and network embeddings, and for analyzing connected data.

🌐Browser Compatibility

Any browser which supports WebGL2. To see which browsers support WebGL2, please see caniuse.com

It is recommended that you use a JavaScript bundling tool, such as Webpack or Browserify, as graspologic-js only exports CommonJS and ECMAScript module formats. It does not provide a web-friendly bundle in order to allow bundling tools to use tree-shaking to minimize dependency size.

It is also recommended that your bundler targets the following browser versions in order to minimize the amount of polyfills, which can adversely affect performance:

  • Edge 79+
  • Firefox 60+
  • Chrome 72+

🔥 2 Minute Quick Start

React

Install the @graspologic/react dependency

npm install @graspologic/react

Add the GraphView component to your app

import React, { useMemo } from 'react'
import { GraphView } from '@graspologic/react'
export default () => {
	const data = useMemo(
		() => ({
			// Pass in your data here
			nodes: [],
			edges: [],
		}),
		[],
	)
	return <GraphView style={{ width: '100%', height: '100%' }} data={data} />
}

Standalone

Install the @graspologic/renderer dependency

npm install @graspologic/renderer
import { WebGLGraphRenderer } from '@graspologic/renderer'
import { GraphContainer } from '@graspologic/graph'

function createRenderer(width, height) {
	// Create a renderer and add it to the container
	const renderer = WebGLGraphRenderer.createInstance({
		width,
		height,
	})

	// Load the dataset
	renderer.load(
		GraphContainer.intern({
			// Pass in your data here
			nodes: [],
			edges: [],
		}),
	)

	// Start rendering
	renderer.start()

	// Return the container
	return renderer
}

// ...elsewhere in your app

// Instantiate the renderer
const renderer = createRenderer(500, 500)

// Add the renderer's canvas to your container element
containerElement.appendChild(renderer.view)

You can see more examples in the examples folder.

License

Under the permissive MIT license

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.