4.0.1 • Published 2 years ago

canvg v4.0.1

Weekly downloads
405,912
License
MIT
Repository
github
Last release
2 years ago

canvg

NPM version Dependencies status Build status Coverage status

JavaScript SVG parser and renderer on Canvas. It takes the URL to the SVG file or the text of the SVG file, parses it in JavaScript and renders the result on Canvas. It also can be used to rasterize SVG images.

Quickstart      Docs      Demo

Quickstart

Install this library using your favorite package manager:

pnpm add canvg
# or
yarn add canvg
# or
npm i canvg

Then, just import Canvg and use it:

import { Canvg } from 'canvg';

let v = null;

window.onload = async () => {
  const canvas = document.querySelector('canvas');
  const ctx = canvas.getContext('2d');

  v = await Canvg.from(ctx, './svgs/1.svg');

  // Start SVG rendering with animations and mouse handling.
  v.start();
};

window.onbeforeunload = () => {
  v.stop();
};

Description of all exports you can find in Documentation.

supported by Cube

Docs

What's implemented?

The end goal is everything from the SVG spec. The majority of the rendering and animation is working. If you would like to see a feature implemented, don't hesitate to add it to the issues list, or better is to create pull request 😎

woix-screensogaws-testreact-mxgraph-editorgf-mxgraph-editorkfw_vue_formsrty-scaffold@nowams/verovioscoreeditorcib-flowmapsysdiagramzpc-iclient-mapboxglcitymapui-fifth-third-shared-module@everything-registry/sub-chunk-1291roc-printangular5-canvas-drawer@antv/narrative-text-vis@antv/ava-reactandflowandflow_vue2archaeopteryx@anzerr/svg.to.imgart-canvas-path@zgfe/modules-journey@zoupers/vue-iclient-mapboxgl@zpc_npm/iclient-mapboxgl@amiiir/amcharts4@tsb/svgcode@warringkingdoms/mindmap@supermap/iclient-mapboxgl@supermap/iclient-maplibregl@supermap/iclient-ol@supermap/iclient-openlayers@supermap/react-iclient-mapboxgl@supermap/vue-iclient@supermap/vue-iclient-leaflet@supermap/vue-iclient-mapboxgl@sv-print/hiprint@woowalker/feuiaurelia-threeanton-jspdf@austrakka/alcmonavis@camol/easy-editor@bubblewrap/corebitwincadviewercuiping-componentctip-plugin-hiprintcustom-pdf-printerdata-video-editormapbox-print-pdf-with-boundsmetro-web-frontmapbox_react_aimer_visionmapbox-print-pdfmaotudb-hiprintmhpprintmichel1mind-map-examplemd-vue-plugin-hiprintneo4j-browserneo4j-browser-reactnpm-jspdf2oneviewloginoneviewlogin2new-jspdf@c29429768/jspdfmw-jspdfms-vue-eletms-vue-npmprint-designprocess-designer-jxprintscratchprintscratch.2.0process-jxpantiko-jspdfpicknplaceplanflowdigi4offlinemmeditorqgb-jspdfpylon-appqhy-jspdfpng2pdfhiprint-unityy-vue-plugin-hiprintz-mindxsvgeditxxkj-libyh-hiprintyk-vue-plugin-hiprintydt-flow-policyydt-vfdzhiskar-jspdfxal-vfdxlp_algo_flowzmh-mindzvos-print-sdk@unicom-blockchain/workflow-designer@utogether/print@vesoft-inc/veditor
4.0.1

2 years ago

3.0.10

2 years ago

4.0.0

2 years ago

3.0.9

3 years ago

3.0.8

3 years ago

3.0.7

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

3.0.0-beta.4

4 years ago

3.0.0-beta.3

4 years ago

3.0.0-beta.2

4 years ago

3.0.0-beta.1

4 years ago

3.0.0-beta.0

4 years ago

2.0.0

5 years ago

2.0.0-beta.1

5 years ago

2.0.0-beta.0

5 years ago

1.5.4

5 years ago

1.5.3

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.0.0

6 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

10 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago