Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export in fabric_drawing() #11

Open
dtkaplan opened this issue Jan 29, 2021 · 4 comments
Open

Export in fabric_drawing() #11

dtkaplan opened this issue Jan 29, 2021 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@dtkaplan
Copy link

There's an export button connected to the canvas produced by fabric_drawing(), and I can see in the source code that the click method invokes saveAs(). But I don't know how to get saveAs() to save the blob, or if it is saving it, where that is. I'm not a JavaScript programmer, which is precisely why tools like this are so helpful. I've looked through various forums about saveAs(), some suggesting that one needs to implement the function in the document (which I've tried, creating a stub that indeed gets called when clicking "export." Others suggest that saveAs() is built-in to the browser, but you need to set certain permissions to use it.

I wonder if you might include an example in the package that allows drawings to be saved or copied to the clipboard or a Shiny object or whatever. This would be extremely helpful in the application I'm developing for letting statistics and math students draw on top of graphs and hand in their work.

@feddelegrand7
Copy link
Owner

Hi, @dtkaplan for now there is only one method for saving the drawing which the export button that saves the canvas as a PNG image. What do you mean exactly by the blob? for fabric_drawing( ), the blob is "the canvas" or the image that will be rendered from the canvas.

@feddelegrand7
Copy link
Owner

You can find here some examples concerning the export button https://ihaddadenfodil.com/post/fabricerin-a-tutorial/

@dtkaplan
Copy link
Author

dtkaplan commented Jan 30, 2021 via email

@feddelegrand7
Copy link
Owner

Hi, thanks @dtkaplan I find the idea interesting, add an additional layer to a shiny output so that one (for example) can draw on it, unfortunately, at the moment I don't have the skills required to create this feature as it's quite complex. Will think about it tough, thanks again.

@feddelegrand7 feddelegrand7 added enhancement New feature or request help wanted Extra attention is needed labels Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants