Loading...
In Chinese, the character "图" (Graph) can often be used to represent many different concepts, such as image,shape,and chart or diagram,etc.
In Graph Theory, a graph is a mathematical structure used to model pairwise relationships between objects, which we typically represent with nodes (or Vertex) and edges (or Link) to denote the objects and the relationships between them.
The "graph" in G6:
Graph Theory categorizes graphs into many different types based on their structure and properties, such as:
In G6, we provide a universal graph representation capable of depicting the various types of graphs mentioned above, for example:
weight
data on the edges.Graphs are a very versatile data structure that can be used to represent a variety of scenarios, such as:
In G6, we provide a rich expression capability for graphs that can meet the needs of different scenarios. We also offer a wealth of interactive and animated effects to make the graphs more vivid and intuitive.
To create a Graph with G6, you first need to import the @antv/g6
library, and then instantiate the Graph class.
For installation instructions, refer to: Getting Started - Installation
The Graph class accepts an instantiation argument object, known as options (Options, in visualization theory it is referred to as: Specification
), which is used to configure the graph's data, element styles, layout, interactions, etc.
import { Graph } from '@antv/g6';const graph = new Graph({container: 'container',width: 800,height: 600,// ... other other options});
The instantiation process only configures the basic information of the graph. To render the graph onto the page, you still need to call the render
method.