react-drawio icon indicating copy to clipboard operation
react-drawio copied to clipboard

Expose export options as DrawIoEmbed props

Open membla opened this issue 1 year ago • 2 comments

Thank you for this! Nicely written and fitted my use case perfectly. Well almost – I think the export options in exportDiagram method could be exposed as a prop on DrawIoEmbed so we can just rely on the internal draw.io Save button and the onSave listener to get the exported data with those options set.

membla avatar Nov 04 '24 17:11 membla

Hi @membla,

As far as I can see, draw.io doesn't support a thing like this. I think it would be best to trigger drawioRef.current.exportDiagram with the necessary arguments when onSave is triggered. Would that work for you?

marcveens avatar Jan 24 '25 09:01 marcveens

Hi @marcveens

I didn't mean as options to draw.io but as props to the component for your internal state.

In our setup with noSaveBtn: true we get two action buttons in the Draw.io top bar – "Save & Exit" and "Exit". Clicking "Save & Exit" will trigger onSave just as exportDiagram will, so it will unless otherwise handled lead an infinite loop.

As exportFormat for the export action is exposed as a prop to the component – could the other arguments not also be exposed?

membla avatar Jan 27 '25 08:01 membla