Migrated repository
Go to file
Yuxin 62599810d8
docs: refactor api docs (#6284)
* docs: refactor api docs

* docs: add 3d behavior docs

* docs: correct comments

* Revert "docs: add 3d behavior docs"

This reverts commit 5c8c64bb713ead4fa41039dad01be426a365cc00.

---------

Co-authored-by: antv <antv@antfin.com>
2024-09-05 17:43:29 +08:00
.changeset chore: update version (#6039) 2024-07-15 20:12:33 +08:00
.github fix: fix e2e test case of minimap (#6247) 2024-08-29 10:00:01 +08:00
.husky chore: update husky and add release workflow (#6041) 2024-07-16 15:35:47 +08:00
.vscode feat: add snapline plugin (#6188) 2024-08-16 18:34:21 +08:00
packages docs: refactor api docs (#6284) 2024-09-05 17:43:29 +08:00
scripts chore: refactor contribute script (#5985) 2024-07-04 16:51:12 +08:00
tests/g6 fix(plugins): fix tooltip with incorrect position after graph resize (#6246) 2024-08-29 10:00:20 +08:00
.commitlintrc.js refactor: remove unused files, and add husky and commitlint (#4383) 2023-03-23 20:43:53 +08:00
.editorconfig refactor: remove unused files, and add husky and commitlint (#4383) 2023-03-23 20:43:53 +08:00
.eslintignore chore: optimize project configs (#5299) 2023-12-28 11:05:09 +08:00
.eslintrc.js chore: config project (#6065) 2024-07-19 19:09:17 +08:00
.gitignore feat(plugins): add minimap plugin (#6103) 2024-08-02 10:07:28 +08:00
.prettierignore chore: optimize project configs (#5299) 2023-12-28 11:05:09 +08:00
.prettierrc.js chore: optimize project configs (#5299) 2023-12-28 11:05:09 +08:00
CHANGELOG.md fix spelling errors (#6223) 2024-08-22 16:24:04 +08:00
CONTRIBUTING.en-US.md docs: fix typos in elements.zh.md and CONTRIBUTING.en-US.md (#5598) 2024-03-28 00:13:07 +08:00
CONTRIBUTING.md build(site): fix #5570 (#5571) 2024-03-21 22:47:15 +08:00
LICENSE chore: commit history cleaning 2023-02-02 10:31:36 +08:00
package.json perf: fix report name to avoid error in ntfs system (#6276) 2024-09-05 10:46:03 +08:00
playwright.config.ts feat(plugins): add minimap plugin (#6103) 2024-08-02 10:07:28 +08:00
pnpm-workspace.yaml refactor: refactor canvas, support switch renderer (#6034) 2024-07-15 19:58:58 +08:00
PUBLISH.md chore: adjust release pr workflow (#6044) 2024-07-16 17:41:04 +08:00
README.en-US.md docs: update README (#5927) 2024-06-25 13:57:19 +08:00
README.md docs: update README (#5927) 2024-06-25 13:57:19 +08:00
tsconfig.json refactor: adjust project and add 3d extension package (#5497) 2024-03-05 19:13:37 +08:00
turbo.json chore: adjust release pr workflow (#6044) 2024-07-16 17:41:04 +08:00

English | 简体中文

G6: A Graph Visualization Framework in TypeScript

npm Version Build Status Coverage Status npm Download typescript npm License

IntroductionExamplesTutorialAPI

G6 is a graph visualization engine. It provides basic capabilities for graph visualization and analysis such as drawing, layout, analysis, interaction, animation, themes, and plugins. With G6, users can quickly build their own graph visualization and analysis applications, making relational data simple, transparent, and meaningful.

Features

G6, as a professional graph visualization engine, boasts the following features:

  • Rich Elements: It comes with a variety of built-in node, edge, and Combo UI elements with extensive style configurations, supports data callbacks, and has a flexible mechanism for extending custom elements.
  • Controllable Interactions: It includes more than 10 built-in interaction behaviors and offers a rich array of events, facilitating the expansion of custom interactive behaviors.
  • High-Performance Layout: The engine features more than 10 common graph layouts, some of which leverage GPU and Rust parallel computing for enhanced performance, and it supports custom layout development.
  • Convenient Plugins: Optimized built-in plugin functionality and performance, with flexible extensibility, making it easier to implement customized business capabilities.
  • Multiple Theme and Palettes: Provides two sets of built-in themes, light and dark, that integrate over 20 popular community color palettes based on the AntV new color scheme.
  • Multi-Environment Rendering: Harnessing the power of G, it supports rendering in Canvas, SVG, and WebGL, as well as server-side rendering with Node.js; it also offers plugin packages that provide powerful 3D rendering and spatial interactions based on WebGL.
  • React Ecosystem: By utilizing the React front-end ecosystem, it supports React nodes, significantly enriching the presentational styles of G6 nodes.

🔨 Getting Started

G6 is usually installed via a package manager such as npm or Yarn.

$ npm install @antv/g6

The Graph object then can be imported from G6.

<div id="container"></div>
import { Graph } from '@antv/g6';

// Get the Data.
const data = {
  nodes: [
    /* your nodes data */
  ],
  edges: [
    /* your edges data */
  ],
};

// Create the Graph instance.
const graph = new Graph({
  container: 'container',
  data,
  node: {
    palette: {
      type: 'group',
      field: 'cluster',
    },
  },
  layout: {
    type: 'force',
  },
  behaviors: ['drag-canvas', 'drag-node'],
});

// Render the Graph.
graph.render();

All goes well, you can get the following lovely graph!

🌍 Ecosystem

  • Ant Design Charts: A React chart library based on G2, G6, X6, L7.
  • Graphin: A simple React wrapper based on G6, as well as an SDK for developing graph visualization applications.

For more ecosystem open-source projects, contributions are welcome. Please feel free to submit a PR for inclusion.

📮 Contributing

  • Issue Reporting: If you encounter any issues with G6 during use, please feel free to submit an issue, along with the minimal sample code that can reproduce the problem.
  • Contribution Guide: Information on how to get involved in the development and contribution to G6.
  • Ideas Discussion: Discuss your ideas on GitHub Discussions or in the DingTalk group.

📄 License

MIT.