Skip to content

Commit

Permalink
Fixes some small bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jagracar committed Sep 27, 2018
1 parent a4bed7f commit 08c6a14
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
8 changes: 5 additions & 3 deletions lib/grafica.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,9 +1131,9 @@ GAxis.prototype.setNTicks = function(nTicks) {
if (nTicks >= 0) {
this.nTicks = nTicks;
this.ticksSeparation = -1;
this.fixedTicks = false;

if (!this.log) {
this.fixedTicks = false;
this.updateTicks();
this.updatePlotTicks();
this.updateTicksInside();
Expand All @@ -1144,9 +1144,9 @@ GAxis.prototype.setNTicks = function(nTicks) {

GAxis.prototype.setTicksSeparation = function(ticksSeparation) {
this.ticksSeparation = ticksSeparation;
this.fixedTicks = false;

if (!this.log) {
this.fixedTicks = false;
this.updateTicks();
this.updatePlotTicks();
this.updateTicksInside();
Expand Down Expand Up @@ -3254,7 +3254,7 @@ GLayer.prototype.addPointAtIndexPos = function() {
if (index <= this.points.length) {
this.points.splice(index, 0, new GPoint(x, y, label));
this.plotPoints.splice(index, 0, new GPoint(this.valueToXPlot(x), this.valueToYPlot(y), label));
this.inside.splice(index, 0, this.isInside(this.plotPoints[0]));
this.inside.splice(index, 0, this.isInside(this.plotPoints[index]));

if ( typeof this.hist !== "undefined") {
this.hist.setPlotPoints(this.plotPoints);
Expand Down Expand Up @@ -3944,6 +3944,7 @@ GPlot.prototype.moveHorizontalAxesLim = function(delta) {

// Fix the limits
this.fixedXLim = true;
this.fixedYLim = true;

// Move the horizontal axes
this.xAxis.moveLim(this.xLim);
Expand All @@ -3968,6 +3969,7 @@ GPlot.prototype.moveVerticalAxesLim = function(delta) {
}

// Fix the limits
this.fixedXLim = true;
this.fixedYLim = true;

// Move the vertical axes
Expand Down
6 changes: 3 additions & 3 deletions lib/grafica.min.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions releases/grafica.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,9 +1131,9 @@ GAxis.prototype.setNTicks = function(nTicks) {
if (nTicks >= 0) {
this.nTicks = nTicks;
this.ticksSeparation = -1;
this.fixedTicks = false;

if (!this.log) {
this.fixedTicks = false;
this.updateTicks();
this.updatePlotTicks();
this.updateTicksInside();
Expand All @@ -1144,9 +1144,9 @@ GAxis.prototype.setNTicks = function(nTicks) {

GAxis.prototype.setTicksSeparation = function(ticksSeparation) {
this.ticksSeparation = ticksSeparation;
this.fixedTicks = false;

if (!this.log) {
this.fixedTicks = false;
this.updateTicks();
this.updatePlotTicks();
this.updateTicksInside();
Expand Down Expand Up @@ -3254,7 +3254,7 @@ GLayer.prototype.addPointAtIndexPos = function() {
if (index <= this.points.length) {
this.points.splice(index, 0, new GPoint(x, y, label));
this.plotPoints.splice(index, 0, new GPoint(this.valueToXPlot(x), this.valueToYPlot(y), label));
this.inside.splice(index, 0, this.isInside(this.plotPoints[0]));
this.inside.splice(index, 0, this.isInside(this.plotPoints[index]));

if ( typeof this.hist !== "undefined") {
this.hist.setPlotPoints(this.plotPoints);
Expand Down Expand Up @@ -3944,6 +3944,7 @@ GPlot.prototype.moveHorizontalAxesLim = function(delta) {

// Fix the limits
this.fixedXLim = true;
this.fixedYLim = true;

// Move the horizontal axes
this.xAxis.moveLim(this.xLim);
Expand All @@ -3968,6 +3969,7 @@ GPlot.prototype.moveVerticalAxesLim = function(delta) {
}

// Fix the limits
this.fixedXLim = true;
this.fixedYLim = true;

// Move the vertical axes
Expand Down
6 changes: 3 additions & 3 deletions releases/grafica.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/GAxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,9 @@ GAxis.prototype.setNTicks = function(nTicks) {
if (nTicks >= 0) {
this.nTicks = nTicks;
this.ticksSeparation = -1;
this.fixedTicks = false;

if (!this.log) {
this.fixedTicks = false;
this.updateTicks();
this.updatePlotTicks();
this.updateTicksInside();
Expand All @@ -728,9 +728,9 @@ GAxis.prototype.setNTicks = function(nTicks) {

GAxis.prototype.setTicksSeparation = function(ticksSeparation) {
this.ticksSeparation = ticksSeparation;
this.fixedTicks = false;

if (!this.log) {
this.fixedTicks = false;
this.updateTicks();
this.updatePlotTicks();
this.updateTicksInside();
Expand Down
2 changes: 1 addition & 1 deletion src/GLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ GLayer.prototype.addPointAtIndexPos = function() {
if (index <= this.points.length) {
this.points.splice(index, 0, new GPoint(x, y, label));
this.plotPoints.splice(index, 0, new GPoint(this.valueToXPlot(x), this.valueToYPlot(y), label));
this.inside.splice(index, 0, this.isInside(this.plotPoints[0]));
this.inside.splice(index, 0, this.isInside(this.plotPoints[index]));

if ( typeof this.hist !== "undefined") {
this.hist.setPlotPoints(this.plotPoints);
Expand Down
2 changes: 2 additions & 0 deletions src/GPlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ GPlot.prototype.moveHorizontalAxesLim = function(delta) {

// Fix the limits
this.fixedXLim = true;
this.fixedYLim = true;

// Move the horizontal axes
this.xAxis.moveLim(this.xLim);
Expand All @@ -538,6 +539,7 @@ GPlot.prototype.moveVerticalAxesLim = function(delta) {
}

// Fix the limits
this.fixedXLim = true;
this.fixedYLim = true;

// Move the vertical axes
Expand Down

0 comments on commit 08c6a14

Please sign in to comment.