monarch-initiative / phenogrid

The phenogrid widget
13 stars 14 forks source link

hide minimap for small grids #214

Closed harryhoch closed 8 years ago

harryhoch commented 8 years ago

can we hide the minimap when either dimension is small (say < 10)?

yuanzhou commented 8 years ago

It depends.

Here is an example that we may want to hide the mini map: capture2

Here is an example that we want to keep the mini map: capture

harryhoch commented 8 years ago

How about we keep it if there are more than 10 rows or columns. …? On Nov 5, 2015, at 4:10 PM, Kent Shefchek notifications@github.com<mailto:notifications@github.com> wrote:

It depends.

Here is an example that we may want to hide the mini map: [capture2]https://cloud.githubusercontent.com/assets/195873/10981781/bde73538-83d7-11e5-9305-763324233aa0.PNG

Here is an example that we want to keep the mini map: [capture]https://cloud.githubusercontent.com/assets/195873/10981770/afd8a206-83d7-11e5-9f37-3c4cd33d512c.PNG

— Reply to this email directly or view it on GitHubhttps://github.com/monarch-initiative/phenogrid/issues/214#issuecomment-154193970.

nlwashington commented 8 years ago

+1 on removing it (at least sometimes).

you need it only if for moving around. since you have a hardcoded number of rows and cols, then the minimap is only needed if there are more rows/cols than that.

which is a separate issue of what to do if you have << max row or col, but the other dimension is much larger (with say 2 rows but 100 columns). in that case, you will still need the minimap for navigation (until you add scrollbars or other means of navigation). in this case, you probably should just fix the way it looks (don't put the rows at the top/bottom of the grid - it is confusing and looks odd...) in those cases, you might think about scaling the size of the tiny colored boxes to be bigger, or don't evenly space them... make the minimap accurately reflect what is actually viewed in the grid itself (close together).

harryhoch commented 8 years ago

@nlwashington, agreed. We should still look into scrollbars..

yuanzhou commented 8 years ago

I'm thinking about the scrollbars + mini map design. Scrollbars can't show the overall grid data density, but it's also hard/impossible to use a square mini map to reflect the actual ratio of the columns (say 1000) and rows (20) with all the cells evenly spread. If we don't care about the overall data distribution, scrollbars fit the purpose of navigation/moving regardless of the number of columns/rows.

s

harryhoch commented 8 years ago

@yuanzhou agreed, nothing will be perfect. How hard would it be to implement scrollbars?

yuanzhou commented 8 years ago

@harryhoch my plan is to look into the mini map code, and know how the drag updates the columns/rows. Then create SVG rect with draggable area for vertical and horizontal to make them function like scrollbars. When we drag the scrollbar slider, the grid view and mini map shaded area will also need to be updated accordingly. And also hide the mini map as well as scrollbars if either the number of columns or rows is less than the config value.

harryhoch commented 8 years ago

ok @yuanzhou, sounds good.

yuanzhou commented 8 years ago

I think I found a better solution to address this issue by still using the mini map not not adding the scrollbars.

Here are the different cases (before inverting the axis):

In multi species comparison mode:

1. No need to show mini map if the numbers of x and y items are within the default limits. The grid region shows everything.

1

2. If there are more y items than the default limit, show the square mini map. We don't care about the x items since there's a pre-defined x limit number of each species.

2

In single species mode:

We check both x and y items to see if they are within the default limits. We can choose either x or y as the baseline. Here I use y count.

1. When there are more y items than the default y limit:

a. show the square mini map when there are also more x items than the default x limit.

3

b. when there are less x items, show the mini map, but shrink the width of mini map based on the (x count / default x limit) ratio.

7

2. When the number of y items is within the default y limit:

a. No need to create the mini map if x count is also within the default x limit.

9

b. There are more x items than the default limit, show the mini map, but shrink the height of mini map based on the (y count / default y limit) ratio.

8

harryhoch commented 8 years ago

@yuanzhou, I like this analysis, but I think there is still a strong feeling that scrollbars are preferred. @nlwashington, what do you think? @yuanzhou, how hard would it be to do scrollbars?

nlwashington commented 8 years ago

i really like what's been done here to shrink the minimap when those times warrant it. and yes, when the rows/cols are < max, then yes i think adding scrollbars for the appropriate axis is still desired in addition.

harryhoch commented 8 years ago

thanks, @nlwashington. It sounds like this might be more of a "like to have" , more than a "must have". @yuanzhou, how hard would scrollbars be?

nlwashington commented 8 years ago

@harryhoch can you clarify what the like/must is referring to exactly?

harryhoch commented 8 years ago

@nlwashington, trying to prioritize. Is this something that you consider very important, or just somewhat important?

nlwashington commented 8 years ago

which "thing"? adding scrollbars, or the making the minimap look correct?

harryhoch commented 8 years ago

scrolabars. we should absolutely fix the minimap

nlwashington commented 8 years ago

i consider ease of navigation around the grid essential.

harryhoch commented 8 years ago

ok, so you would put a high priority on srollbars.. got it. @yuanzhou, how hard is this?

yuanzhou commented 8 years ago

@harryhoch I've played with the mini map fix in my branch and I think I've got 90% of the work done.

Adding scroll bars shouldn't be very hard, it may take a bit time to figure out how to have the grid cells and the mini map view updated once we scroll. I'll dig into it and post my progress and questions here for feedback.

harryhoch commented 8 years ago

Great, thanks.

harryhoch commented 8 years ago

@nlwashington, @doctorbud made an interesting suggestion - wanted to get your feedback. Instead of scrollbars, we could adopt a tablet/map -like navgiation whereby you would click-drag while moving in one of the directions, effectively providing a map-like pan. Thoughts?

yuanzhou commented 8 years ago

This is not the best example but kinda similar to what we discussed: http://bl.ocks.org/nnattawat/9689303#index.html

As Harry mentioned, the grid cell tooltip hover over may create some annoying behaviors when we drag the whole grid region if the mouse happens to hover over a grid cell.

yuanzhou commented 8 years ago

Have merged the minimap PR #217, will create a new ticket for scrollbars for discussions.