-
Notifications
You must be signed in to change notification settings - Fork 26
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
Issue26 #100
base: develop
Are you sure you want to change the base?
Conversation
@hyoklee - I'm getting an import error with your branch. Do you have files not checked in?
|
The issue could be the missing namespace 'hdf_compass'.. @hyoklee did you rebase before commit? |
I ran my branch on Python 2.7 only and can't duplicate the error on Mac and PC. John, do you use Python 3.0? |
A branch must be rebased before make a PR to the upstream repository. Otherwise your code will be missing all the other changes already applied... |
@hyoklee - I'm able to run it now. |
@jreadey, your observation is right. I just want to check how treeview should be implemented further with you. I can try scroll down event binding to add additional nodes but I haven't tried it before so I can't guarantee that it will work. For deep traversal, do you want to add all parents and their children or just immediate parents up to root? |
By deep traversal I was thinking that the user could expand or collapse any group node that has children. We want to stay away from anything that would involve a potentially arbitrary amount of work (e.g. puling in 1000's of nodes). |
@hyoklee Did you notice the conflicts on your branch that stops from merging your PR? |
Conflicts: hdf_compass/compass_viewer/container/__init__.py
@jreadey OK. I'll work on improving tree view for the case like tall.h5 as you suggested. For countries.h5, that's the best I could get on Mac. Mac's scroll down event fires rapidly in succession while Window's event fires one at a time. wxPython's behavior is unpredictable per platform. |
@jreadey I don't know whether it's wxPython problem or hdf_compass problem but the same code behaves differently on Win7 and Mac. See the attached screen shot. The selection() function in tree.py is called only once on Mac/Linux but the same function is called twice on Windows when I open the same file. |
This is looking much better (at least on the mac). Is recursive_walk dead code now? If so, remove it. I think the on_bottom handler is not doing quite the right thing... Nodes should only be appended if the scroll exposes nodes that have not been exposed before. With the group1k.h5 file if I wiggle the scroll up and down (but stay in the range of say g0000 to g00030) nodes get added on every scroll down even though I'm not seeing any nodes I haven't seen before. Can the size of the scroll button be made to be proportional to the percent of nodes visible? E.g. if there are 1000 children, and I see 20 nodes, the scroll button should be very small to reflect there's a limited window on the larger set of nodes. (the ArrayFrame class does this with the grid scroll bars). As it is now, I can't scroll down to the end of the nodes if they are off screen by dragging the scroll button. |
…handling page down event.
It’s not as smooth as Win/Mac but I think it’s better than nothing.
I removed recursive part. I think I addressed your problem by scrolling to the last item added. Please test it again see if it's not what you expected. I also improved tree control for Linux so moving scroll up and down at the end of the tree view can append more items. Thus, "more" is gone for Linux. Does scroll button appear larger / smaller on your Yosemite mac? I don't see such effect on my Mavericks Mac. You can explain it to me by capturing screenshots. |
@hyoklee I am curious about |
@giumas That's provisional to handle loops among nodes. Tree view is not sufficient for HDF5 in general. |
@hyoklee - see the screenshot here: The scrollbar on the right is taking 80% of the length even though only a small fraction of the links are displayed. |
@Jready I see what you mean now. I can't control the size of scroll bar. There are only 20 items on the tree view and next 20 will be loaded when you page down the scroll bar. Thus, 80% size is right (17/20). Please let me know if you want to load all 1000K nodes from the beginning like Icon/List/Grid view does. Then, you'll get a small scroll bar. |
@hyoklee - The List view is using wx.LC_VIRTUAL so it can handle an arbitrary number of items without actually loading them in memory. Does the TreeCtl have equivalent functionality? If not, you can explore expanding the number of nodes you load on activate - say 1000. That way it should load reasonably fast and have a scroll button that is at the minimal size (I think). Next when the user scrolls to the bottom you can load an additional 1000 nodes and so on. |
@jreadey No, tree doesn't have LC_VIRTUAL as far as I know. From Oct. 2 email exchange regarding tree control, @mfolk suggested to set the default limit to 20 so I followed his suggestion. If you like 1,000, you can easily change it by modifying the code self.limit=20 to self.limit=1,000 in tree.py. I think the limiting number should be an user option. What would be the best way to save such preference in Compass? |
I don't think it should be a user option - experiment and see which works best. 20 is too small because scrolling to the bottom is not very effective & the scroll button size is too large. A 1000 may take some time to load - see how it goes. Regardless, we do want to enable the user to see all the links regardless of low many there are. I.e. not the HDFView-style limitation on the number of links. |
Preview of tree view. There’s no deep traversal from a node yet so grandparents or grandchildren will not appear.