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

Introduce a new item that has two start and two end times. #497

Closed
mcshaman opened this issue Dec 6, 2014 · 12 comments
Closed

Introduce a new item that has two start and two end times. #497

mcshaman opened this issue Dec 6, 2014 · 12 comments
Assignees

Comments

@mcshaman
Copy link

mcshaman commented Dec 6, 2014

I have been using Timeline to map out future projects and events. Unfortunately we are not one hundred percent sure when these events will start or finish. When mapping out the timelines manually (using design software) we indicate an earliest start and a latest end. It would be great if Timeline offered this flexibility. I have mocked up an example.
screenshot-2014-12-07-07 43 19

@mdxs
Copy link
Contributor

mdxs commented Dec 8, 2014

Guess that you're looking for something like this http://www.simile-widgets.org/wiki/Timeline_Event_Display#Timeline_Event_Display (which is part of the Simile Timeline widget).

@myrises
Copy link

myrises commented Dec 8, 2014

it is possible with current version too, i think.
look at http://visjs.org/examples/timeline/25_background_areas.html
you can using background type item for earliest start and a latest end, then setup "item4" as range type. both item must has a same group too. other nuances may be resolved by playing with their items style properties (position, color, etc).

additionly, look at http://visjs.org/examples/timeline/30_subgroups.html and http://visjs.org/examples/timeline/31_background_areas_with_groups.html

@AlexDM0
Copy link
Contributor

AlexDM0 commented Dec 8, 2014

@knyazhe1 is right BUT you'll need to do manual stacking and use subgroups. It would be cool if there was a type as you describe it though. We can look into it.

Regards,

Alex

@mdxs
Copy link
Contributor

mdxs commented Dec 8, 2014

The SIMILE-Timeline code is on Github at https://github.com/simile-widgets/timeline but it seems commits stopped on 2013-11-06 (it is BSD-licensed AFAIK, so adoption of ideas/docs/code should be possible... but I'm not a lawyer).

@josdejong
Copy link
Contributor

I think we can implement this as a new item type, derived from the built in RangeItem (similar to how BackgroundItem extends RangeItem).

Easiest would be to take the regular start and end as properties for the outer start and end, and add two new properties like say innerStart and innerEnd to denote the start/end of the inner. That should be relatively straigtforward I think. If we would not use the regular start and end properties I think we need to do some changes in the Timeline itself too, add some abstraction there (i.e. every type of item must get methods getStart and getEnd instead of reading the properties directly, so you can map them to a property of your choice).

@myrises
Copy link

myrises commented Dec 10, 2014

@josdejong commented:

we can implement this as a new item type, derived from the built in RangeItem (similar to how BackgroundItem extends RangeItem).

how to do it in the right way? without any original sources conflict.
i think, need make a single module (customitem.js) for new CustomItem type and export it to... somewhere ⁉️ then rebuild vis-custom.js and vis-custom.min.js. right? 😳

@myrises
Copy link

myrises commented Dec 17, 2014

ok, it seems in the library there will be many changes and new features. other words,
to create the modules is still too early, i think. look at http://jsfiddle.net/knyzhe1/zn673Lz0/
this is visualization of dependencies between timeline modules. some parts are unused at now. need to wait a bit. especially the navigation bar.

@josdejong
Copy link
Contributor

Suppose you use start and end for the outer dates, and use new properties innerStart and innerEnd for the inner dates, there should be no need to adjust the vis.js library itself: you can load vis.js in the browser, then load the file with your CustomItem. This CustomItem should register itself at vis.timeline.components.ItemSet.types.

If you want to extend vis.js with this new CustomItem, you will indeed have to rebuild the library as described in the readme. Easiest is to check out where for example BackgroundItem is referenced/used/exported and do the same for your new CustomItem. vis.js uses commonjs modules.

@mcshaman
Copy link
Author

Great Josdejong. Thanks very much for that. I will give it a go and let you know how it goes.

@AlexDM0
Copy link
Contributor

AlexDM0 commented Jan 9, 2015

Hi,

Over the last year a lot of feature requests have been made. We have just introduced our new website which has a list of the requested features. We have placed this request on that list.

The list can be found here:
http://visjs.org/featureRequests.html

An explaination of the new system can be found here:
http://visjs.org/blog.html#New\ website\ for\ vis.js!

I would like to stress that this does not mean we abandon this request. Discussion here will continue if needed on this feature but we will close it to keep our Github issue page more of a bug-todo list.

Future feature requests will still be made here and then added to the website by us.

Regards,

Alex

@AlexDM0 AlexDM0 closed this as completed Jan 9, 2015
@mojoaxel mojoaxel changed the title Timeline earliest start and latest end Introduce a new item that has two start and two end times. Oct 24, 2016
@mojoaxel
Copy link
Member

Reopening as Feature-Request issue (see #2114).
Everybody: Please feel free to implement this!

@mojoaxel mojoaxel reopened this Oct 24, 2016
@yotamberk yotamberk self-assigned this Nov 5, 2016
@mojoaxel
Copy link
Member

@yotamberk created in #2519 a new example expectedVsActualTimesItems to demonstrate something like this.

@mojoaxel mojoaxel added this to the Minor Release v4.18 milestone Dec 31, 2016
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

7 participants