@@ -682,10 +682,13 @@ axes.prepTicks = function(ax, opts) {
682
682
if ( ax . _name === 'radialaxis' ) nt *= 2 ;
683
683
}
684
684
685
- if ( ! ( ax . minor && ( ax . minor . tickmode !== 'array' && ax . minor . tickmode !== 'domain array' ) ) ) {
685
+ if ( ! ( ax . minor &&
686
+ ( ax . minor . tickmode !== 'array'
687
+ && ax . minor . tickmode !== 'domain array'
688
+ && ax . minor . tickmode !== 'full domain' ) ) ) {
686
689
// add a couple of extra digits for filling in ticks when we
687
690
// have explicit tickvals without tick text
688
- if ( ax . tickmode === 'array' || ax . tickmode === 'domain array' ) nt *= 100 ;
691
+ if ( ax . tickmode === 'array' || ax . tickmode === 'domain array' || ax . tickmode === 'full domain' ) nt *= 100 ;
689
692
}
690
693
691
694
ax . _roughDTick = Math . abs ( rng [ 1 ] - rng [ 0 ] ) / nt ;
@@ -948,14 +951,37 @@ axes.calcTicks = function calcTicks(ax, opts) {
948
951
} else {
949
952
axes . prepTicks ( mockAx , opts ) ;
950
953
}
951
-
954
+
955
+ if ( mockAx . tickmode === 'full domain' ) {
956
+ nt = mockAx . nticks ; // does mockAx have nitkcs?
957
+ var tickVals = [ ] ;
958
+ if ( nt == 0 ) {
959
+ // pass
960
+ } else if ( nt == 1 ) {
961
+ tickVals = [ 0 ] ;
962
+ } else if ( nt == 2 ) {
963
+ tickVals = [ 0 , 1 ] ;
964
+ } else {
965
+ var increment = 1 / ( nt - 2 ) ;
966
+ tickVals . push ( 0 ) ;
967
+ for ( let i = 0 ; i < nt - 2 ; i ++ ) {
968
+ tickVals . push ( ( i + 1 ) * incremente ) ;
969
+ }
970
+ tickVals . push ( 1 ) ;
971
+ }
972
+ if ( major ) {
973
+ Lib . nestedProperty ( ax , 'tickvals' ) . set ( tickVals ) ;
974
+ } else {
975
+ Lib . nestedProperty ( ax . minor , 'tickvals' ) . set ( tickVals ) ;
976
+ }
977
+ }
952
978
// tickmode 'domain array' is just 'array' but with a pre-calc step
953
979
// original comment:
954
980
// now that we've figured out the auto values for formatting
955
981
// in case we're missing some ticktext, we can break out for array ticks
956
- if ( mockAx . tickmode === 'array' || mockAx . tickmode === 'domain array' ) {
982
+ if ( mockAx . tickmode === 'array' || mockAx . tickmode === 'domain array' || mockAx . tickmode === 'full domain' ) {
957
983
// Mapping proportions to array:
958
- if ( mockAx . tickmode === 'domain array' ) {
984
+ if ( mockAx . tickmode === 'domain array' || mockAx . tickmode === 'full domain' ) {
959
985
var width = ( maxRange - minRange ) ;
960
986
if ( axrev ) width *= - 1 ;
961
987
var offset = ! axrev ? minRange : maxRange ;
@@ -1251,10 +1277,12 @@ axes.calcTicks = function calcTicks(ax, opts) {
1251
1277
// Reset tickvals back to domain array
1252
1278
if ( tickFractionalVals . _isSet ) {
1253
1279
delete tickFractionalVals . _isSet ;
1280
+ if ( ax . tickmode === 'full domain' ) tickFractionalVals = [ ] ;
1254
1281
Lib . nestedProperty ( ax , 'tickvals' ) . set ( tickFractionalVals ) ;
1255
1282
}
1256
1283
if ( minorTickFractionalVals . _isSet ) {
1257
1284
delete tickFractionalVals . _isSet ;
1285
+ if ( ax . minor . tickmode === 'full domain' ) tickFractionalVals = [ ] ;
1258
1286
Lib . nestedProperty ( ax . minor , 'tickvals' ) . set ( minorTickFractionalVals ) ;
1259
1287
}
1260
1288
@@ -1662,7 +1690,7 @@ axes.tickFirst = function(ax, opts) {
1662
1690
// more precision for hovertext
1663
1691
axes . tickText = function ( ax , x , hover , noSuffixPrefix ) {
1664
1692
var out = tickTextObj ( ax , x ) ;
1665
- var arrayMode = ( ax . tickmode === 'array' || ax . tickmode === 'domain array' ) ;
1693
+ var arrayMode = ( ax . tickmode === 'array' || ax . tickmode === 'domain array' || ax . tickmode === 'full domain' ) ;
1666
1694
var extraPrecision = hover || arrayMode ;
1667
1695
var axType = ax . type ;
1668
1696
// TODO multicategory, if we allow ticktext / tickvals
@@ -3378,7 +3406,7 @@ axes.drawGrid = function(gd, ax, opts) {
3378
3406
3379
3407
var counterAx = opts . counterAxis ;
3380
3408
if ( counterAx && axes . shouldShowZeroLine ( gd , ax , counterAx ) ) {
3381
- var isArrayMode = ( ax . tickmode === 'array' || ax . tickmode === 'domain array' ) ;
3409
+ var isArrayMode = ( ax . tickmode === 'array' || ax . tickmode === 'domain array' || ax . tickmode === 'full domain' ) ;
3382
3410
for ( var i = 0 ; i < majorVals . length ; i ++ ) {
3383
3411
var xi = majorVals [ i ] . x ;
3384
3412
if ( isArrayMode ? ! xi : ( Math . abs ( xi ) < ax . dtick / 100 ) ) {
0 commit comments