Browse Source

Released version 1.0.0

css_transitions v1.0.0
jos 10 years ago
parent
commit
8e6bb738cb
7 changed files with 55 additions and 61 deletions
  1. +1
    -1
      HISTORY.md
  2. +1
    -1
      bower.json
  3. +37
    -46
      dist/vis.js
  4. +1
    -1
      dist/vis.min.css
  5. +11
    -11
      dist/vis.min.js
  6. +3
    -0
      misc/how_to_publish.md
  7. +1
    -1
      package.json

+ 1
- 1
HISTORY.md View File

@ -2,7 +2,7 @@
http://visjs.org http://visjs.org
## not yet released, version 0.8.0
## 2014-05-02, version 1.0.0
### Timeline ### Timeline

+ 1
- 1
bower.json View File

@ -1,6 +1,6 @@
{ {
"name": "vis", "name": "vis",
"version": "0.7.5-SNAPSHOT",
"version": "1.0.0",
"description": "A dynamic, browser-based visualization library.", "description": "A dynamic, browser-based visualization library.",
"homepage": "http://visjs.org/", "homepage": "http://visjs.org/",
"repository": { "repository": {

+ 37
- 46
dist/vis.js View File

@ -4,7 +4,7 @@
* *
* A dynamic, browser-based visualization library. * A dynamic, browser-based visualization library.
* *
* @version 0.7.5-SNAPSHOT
* @version 1.0.0
* @date 2014-05-02 * @date 2014-05-02
* *
* @license * @license
@ -1742,7 +1742,6 @@ DataSet.prototype.getIds = function (options) {
/** /**
* Execute a callback function for every item in the dataset. * Execute a callback function for every item in the dataset.
* The order of the items is not determined.
* @param {function} callback * @param {function} callback
* @param {Object} [options] Available options: * @param {Object} [options] Available options:
* {Object.<String, String>} [convert] * {Object.<String, String>} [convert]
@ -1988,9 +1987,8 @@ DataSet.prototype.min = function (field) {
/** /**
* Find all distinct values of a specified field * Find all distinct values of a specified field
* @param {String} field * @param {String} field
* @return {Array} values Array containing all distinct values. If the data
* items do not contain the specified field, an array
* containing a single value undefined is returned.
* @return {Array} values Array containing all distinct values. If data items
* do not contain the specified field are ignored.
* The returned array is unordered. * The returned array is unordered.
*/ */
DataSet.prototype.distinct = function (field) { DataSet.prototype.distinct = function (field) {
@ -2010,7 +2008,7 @@ DataSet.prototype.distinct = function (field) {
break; break;
} }
} }
if (!exists) {
if (!exists && (value !== undefined)) {
values[count] = value; values[count] = value;
count++; count++;
} }
@ -7551,47 +7549,12 @@ Timeline.prototype.setItems = function(items) {
this.itemSet.setItems(newDataSet); this.itemSet.setItems(newDataSet);
if (initialLoad && (this.options.start == undefined || this.options.end == undefined)) { if (initialLoad && (this.options.start == undefined || this.options.end == undefined)) {
// apply the data range as range
var dataRange = this.getItemRange();
this.fit();
// add 5% space on both sides
var start = dataRange.min;
var end = dataRange.max;
if (start != null && end != null) {
var interval = (end.valueOf() - start.valueOf());
if (interval <= 0) {
// prevent an empty interval
interval = 24 * 60 * 60 * 1000; // 1 day
}
start = new Date(start.valueOf() - interval * 0.05);
end = new Date(end.valueOf() + interval * 0.05);
}
// override specified start and/or end date
if (this.options.start != undefined) {
start = util.convert(this.options.start, 'Date');
}
if (this.options.end != undefined) {
end = util.convert(this.options.end, 'Date');
}
// skip range set if there is no start and end date
if (start === null && end === null) {
return;
}
// if start and end dates are set but cannot be satisfyed due to zoom restrictions — correct end date
if (start != null && end != null) {
var diff = end.valueOf() - start.valueOf();
if (this.options.zoomMax != undefined && this.options.zoomMax < diff) {
end = new Date(start.valueOf() + this.options.zoomMax);
}
if (this.options.zoomMin != undefined && this.options.zoomMin > diff) {
end = new Date(start.valueOf() + this.options.zoomMin);
}
}
var start = (this.options.start != undefined) ? util.convert(this.options.start, 'Date') : null;
var end = (this.options.end != undefined) ? util.convert(this.options.end, 'Date') : null;
this.range.setRange(start, end);
this.setWindow(start, end);
} }
}; };
@ -7599,7 +7562,7 @@ Timeline.prototype.setItems = function(items) {
* Set groups * Set groups
* @param {vis.DataSet | Array | google.visualization.DataTable} groups * @param {vis.DataSet | Array | google.visualization.DataTable} groups
*/ */
Timeline.prototype.setGroups = function(groups) {
Timeline.prototype.setGroups = function setGroups(groups) {
// convert to type DataSet when needed // convert to type DataSet when needed
var newDataSet; var newDataSet;
if (!groups) { if (!groups) {
@ -7617,6 +7580,34 @@ Timeline.prototype.setGroups = function(groups) {
this.itemSet.setGroups(newDataSet); this.itemSet.setGroups(newDataSet);
}; };
/**
* Set Timeline window such that it fits all items
*/
Timeline.prototype.fit = function fit() {
// apply the data range as range
var dataRange = this.getItemRange();
// add 5% space on both sides
var start = dataRange.min;
var end = dataRange.max;
if (start != null && end != null) {
var interval = (end.valueOf() - start.valueOf());
if (interval <= 0) {
// prevent an empty interval
interval = 24 * 60 * 60 * 1000; // 1 day
}
start = new Date(start.valueOf() - interval * 0.05);
end = new Date(end.valueOf() + interval * 0.05);
}
// skip range set if there is no start and end date
if (start === null && end === null) {
return;
}
this.range.setRange(start, end);
};
/** /**
* Get the data range of the item set. * Get the data range of the item set.
* @returns {{min: Date, max: Date}} range A range with a start and end Date. * @returns {{min: Date, max: Date}} range A range with a start and end Date.

+ 1
- 1
dist/vis.min.css
File diff suppressed because it is too large
View File


+ 11
- 11
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 3
- 0
misc/how_to_publish.md View File

@ -70,6 +70,9 @@ This generates the vis.js library in the folder `./dist`.
- Move the created zip file `vis.zip` to the `download` folder in the - Move the created zip file `vis.zip` to the `download` folder in the
`github-pages` branch. TODO: this should be automated. `github-pages` branch. TODO: this should be automated.
- Check if there are new or updated examples, and update the gallery screenshots
accordingly.
- Go to the `github-pages` branch and run the following script: - Go to the `github-pages` branch and run the following script:
node updateversion.js node updateversion.js

+ 1
- 1
package.json View File

@ -1,6 +1,6 @@
{ {
"name": "vis", "name": "vis",
"version": "0.7.5-SNAPSHOT",
"version": "1.0.0",
"description": "A dynamic, browser-based visualization library.", "description": "A dynamic, browser-based visualization library.",
"homepage": "http://visjs.org/", "homepage": "http://visjs.org/",
"repository": { "repository": {

Loading…
Cancel
Save