{"action":"created","issue":{"url":"https://api.github.com/repos/vispy/vispy/issues/895","labels_url":"https://api.github.com/repos/vispy/vispy/issues/895/labels{/name}","comments_url":"https://api.github.com/repos/vispy/vispy/issues/895/comments","events_url":"https://api.github.com/repos/vispy/vispy/issues/895/events","html_url":"https://github.com/vispy/vispy/pull/895","id":74710281,"number":895,"title":"WIP: Visual views","user":{"login":"campagnola","id":940580,"avatar_url":"https://avatars.githubusercontent.com/u/940580?v=3","gravatar_id":"","url":"https://api.github.com/users/campagnola","html_url":"https://github.com/campagnola","followers_url":"https://api.github.com/users/campagnola/followers","following_url":"https://api.github.com/users/campagnola/following{/other_user}","gists_url":"https://api.github.com/users/campagnola/gists{/gist_id}","starred_url":"https://api.github.com/users/campagnola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/campagnola/subscriptions","organizations_url":"https://api.github.com/users/campagnola/orgs","repos_url":"https://api.github.com/users/campagnola/repos","events_url":"https://api.github.com/users/campagnola/events{/privacy}","received_events_url":"https://api.github.com/users/campagnola/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-05-09T16:42:21Z","updated_at":"2015-06-04T08:42:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vispy/vispy/pulls/895","html_url":"https://github.com/vispy/vispy/pull/895","diff_url":"https://github.com/vispy/vispy/pull/895.diff","patch_url":"https://github.com/vispy/vispy/pull/895.patch"},"body":"This PR will implement part of #894:\r\n\r\n- [x] Visual views\r\n- [x] MultiProgram\r\n- [x] Visual class organization: BaseVisual, Visual, VisualView, CompoundVisual\r\n- [x] TransformSystem that responds to canvas resize / viewport / fbo\r\n- [x] Preliminary VisualCollection class that lacks support for collectionizing transforms\r\n\r\n@almarklein, @Eric89GXL have a look at examples/basics/visuals/visual_view.py and comment on the API."},"comment":{"url":"https://api.github.com/repos/vispy/vispy/issues/comments/108788997","html_url":"https://github.com/vispy/vispy/pull/895#issuecomment-108788997","issue_url":"https://api.github.com/repos/vispy/vispy/issues/895","id":108788997,"user":{"login":"almarklein","id":3015475,"avatar_url":"https://avatars.githubusercontent.com/u/3015475?v=3","gravatar_id":"","url":"https://api.github.com/users/almarklein","html_url":"https://github.com/almarklein","followers_url":"https://api.github.com/users/almarklein/followers","following_url":"https://api.github.com/users/almarklein/following{/other_user}","gists_url":"https://api.github.com/users/almarklein/gists{/gist_id}","starred_url":"https://api.github.com/users/almarklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almarklein/subscriptions","organizations_url":"https://api.github.com/users/almarklein/orgs","repos_url":"https://api.github.com/users/almarklein/repos","events_url":"https://api.github.com/users/almarklein/events{/privacy}","received_events_url":"https://api.github.com/users/almarklein/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T08:42:34Z","updated_at":"2015-06-04T08:42:34Z","body":"I think what I mean is that (sticking with your terminology), the user always instantiates a `VisualView` (and the real underlying `Visual` is automatically created the first time):\r\n\r\n    # Your current approach\r\n    line1 = LineVisual()\r\n    line2 = line1.view()\r\n    # line1 and line2 are not of the same class\r\n    # Question: is line2 a VisualView or a LineVisualView of some sort?\r\n  \r\n    # What I am proposing\r\n    line1 = LineVisualView()  # although if we go this way, we should obviously rename it\r\n    line2 = line1.view()\r\n    # Both objects are of the same class and are a view on the same underlying Visual\r\n\r\nMy (minor) issues with the current approach is that I find the class hierarchy a bit complex, I don't like mixins so much, and I slightly dislike that line1 and line2 are not equals. Although with what I am proposing you'd need two classes (`SomethingVisual` and `SomethingVisualView`) for each type of visual (thought the view can probably be defined in 2 lines or perhaps autogenerated).\r\n\r\nI'm not nearly as much into this code as you are, so I leave it to your judgement what would work best :)\r\n"}}