File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,28 @@ describe('image plot', function() {
218
218
. then ( done ) ;
219
219
} ) ;
220
220
221
+ it ( 'should handle restyling x0/y0 to category' , function ( done ) {
222
+ var mock = require ( '@mocks/image_opacity.json' ) ;
223
+ var mockCopy = Lib . extendDeep ( { } , mock ) ;
224
+
225
+ var x = [ ] ; var y = [ ] ;
226
+ Plotly . newPlot ( gd , mockCopy ) . then ( function ( ) {
227
+ return Plotly . restyle ( gd , { x0 : 50 , y0 : 50 } ) ;
228
+ } ) . then ( function ( ) {
229
+ x . push ( d3 . select ( sel ) . attr ( 'x' ) ) ;
230
+ y . push ( d3 . select ( sel ) . attr ( 'y' ) ) ;
231
+
232
+ return Plotly . restyle ( gd , { x0 : 'A' , y0 : 'F' } ) ;
233
+ } ) . then ( function ( ) {
234
+ x . push ( d3 . select ( sel ) . attr ( 'x' ) ) ;
235
+ y . push ( d3 . select ( sel ) . attr ( 'y' ) ) ;
236
+ expect ( x [ 1 ] ) . toEqual ( x [ 0 ] , 'image element should have same x position' ) ;
237
+ expect ( y [ 1 ] ) . toEqual ( y [ 0 ] , 'image element should have same y position' ) ;
238
+ } )
239
+ . catch ( failTest )
240
+ . then ( done ) ;
241
+ } ) ;
242
+
221
243
it ( 'keeps the correct ordering after hide and show' , function ( done ) {
222
244
function getIndices ( ) {
223
245
var out = [ ] ;
You can’t perform that action at this time.
0 commit comments