GithubHelp home page GithubHelp logo

arnab003 / svgdecanvo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fusioncharts/svgdecanvo

0.0 1.0 0.0 162 KB

This library can be used to draw the SVG equivalent to HTML5 Canvas

License: MIT License

JavaScript 98.77% HTML 1.23%

svgdecanvo's Introduction

SvgDeCanvo - Converts SVG string to canvas

Installation

npm install svgdecanvo

Usage

var svgString = `<svg height="400" version="1.1" width="600" xmlns="http://www.w3.org/2000/svg" id="raphael-paper-0" style="overflow: hidden; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); user-select: none; cursor: default; vertical-align: middle; left: 10px; top: 10px;">
    <desc></desc>
    <defs></defs>
    <rect x="0" y="0" width="500" height="200" rx="0" ry="0" fill="#ff0000" stroke="#000000" style="fill: rgb(255, 0, 0); stroke: rgb(0, 0, 0);"></rect>
    <text x="10" y="20" fill="#ffffff" text-anchor="left" stroke="none" style="fill: rgb(255, 255, 255); stroke: none;">
    <tspan dy="11" x="10">
        Use index.html as a template to work on temporary workspace!
    </tspan>
    <tspan dy="12" x="10" xml:space="preserve"></tspan>
    <tspan dy="12" x="10">
        Ensure that your test files are named spec-&lt;somename&gt;.html</tspan>
    </text>
</svg>
`,
	canvasEle = document.createElement('canvas');


SVG = new SvgDeCanvo(svgString, canvasEle, function (canvas) {
});

svgdecanvo's People

Contributors

subhash-halder avatar rohitkr avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.