Comments (6)
Thinking about this, the "automatic" behavior can definitely get tricky. For example, LocusZoom's existing resize logic allows for any arbitrary aspect ratio, so you could have a LocusZoom plot that's many thousands of pixels tall. As a page / containing dev resizes, if a LocusZoom plot is set to automatically stay at 100%, how should it handle changing its vertical size? Just maintain the present aspect ratio, perhaps?
@MrFlick / @benralexander thoughts?
from locuszoom.
I agree that maintaining the aspect ratio would be a good solution.
On Tue, Mar 22, 2016 at 3:52 PM, Christopher Clark <[email protected]
wrote:
Thinking about this, the "automatic" behavior can definitely get tricky.
For example, LocusZoom's existing resize logic allows for any arbitrary
aspect ratio, so you could have a LocusZoom plot that's many thousands of
pixels tall. As a page / containing dev resizes, if a LocusZoom plot is set
to automatically stay at 100%, how should it handle changing its vertical
size? Just maintain the present aspect ratio, perhaps?@MrFlick https://github.com/MrFlick / @benralexander
https://github.com/benralexander thoughts?—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#41 (comment)
from locuszoom.
It seems like page resizing should just effect the width of the plot. Changing the height makes sense as a drag. Right now we have drag in the order to change both width and height. Maybe just allow it to change the height. Since we're not really making plots where the distance on the x and y axis are directly relatable, i'm not sure it makes sense to try to preserve aspect ratios. That's more important and x and y values are on the same scale.
from locuszoom.
To be fully integrated with the rest of the portal there probably shouldn't
be an independent drag event, and instead the graphic should drive its
width from the page size. At small screen sizes I could imagine that a
presentation with a preserved aspect ratio would be more readable than one
that is tall but skinny. That said, I could also imagine someone
intentionally making the screen very wide in order to better examine
genomic position, and not necessarily wanting the graphic to become
taller. So in the end I'm not sure in the end whether preserving the
aspect ratio will be better or worse, but I imagine it's not a big coding
switch either way (i.e. let's see how it feels once we get it in the
portal). I do think, however, that we want to make the LZ's width (at
least) dependent on browser page size, and not independently manipulable
via a corner drag.
On Wed, Mar 23, 2016 at 4:26 PM, MrFlick [email protected] wrote:
It seems like page resizing should just effect the width of the plot.
Changing the height makes sense as a drag. Right now we have drag in the
order to change both width and height. Maybe just allow it to change the
height. Since we're not really making plots where the distance on the x and
y axis are directly relatable, i'm not sure it makes sense to try to
preserve aspect ratios. That's more important and x and y values are on the
same scale.—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#41 (comment)
from locuszoom.
Thanks for the discussion on this, folks. Here's an update...
A working prototype for responsive resizing is now up in #42 (working demo here). Things to note:
- The demo may at first appear to be a bit of an extreme example because the containing div is set to take up the entire page width on an otherwise blank page, so on a large monitor at full screen it can get pretty big.
- The demo actually has Tool Tips (#40) checked out, which currently pulls from Responsive Resizing (#42), so we're seeing both together. I've already identified the slight tool tip positioning bug and am looking into that.
- The approach on this branch allows for three way to define the dimensions/resizability of a plot:
- Discrete dimensions with no resizing
- Discrete initial dimensions with manual resizing
- Responsive resizing with a fixed, predefined aspect ratio
In this case, the containing div's width is the determining factor of the plot's dimensions, and the aspect ratio defined in the layout is preserved as the containing div is resized (e.g. by resizing the window)
It sounds like, from the discussion here, that responsive resizing with a constant aspect ratio may only address some use cases of responsive resizing. Other use cases may involve keeping the height at a predefined constant and allowing the aspect ratio to flex, whereas other cases still may involve inferring a "pretty good" aspect ratio from the aspect ratio of the containing window.
How about, since we're already trying to get a responsive resizing proof of-concept in place for the March integration, that we stick with the simple fixed-aspect-ratio approach and then expand the layout syntax to support those other use cases in a subsequent branch? @benralexander on your end that would just require selecting a good catch-all aspect ratio and defining that along with the resizable
parameter in your custom layout (see the source of demo_responsive.html on that branch for an example of how this is done).
from locuszoom.
I just merged #42 which implements the basic three modes of resizing described here. @benralexander going forward for the March goals if an aspect ratio other than 16:9 would be preferable let me know as that was an arbitrary choice and it's trivial to change that at any point. I'm going to file follow-up issues for the other resizing modes described here, and we'll approach those at a later date.
from locuszoom.
Related Issues (20)
- Update docs for pre-release 14
- LocusZoom.js - Unable to use custom adapter for LocusZoom data source HOT 7
- Missing SNP but LD pattern present HOT 1
- Show fewer labels for GWAS catalog view
- Zoom/scroll events not firing in safari
- Improve rendering and readability of labels
- Is it possible to reference custom data fields in the LocusZoom tooltip? HOT 4
- Widget `zoom_region` fails HOT 12
- Error if `region_nav_plot` is attached to a panel rather than the plot HOT 7
- Resulting SVG has black background during conversion to PDF HOT 3
- [Question] Update a `set_state` widget value when the state changes HOT 5
- TypeScript types HOT 3
- Floating point error with high -log10 p-values? HOT 3
- JS formatter HOT 2
- Manhattan plot and LocusZoom plot on the same page HOT 1
- Missing SNP HOT 2
- Can't compile LocusZoom with `npm run build` HOT 2
- Is possible to load local burden test by locuszoom.js ? HOT 5
- UMich SPH server is down? HOT 5
- Inconsistent gene names found in UMich data API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from locuszoom.