Skip to content

Commit 2fcde64

Browse files
committed
Merge pull request plotly#540 from plotly/ternary-restyle-fix
Ternary restyle fix
2 parents 0be79e2 + befac03 commit 2fcde64

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/plot_api/plot_api.js

+1
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
15751575
'mode','visible','type','orientation','fill',
15761576
'histfunc','histnorm','text',
15771577
'x', 'y', 'z',
1578+
'a', 'b', 'c',
15781579
'xtype','x0','dx','ytype','y0','dy','xaxis','yaxis',
15791580
'line.width',
15801581
'connectgaps', 'transpose', 'zsmooth',

test/jasmine/tests/ternary_test.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,22 @@ describe('ternary plots', function() {
8888
});
8989
});
9090

91+
it('should be able to restyle', function(done) {
92+
Plotly.restyle(gd, { a: [[1,2,3]]}, 0).then(function() {
93+
var transforms = [];
94+
d3.selectAll('.ternary .point').each(function() {
95+
var point = d3.select(this);
96+
transforms.push(point.attr('transform'));
97+
});
98+
99+
expect(transforms).toEqual([
100+
'translate(186.45,209.8)',
101+
'translate(118.53,170.59)',
102+
'translate(248.76,117.69)'
103+
]);
104+
}).then(done);
105+
});
106+
91107
it('should display to hover labels', function() {
92108
var hoverLabels;
93109

@@ -180,7 +196,6 @@ describe('ternary plots', function() {
180196
done();
181197
});
182198
});
183-
184199
});
185200

186201
function countTernarySubplot() {

0 commit comments

Comments
 (0)