# GEngine **Repository Path**: antv/gengine ## Basic Information - **Project Name**: GEngine - **Description**: 💥 A flexible rendering engine for visualization. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-14 - **Last Updated**: 2025-10-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README English | [简体中文](./README-zh_CN.md) # G  [](https://coveralls.io/github/antvis/g?branch=next) [](#badge)   [](https://www.npmjs.com/package/@antv/g) [](https://www.npmjs.com/package/@antv/g) [](http://isitmaintained.com/project/antvis/g 'Percentage of issues still open') [](https://github.com/antvis/g/pulls) As the underlying rendering engine of AntV, G is dedicated to provide consistent and high performance 2D / 3D graphics rendering capabilities for upper layer products, adapting all underlying rendering APIs (Canvas2D / SVG / WebGL / WebGPU / CanvasKit / Node.js) on the web side. In particular, it provides GPGPU support for algorithms suitable for parallel computing in graph scenarios.
## ✨ Features **Easy-to-use API**。The graphics and event system is compatible with DOM Element & Event API, and the animation system is compatible with Web Animations API, which can be adapted to the existing ecosystem of Web side such as D3, Hammer.js gesture library, etc. at a very low cost. **Support multiple rendering environments**。Support Canvas2D / SVG / WebGL / WebGPU / CanvasKit and runtime switching, and also server-side rendering. **High performance rendering and computing**。WebGPU-based GPGPU support for parallelizable algorithms. [webgpu-graph](https://g-next.antv.vision/en/docs/api/gpgpu/webgpu-graph) is a library of graph analysis algorithms using GPU acceleration. Extensible plug-in mechanism and rich set of plug-ins: - Rendering Related - [g-plugin-canvas-renderer](https://g-next.antv.vision/en/docs/plugins/canvas-renderer) Rendering 2D graphics based on Canvas2D. - [g-plugin-svg-renderer](https://g-next.antv.vision/en/docs/plugins/svg-renderer) Rendering 2D graphics based on SVG. - [g-plugin-device-renderer](https://g-next.antv.vision/en/docs/plugins/device-renderer) Rendering 2D graphics based on GPUDevice. - [g-plugin-html-renderer](https://g-next.antv.vision/en/docs/plugins/html-renderer) Rendering DOM with HTML. - [g-plugin-3d](https://g-next.antv.vision/en/docs/plugins/3d) Extended 3D capabilities. - [g-plugin-rough-canvas-renderer](https://g-next.antv.vision/en/docs/plugins/rough-canvas-renderer) Perform hand-drawn style rendering with [rough.js](https://roughjs.com/) and Canvs2D. - [g-plugin-rough-svg-renderer](https://g-next.antv.vision/en/docs/plugins/rough-svg-renderer) Perform hand-drawn style rendering with [rough.js](https://roughjs.com/) and SVG. - [g-plugin-canvaskit-renderer](https://g-next.antv.vision/en/docs/plugins/canvaskit-renderer) Rendering 2D graphics based on [Skia](https://skia.org/docs/user/modules/quickstart). - Picking - [g-plugin-canvas-picker](https://g-next.antv.vision/en/docs/plugins/canvas-picker) Do picking with Canvas2D and mathematical calculations. - [g-plugin-svg-picker](https://g-next.antv.vision/en/docs/plugins/svg-picker) Do picking with SVG and DOM API. - Interaction - [g-plugin-dom-interaction](https://g-next.antv.vision/en/docs/plugins/dom-interaction) Binds event listeners with DOM API. - [g-plugin-control](https://g-next.antv.vision/en/docs/plugins/control) Provides camera interaction for 3D scenes. - [g-plugin-dragndrop](https://g-next.antv.vision/en/docs/plugins/dragndrop) Provides Drag 'n' Drop based on PointerEvents. - Physics Engine - [g-plugin-box2d](https://g-next.antv.vision/en/docs/plugins/box2d) Based on [Box2D](https://box2d.org/). - [g-plugin-matterjs](https://g-next.antv.vision/en/docs/plugins/matterjs) Based on [matter.js](https://brm.io/matter-js/). - [g-plugin-physx](https://g-next.antv.vision/en/docs/plugins/physx) Based on [PhysX](https://developer.nvidia.com/physx-sdk). - Layout Engine - [g-plugin-yoga](https://g-next.antv.vision/en/docs/plugins/yoga) Provides Flex layout capabilities based on Yoga. - GPGPU - [g-plugin-gpgpu](https://g-next.antv.vision/en/docs/plugins/gpgpu) Provides GPGPU capabilities based on WebGPU. - CSS Selector - [g-plugin-css-select](https://g-next.antv.vision/en/docs/plugins/css-select) Supports for retrieval in the scene graph using CSS selectors. - A11y - [g-plugin-a11y](https://g-next.antv.vision/en/docs/plugins/a11y) Provides accessibility features. ## 📦 Install ```bash # Install Core $ npm install @antv/g --save # Canvas Renderer $ npm install @antv/g-canvas --save # SVG Renderer $ npm install @antv/g-svg --save # WebGL Renderer $ npm install @antv/g-webgl --save ``` ## 🔨 Usage ```html ``` ```js import { Circle, Canvas, CanvasEvent } from '@antv/g'; import { Renderer as CanvasRenderer } from '@antv/g-canvas'; // or // import { Renderer as WebGLRenderer } from '@antv/g-webgl'; // import { Renderer as SVGRenderer } from '@antv/g-svg'; // create a canvas const canvas = new Canvas({ container: 'container', width: 500, height: 500, renderer: new CanvasRenderer(), // select a renderer }); // create a circle const circle = new Circle({ style: { cx: 100, cy: 100, r: 50, fill: 'red', stroke: 'blue', lineWidth: 5, }, }); canvas.addEventListener(CanvasEvent.READY, function () { // append to canvas canvas.appendChild(circle); // add listener for `click` event circle.addEventListener('click', function () { this.style.fill = 'green'; }); }); ``` ## ⌨️ Development Start previewing demos: ```bash git clone git@github.com:antvis/g.git cd g pnpm install pnpm build pnpm dev ``` ### API Spec Start a dev-server on root dir, eg. `http-server`: ```bash http-server -p 9090 ``` Open api.html on `localhost:9090/spec/api.html`. ### Run test cases Build and run test cases: ```bash pnpm build pnpm test ``` ### Run demos Preview our dev demos: ```bash pnpm build pnpm dev ``` ## Inspired by - [Sprite.js](https://github.com/spritejs/spritejs) - [Pixi.js](https://pixijs.com/) - [PlayCanvas](https://playcanvas.com/) - [WebKit](https://github.com/WebKit/WebKit/blob/main/Source/WebCore) ## Contributors | [