randyzwitch / ECharts.jl

Julia package for the Apache ECharts v4 visualization library
https://randyzwitch.com/ECharts.jl/
Other
84 stars 9 forks source link

Add savefig methods #11

Open randyzwitch opened 6 years ago

randyzwitch commented 6 years ago

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

davidanthoff commented 6 years ago

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.

randyzwitch commented 6 years ago

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?

davidanthoff commented 6 years ago

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

randyzwitch commented 6 years ago

53 might help with this

davide-f commented 3 years ago

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

randyzwitch commented 3 years ago

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