[vislib/data] leave git out of this
This commit is contained in:
parent
c59a5233af
commit
44dd2fc1ca
|
@ -332,13 +332,13 @@ define(function (require) {
|
|||
* Calculates the lowest Y value across all charts, taking
|
||||
* stacking into consideration.
|
||||
*
|
||||
* @method gitYMin
|
||||
* @method getYMin
|
||||
* @param {function} [getValue] - optional getter that will receive a
|
||||
* point and should return the value that should
|
||||
* be considered
|
||||
* @returns {Number} Min y axis value
|
||||
*/
|
||||
Data.prototype.gitYMin = function (getValue) {
|
||||
Data.prototype.getYMin = function (getValue) {
|
||||
var self = this;
|
||||
var arr = [];
|
||||
|
||||
|
@ -369,13 +369,13 @@ define(function (require) {
|
|||
* Calculates the highest Y value across all charts, taking
|
||||
* stacking into consideration.
|
||||
*
|
||||
* @method gitYMax
|
||||
* @method getYMax
|
||||
* @param {function} [getValue] - optional getter that will receive a
|
||||
* point and should return the value that should
|
||||
* be considered
|
||||
* @returns {Number} Max y axis value
|
||||
*/
|
||||
Data.prototype.gitYMax = function (getValue) {
|
||||
Data.prototype.getYMax = function (getValue) {
|
||||
var self = this;
|
||||
var arr = [];
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ define(function (require) {
|
|||
alerts: new Alerts(vis, data, opts.alerts),
|
||||
yAxis: new YAxis({
|
||||
el : vis.el,
|
||||
yMin : data.gitYMin(),
|
||||
yMax : data.gitYMax(),
|
||||
yMin : data.getYMin(),
|
||||
yMax : data.getYMax(),
|
||||
_attr: vis._attr
|
||||
})
|
||||
});
|
||||
|
|
|
@ -252,7 +252,7 @@ define(function (require) {
|
|||
it('should return all points from every series', testLength(colsData));
|
||||
});
|
||||
|
||||
describe('gitYMin method', function () {
|
||||
describe('getYMin method', function () {
|
||||
var Data;
|
||||
var dataSeries;
|
||||
var stackedDataSeries;
|
||||
|
@ -285,8 +285,8 @@ define(function (require) {
|
|||
// date range. It also has the largest y value. This value should be excluded
|
||||
// when calculating the Y max value since it falls outside of the range.
|
||||
it('should return the Y domain min value', function () {
|
||||
expect(visData.gitYMin()).to.be(minValue);
|
||||
expect(stackedVisData.gitYMin()).to.be(stackedMinValue);
|
||||
expect(visData.getYMin()).to.be(minValue);
|
||||
expect(stackedVisData.getYMin()).to.be(stackedMinValue);
|
||||
});
|
||||
|
||||
it('should have a minimum date value that is greater than the max value within the date range', function () {
|
||||
|
@ -295,13 +295,13 @@ define(function (require) {
|
|||
});
|
||||
|
||||
it('allows passing a value getter for manipulating the values considered', function () {
|
||||
var realMin = visData.gitYMin();
|
||||
var realMin = visData.getYMin();
|
||||
var multiplier = 13.2;
|
||||
expect(visData.gitYMin(function (d) { return d.y * multiplier; })).to.be(realMin * multiplier);
|
||||
expect(visData.getYMin(function (d) { return d.y * multiplier; })).to.be(realMin * multiplier);
|
||||
});
|
||||
});
|
||||
|
||||
describe('gitYMax method', function () {
|
||||
describe('getYMax method', function () {
|
||||
var Data;
|
||||
var dataSeries;
|
||||
var stackedDataSeries;
|
||||
|
@ -334,8 +334,8 @@ define(function (require) {
|
|||
// date range. It also has the largest y value. This value should be excluded
|
||||
// when calculating the Y max value since it falls outside of the range.
|
||||
it('should return the Y domain min value', function () {
|
||||
expect(visData.gitYMax()).to.be(maxValue);
|
||||
expect(stackedVisData.gitYMax()).to.be(stackedMaxValue);
|
||||
expect(visData.getYMax()).to.be(maxValue);
|
||||
expect(stackedVisData.getYMax()).to.be(stackedMaxValue);
|
||||
});
|
||||
|
||||
it('should have a minimum date value that is greater than the max value within the date range', function () {
|
||||
|
@ -344,9 +344,9 @@ define(function (require) {
|
|||
});
|
||||
|
||||
it('allows passing a value getter for manipulating the values considered', function () {
|
||||
var realMax = visData.gitYMax();
|
||||
var realMax = visData.getYMax();
|
||||
var multiplier = 13.2;
|
||||
expect(visData.gitYMax(function (d) { return d.y * multiplier; })).to.be(realMax * multiplier);
|
||||
expect(visData.getYMax(function (d) { return d.y * multiplier; })).to.be(realMax * multiplier);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -72,8 +72,8 @@ define(function (require) {
|
|||
|
||||
yAxis = new YAxis({
|
||||
el: node,
|
||||
yMin: dataObj.gitYMin(),
|
||||
yMax: dataObj.gitYMax(),
|
||||
yMin: dataObj.getYMin(),
|
||||
yMax: dataObj.getYMax(),
|
||||
_attr: {
|
||||
margin: { top: 0, right: 0, bottom: 0, left: 0 }
|
||||
}
|
||||
|
|
|
@ -268,7 +268,7 @@ define(function (require) {
|
|||
it('should return yAxis extents equal to data extents', function () {
|
||||
vis.handler.charts.forEach(function (chart) {
|
||||
var yAxis = chart.handler.yAxis;
|
||||
var yVals = [vis.handler.data.gitYMin(), vis.handler.data.gitYMax()];
|
||||
var yVals = [vis.handler.data.getYMin(), vis.handler.data.getYMax()];
|
||||
|
||||
expect(yAxis.yMin).to.equal(yVals[0]);
|
||||
expect(yAxis.yMax).to.equal(yVals[1]);
|
||||
|
|
|
@ -206,7 +206,7 @@ define(function (require) {
|
|||
it('should return yAxis extents equal to data extents', function () {
|
||||
vis.handler.charts.forEach(function (chart) {
|
||||
var yAxis = chart.handler.yAxis;
|
||||
var yVals = [vis.handler.data.gitYMin(), vis.handler.data.gitYMax()];
|
||||
var yVals = [vis.handler.data.getYMin(), vis.handler.data.getYMax()];
|
||||
|
||||
expect(yAxis.yMin).to.equal(yVals[0]);
|
||||
expect(yAxis.yMax).to.equal(yVals[1]);
|
||||
|
|
|
@ -182,7 +182,7 @@ define(function (require) {
|
|||
it('should return yAxis extents equal to data extents', function () {
|
||||
vis.handler.charts.forEach(function (chart) {
|
||||
var yAxis = chart.handler.yAxis;
|
||||
var yVals = [vis.handler.data.gitYMin(), vis.handler.data.gitYMax()];
|
||||
var yVals = [vis.handler.data.getYMin(), vis.handler.data.getYMax()];
|
||||
|
||||
expect(yAxis.yMin).to.equal(yVals[0]);
|
||||
expect(yAxis.yMax).to.equal(yVals[1]);
|
||||
|
|
Loading…
Reference in a new issue