# Introduction

Graphery SVG offers a simple mechanism to extend its functionality through plugins. In this way, the core of Graphery SVG kept its size and performance. You can extend Graphery SVG when advanced or specific functionality is needed. This mechanism allows us to offer a great deal of functionality on demand, avoiding that the core library includes functionalities we will never use.

# How to load a plugin?

The plugins are import as ES6 module and added to Graphery SVG with gySVG.extend(plugin). In this way, the plugin inserts, extend or replace the basic Graphery SVG methods.

import gySVG      from 'https://cdn.graphery.online/svg/1.0.0/module/index.js';
import keepAspect from 'https://cdn.graphery.online/svg/1.0.0/module/keep-aspect.plugin.js';

gySVG.extend(keepAspect);

# Included plugin

The Graphery SVG team develop several plugin for special aspect, and you can obtain this plugin directly from the CDN or with NPM package. The plugins included as part of the Graphery SVG are:

  • Debug: show messages by console with information about methods calls, errors, etc.

  • Resize Observer: observe the SVG size change.

  • Keep Aspect: keep the text al stroke proportion when the SVG size change.

  • Sequence: orchestrates various animations with a simple API.

# Custom plugins

You can easily create your own plugins to extend Graphery SVG at your convenience. Please, see the section Develop Custom Plugins.