vg: soften third-party dependencies
Created by: fawick
At the moment, installing gonum.org/v1/plot/vg/draw
has a hard requirement on various non-vendored third-party packages.
I'd like to propose a refactoring of the vg/{draw,vgeps,vgimg,vgpdf,vgsvg}
so that implementations of vg.Canvas
need to be registered, which the packages could do in their func init()
.
This would make all third-party dependencies soft requirements and a user might choose not to fulfill some of them in case the respective output formats are not required (e.g. one might want to use PNG but have no need for PDF).
As a side benefit, this would make it easy to incubate new implementations of the vg.Canvas
interface, as these no longer need to be hardwired to vg/draw
.
(Incidentally, this would fix issues like #238 (closed), but that's not the objective here.)