From 6246695269637b905f5eb935c2ee8702b194819a Mon Sep 17 00:00:00 2001 From: cnavarreteliz Date: Fri, 12 Oct 2018 18:09:18 -0300 Subject: [PATCH 1/2] adds classes to .d3plus-timeline based on presentation type --- src/Timeline.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Timeline.js b/src/Timeline.js index a006e33..fe45e40 100644 --- a/src/Timeline.js +++ b/src/Timeline.js @@ -330,6 +330,7 @@ export default class Timeline extends Axis { this._brushGroup = elem("g.brushGroup", {parent: this._group}); this._brushGroup.call(brush).transition(this._transition) + .attr("class", this._buttonBehaviorCurrent === "buttons" ? "d3plus-timeline-buttons" : "d3plus-timeline-ticks") .call(brush.move, this._buttonBehaviorCurrent === "ticks" ? this._updateBrushLimit(selection) : selection); this._outerBounds.y -= this._handleSize / 2; From 2c42d5029f5c5e84a8709cc00ab976f7c968e79e Mon Sep 17 00:00:00 2001 From: cnavarreteliz Date: Tue, 16 Oct 2018 11:16:24 -0300 Subject: [PATCH 2/2] fixes weird behavior using ticks in Timeline and setting ticks() by user --- src/Timeline.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Timeline.js b/src/Timeline.js index fe45e40..7b69dc8 100644 --- a/src/Timeline.js +++ b/src/Timeline.js @@ -297,6 +297,10 @@ export default class Timeline extends Axis { this._buttonAlign === "start" ? undefined : this._marginLeft + buttonMargin, this._buttonAlign === "end" ? undefined : marginRight - buttonMargin ]; + } + + if (this._buttonBehaviorCurrent === "ticks" && this._ticks) { + this._domain = [this._ticks[0], this._ticks[this._ticks.length - 1]]; } this._labels = this._ticks; @@ -330,7 +334,6 @@ export default class Timeline extends Axis { this._brushGroup = elem("g.brushGroup", {parent: this._group}); this._brushGroup.call(brush).transition(this._transition) - .attr("class", this._buttonBehaviorCurrent === "buttons" ? "d3plus-timeline-buttons" : "d3plus-timeline-ticks") .call(brush.move, this._buttonBehaviorCurrent === "ticks" ? this._updateBrushLimit(selection) : selection); this._outerBounds.y -= this._handleSize / 2;