8000 tickvals / ticktext edge cases by alexcjohnson · Pull Request #1191 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

tickvals / ticktext edge cases #1191

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 6 commits into from
Nov 23, 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
Next Next commit
include test that we didn't add any categories to category tickvals test
  • Loading branch information
alexcjohnson committed Nov 22, 2016
commit 74da7a4b68e4e64fd2ff330d9d7a8d73114583a1
7 changes: 5 additions & 2 deletions test/jasmine/tests/axes_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1555,15 +1555,16 @@ describe('Test axes', function() {
});

it('should handle tickvals edge cases with category axes', function() {
var textOut = mockCalc({
var ax = {
type: 'category',
_categories: ['a', 'b', 'c', 'd'],
tickmode: 'array',
tickvals: ['a', 1, 1.5, 'c', 2.7, 3, 'e', 4, 5, -2],
ticktext: ['A!', 'B?', 'B->C'],
range: [-0.5, 4.5],
nticks: 10
});
};
var textOut = mockCalc(ax);

var expectedText = [
'A!', // category position, explicit text
Expand All @@ -1577,6 +1578,8 @@ describe('Test axes', function() {
// 'e', 5, -2: bad category and numbers out of range: omitted
];
expect(textOut).toEqual(expectedText);
// make sure we didn't add any more axes accidentally
expect(ax._categories).toEqual(['a', 'b', 'c', 'd']);
});
});
});
0