chrvadala / react-svg-pan-zoom

:eyes: A React component that adds pan and zoom features to SVG
https://chrvadala.github.io/react-svg-pan-zoom/
MIT License
677 stars 125 forks source link

Members required for customized toolbar are not exported #191

Closed justin-hackin closed 3 years ago

justin-hackin commented 3 years ago

Bug reports:

One can not follow the instructions provided here https://github.com/chrvadala/react-svg-pan-zoom/issues/134 for customizing toolbar because the toolbar code contains imports relative to the src directory of this project. This requires obscure workarounds so that the dependent project can build the source files of this project.

Features:

Although TOOL_PAN, TOOL_ZOOM_IN, TOOL_ZOOM_OUT, and fitToViewer are exported, ToolbarButton and the icons are not. A simple solution: export ToolbarButton and icon components.

justin-hackin commented 3 years ago

Here's a PR https://github.com/chrvadala/react-svg-pan-zoom/pull/192

However, you might want to consider enabling custom icons as props since I think this is the most common use case and having to copy-paste the existing code is not DRY. Though, in my use case, I also wanted to remove the none tool and props could be provided for this as well.

chrvadala commented 3 years ago

PR released with v3.9.0

justin-hackin commented 3 years ago

Thanks again for accepting the PR. You helped me to build this https://www.youtube.com/watch?v=_J6QBTSfmpU

chrvadala commented 3 years ago

Wow, your lanterns are awesome and great use of the pan zoom tool! Thanks for sharing