@@ -35,7 +35,8 @@ import type LogScale from '../scale/Log';
3535import Scale from '../scale/Scale' ;
3636import {
3737 adoptScaleExtentKindMapping , adoptScaleRawExtentInfoAndPrepare ,
38- ScaleExtentFixMinMax
38+ ScaleExtentFixMinMax ,
39+ ScaleRawExtentResultFinal
3940} from './scaleRawExtentInfo' ;
4041import { getScaleLinearSpanEffective } from '../scale/scaleMapper' ;
4142import { NullUndefined } from '../util/types' ;
@@ -58,7 +59,7 @@ function calcNiceForIntervalOrLogScale(
5859 const oldOutermostExtent = isTargetLogScale ? scale . getExtent ( ) : null ;
5960 const oldIntervalExtent = intervalStub . getExtent ( ) ;
6061
61- let newIntervalExtent = intervalScaleEnsureValidExtent ( oldIntervalExtent , fixMinMax ) ;
62+ let newIntervalExtent = intervalScaleEnsureValidExtent ( oldIntervalExtent , fixMinMax , opt . rawExtentResult ) ;
6263
6364 intervalStub . setExtent ( newIntervalExtent [ 0 ] , newIntervalExtent [ 1 ] ) ;
6465 newIntervalExtent = intervalStub . getExtent ( ) ;
@@ -183,13 +184,16 @@ type ScaleCalcNiceMethodOpt = {
183184 minInterval ?: number ;
184185 maxInterval ?: number ;
185186 fixMinMax ?: ScaleExtentFixMinMax ;
187+ rawExtentResult ?: ScaleRawExtentResultFinal ;
186188} ;
187189
188190/**
189191 * NOTE: See the summary of the process of extent determination in the comment of `scaleMapper.setExtent`.
190192 *
191193 * Calculate a "nice" extent and "nice" ticks configs based on the current scale extent and ec options.
192194 * scale extent will be modified, and config may be set to the scale.
195+ *
196+ * @see SCALE_EXTENT_CONSTRUCTION for the full processing flow.
193197 */
194198export function scaleCalcNice (
195199 axisLike : {
@@ -209,6 +213,9 @@ export function scaleCalcNice(
209213 scaleCalcNice2 ( scale , model , axis , ecModel , null ) ;
210214}
211215
216+ /**
217+ * @see SCALE_EXTENT_CONSTRUCTION for the full processing flow.
218+ */
212219export function scaleCalcNice2 (
213220 scale : Scale ,
214221 model : AxisBaseModel < NumericAxisBaseOptionCommon > ,
@@ -237,12 +244,13 @@ export function scaleCalcNice2(
237244 splitNumber : model . get ( 'splitNumber' ) ,
238245 fixMinMax : rawExtentResult . fixMM ,
239246 minInterval : isIntervalOrTime ? model . get ( 'minInterval' ) : null ,
240- maxInterval : isIntervalOrTime ? model . get ( 'maxInterval' ) : null
247+ maxInterval : isIntervalOrTime ? model . get ( 'maxInterval' ) : null ,
248+ rawExtentResult
241249 } ) ;
242250 }
243251
244252 if ( axis && ecModel ) {
245- adoptScaleExtentKindMapping ( scale , rawExtentResult ) ;
253+ adoptScaleExtentKindMapping ( axis , scale , rawExtentResult ) ;
246254 }
247255
248256 if ( __DEV__ ) {
0 commit comments