ECharts.jl icon indicating copy to clipboard operation
ECharts.jl copied to clipboard

Add savefig methods

Open randyzwitch opened this issue 7 years ago • 6 comments
trafficstars

Add methods for writing JSON to file, writing whole HTML page, GIF/PNG, etc.

randyzwitch avatar Jan 23 '18 15:01 randyzwitch

There is also a story for this via FileIO.jl: if your figure object implements show methods for SVG, PNG, PDF or EPS, it automatically hooks into the FileIO.jl save method, without you having to do anything else. So things like save('myfig.png", fig) will just work if fig supports a show method for the PNG mime type. The IOContext in these cases will have a custom property :full_fidelity=>true that indicates that the show method should write a full fidelity version, not something meant for a display, in case that makes a difference.

davidanthoff avatar Feb 05 '18 03:02 davidanthoff

It's not really clear to me what FileIO is providing here, to be honest.

I can see wanting to write an EChart directly to json (I already defined print(x::EChart), would just need to write it to file), getting a PNG (which can be done from inside echarts.js), and possibly writing a whole HTML page out (which could be factored out of my show method).

Is there any key functionality that FileIO provides that I'm not understanding?

randyzwitch avatar Feb 05 '18 16:02 randyzwitch

No, it just gives us a shared saved method that lots and lots of packages can use, that is pretty much it.

davidanthoff avatar Feb 05 '18 17:02 davidanthoff

#53 might help with this

randyzwitch avatar Feb 21 '18 15:02 randyzwitch

Are there any update on this issue? I believe it would be very useful

davide-f avatar Feb 26 '21 18:02 davide-f

I'm not actively working on this package, but happy to review pull requests from the community

randyzwitch avatar Mar 05 '21 13:03 randyzwitch