blockdiag / blockdiag_interactive_shell

15 stars 7 forks source link

Save as PNG #4

Open tk0miya opened 6 years ago

tk0miya commented 6 years ago

That would be an awesome feature. Google gives some hints, but I haven't got enough time to dig into this yet.


tk0miya commented 6 years ago

From Chad Whitacre on 2015-06-10 14:20:51+00:00

Here's a hack from mbostock using the CANVAS element as a go-between.

tk0miya commented 6 years ago

From Takeshi KOMIYA on 2015-06-12 14:08:50+00:00

The interactive shell is based on blockdiag. So, it already has capability of saving as PNG.

but I do not provide the feature. because GAE does not support to install Pillow library by user. And another reason is that generating PNG image is a heavy process. if I provide the feature, it wastes CPU times and it causes service termination from depletion of free time of GAE.

Perhaps, moving to heroku resolve these problems. but I don't have any time for that.

tk0miya commented 6 years ago

From anatoly techtonik on 2015-06-14 08:18:26+00:00

The links to canvas element is should provide browser-only solution, but that didn't work for me (yet?)

tk0miya commented 6 years ago

From Takeshi KOMIYA on 2015-06-30 14:39:50+00:00

Maybe, it caused from that blockdiag and interactive shell do not support canvas element. They use svg element.

tk0miya commented 6 years ago

From anatoly techtonik on 2015-07-01 14:44:44+00:00

It seems like I was able to get SVG rendered to CANVAS and copied to clipboard as PNG. But my goal was to copy SVG directly to clipboard, and this goal failed - https://code.google.com/p/chromium/issues/detail?id=504700, and I didn't save a reference code for previous attempt.

tk0miya commented 6 years ago

From anatoly techtonik on 2017-05-13 13:14:08+00:00

See https://bitbucket.org/blockdiag/blockdiag_interactive_shell/pull-requests/8/add-ability-to-save-png/diff for the fix.