Skip to content

Commit 330c5f3

Browse files
committed
expand axes within convert step
- to ensure that the reset-axes and autoscale mode bar buttons works as desired.
1 parent ad88139 commit 330c5f3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/traces/contourgl/convert.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
var createContour2D = require('gl-contour2d');
1313
var createHeatmap2D = require('gl-heatmap2d');
1414

15+
var Axes = require('../../plots/cartesian/axes');
1516
var makeColorMap = require('../contour/make_color_map');
1617
var str2RGBArray = require('../../lib/str2rgbarray');
1718

@@ -96,7 +97,6 @@ proto.update = function(fullTrace, calcTrace) {
9697
this.contourOptions.x = this.heatmapOptions.x = calcPt.x;
9798
this.contourOptions.y = this.heatmapOptions.y = calcPt.y;
9899

99-
100100
// pass on fill information
101101
if(fullTrace.contours.coloring === 'fill') {
102102
colorOptions = convertColorScale(fullTrace, {fill: true});
@@ -118,6 +118,10 @@ proto.update = function(fullTrace, calcTrace) {
118118

119119
this.contour.update(this.contourOptions);
120120
this.heatmap.update(this.heatmapOptions);
121+
122+
// expand axes
123+
Axes.expand(this.scene.xaxis, calcPt.x);
124+
Axes.expand(this.scene.yaxis, calcPt.y);
121125
};
122126

123127
proto.dispose = function() {

src/traces/heatmapgl/convert.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'use strict';
1111

1212
var createHeatmap2D = require('gl-heatmap2d');
13-
13+
var Axes = require('../../plots/cartesian/axes');
1414
var str2RGBArray = require('../../lib/str2rgbarray');
1515

1616

@@ -87,6 +87,9 @@ proto.update = function(fullTrace, calcTrace) {
8787
this.textLabels = [].concat.apply([], fullTrace.text);
8888

8989
this.heatmap.update(this.options);
90+
91+
Axes.expand(this.scene.xaxis, calcPt.x);
92+
Axes.expand(this.scene.yaxis, calcPt.y);
9093
};
9194

9295
proto.dispose = function() {

0 commit comments

Comments
 (0)