From 1eb05e52fa00f3cdc4907f2436b1c276bea97666 Mon Sep 17 00:00:00 2001 From: Alexander Wunschik Date: Fri, 30 Dec 2016 18:01:47 +0100 Subject: [PATCH] readded throttleRedraw (#2514) * readded depricated option throttleRedraw; fixes #2511 * added doc style for depricated options --- docs/css/style.css | 7 +++++++ docs/timeline/index.html | 7 +++++++ lib/timeline/Graph2d.js | 6 ++++++ lib/timeline/Timeline.js | 10 ++++++++-- lib/timeline/optionsGraph2d.js | 1 + lib/timeline/optionsTimeline.js | 1 + 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/css/style.css b/docs/css/style.css index 61b36273..f7048a9c 100644 --- a/docs/css/style.css +++ b/docs/css/style.css @@ -128,6 +128,13 @@ tr.visible { fadeIn 250ms ease-in; } +tr.depricated td { + color: #AAA; + text-decoration: line-through; +} +tr.depricated td:last-child { + text-decoration: none; +} @-webkit-keyframes fadeIn { 0% { diff --git a/docs/timeline/index.html b/docs/timeline/index.html index f8717d96..266eb576 100644 --- a/docs/timeline/index.html +++ b/docs/timeline/index.html @@ -1048,6 +1048,13 @@ function (option, path) { This would be used as an additional way to add content that is constant in size with the visible frame of the item and does not get visibly hidden with the item's internal container: vis-item-overflow which is overflow:hidden. + + throttleRedraw + number + 0 + This option is DEPRICATED and no longer supported. It will be removed in the next MAJOR release. + + timeAxis Object diff --git a/lib/timeline/Graph2d.js b/lib/timeline/Graph2d.js index 0e294592..a222456e 100644 --- a/lib/timeline/Graph2d.js +++ b/lib/timeline/Graph2d.js @@ -34,6 +34,12 @@ function Graph2d (container, items, groups, options) { groups = forthArgument; } + // TODO: REMOVE THIS in the next MAJOR release + // see https://github.com/almende/vis/issues/2511 + if (options && options.throttleRedraw) { + console.warn("Graph2d option \"throttleRedraw\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release."); + } + var me = this; this.defaultOptions = { start: null, diff --git a/lib/timeline/Timeline.js b/lib/timeline/Timeline.js index 20f708c4..418a713d 100644 --- a/lib/timeline/Timeline.js +++ b/lib/timeline/Timeline.js @@ -41,6 +41,12 @@ function Timeline (container, items, groups, options) { groups = forthArgument; } + // TODO: REMOVE THIS in the next MAJOR release + // see https://github.com/almende/vis/issues/2511 + if (options && options.throttleRedraw) { + console.warn("Timeline option \"throttleRedraw\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release."); + } + var me = this; this.defaultOptions = { start: null, @@ -69,9 +75,9 @@ function Timeline (container, items, groups, options) { this.options.rtl = (directionFromDom && (directionFromDom.toLowerCase() == "rtl")); } else { this.options.rtl = options.rtl; - } + } - this.options.rollingMode = options && options.rollingMode; + this.options.rollingMode = options && options.rollingMode; // all components listed here will be repainted automatically this.components = []; diff --git a/lib/timeline/optionsGraph2d.js b/lib/timeline/optionsGraph2d.js index aa7edfab..18dd1228 100644 --- a/lib/timeline/optionsGraph2d.js +++ b/lib/timeline/optionsGraph2d.js @@ -100,6 +100,7 @@ let allOptions = { }, autoResize: {bool}, + throttleRedraw: {number}, // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511 clickToUse: {bool}, end: {number, date, string, moment}, format: { diff --git a/lib/timeline/optionsTimeline.js b/lib/timeline/optionsTimeline.js index 948022fd..3833f7a6 100644 --- a/lib/timeline/optionsTimeline.js +++ b/lib/timeline/optionsTimeline.js @@ -30,6 +30,7 @@ let allOptions = { verticalScroll: { 'boolean': bool, 'undefined': 'undefined'}, horizontalScroll: { 'boolean': bool, 'undefined': 'undefined'}, autoResize: { 'boolean': bool}, + throttleRedraw: {number}, // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511 clickToUse: { 'boolean': bool}, dataAttributes: {string, array}, editable: {