Thanks to visit codestin.com
Credit goes to github.com

Skip to content

xiebanglong/g

 
 

Repository files navigation

English | 简体中文

G

npm package npm downloads npm package npm downloads Percentage of issues still open

  • A powerful rendering engine for AntV providing canvas and svg draw.

✨ Features

  • Powerful and scalable rendering capability with built-in basic Graphics.
  • Excellent rendering performance and supports visualization scenarios with large amounts of data.
  • Complete simulation of browser DOM events, and no difference from native events.
  • Smooth animation implementation and rich configuration interfaces.
  • While providing Canvas and SVG version of implementation, and both of API basic consistent.

📦 Install

# Canvas version
$ npm install @antv/g-canvas --save

# SVG version
$ npm install @antv/g-svg --save

🔨 Usage

<div id="container"></div>
import { Circle } 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: {
    x: 100,
    y: 100,
    r: 50,
    fill: 'red',
    stroke: 'blue',
    lineWidth: 5,
  },
});

// append to canvas
canvas.appendChild(circle);

⌨️ Development

$ git clone [email protected]:antvis/g.git
$ cd g
$ yarn install
$ yarn watch
$ yarn start

About

A powerful rendering engine implemented with Canvas2D / SVG / WebGL / WebGPU.

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 52.0%
  • TypeScript 48.0%