Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Is there a way to "fitVertical()" the Timeline? #2475

Open
pauljayd opened this issue Dec 18, 2016 · 6 comments
Open

Is there a way to "fitVertical()" the Timeline? #2475

pauljayd opened this issue Dec 18, 2016 · 6 comments

Comments

@pauljayd
Copy link

I would like to be able to execute a function to casue the Timeline to expand such that no items are out-of-view (vertically) at the current date. IS there any way to do this?

Thanks

@yotamberk
Copy link
Contributor

What do you mean by expand? The height becomes bigger?

@pauljayd
Copy link
Author

THanks for the quick response -- sorry I wasn't clear:
I would like to be able to execute a function such that given the current view (height & width) and centered date, the zoom would be set such that no items are out of view vertically (which would require either dragging up/down or scrolling).
If no item is then visible, perhaps an option would be to move forward/backward to the nearest date with an item.
Does this make sense?
Thanks.

@yotamberk
Copy link
Contributor

Sorry but I'm still not clear on what you mean... Do you mean assuming you have many groups and there are items only on the center groups, that the timeline will focus on them?
The fitVertical option doesn't make sense because there is no vertical scaling done. Maybe you mean verticalFocus. It still isn't clear to me the purpose of it.

@pauljayd
Copy link
Author

Sorry again that I'm not making myself clear.
Given a Timeline with a fixed height and zoom level, some items may be vertically out-of-view or cut (see image 1):
image1

Notice the blue box-shadow at top, where item 2 is cut off.

At this point, I would like to execute a function, say "fitVertical()" such that the
zoom level is adjusted so that all out-of-view vertical items are brought into view (see image2):
image2

Thus, the box shadow has disappeared, and of course the zoom has changed.
I want this to be able to present the timeline without forcing the user to scroll or drag (at
least in the initial view).
Does this make sense?

Paul

@yotamberk
Copy link
Contributor

much clearer! Thanks! No way to do this yet. I'll add this as a feature request!

@yotamberk
Copy link
Contributor

I've now branched out to a new fork of my own including only Timeline.
I've applied a fix for this here: https://github.com/yotamberk/timeline-plus
and can be used via npm here: https://www.npmjs.com/package/timeline-plus

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants