Skip to content

Commit

Permalink
Merge pull request #1600 from palantir/release-v0.43.1
Browse files Browse the repository at this point in the history
Release v0.43.1 (--> master)
  • Loading branch information
jtlan committed Feb 6, 2015
2 parents 540bdcf + 65a8e81 commit 6c42b77
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "plottable",
"description": "A library for creating charts out of D3",
"version": "0.43.0",
"version": "0.43.1",
"main": ["plottable.js", "plottable.css"],
"license": "MIT",
"ignore": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "plottable.js",
"description": "A library for creating charts out of D3",
"version": "0.43.0",
"version": "0.43.1",
"repository": {
"type": "git",
"url": "https://github.com/palantir/plottable.git"
Expand Down
8 changes: 4 additions & 4 deletions plottable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1275,14 +1275,14 @@ declare module Plottable {
*/
rangeBand(): number;
/**
* Returns the full band width of the scale.
* Returns the step width of the scale.
*
* The full band width is defined as the entire space for a band to occupy,
* not accounting for any padding in between the bands.
* The step width is defined as the entire space for a band to occupy,
* including the padding in between the bands.
*
* @returns {number} the full band width of the scale
*/
fullBandWidth(): number;
stepWidth(): number;
/**
* Returns the inner padding of the scale.
*
Expand Down
21 changes: 11 additions & 10 deletions plottable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Plottable 0.43.0 (https://github.com/palantir/plottable)
Plottable 0.43.1 (https://github.com/palantir/plottable)
Copyright 2014 Palantir Technologies
Licensed under MIT (https://github.com/palantir/plottable/blob/master/LICENSE)
*/
Expand Down Expand Up @@ -978,7 +978,7 @@ var Plottable;
///<reference path="../reference.ts" />
var Plottable;
(function (Plottable) {
Plottable.version = "0.43.0";
Plottable.version = "0.43.1";
})(Plottable || (Plottable = {}));

///<reference path="../reference.ts" />
Expand Down Expand Up @@ -2290,15 +2290,15 @@ var Plottable;
return this._d3Scale.rangeBand();
};
/**
* Returns the full band width of the scale.
* Returns the step width of the scale.
*
* The full band width is defined as the entire space for a band to occupy,
* not accounting for any padding in between the bands.
* The step width is defined as the entire space for a band to occupy,
* including the padding in between the bands.
*
* @returns {number} the full band width of the scale
*/
Ordinal.prototype.fullBandWidth = function () {
return this.rangeBand() + this.innerPadding();
Ordinal.prototype.stepWidth = function () {
return this.rangeBand() * (1 + this.innerPadding());
};
Ordinal.prototype.innerPadding = function (innerPadding) {
if (innerPadding == null) {
Expand Down Expand Up @@ -5052,7 +5052,7 @@ var Plottable;
break;
}
ticks.each(function (d) {
var bandWidth = scale.rangeBand();
var bandWidth = scale.stepWidth();
var width = self._isHorizontal() ? bandWidth : axisWidth - self._maxLabelTickLength() - self.tickLabelPadding();
var height = self._isHorizontal() ? axisHeight - self._maxLabelTickLength() - self.tickLabelPadding() : bandWidth;
var writeOptions = {
Expand All @@ -5073,7 +5073,7 @@ var Plottable;
Category.prototype._measureTicks = function (axisWidth, axisHeight, scale, ticks) {
var _this = this;
var wrappingResults = ticks.map(function (s) {
var bandWidth = scale.fullBandWidth();
var bandWidth = scale.stepWidth();
var width = _this._isHorizontal() ? bandWidth : axisWidth - _this._maxLabelTickLength() - _this.tickLabelPadding();
var height = _this._isHorizontal() ? axisHeight - _this._maxLabelTickLength() - _this.tickLabelPadding() : bandWidth;
return _this._wrapper.wrap(_this.formatter()(s), _this._measurer, width, height);
Expand All @@ -5092,7 +5092,8 @@ var Plottable;
var ordScale = this._scale;
var tickLabels = this._tickLabelContainer.selectAll("." + Axis.AbstractAxis.TICK_LABEL_CLASS).data(this._scale.domain(), function (d) { return d; });
var getTickLabelTransform = function (d, i) {
var scaledValue = ordScale.scale(d) - ordScale.rangeBand() / 2;
var innerPaddingWidth = ordScale.stepWidth() - ordScale.rangeBand();
var scaledValue = ordScale.scale(d) - ordScale.rangeBand() / 2 - innerPaddingWidth / 2;
var x = _this._isHorizontal() ? scaledValue : 0;
var y = _this._isHorizontal() ? 0 : scaledValue;
return "translate(" + x + "," + y + ")";
Expand Down
10 changes: 5 additions & 5 deletions plottable.min.js

Large diffs are not rendered by default.

Binary file modified plottable.zip
Binary file not shown.
7 changes: 4 additions & 3 deletions src/components/axes/categoryAxis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export module Axis {
break;
}
ticks.each(function (d: string) {
var bandWidth = scale.rangeBand();
var bandWidth = scale.stepWidth();
var width = self._isHorizontal() ? bandWidth : axisWidth - self._maxLabelTickLength() - self.tickLabelPadding();
var height = self._isHorizontal() ? axisHeight - self._maxLabelTickLength() - self.tickLabelPadding() : bandWidth;
var writeOptions = {
Expand All @@ -137,7 +137,7 @@ export module Axis {
*/
private _measureTicks(axisWidth: number, axisHeight: number, scale: Scale.Ordinal, ticks: string[]) {
var wrappingResults = ticks.map((s: string) => {
var bandWidth = scale.fullBandWidth();
var bandWidth = scale.stepWidth();
var width = this._isHorizontal() ? bandWidth : axisWidth - this._maxLabelTickLength() - this.tickLabelPadding();
var height = this._isHorizontal() ? axisHeight - this._maxLabelTickLength() - this.tickLabelPadding() : bandWidth;
return this._wrapper.wrap(this.formatter()(s), this._measurer, width, height);
Expand All @@ -162,7 +162,8 @@ export module Axis {
var tickLabels = this._tickLabelContainer.selectAll("." + AbstractAxis.TICK_LABEL_CLASS).data(this._scale.domain(), (d) => d);

var getTickLabelTransform = (d: string, i: number) => {
var scaledValue = ordScale.scale(d) - ordScale.rangeBand() / 2;
var innerPaddingWidth = ordScale.stepWidth() - ordScale.rangeBand();
var scaledValue = ordScale.scale(d) - ordScale.rangeBand() / 2 - innerPaddingWidth / 2;
var x = this._isHorizontal() ? scaledValue : 0;
var y = this._isHorizontal() ? 0 : scaledValue;
return "translate(" + x + "," + y + ")";
Expand Down
10 changes: 5 additions & 5 deletions src/scales/ordinalScale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ export module Scale {
}

/**
* Returns the full band width of the scale.
* Returns the step width of the scale.
*
* The full band width is defined as the entire space for a band to occupy,
* not accounting for any padding in between the bands.
* The step width is defined as the entire space for a band to occupy,
* including the padding in between the bands.
*
* @returns {number} the full band width of the scale
*/
public fullBandWidth(): number {
return this.rangeBand() + this.innerPadding();
public stepWidth(): number {
return this.rangeBand() * (1 + this.innerPadding());
}

/**
Expand Down

0 comments on commit 6c42b77

Please sign in to comment.