projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.58k stars 1.17k forks source link

(MR-ish) Remove paths-js dependency #797

Open alexandernst opened 3 years ago

alexandernst commented 3 years ago

Currently paths-js is used in a single place in order to generate a SVG path. The code can be easily replaced with ~10 lines of pure JS code. This will allow for the entire paths-js dependency to be dropped, reducing the size of the final bundle vy ~56kb (before gzip).

You can check a diff here: https://github.com/Develatio/react-diagrams/commit/ecfed4a035653f7678587784089ad7262db3cc2b

Feel free to use the diff and merge it in this repo :)

alexandernst commented 3 years ago

Because of how the code is designed, most of the times more than 1 L expression will be generated for the same point, causing unnecesary SVG instructions. This patch fixes this: https://github.com/Develatio/react-diagrams/commit/715e611786b57e7e10c5942dd9220c203c663132