You can use this package in your react.js for:
-
display an external SVG file / SVG string as a react.js component.
-
zoom & pan the SVG using D3.js.
$ yarn add react-svg-file-zoom-pan
$ yarn install
$ yarn start
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%'
unit tests
$ yarn test
end-to-end tests
$ yarn start
$ yarn e2e
http://bl.ocks.org/sgruhier/1d692762f8328a2c9957