From a0fe96cfad82752a8d3ec03daac13c28505269d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Tusz?= Date: Mon, 16 May 2016 17:25:53 -0400 Subject: [PATCH 1/2] Ternary: Check for updates to ternary `a`,`b`,`c` in `restyle` --- src/plot_api/plot_api.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index d43276ff186..9b7acb1af60 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -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', From befac034dd37f21e44df384e0a4525e14c0ac8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Tusz?= Date: Mon, 16 May 2016 17:26:08 -0400 Subject: [PATCH 2/2] Ternary: Add test for restyle updates --- test/jasmine/tests/ternary_test.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/jasmine/tests/ternary_test.js b/test/jasmine/tests/ternary_test.js index b933dae528c..b7ac57b640b 100644 --- a/test/jasmine/tests/ternary_test.js +++ b/test/jasmine/tests/ternary_test.js @@ -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([ + '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; @@ -180,7 +196,6 @@ describe('ternary plots', function() { done(); }); }); - }); function countTernarySubplot() {