From 61108f393edc084968ec2e67045e490f3368eaec Mon Sep 17 00:00:00 2001
From: jos
Date: Thu, 30 Apr 2015 10:49:52 +0200
Subject: [PATCH 1/3] Renamed class `.vis-item-frame` to `.vis-item-overflow`
---
examples/timeline/18_range_overflow.html | 4 ++--
lib/timeline/component/css/item.css | 2 +-
lib/timeline/component/item/BackgroundItem.js | 2 +-
lib/timeline/component/item/RangeItem.js | 2 +-
test/timeline.html | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/examples/timeline/18_range_overflow.html b/examples/timeline/18_range_overflow.html
index b1636ad7..cac86a8a 100644
--- a/examples/timeline/18_range_overflow.html
+++ b/examples/timeline/18_range_overflow.html
@@ -11,7 +11,7 @@
font-family: sans-serif;
}
- .vis-item .vis-item-frame {
+ .vis-item .vis-item-overflow {
overflow: visible;
}
@@ -22,7 +22,7 @@
In case of ranges being spread over a wide range of time, it can be interesting to have the text contents of the ranges overflow the box. This can be achieved by changing the overflow property of the contents to visible with css:
- Clear the Timeline. An object can be passed specifying which sections to clear: items, groups,
- and/or options. By Default, items, groups and options are cleared, i.e. what = {items: true, groups: true, options: true}. Example usage:
-
-
timeline.clear(); // clear items, groups, and options
-timeline.clear({options: true}); // clear options only
-
-
-
destroy()
diff --git a/lib/timeline/Core.js b/lib/timeline/Core.js
index 11bed710..9dd08b9c 100644
--- a/lib/timeline/Core.js
+++ b/lib/timeline/Core.js
@@ -288,7 +288,8 @@ Core.prototype.isActive = function () {
*/
Core.prototype.destroy = function () {
// unbind datasets
- this.clear();
+ this.setItems(null);
+ this.setGroups(null);
// remove all event listeners
this.off();
@@ -455,37 +456,6 @@ Core.prototype.getVisibleItems = function() {
return this.itemSet && this.itemSet.getVisibleItems() || [];
};
-
-
-/**
- * Clear the Core. By Default, items, groups and options are cleared.
- * Example usage:
- *
- * timeline.clear(); // clear items, groups, and options
- * timeline.clear({options: true}); // clear options only
- *
- * @param {Object} [what] Optionally specify what to clear. By default:
- * {items: true, groups: true, options: true}
- */
-Core.prototype.clear = function(what) {
- // clear items
- if (!what || what.items) {
- this.setItems(null);
- }
-
- // clear groups
- if (!what || what.groups) {
- this.setGroups(null);
- }
-
- // clear options of timeline and of each of the components
- if (!what || what.options) {
- this.components.forEach(component => component.setOptions(component.defaultOptions));
-
- this.setOptions(this.defaultOptions); // this will also do a redraw
- }
-};
-
/**
* Set Core window such that it fits all items
* @param {Object} [options] Available options:
diff --git a/lib/timeline/component/Legend.js b/lib/timeline/component/Legend.js
index 64be8b91..e34e9d95 100644
--- a/lib/timeline/component/Legend.js
+++ b/lib/timeline/component/Legend.js
@@ -39,7 +39,7 @@ Legend.prototype = new Component();
Legend.prototype.clear = function() {
this.groups = {};
this.amountOfGroups = 0;
-}
+};
Legend.prototype.addGroup = function(label, graphOptions) {
From b523d7ef85fddd6af711ca459ef6cc944c0d6782 Mon Sep 17 00:00:00 2001
From: jos
Date: Thu, 30 Apr 2015 14:11:07 +0200
Subject: [PATCH 3/3] Fixed background styling issue with Graph2d
---
examples/graph2d/05_bothAxis.html | 5 ++---
examples/graph2d/16_bothAxis_titles.html | 6 +++---
lib/timeline/component/css/pathStyles.css | 14 ++++++--------
3 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/examples/graph2d/05_bothAxis.html b/examples/graph2d/05_bothAxis.html
index 1a42b784..093c896f 100644
--- a/examples/graph2d/05_bothAxis.html
+++ b/examples/graph2d/05_bothAxis.html
@@ -3,6 +3,8 @@
Graph2d | Both Axis Example
+
+
-
-
-
diff --git a/examples/graph2d/16_bothAxis_titles.html b/examples/graph2d/16_bothAxis_titles.html
index 2083be98..45f32881 100644
--- a/examples/graph2d/16_bothAxis_titles.html
+++ b/examples/graph2d/16_bothAxis_titles.html
@@ -3,6 +3,8 @@
Graph2d | Axis Titles and Styling
+
+
-
-
-
+