79 Star 448 Fork 108

GVPantv / G6

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.en-US.md 6.26 KB
一键复制 编辑 原始数据 按行查看 历史
hustcc 提交于 2024-03-21 20:12 . feat: add plugin watermark (#5569)

English | 简体中文

G6: A Graph Visualization Framework in TypeScript

The G6 5.0 beta version has been released. There are still many details and experience issues, and we welcome you to try it out and provide feedback. Use it with caution in production environments for now. The official version will be released with 6.6!

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@next
$ yarn add @antv/g6@next

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',
  autoFit: 'view',
  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.

JavaScript
1
https://gitee.com/antv/g6.git
git@gitee.com:antv/g6.git
antv
g6
G6
v5

搜索帮助