angular-visjs
angular-visjs copied to clipboard
How to set up
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>
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!!
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
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.
The example from vis are working fine, but the indexes from angular-visjs don't. I'm just gonna use vis natively I guess
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