{"action":"created","issue":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/2368","labels_url":"https://api.github.com/repos/spyder-ide/spyder/issues/2368/labels{/name}","comments_url":"https://api.github.com/repos/spyder-ide/spyder/issues/2368/comments","events_url":"https://api.github.com/repos/spyder-ide/spyder/issues/2368/events","html_url":"https://github.com/spyder-ide/spyder/pull/2368","id":71102294,"number":2368,"title":"Compact Variable Explorer with customizable tooltip","user":{"login":"d1manson","id":4244876,"avatar_url":"https://avatars.githubusercontent.com/u/4244876?v=3","gravatar_id":"","url":"https://api.github.com/users/d1manson","html_url":"https://github.com/d1manson","followers_url":"https://api.github.com/users/d1manson/followers","following_url":"https://api.github.com/users/d1manson/following{/other_user}","gists_url":"https://api.github.com/users/d1manson/gists{/gist_id}","starred_url":"https://api.github.com/users/d1manson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d1manson/subscriptions","organizations_url":"https://api.github.com/users/d1manson/orgs","repos_url":"https://api.github.com/users/d1manson/repos","events_url":"https://api.github.com/users/d1manson/events{/privacy}","received_events_url":"https://api.github.com/users/d1manson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/Variable-Explorer","name":"Variable-Explorer","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/spyder-ide/spyder/milestones/5","html_url":"https://github.com/spyder-ide/spyder/milestones/v3.0","labels_url":"https://api.github.com/repos/spyder-ide/spyder/milestones/5/labels","id":982077,"number":5,"title":"v3.0","description":"","creator":{"login":"spyder-issues-migrator","id":11021581,"avatar_url":"https://avatars.githubusercontent.com/u/11021581?v=3","gravatar_id":"","url":"https://api.github.com/users/spyder-issues-migrator","html_url":"https://github.com/spyder-issues-migrator","followers_url":"https://api.github.com/users/spyder-issues-migrator/followers","following_url":"https://api.github.com/users/spyder-issues-migrator/following{/other_user}","gists_url":"https://api.github.com/users/spyder-issues-migrator/gists{/gist_id}","starred_url":"https://api.github.com/users/spyder-issues-migrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyder-issues-migrator/subscriptions","organizations_url":"https://api.github.com/users/spyder-issues-migrator/orgs","repos_url":"https://api.github.com/users/spyder-issues-migrator/repos","events_url":"https://api.github.com/users/spyder-issues-migrator/events{/privacy}","received_events_url":"https://api.github.com/users/spyder-issues-migrator/received_events","type":"User","site_admin":false},"open_issues":263,"closed_issues":65,"state":"open","created_at":"2015-02-16T23:17:23Z","updated_at":"2015-04-28T20:12:33Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-04-26T18:23:06Z","updated_at":"2015-04-29T07:41:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/spyder-ide/spyder/pulls/2368","html_url":"https://github.com/spyder-ide/spyder/pull/2368","diff_url":"https://github.com/spyder-ide/spyder/pull/2368.diff","patch_url":"https://github.com/spyder-ide/spyder/pull/2368.patch"},"body":"*Copied and edited from original post: https://github.com/spyder-ide/spyder/issues/2353*\r\n\r\nI've noticed that most of the time my *variable explorer* is not visible on screen (it's \"behind\" some other widget tab).   The main reason for this is that its \"area-to-usefulness\" ratio is not that good...each variable takes up a lot of space vertically and you need to set the width of the widget to be pretty wide in order be able to see the value properly. \r\n\r\nIt occurs to me that there are 3 usage cases for the widget: \r\n* find a variable that you can't remember the name of or aren't sure if you've currently got\r\n* check the value/type/size/min/max of a variable...or get a plot of it.\r\n* edit a variable\r\n\r\nFor the *first* usage, you normally only need to be able to see the names of the variables, so a nice compact list is probably sufficient. However I do note that in some cases you may actually need to do a visual \"search\" by some heuristic combination of name +value/size/type etc. This heuristic visual search is not really that easy using the current editor, not to mention that it hides many kinds of objects (or else shows you hundreds you don't care about).  [A nice, but complicated UI for dealing with this less common task would be a fancy search system a bit like gmail where you say something like \"size>100, dtype:int name:_old\", ideally with auto-complete helping you to fill out your query, and instant results....but that's not what I am suggesting here...instead....] to address this heuristic visual search task, it would need to be possible to toggle between the full and compact modes.\r\n\r\nFor the *second* case you are generally interested in a single variable at a given time (if you wanted to compare multiple values it's currently not really that easy unless the variables happen to be adjacent in the list), so you could have a tooltip showing you the info that you care about. Indeed since this tooltip is generated on request for a single variable you could perform a computation that takes up to about 100-200ms without the user noticing.   You also get quite a bit of space to display the data because it's the data for a single variable at a given time.  I suggest that the script for generating the tooltip data is exposed to the user so they can fully customize it to render data in a way that is convenient for them (i.e. in the same way users can customize their startup scripts.  However, that's not to say that you can't write something fairly simple which guesses what kind of plotting and summary data would be of interest to a \"generic\" user, .e.g. matshow large 2d arrays, lineplot long 1d arrays, describe data frames etc. And you can show more than one plot/table if you want.\r\n\r\nFor the *third* usage case, the editing, you either double click the variable name and launch a separate widget (as you currently do), or if the variable is simple enough you can edit it inline in a similar manner to the current tool, except that the edittext would replace the name cell rather than the value cell (because the value column is not showing).\r\n\r\nSo...with the above in mind I have forged ahead and had a go at implementing something.\r\n\r\nIt is still a bit rough around the edges but it does do most of what I describe above.  I have submitted this as a PR so that it can more easily be commented on and examined.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/4244876/7335193/355674dc-eba6-11e4-85ca-852ef78613be.png)\r\n\r\n(As discussed in https://github.com/spyder-ide/spyder/issues/2353, there is a plan to make all toolbars toggle-able)\r\n\r\nFor reference, in Matlab you can (under certain circumstances) get a tooltip when you mouse over a var in the editor itself:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/4244876/7339197/ca67a9a8-ec5d-11e4-899c-d2a2e25fe92d.png)\r\n\r\nIt also offers the following choice of columns in the variable editor: ``Value, Size, Bytes, Class, Min, Max, Range, Mean, Median, Mode, Var, Std``.  But there's no obvious way to arrange your screen in such a way as to actually make space for all those columns,\r\n\r\n\r\n**Update: features implemented so far...**\r\n![image](https://cloud.githubusercontent.com/assets/4244876/7350288/4b295166-ecf6-11e4-8927-1dbafc5564a8.png)\r\nEasily toggle between compact and full mode.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/4244876/7350302/780b78e4-ecf6-11e4-923c-b40b72a465f8.png)\r\nEdit simple values inline (and launch edit dialog for more complex values).\r\n\r\n![image](https://cloud.githubusercontent.com/assets/4244876/7350361/bc614168-ecf6-11e4-8458-ea0f2d601f72.png)\r\nProvide a custom function for generating meta data and html.\r\n\r\nIn addition to the matshow example above, default function shows things like:\r\n![image](https://cloud.githubusercontent.com/assets/4244876/7350501/8f99bfa6-ecf7-11e4-85a6-45415c9448e5.png)\r\nDataFrame.describe.to_html()   \r\n\r\n![image](https://cloud.githubusercontent.com/assets/4244876/7350574/df4ba9ec-ecf7-11e4-8886-9bfd04ae6454.png)\r\nsimple lineplot of 1d data   \r\n\r\n![image](https://cloud.githubusercontent.com/assets/4244876/7350607/17d8227c-ecf8-11e4-83b5-09390247273b.png)\r\nsphinx doc for objects that dont fall into other categories and have docstrings\r\n\r\n**TODOs:**   \r\n* It would be good to make the tooltip reszing a bit better, possibly providing the option of pinning it with ``Alt`` or something and then having scrollbars to navigate longer content like the docstrings.\r\n* Ideally it would be good to implement canceling and timeout for the metadata generation.  This would help users with their own custom version of the ``make_meta_dict`` function, but also in cases where the default version of the function is causing the program to hang because the object in question is large.\r\n* It would be nice to hook up a custom filter function in addition to the custom ``make_meta_dict`` function.  Otherwise the user would be forced to turn off the filters in order to find the custom objects for which they have implemented representation code. (Note that this filtering has to be separate from the actual generation of the representation because we assume the representation is a costly process and should only be done in full when required, i.e. not just as a test of feasibility).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/comments/97335298","html_url":"https://github.com/spyder-ide/spyder/pull/2368#issuecomment-97335298","issue_url":"https://api.github.com/repos/spyder-ide/spyder/issues/2368","id":97335298,"user":{"login":"Nodd","id":506348,"avatar_url":"https://avatars.githubusercontent.com/u/506348?v=3","gravatar_id":"","url":"https://api.github.com/users/Nodd","html_url":"https://github.com/Nodd","followers_url":"https://api.github.com/users/Nodd/followers","following_url":"https://api.github.com/users/Nodd/following{/other_user}","gists_url":"https://api.github.com/users/Nodd/gists{/gist_id}","starred_url":"https://api.github.com/users/Nodd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nodd/subscriptions","organizations_url":"https://api.github.com/users/Nodd/orgs","repos_url":"https://api.github.com/users/Nodd/repos","events_url":"https://api.github.com/users/Nodd/events{/privacy}","received_events_url":"https://api.github.com/users/Nodd/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T07:41:29Z","updated_at":"2015-04-29T07:41:29Z","body":"Using the tooltip seems fragile to me, because you have to not move the mouse at all to see the information. Why not display the information in the Object inspector instead ? Of course it means that some place would be reserved for the widget.\r\n\r\nAlso the make_meta_dist parameter included in the settings seems out of place. Maybe these functions could be added as plugins ? This would enable to have multiple versions to match different types.\r\n\r\nThe visualizations are quite cool I think, it won't ne adapted to all data sets but when it works it works well ! I remember someone asking for a display for large sparse matrix, this could be a first step."}}