Skip to content

Commit

Permalink
use ax._gridVals to built WebGL splom grid line data
Browse files Browse the repository at this point in the history
- ... that is instead of ax._vals
- ax._gridVals has the grid line of the axis ends filtered out,
  which leads here to less rendered line - improving perf
  w/o generating a diff in the baselines.
  • Loading branch information
etpinard committed Sep 13, 2019
1 parent 184db74 commit 9f30e0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/traces/splom/base_plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ function makeGridData(gd) {
var sp = fullLayout._plots[k];
var xa = sp.xaxis;
var ya = sp.yaxis;
var xVals = xa._vals;
var yVals = ya._vals;
var xVals = xa._gridVals;
var yVals = ya._gridVals;
// ya.l2p assumes top-to-bottom coordinate system (a la SVG),
// we need to compute bottom-to-top offsets and slopes:
var yOffset = gs.b + ya.domain[0] * gs.h;
Expand Down
12 changes: 6 additions & 6 deletions test/jasmine/tests/splom_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,26 +702,26 @@ describe('Test splom interactions:', function() {
}

Plotly.plot(gd, fig).then(function() {
_assert([1198, 16678, 3358, 118]);
_assert([1198, 16558, 3358, 118]);
return Plotly.restyle(gd, 'showupperhalf', false);
})
.then(function() {
_assert([1198, 8488, 1768, 4]);
_assert([1198, 8476, 1768, 4]);
return Plotly.restyle(gd, 'diagonal.visible', false);
})
.then(function() {
_assert([1138, 7654, 1600]);
_assert([1138, 7534, 1600]);
return Plotly.restyle(gd, {
showupperhalf: true,
showlowerhalf: false
});
})
.then(function() {
_assert([8188, 112, 1588]);
_assert([7966, 112, 1588]);
return Plotly.restyle(gd, 'diagonal.visible', true);
})
.then(function() {
_assert([58, 9022, 1756, 118]);
_assert([58, 8908, 1756, 118]);
return Plotly.relayout(gd, {
'xaxis.gridcolor': null,
'xaxis.gridwidth': null,
Expand All @@ -732,7 +732,7 @@ describe('Test splom interactions:', function() {
.then(function() {
// one batch for all 'grid' lines
// and another for all 'zeroline' lines
_assert([9082, 1876]);
_assert([8968, 1876]);
})
.catch(failTest)
.then(done);
Expand Down

0 comments on commit 9f30e0a

Please sign in to comment.