Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
69dc0c4
DRY and small pref boost for scattergl
etpinard Jul 31, 2018
41ad08a
push trace module into fullLayout._modules even if visible:false
etpinard Jul 23, 2018
9c8ba02
fill in list of visible:true module in fullLayout._visibleModules
etpinard Jul 23, 2018
8ef5cb3
fix and :lock: splom trace visible toggling
etpinard Jul 23, 2018
cf0b19d
sub fail -> failTest
etpinard Jul 26, 2018
9cc5fbe
add scatter visibility restyles tests
etpinard Jul 25, 2018
dfada6a
add bar autorange tests & move 'b' init to setPositions
etpinard Jul 26, 2018
be44366
add findExtremes
etpinard Jul 25, 2018
ad1ac1f
adapt getAutoRange and doAutoRange to trace _extremes
etpinard Jul 25, 2018
769c160
fill trace._extremes with findExtremes in calc
etpinard Jul 25, 2018
736ab69
replace Axex.expand -> findExtremes in annotations and shapes
etpinard Jul 25, 2018
6194457
:hocho: ax._min / ax._max logic for rangeslider
etpinard Jul 25, 2018
8cd06ae
adapt enforceConstraints to new per trace/item _extremes
etpinard Jul 25, 2018
2a745de
adapt polar to new per trace/item _extremes
etpinard Jul 25, 2018
82d4bcc
adapt gl2d to findExtremes
etpinard Jul 26, 2018
29db388
:hocho: Axes.expand & adapt test for findExtremes
etpinard Jul 26, 2018
72f06a6
improve concatExtremes perf
etpinard Jul 27, 2018
a0bfaf3
collapse trace extremes before getAutorange
etpinard Jul 30, 2018
33b4085
mv repeat -> Lib.repeat
etpinard Aug 1, 2018
d233f3b
fix and :lock: _extremes in polar tranformed traces
etpinard Aug 1, 2018
89aebd1
fix typos in :books:
etpinard Aug 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/plots/cartesian/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
var className = (_module.layerName || name + 'layer');
var plotMethod = _module.plot;

// plot all traces of this type on this subplot at once
// plot all visible traces of this type on this subplot at once
cdModuleAndOthers = getModuleCalcData(cdSubplot, plotMethod);
cdModule = cdModuleAndOthers[0];
// don't need to search the found traces again - in fact we need to NOT
Expand Down
1 change: 1 addition & 0 deletions src/plots/get_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ exports.getModuleCalcData = function(calcdata, arg1) {
for(var i = 0; i < calcdata.length; i++) {
var cd = calcdata[i];
var trace = cd[0].trace;
// N.B. 'legendonly' traces do not make it pass here
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass past

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 89aebd1

if(trace.visible !== true) continue;

// group calcdata trace not by 'module' (as the name of this function
Expand Down
4 changes: 2 additions & 2 deletions src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ plots._hasPlotType = function(category) {
if(basePlotModules[i].name === category) return true;
}

// check trace modules
// check trace modules (including non-visible:true)
var modules = this._modules || [];
for(i = 0; i < modules.length; i++) {
var name = modules[i].name;
Expand Down Expand Up @@ -912,7 +912,7 @@ plots.supplyDataDefaults = function(dataIn, dataOut, layout, fullLayout) {
var _module = fullTrace._module;
if(!_module) return;

if(fullTrace.visible === true) Lib.pushUnique(modules, _module);
Lib.pushUnique(modules, _module);
Lib.pushUnique(basePlotModules, fullTrace._module.basePlotModule);

cnt++;
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/cartesian_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe('restyle', function() {
return Plotly.restyle(gd, {visible: 'legendonly'}, 1);
})
.then(function() {
expect(!!gd._fullLayout._plots.x2y2._scene).toBe(false);
expect(!!gd._fullLayout._plots.x2y2._scene).toBe(true);
return Plotly.restyle(gd, {visible: true}, 1);
})
.then(function() {
Expand Down
15 changes: 13 additions & 2 deletions test/jasmine/tests/gl2d_plot_interact_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,27 +358,38 @@ describe('@gl Test gl2d plots', function() {
var _mock = Lib.extendDeep({}, mock);
_mock.data[0].line.width = 5;

function assertDrawCall(msg, exp) {
var draw = gd._fullLayout._plots.xy._scene.scatter2d.draw;
expect(draw).toHaveBeenCalledTimes(exp, msg);
draw.calls.reset();
}

Plotly.plot(gd, _mock)
.then(delay(30))
.then(function() {
spyOn(gd._fullLayout._plots.xy._scene.scatter2d, 'draw');
return Plotly.restyle(gd, 'visible', 'legendonly');
})
.then(function() {
expect(gd.querySelector('.gl-canvas-context')).toBe(null);
expect(readPixel(gd.querySelector('.gl-canvas-context'), 108, 100)[0]).toBe(0);
assertDrawCall('legendonly', 0);

return Plotly.restyle(gd, 'visible', true);
})
.then(function() {
expect(readPixel(gd.querySelector('.gl-canvas-context'), 108, 100)[0]).not.toBe(0);
assertDrawCall('back to visible', 1);

return Plotly.restyle(gd, 'visible', false);
})
.then(function() {
expect(gd.querySelector('.gl-canvas-context')).toBe(null);
expect(readPixel(gd.querySelector('.gl-canvas-context'), 108, 100)[0]).toBe(0);
assertDrawCall('visible false', 0);

return Plotly.restyle(gd, 'visible', true);
})
.then(function() {
assertDrawCall('back up', 1);
expect(readPixel(gd.querySelector('.gl-canvas-context'), 108, 100)[0]).not.toBe(0);
})
.catch(failTest)
Expand Down