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

Remove Base.Graphics from Base and make it a package #9862

Closed
dhoegh opened this issue Jan 20, 2015 · 12 comments
Closed

Remove Base.Graphics from Base and make it a package #9862

dhoegh opened this issue Jan 20, 2015 · 12 comments
Labels
excision Removal of code from Base or the repository needs decision A decision on this change is needed
Milestone

Comments

@dhoegh
Copy link
Contributor

dhoegh commented Jan 20, 2015

By looking at @timholy coverage results, I saw that Base.graphics is virtually untested. The module seems to be self-sustained, it does not seem to be used in Base or requiring any low level code implementation in Base. Therefore I think it is natural to implement it in a package in order to reduce Base according to #5155. The module seems to be used in the Color.jl package.

If could be removed it would be good to get the deprecation process going in 0.4

@garborg
Copy link
Contributor

garborg commented Jan 20, 2015

Winston uses it. Wherever it goes, my main wish would for it to evolve into something both Winston and Compose use, instead of Compose needing to define its own version of BoundingBox and co., without sharing methods.

Then I'd like bounds, points, polygons, etc., in geospatial packages to be able to inherit / delegate methods and draw to either backend for free. Maybe moving it out into a package would mean more freedom to iterate on design until it was more useful?

@timholy
Copy link
Member

timholy commented Jan 20, 2015

Relevant: #9814

I think it exists in the hopes that it will encourage some degree of sharing among various packages dealing with graphics. In addition to Color.jl, it's used at least in Cairo.jl, Gtk.jl, Images.jl, ImageView.jl, ProfileView.jl, Tk.jl, and Winston.jl. But it hasn't been used in quite a few other packages, like Compose.jl or (AFAICT) any of the OpenGL stuff.

@dcjones
Copy link
Contributor

dcjones commented Jan 20, 2015

It's not just a matter of refactoring Compose to use Base.Graphics. Nothing in Base.Graphics is remotely compatible with Compose. The issue is that Base.Graphics defines a imperative graphics API (like Cairo) whereas compose is thoroughly declarative (like SVG). Though it would be possible to write a compatibility layer to coerce compose graphics out of this api, it wouldn't be fun to implement nor greatly benefit anyone.

If we were to share graphics code, maybe a more fruitful direction would be to do so at the level of geometry: define types and functions in Base for polygons, rectangles, lines, curves, computing bounding boxes over geometry, etc.

@garborg
Copy link
Contributor

garborg commented Jan 20, 2015

Sorry, I guess I maybe I underestimated the difficulty of an upstream package's points, lines, polygons, boundingboxes, being usable by either approach, in spite of the divergence of approaches. My 'for free' wording was a little stronger than I was actually envisioning, but your suggestion about some geometric types in Base, along with whatever methods on them are basic enough to be useful across approaches, is what I was thinking.

@JeffBezanson
Copy link
Member

The intent of Base.Graphics was to capture whatever is useful to share among graphics packages. So, anything that's not useful in that way should be removed. Based on the current state of things, it looks like it would make sense to create an external Geometry.jl package and remove Base.Graphics.

@ViralBShah
Copy link
Member

I have been thinking about this too, and an external package seems like the way to go.

@tknopp
Copy link
Contributor

tknopp commented Jan 21, 2015

+1 Yes it is always good to agree on common infrastructure. But this should evolve in packages.

It is always very hard to define an interface before knowing the exact requirements. And the big advantage when this evolves in packages is that one has more flexibility to try things out an experiment with ideas. Further this is driven by existing code (in Winston and Compose). So its likely that whatever the result is that it useful.

@lobingera
Copy link

I like the idea to centralize (2D)-geometry related functions and data types into a dedicated package.
point types, line types, polygons, splines (b- and other)
and an extensive library for converting (e.g. complex value to a 2D point).
And i think this could stay in Base - so we limit the propability someone reinvents this in her/his package.

Everything above that (point to line relations, inside-outside testing etc.) is already a matter of computational geometry and this a dangerous numercal field, so i'd rather see library calls there, then local julia code.

GCAL, lib2geom etc.

@IainNZ
Copy link
Member

IainNZ commented Jan 22, 2015

+100 to removing it into a package, its just lost inside Base and isn't a fully formed idea yet. It can always come back in the future (but I don't think it needs to).

@ViralBShah ViralBShah added the needs decision A decision on this change is needed label Jan 23, 2015
@ViralBShah ViralBShah added this to the 0.4 milestone Feb 1, 2015
@ViralBShah
Copy link
Member

#9814 should be included in the new package when this is done.

@dhoegh
Copy link
Contributor Author

dhoegh commented Feb 26, 2015

Should this be closed due to #10150

@ivarne ivarne closed this as completed Feb 26, 2015
@ivarne
Copy link
Member

ivarne commented Feb 26, 2015

Yes, I think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
excision Removal of code from Base or the repository needs decision A decision on this change is needed
Projects
None yet
Development

No branches or pull requests