@@ -2683,4 +2683,45 @@ describe('bar tweening', function() {
26832683 . catch ( failTest )
26842684 . then ( done ) ;
26852685 } ) ;
2686+
2687+ it ( 'for bar positions during object-constancy transitions' , function ( done ) {
2688+ var _mock = {
2689+ data : [ {
2690+ type : 'bar' ,
2691+ ids : [ 'A' , 'B' , 'C' ] ,
2692+ x : [ 'A' , 'B' , 'C' ] ,
2693+ text : [ 'A' , 'B' , 'C' ] ,
2694+ textposition : 'inside' ,
2695+ y : [ 24 , 5 , 8 ] ,
2696+ error_y : { 'array' : [ 3 , 2 , 1 ] } ,
2697+ marker : { color : [ 'red' , 'green' , 'blue' ] }
2698+ } ]
2699+ } ;
2700+
2701+ var nextFrame = { data : [ { ids : [ 'B' , 'C' , 'A' ] } ] } ;
2702+
2703+ var tests = [
2704+ [ 0 , '.point path' , 'datum' , 'id' , [ 'A' , 'B' , 'C' ] ] ,
2705+ [ 0 , '.point path' , 'style' , 'fill' , [ 'rgb(255, 0, 0)' , 'rgb(0, 128, 0)' , 'rgb(0, 0, 255)' ] ] ,
2706+ [ 0 , '.point path' , 'attr' , 'd' , [ 'M18,270V42H162V270Z' , 'M198,270V222.5H342V270Z' , 'M378,270V194H522V270Z' ] ] ,
2707+ [ 0 , 'text.bartext' , 'attr' , 'transform' , [ 'translate(90 56)' , 'translate(270 236.5)' , 'translate(450 208)' ] ] ,
2708+ [ 0 , 'path.yerror' , 'attr' , 'd' , [ 'M86,14h8m-4,0V71m-4,0h8' , 'M266,204h8m-4,0V242m-4,0h8' , 'M446,185h8m-4,0V204m-4,0h8' ] ] ,
2709+
2710+ [ 250 , '.point path' , 'datum' , 'id' , [ 'A' , 'B' , 'C' ] ] ,
2711+ [ 250 , '.point path' , 'style' , 'fill' , [ 'rgb(128, 0, 128)' , 'rgb(128, 64, 0)' , 'rgb(0, 64, 128)' ] ] ,
2712+ [ 250 , '.point path' , 'attr' , 'd' , [ 'M198,270V118H342V270Z' , 'M108,270V132H252V270Z' , 'M288,270V208H432V270Z' ] ] ,
2713+ [ 250 , 'text.bartext' , 'attr' , 'transform' , [ 'translate(269.7890625 134)' , 'translate(179.5859375 148.25)' , 'translate(359.578125 224.25)' ] ] ,
2714+ [ 250 , 'path.yerror' , 'attr' , 'd' , [ 'M266,99h8m-4,0V137m-4,0h8' , 'M176,109h8m-4,0V156m-4,0h8' , 'M356,194h8m-4,0V223m-4,0h8' ] ] ,
2715+
2716+ [ 500 , '.point path' , 'datum' , 'id' , [ 'A' , 'B' , 'C' ] ] ,
2717+ [ 500 , '.point path' , 'style' , 'fill' , [ 'rgb(0, 0, 255)' , 'rgb(255, 0, 0)' , 'rgb(0, 128, 0)' ] ] ,
2718+ [ 500 , '.point path' , 'attr' , 'd' , [ 'M378,270V194H522V270Z' , 'M18,270V42H162V270Z' , 'M198,270V223H342V270Z' ] ] ,
2719+ [ 500 , 'text.bartext' , 'attr' , 'transform' , [ 'translate(450 208)' , 'translate(90 56)' , 'translate(270 236.5)' ] ] ,
2720+ [ 500 , 'path.yerror' , 'attr' , 'd' , [ 'M446,185h8m-4,0V204m-4,0h8' , 'M86,14h8m-4,0V71m-4,0h8' , 'M266,204h8m-4,0V242m-4,0h8' ] ]
2721+ ] ;
2722+
2723+ checkTransition ( gd , _mock , nextFrame , transitionOpts , tests )
2724+ . catch ( failTest )
2725+ . then ( done ) ;
2726+ } ) ;
26862727} ) ;
0 commit comments