Skip to content

Ternary restyle fix #540

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
May 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
'mode','visible','type','orientation','fill',
'histfunc','histnorm','text',
'x', 'y', 'z',
'a', 'b', 'c',
'xtype','x0','dx','ytype','y0','dy','xaxis','yaxis',
'line.width',
'connectgaps', 'transpose', 'zsmooth',
Expand Down
17 changes: 16 additions & 1 deletion test/jasmine/tests/ternary_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ describe('ternary plots', function() {
});
});

it('should be able to restyle', function(done) {
Plotly.restyle(gd, { a: [[1,2,3]]}, 0).then(function() {
var transforms = [];
d3.selectAll('.ternary .point').each(function() {
var point = d3.select(this);
transforms.push(point.attr('transform'));
});

expect(transforms).toEqual([
Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine. But, checking the content of gd.calcdata would have sufficed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I thought as well, but calcdata was being updated before the change, while the plot wasn't (unless I was bitten by the devtool watcher gremlin).

'translate(186.45,209.8)',
'translate(118.53,170.59)',
'translate(248.76,117.69)'
]);
}).then(done);
});

it('should display to hover labels', function() {
var hoverLabels;

Expand Down Expand Up @@ -180,7 +196,6 @@ describe('ternary plots', function() {
done();
});
});

});

function countTernarySubplot() {
Expand Down