Need private packages and team management tools?Check out npm Teams »

svg-drawing

1.8.2 • Public • Published

svg-drawing

npm version npm

introduction

svg-drawing is drawing svg library. This is use two.js.

demo example code

Get started

<html>
  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/two.js/0.6.0/two.min.js"></script> 
    <script src="https://unpkg.com/svg-drawing@1.8.0/lib/index.min.js"></script> 
  </head>
  <body>
    <script>
      var SvgDrawing = window['svg-drawing'].SvgDrawing
      var el = document.createElement('div')
      el.setAttribute(
        'style',
        `
      border: 1px solid #ddd;
      width: 500px;
      height: 500px;
      `
      )
      document.body.appendChild(el)
      new SvgDrawing({
        el,
        autostart: true
      })
    </script> 
  </body>
</html>

Install

yarn add two.js svg-drawing
import { SvgDrawing } from 'svg-drawing'
 
const el = document.createElement('div')
el.setAttribute(
  'style',
  `
  border: 1px solid #ddd;
  width: 500px;
  height: 500px;
  `
)
document.body.appendChid(el)
new SvgDrawing({
  el,
  autostart: true
})

Refference

https://two.js.org/examples/dynamic-vertices.html

Install

npm i svg-drawing

DownloadsWeekly Downloads

57

Version

1.8.2

License

MIT

Unpacked Size

95.7 kB

Total Files

19

Last publish

Collaborators

  • avatar