Students often ask G2, G2Plot and Ant Design Charts what is the relationship between them? Which one should I choose? Here we introduce the three and their direct relationship.

The image below from AntV’s website probably tells you everything.

G2

G2 is a set of high interactive graphics syntax driven by data for general statistical charts, with a high degree of ease of use and scalability. With G2, you can build a variety of interactive charts using Canvas or SVG in a single statement without having to pay attention to the tedious implementation details of charts. Powerful interactive syntax helps visual analysis and makes charts come to life.

G2Plot

G2Plot is based on G2, shielding complex concepts, reserving G2’s powerful graphics capabilities, converting G2 capabilities into Config situation revealing through Adaptor, encapsulating the common statistical chart library in business, and helping developers draw high-quality statistical charts at the lowest cost. Covers 25+ commonly used statistical charts.

Ant Design Charts

Ant Design Charts is based on G2Plot and is the official Chart component solution for Ant Design, making up for the absence of Ant Design’s component library on statistical Charts. The charting capability is consistent with G2Plot without modifying technical concepts or configuration structures. It not only reduces the maintenance cost of this module, but also reduces the development understanding cost used by developers.

conclusion

The key point is usually at the end of the conversation, three minutes, a brief summary.

  • G2, as the underlying dependency, uses graphical syntax, which is relatively expensive to get started and powerful.

  • G2Plot is fully dependent on G2. The G2Plot layer is just based on G2’s powerful graphics, interaction, events and animation capabilities, extending different common business charts one by one, out of the box and easy to configure.

  • Ant Design Charts is the React version of G2Plot, which encapsulates G2Plot based on React without awareness

    Destroy (), update ()

    Back to the first chart, Ant Design Charts is not limited to G2Plot. At present, part of flow Charts and organizational structure Charts have been encapsulated in the basis of G6. L7 (Geographic visualization) and other chart libraries will be added later.

  • G2Plot and Ant Design Charts all show G2, which can be simply understood as aligned in capability.

    import { G2 } from ‘@antv/g2plot’; import { G2 } from ‘@ant-design/charts’;

G2 to Ant Design Charts, we have only one purpose: to lower the threshold of development, the choice depends on your understanding of each chart library, beginners recommend using the simplest Ant Design Charts, feel free to use.