diff --git a/docs/timeline.html b/docs/timeline.html index 6b92cac1..822f8b48 100644 --- a/docs/timeline.html +++ b/docs/timeline.html @@ -872,18 +872,6 @@ var options = { Returns ID of the newly created bar. -
what = {items: true, groups: true, options: true}. Example usage:
-
-timeline.clear(); // clear items, groups, and options
-timeline.clear({options: true}); // clear options only
-
-
-.vis-item .vis-item-frame {
+.vis-item .vis-item-overflow {
overflow: visible;
}
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) {
diff --git a/lib/timeline/component/css/item.css b/lib/timeline/component/css/item.css
index 225daf83..756c55b0 100644
--- a/lib/timeline/component/css/item.css
+++ b/lib/timeline/component/css/item.css
@@ -57,7 +57,7 @@
margin: 0;
}
-.vis-item .vis-item-frame {
+.vis-item .vis-item-overflow {
position: relative;
width: 100%;
height: 100%;
diff --git a/lib/timeline/component/css/pathStyles.css b/lib/timeline/component/css/pathStyles.css
index 9089e6cc..38b2f087 100644
--- a/lib/timeline/component/css/pathStyles.css
+++ b/lib/timeline/component/css/pathStyles.css
@@ -68,24 +68,24 @@
stroke: #8f3938;
}
-.vis-fill {
+.vis-timeline .vis-fill {
fill-opacity:0.1;
stroke: none;
}
-.vis-bar {
+.vis-timeline .vis-bar {
fill-opacity:0.5;
stroke-width:1px;
}
-.vis-point {
+.vis-timeline .vis-point {
stroke-width:2px;
fill-opacity:1.0;
}
-.vis-legend-background {
+.vis-timeline .vis-legend-background {
stroke-width:1px;
fill-opacity:0.9;
fill: #ffffff;
@@ -93,16 +93,14 @@
}
-.vis-outline {
+.vis-timeline .vis-outline {
stroke-width:1px;
fill-opacity:1;
fill: #ffffff;
stroke: #e5e5e5;
}
-.vis-icon-fill {
+.vis-timeline .vis-icon-fill {
fill-opacity:0.3;
stroke: none;
}
-
-
diff --git a/lib/timeline/component/item/BackgroundItem.js b/lib/timeline/component/item/BackgroundItem.js
index 62493dc6..dba94be0 100644
--- a/lib/timeline/component/item/BackgroundItem.js
+++ b/lib/timeline/component/item/BackgroundItem.js
@@ -66,7 +66,7 @@ BackgroundItem.prototype.redraw = function() {
// frame box (to prevent the item contents from overflowing
dom.frame = document.createElement('div');
- dom.frame.className = 'vis-item-frame';
+ dom.frame.className = 'vis-item-overflow';
dom.box.appendChild(dom.frame);
// contents box
diff --git a/lib/timeline/component/item/RangeItem.js b/lib/timeline/component/item/RangeItem.js
index fcc65e8b..10e36a78 100644
--- a/lib/timeline/component/item/RangeItem.js
+++ b/lib/timeline/component/item/RangeItem.js
@@ -62,7 +62,7 @@ RangeItem.prototype.redraw = function() {
// frame box (to prevent the item contents from overflowing
dom.frame = document.createElement('div');
- dom.frame.className = 'vis-item-frame';
+ dom.frame.className = 'vis-item-overflow';
dom.box.appendChild(dom.frame);
// contents box
diff --git a/test/timeline.html b/test/timeline.html
index e6fb7e13..add85cdd 100644
--- a/test/timeline.html
+++ b/test/timeline.html
@@ -23,7 +23,7 @@
.vis-timeline .vis-item.vis-range .vis-drag-left,
.vis-timeline .vis-item.vis-range .vis-drag-right {
/*width: 40px;*/
- background: rgba(255,255,255,0.5);
+ background: rgba(255,0,0,0.5);
}
#visualization .vis-grid.vis-vertical.odd {