@@ -52,9 +52,13 @@ function getUnit(colValStats, colname) {
52
52
}
53
53
*/
54
54
55
- export function resultsSuccess ( callback , flds , tblId , zoom ) {
55
+ export function resultsSuccess ( callback , flds , optionParameters ) {
56
+ const tblId = optionParameters . tblId ;
57
+
56
58
const xName = get ( flds , [ 'x.columnOrExpr' ] ) ;
57
59
const yName = get ( flds , [ 'y.columnOrExpr' ] ) ;
60
+
61
+ const zoom = ( xName !== optionParameters . x . columnOrExpr || yName !== optionParameters . y . columnOrExpr ) ? undefined :optionParameters . zoom ;
58
62
const xErr = get ( flds , [ 'x.error' ] ) ;
59
63
const yErr = get ( flds , [ 'y.error' ] ) ;
60
64
@@ -78,6 +82,7 @@ export function resultsSuccess(callback, flds, tblId, zoom) {
78
82
userSetBoundaries = isEmpty ( userSetBoundaries ) ? undefined : userSetBoundaries ;
79
83
const xyRatio = parseFloat ( flds . xyRatio ) ;
80
84
85
+
81
86
/*
82
87
const axisParamsShape = PropTypes.shape({
83
88
columnOrExpr : PropTypes.string,
@@ -454,6 +459,7 @@ export class XYPlotOptions extends React.Component {
454
459
}
455
460
456
461
render ( ) {
462
+
457
463
const { colValStats, groupKey, xyPlotParams, defaultParams, onOptionsSelected} = this . props ;
458
464
459
465
const largeTable = possibleDecimatedTable ( colValStats ) ;
@@ -462,6 +468,7 @@ export class XYPlotOptions extends React.Component {
462
468
const yProps = { colValStats, params :xyPlotParams , groupKey, fldPath :'y.columnOrExpr' , label :'Y' , tooltip :'Y Axis' , nullAllowed :false } ;
463
469
const xErrProps = { colValStats, params :xyPlotParams , groupKey, fldPath :'x.error' , label :'X Err' , tooltip :'X Error' , nullAllowed :true } ;
464
470
const yErrProps = { colValStats, params :xyPlotParams , groupKey, fldPath :'y.error' , label :'Y Err' , tooltip :'Y Error' , nullAllowed :true } ;
471
+
465
472
return (
466
473
< div style = { { padding :'0 5px 7px' } } >
467
474
< FieldGroup groupKey = { groupKey } validatorFunc = { null } keepState = { true }
@@ -470,7 +477,7 @@ export class XYPlotOptions extends React.Component {
470
477
< div style = { { display : 'flex' , flexDirection : 'row' , padding : '5px 0 15px' } } >
471
478
< CompleteButton style = { { flexGrow : 0 } }
472
479
groupKey = { groupKey }
473
- onSuccess = { ( flds ) => resultsSuccess ( onOptionsSelected , flds , xyPlotParams . tblId , xyPlotParams . zoom ) }
480
+ onSuccess = { ( flds ) => resultsSuccess ( onOptionsSelected , flds , xyPlotParams ) }
474
481
onFail = { resultsFail }
475
482
text = 'Apply'
476
483
/>
0 commit comments