Skip to content
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

How to set up #43

Open
Seiifer opened this issue Nov 27, 2015 · 5 comments
Open

How to set up #43

Seiifer opened this issue Nov 27, 2015 · 5 comments

Comments

@Seiifer
Copy link

Seiifer commented Nov 27, 2015

Is this still maintained ? Is there any more documentation incoming ?

I'm having troubles using it, first what to use in the template because we find several versions depending on where we look at :

Should we use this directive :

<vis-timeline data="r.timeLineData" options="r.timeLineOptions"></vis-timeline>

Or this one :

<vis-graph2d data="r.timeLineData" options="r.timeLineOptions"></vis-graph2d>

This is the data in my controller :

    this.dataItems = new VisDataSet([
      {start: new Date(2010, 4, 2), end: new Date(2010, 4, 8), content: 'Trajectory A'},
      {start: new Date(2010, 4, 10), end: new Date(2010, 4, 14), content: 'Trajectory B'},
      {start: new Date(2010, 4, 16), end: new Date(2010, 4, 25), content: 'Trajectory C'}
    ]);

    this.dataGroups = new VisDataSet([
      {id: 1, content: 'Group 1'}
    ]);

    this.timeLineData = {items: this.dataItems, groups: this.dataGroups};

    this.timeLineOptions = {"start": '2010-04-01', "end": '2010-04-30'};

The options is set properly since I'm initially seeing the proper range (2010 April) but there is no boxes inside the timeline, no date and no content. So how should I use it ?

Also, if I don't intend to use groups, can we directly do this :

<vis-timeline data="r.dataItems" options="r.timeLineOptions"></vis-timeline>
@cdjackson
Copy link
Contributor

Yes, this is maintained, but note that this is just a directive that is a wrapper around the main visjs library, so it is just passing your configuration into visjs.

Should we use this directive :


Or this one :


I guess that depends on what you’re trying to do. One is for timeline, and one is for graph2d!!

@Seiifer
Copy link
Author

Seiifer commented Nov 27, 2015

Well, I want to make a timeline, but shouldn't the above code be working ?

Because I'm only getting an empty timeline and this JS Warning :

mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create

@cdjackson
Copy link
Contributor

I’m not sure - I don’t currently have time to analyse your code, but have you tried the examples since this is working on github.

@Seiifer
Copy link
Author

Seiifer commented Nov 27, 2015

The example from vis are working fine, but the indexes from angular-visjs don't.
I'm just gonna use vis natively I guess

@cdjackson
Copy link
Contributor

Well I just looked at the angular-visas examples on git, and the timeline was working fine!

http://visjs.github.io/angular-visjs/#/timeline http://visjs.github.io/angular-visjs/#/timeline

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

No branches or pull requests

2 participants