react-svg-file-zoom-pan

1.0.5 • Public • Published

React Svg File Zoom Pan

You can use this package in your react.js for:

  1. display an external SVG file / SVG string as a react.js component.

  2. zoom & pan the SVG using D3.js.

1. INSTALL

$ yarn add react-svg-file-zoom-pan

2. GETTING STARTED

run storybook to see demo
$ yarn install
$ yarn storybook
usage

svgPath: an URL, which is the link of your external SVG file.

svg: a string, which is the SVG content

Please input via svgPath or svg.

duration: a number, which is the time of the transition to the original SVG size when double-clicking.

resize: a bool, which set wheter you want to set SVG attributes to width: '100%', height: '100%'

3. LICENSE

LICENSE

4. REFERENCE

http://bl.ocks.org/sgruhier/1d692762f8328a2c9957

http://bl.ocks.org/mbostock/1014829

http://stackoverflow.com/questions/21209549/embed-and-refer-to-an-external-svg-via-d3-and-or-javascript

/react-svg-file-zoom-pan/

    Package Sidebar

    Install

    npm i react-svg-file-zoom-pan

    Weekly Downloads

    26

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    29.4 kB

    Total Files

    7

    Last publish

    Collaborators

    • jasonych99