diff --git a/HISTORY.md b/HISTORY.md index e6175fff..c647a7a6 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,8 +3,7 @@ http://visjs.org ## , version 0.3.0 -- Implemented option `showCurrentTime`, displaying a red, vertical bar at - current time. Thanks fi0dor. +- Implemented options `showCurrentTime` and `showCustomTime`. Thanks fi0dor. - Fixed broken Timeline options `min` and `max`. - Fixed not being able to load vis.js in node.js. diff --git a/docs/dataset.html b/docs/dataset.html index 1847a3b1..be0ee783 100644 --- a/docs/dataset.html +++ b/docs/dataset.html @@ -424,7 +424,7 @@ var items = DataSet.get(options); // retrieve all items or a filtered set filter - function + Function Items can be filtered on specific properties by providing a filter function. A filter function is executed for each of the items in the DataSet, and is called with the item as parameter. The function must @@ -432,6 +432,13 @@ var items = DataSet.get(options); // retrieve all items or a filtered set true will be emitted. See section Data Filtering. + + + order + String | Function + Order the items by a field name or custom sort function. + +

diff --git a/docs/timeline.html b/docs/timeline.html index 525a4baf..5c4d0424 100644 --- a/docs/timeline.html +++ b/docs/timeline.html @@ -190,7 +190,9 @@ var items = [ type String 'box' - The type of the item. Can be 'box' (default), 'range', or 'point'. + The type of the item. Can be 'box' (default), 'range', or 'point'. + + group @@ -344,6 +346,15 @@ var options = { end date. + + groupOrder + String | Function + none + Order the groups by a field name or custom sort function. + By default, groups are not ordered. + + + height String @@ -399,7 +410,7 @@ var options = { order - function + Function none Provide a custom sort function to order the items. The order of the items is determining the way they are stacked. The function @@ -432,6 +443,16 @@ var options = { Show a vertical bar at the current time. + + showCustomTime + boolean + false + Show a vertical bar displaying a custom time. This line can be dragged by the user. The custom time can be utilized to show a state in the past or in the future. + + + + showMajorLabels boolean @@ -513,6 +534,19 @@ var options = { Return Type Description + + + getCustomTime() + Date + Retrieve the custom time. Only applicable when the option showCustomTime is true. + + + + setCustomTime(time) + none + Adjust the custom time bar. Only applicable when the option showCustomTime is true. time is a Date object. + + setGroups(groups) none @@ -541,6 +575,7 @@ var options = { + diff --git a/examples/timeline/05_groups.html b/examples/timeline/05_groups.html index d6c9ced4..da1c582d 100644 --- a/examples/timeline/05_groups.html +++ b/examples/timeline/05_groups.html @@ -59,7 +59,7 @@ // create visualization var container = document.getElementById('visualization'); var options = { - groupsOrder: 'content' + groupOrder: 'content' }; var timeline = new vis.Timeline(container); diff --git a/src/timeline/component/GroupSet.js b/src/timeline/component/GroupSet.js index ea2242b9..c0643754 100644 --- a/src/timeline/component/GroupSet.js +++ b/src/timeline/component/GroupSet.js @@ -270,7 +270,7 @@ GroupSet.prototype.repaint = function repaint() { // update the top positions of the groups in the correct order var orderedGroups = this.groupsData.getIds({ - order: this.options.groupsOrder + order: this.options.groupOrder }); for (i = 0; i < orderedGroups.length; i++) { (function (group, prevGroup) { diff --git a/src/timeline/component/item/ItemRangeOverflow.js b/src/timeline/component/item/ItemRangeOverflow.js index 29f4cf55..521d42aa 100644 --- a/src/timeline/component/item/ItemRangeOverflow.js +++ b/src/timeline/component/item/ItemRangeOverflow.js @@ -81,11 +81,11 @@ ItemRangeOverflow.prototype.repaint = function repaint() { /** * Return the items width - * @return {Integer} width + * @return {Number} width */ ItemRangeOverflow.prototype.getWidth = function getWidth() { if (this.props.content !== undefined && this.width < this.props.content.width) return this.props.content.width; else return this.width; -} +};