@@ -134,7 +134,7 @@ function someFiltersActive(view) {
134134 } ) ;
135135}
136136
137- function model ( layout , fullLayout , d , i ) {
137+ function model ( layout , d , i ) {
138138 var cd0 = unwrap ( d ) ;
139139 var trace = cd0 . trace ;
140140 var lineColor = helpers . convertTypedArray ( cd0 . lineColor ) ;
@@ -168,16 +168,6 @@ function model(layout, fullLayout, d, i) {
168168 var rowContentWidth = groupWidth ;
169169 var rowHeight = groupHeight ;
170170
171- for ( var k = 0 ; k < dimensions . length ; k ++ ) {
172- var dim = dimensions [ k ] ;
173- dim . _ax = {
174- type : 'linear' ,
175- showexponent : 'all' ,
176- exponentformat : 'B'
177- } ;
178- Axes . setConvert ( dim . _ax , fullLayout ) ;
179- }
180-
181171 return {
182172 key : i ,
183173 colCount : dimensions . filter ( helpers . isVisible ) . length ,
@@ -388,28 +378,51 @@ function updatePanelLayout(yAxis, vm) {
388378 }
389379}
390380
381+ function attachAxesToCd ( cd , fullLayout ) {
382+ for ( var i = 0 ; i < cd . length ; i ++ ) {
383+ for ( var j = 0 ; j < cd [ i ] . length ; j ++ ) {
384+ var dimensions = cd [ i ] [ j ] . trace . dimensions ;
385+
386+ for ( var k = 0 ; k < dimensions . length ; k ++ ) {
387+ var dim = dimensions [ k ] ;
388+
389+ dim . _ax = {
390+ type : 'linear' ,
391+ showexponent : 'all' ,
392+ exponentformat : 'B' ,
393+ tickformat : dim . tickformat
394+ } ;
395+
396+ Axes . setConvert ( dim . _ax , fullLayout ) ;
397+ }
398+ }
399+ }
400+ }
401+
391402module . exports = function parcoords ( gd , cdModule , layout , callbacks ) {
392403 var state = parcoordsInteractionState ( ) ;
393404
394405 var fullLayout = gd . _fullLayout ;
395406 var svg = fullLayout . _toppaper ;
396407 var glContainer = fullLayout . _glcontainer ;
397408
409+ attachAxesToCd ( cdModule , fullLayout ) ;
410+
398411 function linearFormat ( dim , v ) {
399- return Axes . tickText ( dim . _ax , v , true ) . text ;
412+ return Axes . tickText ( dim . _ax , v , false ) . text ;
400413 }
401414
402- function extremeText ( d , i , isTop ) {
415+ function extremeText ( d , isTop ) {
403416 if ( d . ordinal ) return '' ;
404417 var domain = d . domainScale . domain ( ) ;
405418 var v = ( domain [ isTop ? domain . length - 1 : 0 ] ) ;
406419
407- return linearFormat ( d . model . dimensions [ i ] , v ) ;
420+ return linearFormat ( d . model . dimensions [ d . visibleIndex ] , v ) ;
408421 }
409422
410423 var vm = cdModule
411424 . filter ( function ( d ) { return unwrap ( d ) . trace . visible ; } )
412- . map ( model . bind ( 0 , layout , fullLayout ) )
425+ . map ( model . bind ( 0 , layout ) )
413426 . map ( viewModel . bind ( 0 , state , callbacks ) ) ;
414427
415428 glContainer . each ( function ( d , i ) {
@@ -589,7 +602,7 @@ module.exports = function parcoords(gd, cdModule, layout, callbacks) {
589602 . classed ( c . cn . axis , true ) ;
590603
591604 axis
592- . each ( function ( d , i ) {
605+ . each ( function ( d ) {
593606 var wantedTickCount = d . model . height / d . model . tickDistance ;
594607 var scale = d . domainScale ;
595608 var sdom = scale . domain ( ) ;
@@ -603,7 +616,7 @@ module.exports = function parcoords(gd, cdModule, layout, callbacks) {
603616 sdom :
604617 null )
605618 . tickFormat ( function ( v ) {
606- return helpers . isOrdinal ( d ) ? v : linearFormat ( d . model . dimensions [ i ] , v ) ;
619+ return helpers . isOrdinal ( d ) ? v : linearFormat ( d . model . dimensions [ d . visibleIndex ] , v ) ;
607620 } )
608621 . scale ( scale ) ) ;
609622 Drawing . font ( axis . selectAll ( 'text' ) , d . model . tickFont ) ;
@@ -692,7 +705,7 @@ module.exports = function parcoords(gd, cdModule, layout, callbacks) {
692705 . call ( styleExtentTexts ) ;
693706
694707 axisExtentTopText
695- . text ( function ( d , i ) { return extremeText ( d , i , true ) ; } )
708+ . text ( function ( d ) { return extremeText ( d , true ) ; } )
696709 . each ( function ( d ) { Drawing . font ( d3 . select ( this ) , d . model . rangeFont ) ; } ) ;
697710
698711 var axisExtentBottom = axisExtent . selectAll ( '.' + c . cn . axisExtentBottom )
@@ -717,7 +730,7 @@ module.exports = function parcoords(gd, cdModule, layout, callbacks) {
717730 . call ( styleExtentTexts ) ;
718731
719732 axisExtentBottomText
720- . text ( function ( d , i ) { return extremeText ( d , i , false ) ; } )
733+ . text ( function ( d ) { return extremeText ( d , false ) ; } )
721734 . each ( function ( d ) { Drawing . font ( d3 . select ( this ) , d . model . rangeFont ) ; } ) ;
722735
723736 brush . ensureAxisBrush ( axisOverlays ) ;
0 commit comments