8000 Convert arrayOk attribute to calcdata in calc step by etpinard · Pull Request #1257 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Convert arrayOk attribute to calcdata in calc step #1257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 22, 2016
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
add filter + zoom + arrayOk attributes test case
  • Loading branch information
etpinard committed Dec 16, 2016
commit aca5487b29dc311b371e34ca85ceb989b0110d1d
28 changes: 28 additions & 0 deletions test/jasmine/tests/transform_filter_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@ describe('filter transforms interactions', function() {
var mockData0 = [{
x: [-2, -1, -2, 0, 1, 2, 3],< 8000 /span>
y: [1, 2, 3, 1, 2, 3, 1],
text: ['a', 'b', 'c', 'd', 'e', 'f', 'g'],
transforms: [{
type: 'filter',
operation: '>'
Expand All @@ -856,6 +857,7 @@ describe('filter transforms interactions', function() {
var mockData1 = [Lib.extendDeep({}, mockData0[0]), {
x: [20, 11, 12, 0, 1, 2, 3],
y: [1, 2, 3, 2, 5, 2, 0],
text: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
transforms: [{
type: 'filter',
operation: '<',
Expand Down Expand Up @@ -988,4 +990,30 @@ describe('filter transforms interactions', function() {
done();
});
});

it('zooming in/out should not change filtered data', function(done) {
var data = Lib.extendDeep([], mockData1);

var gd = createGraphDiv();

function getTx(p) { return p.tx; }

Plotly.plot(gd, data).then(function() {
expect(gd.calcdata[0].map(getTx)).toEqual(['e', 'f', 'g']);
expect(gd.calcdata[1].map(getTx)).toEqual(['D', 'E', 'F', 'G']);

return Plotly.relayout(gd, 'xaxis.range', [-1, 1]);
})
.then(function() {
expect(gd.calcdata[0].map(getTx)).toEqual(['e', 'f', 'g']);
expect(gd.calcdata[1].map(getTx)).toEqual(['D', 'E', 'F', 'G']);

return Plotly.relayout(gd, 'xaxis.autorange', true);
})
.then(function() {
expect(gd.calcdata[0].map(getTx)).toEqual(['e', 'f', 'g']);
expect(gd.calcdata[1].map(getTx)).toEqual(['D', 'E', 'F', 'G']);
})
.then(done);
});
});
0