marcveens / react-drawio

React component for integrating the Diagrams (draw.io) embed iframe
MIT License
43 stars 8 forks source link

Allow png export options #20

Closed AngusParsonson closed 5 months ago

AngusParsonson commented 5 months ago

Hi,

In the embed mode documentation, there are some additional parameters that you can use e.g. when exporting a png you can set transparent background to false:

https://www.drawio.com/doc/faq/embed-mode#:~:text=For%20png%20and,the%20background%20color.

Would it be possible to add these to the exportDiagram() function?

Thanks, Angus

marcveens commented 5 months ago

Hi @AngusParsonson,

Thanks for this suggestion. I've added the types in version 0.1.8 which has been released just now!

An example of the parameters can be seen here: https://marcveens.github.io/react-drawio/?path=/story/components-drawioembed--export-data-png, with types defined here: https://github.com/marcveens/react-drawio/blob/main/src/types.ts#L235. Let me know if anything else is missing :)