@@ -1408,16 +1408,6 @@ function _restyle(gd, aobj, traces) {
14081408 return 'LAYOUT' + axName + '.range' ;
14091409 }
14101410
1411- function getFullTrace ( traceIndex ) {
1412- // usually fullData maps 1:1 onto data, but with groupby transforms
1413- // the fullData index can be greater. Take the *first* matching trace.
1414- for ( var j = traceIndex ; j < fullData . length ; j ++ ) {
1415- if ( fullData [ j ] . _input === data [ traceIndex ] ) return fullData [ j ] ;
1416- }
1417- // should never get here - and if we *do* it should cause an error
1418- // later on undefined fullTrace is passed to nestedProperty.
1419- }
1420-
14211411 // for attrs that interact (like scales & autoscales), save the
14221412 // old vals before making the change
14231413 // val=undefined will not set a value, just record what the value was.
@@ -1438,7 +1428,7 @@ function _restyle(gd, aobj, traces) {
14381428 extraparam = layoutNP ( gd . layout , attr . replace ( 'LAYOUT' , '' ) ) ;
14391429 } else {
14401430 var tracei = traces [ i ] ;
1441- var preGUI = fullLayout . _tracePreGUI [ getFullTrace ( tracei ) . _fullInput . uid ] ;
1431+ var preGUI = fullLayout . _tracePreGUI [ fullData [ tracei ] . uid ] ;
14421432 extraparam = makeNP ( preGUI , guiEditFlag ) ( data [ tracei ] , attr ) ;
14431433 }
14441434
@@ -1509,8 +1499,8 @@ function _restyle(gd, aobj, traces) {
15091499 undoit [ ai ] = a0 ( ) ;
15101500 for ( i = 0 ; i < traces . length ; i ++ ) {
15111501 cont = data [ traces [ i ] ] ;
1512- contFull = getFullTrace ( traces [ i ] ) ;
1513- var preGUI = fullLayout . _tracePreGUI [ contFull . _fullInput . uid ] ;
1502+ contFull = fullData [ traces [ i ] ] ;
1503+ var preGUI = fullLayout . _tracePreGUI [ contFull . uid ] ;
15141504 param = makeNP ( preGUI , guiEditFlag ) ( cont , ai ) ;
15151505 oldVal = param . get ( ) ;
15161506 newVal = Array . isArray ( vi ) ? vi [ i % vi . length ] : vi ;
@@ -2343,8 +2333,7 @@ var layoutUIControlPatterns = [
23432333// or with no `attr` we use `trace.uirevision`
23442334var traceUIControlPatterns = [
23452335 { pattern : / ^ s e l e c t e d p o i n t s $ / , attr : 'selectionrevision' } ,
2346- // "visible" includes trace.transforms[i].styles[j].value.visible
2347- { pattern : / ( ^ | v a l u e \. ) v i s i b l e $ / , attr : 'legend.uirevision' } ,
2336+ { pattern : / ^ v i s i b l e $ / , attr : 'legend.uirevision' } ,
23482337 { pattern : / ^ d i m e n s i o n s \[ \d + \] \. c o n s t r a i n t r a n g e / } ,
23492338 { pattern : / ^ n o d e \. ( x | y | g r o u p s ) / } , // for Sankey nodes
23502339 { pattern : / ^ l e v e l $ / } , // for Sunburst, Treemap and Icicle traces
@@ -2354,8 +2343,7 @@ var traceUIControlPatterns = [
23542343 // reasonable or should these be `editrevision`?
23552344 // Also applies to axis titles up in the layout section
23562345
2357- // "name" also includes transform.styles
2358- { pattern : / ( ^ | v a l u e \. ) n a m e $ / } ,
2346+ { pattern : / ^ n a m e $ / } ,
23592347 // including nested colorbar attributes (ie marker.colorbar)
23602348 { pattern : / c o l o r b a r \. t i t l e \. t e x t $ / } ,
23612349 { pattern : / c o l o r b a r \. ( x | y ) $ / , attr : 'editrevision' }
@@ -2392,7 +2380,7 @@ function getNewRev(revAttr, container) {
23922380
23932381function getFullTraceIndexFromUid ( uid , fullData ) {
23942382 for ( var i = 0 ; i < fullData . length ; i ++ ) {
2395- if ( fullData [ i ] . _fullInput . uid === uid ) return i ;
2383+ if ( fullData [ i ] . uid === uid ) return i ;
23962384 }
23972385 return - 1 ;
23982386}
@@ -2499,7 +2487,7 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
24992487 for ( var uid in allTracePreGUI ) {
25002488 var tracePreGUI = allTracePreGUI [ uid ] ;
25012489 var newTrace = null ;
2502- var fullInput ;
2490+ var fullTrace ;
25032491 for ( key in tracePreGUI ) {
25042492 // wait until we know we have preGUI values to look for traces
25052493 // but if we don't find both, stop looking at this uid
@@ -2511,10 +2499,9 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
25112499 delete allTracePreGUI [ uid ] ;
25122500 break ;
25132501 }
2514- var fullTrace = oldFullData [ fulli ] ;
2515- fullInput = fullTrace . _fullInput ;
2502+ fullTrace = oldFullData [ fulli ] ;
25162503
2517- var newTracei = getTraceIndexFromUid ( uid , data , fullInput . index ) ;
2504+ var newTracei = getTraceIndexFromUid ( uid , data , fullTrace . index ) ;
25182505 if ( newTracei < 0 ) {
25192506 // No match in new data
25202507 delete allTracePreGUI [ uid ] ;
@@ -2529,7 +2516,7 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
25292516 oldRev = nestedProperty ( oldFullLayout , match . attr ) . get ( ) ;
25302517 newRev = oldRev && getNewRev ( match . attr , layout ) ;
25312518 } else {
2532- oldRev = fullInput . uirevision ;
2519+ oldRev = fullTrace . uirevision ;
25332520 // inheritance for trace.uirevision is simple, just layout.uirevision
25342521 newRev = newTrace . uirevision ;
25352522 if ( newRev === undefined ) newRev = layout . uirevision ;
@@ -2541,7 +2528,7 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
25412528 newNP = nestedProperty ( newTrace , key ) ;
25422529 newVal = newNP . get ( ) ;
25432530 if ( valsMatch ( newVal , preGUIVal ) ) {
2544- newNP . set ( undefinedToNull ( nestedProperty ( fullInput , key ) . get ( ) ) ) ;
2531+ newNP . set ( undefinedToNull ( nestedProperty ( fullTrace , key ) . get ( ) ) ) ;
25452532 continue ;
25462533 }
25472534 }
@@ -2630,9 +2617,9 @@ function react(gd, data, layout, config) {
26302617
26312618 applyUIRevisions ( gd . data , gd . layout , oldFullData , oldFullLayout ) ;
26322619
2633- // "true" skips updating calcdata and remapping arrays from calcTransforms,
2634- // which supplyDefaults usually does at the end, but we may need to NOT do
2635- // if the diff (which we haven't determined yet) says we'll recalc
2620+ // "true" skips updating calcdata, which supplyDefaults usually does at
2621+ // the end, but we may need to NOT do if the diff (which we haven't
2622+ // determined yet) says we'll recalc
26362623 Plots . supplyDefaults ( gd , { skipUpdateCalc : true } ) ;
26372624
26382625 var newFullData = gd . _fullData ;
@@ -2667,7 +2654,7 @@ function react(gd, data, layout, config) {
26672654 if ( emptyCategories ) emptyCategories ( ) ;
26682655 }
26692656 }
2670- // otherwise do the calcdata updates and calcTransform array remaps that we skipped earlier
2657+ // otherwise do the calcdata updates that we skipped earlier
26712658 } else {
26722659 Plots . supplyDefaultsUpdateCalc ( gd . calcdata , newFullData ) ;
26732660 }
@@ -2783,11 +2770,11 @@ function diffData(gd, oldFullData, newFullData, immutable, transition, newDataRe
27832770
27842771 for ( i = 0 ; i < oldFullData . length ; i ++ ) {
27852772 if ( newFullData [ i ] ) {
2786- trace = newFullData [ i ] . _fullInput ;
2773+ trace = newFullData [ i ] ;
27872774 if ( seenUIDs [ trace . uid ] ) continue ;
27882775 seenUIDs [ trace . uid ] = 1 ;
27892776
2790- getDiffFlags ( oldFullData [ i ] . _fullInput , trace , [ ] , diffOpts ) ;
2777+ getDiffFlags ( oldFullData [ i ] , trace , [ ] , diffOpts ) ;
27912778 }
27922779 }
27932780
0 commit comments