logo

G

  • Tutorials
  • API
  • Examples
  • Plugins
  • Productsantv logo arrow
  • 6.1.26
  • Introduction to the plug-in system
  • 插件结构
  • g-plugin-a11y
  • g-plugin-annotation
  • g-plugin-box2d
  • g-plugin-gpgpu
  • g-plugin-matterjs
  • g-plugin-yoga
  • g-plugin-css-select
  • g-plugin-3d
  • g-plugin-device-renderer
  • g-plugin-canvas-renderer
  • g-plugin-canvaskit-renderer
  • g-plugin-rough-canvas-renderer
  • g-plugin-rough-svg-renderer
  • g-plugin-canvas-path-generator
  • g-plugin-canvas-picker
  • g-plugin-svg-renderer
  • g-plugin-svg-picker
  • g-plugin-dom-interaction
  • g-plugin-dragndrop
  • g-plugin-control

g-plugin-rough-svg-renderer

Previous
g-plugin-rough-canvas-renderer
Next
g-plugin-canvas-path-generator

Resource

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-Interactive solution
xtechLiven Experience technology
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

Hand-drawn style rendering using the SVG version of rough.js, example.

Usage

First you need to use the g-svg renderer, register the plugin and it will replace the rendering of 2D graphics in g-plugin-svg-renderer.

import { Canvas } from '@antv/g';
import { Renderer } from '@antv/g-svg';
import { Plugin as PluginRoughSVGRenderer } from '@antv/g-plugin-rough-svg-renderer';
// create a renderer
const renderer = new Renderer();
renderer.registerPlugin(new PluginRoughSVGRenderer());
// create a canvas & use `g-svg`
const canvas = new Canvas({
container: 'container',
width: 600,
height: 500,
renderer,
});

In addition, we support all 2D graphics, among which Text, Image and HTML have no hand-drawn style.

Style properties

In addition to the style properties of 2D graphics, the configuration items provided by rough.js can also be used. See g-plugin-rough-canvas-renderer.

Picking

Non-solid fill styles leave a lot of white space, and these blank areas do not trigger interaction events. This is inconsistent with g-plugin-canvas-renderer.