File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ function viewModel(model) {
176
176
viewModel . dimensions = dimensions . filter ( visible ) . map ( function ( dimension , i ) {
177
177
var domainToUnit = domainToUnitScale ( dimension ) ;
178
178
var foundKey = uniqueKeys [ dimension . label ] ;
179
- uniqueKeys [ dimension . label ] = ( foundKey ? 0 : foundKey ) + 1 ;
179
+ uniqueKeys [ dimension . label ] = ( foundKey || 0 ) + 1 ;
180
180
var key = dimension . label + ( foundKey ? '__' + foundKey : '' ) ;
181
181
return {
182
182
key : key ,
Original file line number Diff line number Diff line change @@ -285,6 +285,23 @@ describe('@noCI parcoords', function() {
285
285
} ) ;
286
286
} ) ;
287
287
288
+ it ( 'Works with duplicate dimension labels' , function ( done ) {
289
+
290
+ var mockCopy = Lib . extendDeep ( { } , mock2 ) ;
291
+
292
+ mockCopy . layout . width = 320 ;
293
+ mockCopy . data [ 0 ] . dimensions [ 1 ] . label = mockCopy . data [ 0 ] . dimensions [ 0 ] . label ;
294
+
295
+ var gd = createGraphDiv ( ) ;
296
+ Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
297
+
298
+ expect ( gd . data . length ) . toEqual ( 1 ) ;
299
+ expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 2 ) ;
300
+ expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 2 ) ;
301
+ done ( ) ;
302
+ } ) ;
303
+ } ) ;
304
+
288
305
it ( 'Works with a single line; also, use a longer color array than the number of lines' , function ( done ) {
289
306
290
307
var mockCopy = Lib . extendDeep ( { } , mock2 ) ;
You can’t perform that action at this time.
0 commit comments