Skip to content

Commit

Permalink
Bump version to 0.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
teamdandelion committed May 2, 2014
1 parent 3710c19 commit 8148cc6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plottable",
"version": "0.10.1",
"version": "0.10.2",
"ignore": [
"**/*",
"!plottable.js",
Expand Down
2 changes: 1 addition & 1 deletion license_header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Plottable v0.10.1 (https://github.com/palantir/plottable)
Plottable v0.10.2 (https://github.com/palantir/plottable)
Copyright 2014 Palantir Technologies
Licensed under MIT (https://github.com/palantir/plottable/blob/master/LICENSE)
*/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plottable.js",
"version": "0.10.1",
"version": "0.10.2",
"description": "Build flexible, performant, interactive charts using D3",
"repository": {
"type": "git",
Expand Down
3 changes: 3 additions & 0 deletions plottable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1017,16 +1017,19 @@ declare module Plottable {
declare module Plottable {
class DragBoxInteraction extends DragInteraction {
public dragBox: D3.Selection;
public boxIsDrawn: boolean;
/**
* Clears the highlighted drag-selection box drawn by the AreaInteraction.
*
* @returns {AreaInteraction} The calling AreaInteraction.
*/
public clearBox(): DragBoxInteraction;
public setBox(x0: number, x1: number, y0: number, y1: number): DragBoxInteraction;
}
}
declare module Plottable {
class XDragBoxInteraction extends DragBoxInteraction {
public setBox(x0: number, x1: number): XDragBoxInteraction;
}
}
declare module Plottable {
Expand Down
38 changes: 26 additions & 12 deletions plottable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Plottable v0.10.1 (https://github.com/palantir/plottable)
Plottable v0.10.2 (https://github.com/palantir/plottable)
Copyright 2014 Palantir Technologies
Licensed under MIT (https://github.com/palantir/plottable/blob/master/LICENSE)
*/
Expand Down Expand Up @@ -459,6 +459,9 @@ var Plottable;
if (this.hasBeenRemoved) {
throw new Error("Cannot reuse a component after removing it");
}
if (this.element != null) {
throw new Error("Cannot re-anchor a component after it is already anchored");
}
if (element.node().nodeName === "svg") {
// svg node gets the "plottable" CSS class
this.rootSVG = element;
Expand Down Expand Up @@ -3074,9 +3077,13 @@ var Plottable;
__extends(DragBoxInteraction, _super);
function DragBoxInteraction() {
_super.apply(this, arguments);
this.boxIsDrawn = false;
}
DragBoxInteraction.prototype._dragstart = function () {
_super.prototype._dragstart.call(this);
if (this.callbackToCall != null && this.boxIsDrawn) {
this.callbackToCall(null);
}
this.clearBox();
};

Expand All @@ -3087,6 +3094,17 @@ var Plottable;
*/
DragBoxInteraction.prototype.clearBox = function () {
this.dragBox.attr("height", 0).attr("width", 0);
this.boxIsDrawn = false;
return this;
};

DragBoxInteraction.prototype.setBox = function (x0, x1, y0, y1) {
var w = Math.abs(x0 - x1);
var h = Math.abs(y0 - y1);
var xo = Math.min(x0, x1);
var yo = Math.min(y0, y1);
this.dragBox.attr({ x: xo, y: yo, width: w, height: h });
this.boxIsDrawn = (w > 0 && h > 0);
return this;
};

Expand All @@ -3112,11 +3130,7 @@ var Plottable;
}
XDragBoxInteraction.prototype._drag = function () {
_super.prototype._drag.call(this);
var width = Math.abs(this.origin[0] - this.location[0]);
var height = this.componentToListenTo.availableHeight;
var x = Math.min(this.origin[0], this.location[0]);
var y = 0;
this.dragBox.attr({ x: x, y: y, height: height, width: width });
this.setBox(this.origin[0], this.location[0]);
};

XDragBoxInteraction.prototype._doDragend = function () {
Expand All @@ -3128,6 +3142,11 @@ var Plottable;
var pixelArea = { xMin: xMin, xMax: xMax };
this.callbackToCall(pixelArea);
};

XDragBoxInteraction.prototype.setBox = function (x0, x1) {
_super.prototype.setBox.call(this, x0, x1, 0, this.componentToListenTo.availableHeight);
return this;
};
return XDragBoxInteraction;
})(Plottable.DragBoxInteraction);
Plottable.XDragBoxInteraction = XDragBoxInteraction;
Expand All @@ -3142,18 +3161,13 @@ var Plottable;
}
XYDragBoxInteraction.prototype._drag = function () {
_super.prototype._drag.call(this);
var width = Math.abs(this.origin[0] - this.location[0]);
var height = Math.abs(this.origin[1] - this.location[1]);
var x = Math.min(this.origin[0], this.location[0]);
var y = Math.min(this.origin[1], this.location[1]);
this.dragBox.attr({ x: x, y: y, height: height, width: width });
this.setBox(this.origin[0], this.location[0], this.origin[1], this.location[1]);
};

XYDragBoxInteraction.prototype._doDragend = function () {
if (this.callbackToCall == null) {
return;
}

var xMin = Math.min(this.origin[0], this.location[0]);
var xMax = Math.max(this.origin[0], this.location[0]);
var yMin = Math.min(this.origin[1], this.location[1]);
Expand Down

0 comments on commit 8148cc6

Please sign in to comment.