Skip to content

Commit 3502d49

Browse files
committed
Revert branch to equal master
1 parent 4476d38 commit 3502d49

File tree

6 files changed

+110
-643
lines changed

6 files changed

+110
-643
lines changed

src/plot_api/plot_api.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,11 +2945,7 @@ function getDiffFlags(oldContainer, newContainer, outerparts, opts) {
29452945
// so newContainer won't have them.
29462946
if((key === 'tick0' || key === 'dtick') && outerparts[0] !== 'geo') {
29472947
var tickMode = newContainer.tickmode;
2948-
if(tickMode === 'auto' ||
2949-
tickMode === 'array' ||
2950-
tickMode === 'domain array' ||
2951-
tickMode === 'full domain' ||
2952-
!tickMode) continue;
2948+
if(tickMode === 'auto' || tickMode === 'array' || !tickMode) continue;
29532949
}
29542950
// FIXME: Similarly for axis ranges for 3D
29552951
// contourcarpet doesn't HAVE zmin/zmax, they're just auto-added. It needs them.

src/plots/cartesian/axes.js

Lines changed: 5 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -682,13 +682,10 @@ axes.prepTicks = function(ax, opts) {
682682
if(ax._name === 'radialaxis') nt *= 2;
683683
}
684684

685-
if(!(ax.minor &&
686-
(ax.minor.tickmode !== 'array' &&
687-
ax.minor.tickmode !== 'domain array' &&
688-
ax.minor.tickmode !== 'full domain'))) {
685+
if(!(ax.minor && ax.minor.tickmode !== 'array')) {
689686
// add a couple of extra digits for filling in ticks when we
690687
// have explicit tickvals without tick text
691-
if(ax.tickmode === 'array' || ax.tickmode === 'domain array' || ax.tickmode === 'full domain') nt *= 100;
688+
if(ax.tickmode === 'array') nt *= 100;
692689
}
693690

694691
ax._roughDTick = Math.abs(rng[1] - rng[0]) / nt;
@@ -923,12 +920,7 @@ axes.calcTicks = function calcTicks(ax, opts) {
923920
var minorTicks = [];
924921

925922
var tickVals = [];
926-
var tickFractionalVals = [];
927-
tickFractionalVals._isSet = false;
928-
929923
var minorTickVals = [];
930-
var minorTickFractionalVals = [];
931-
minorTickFractionalVals._isSet = false;
932924

933925
var hasMinor = ax.minor && (ax.minor.ticks || ax.minor.showgrid);
934926

@@ -952,61 +944,9 @@ axes.calcTicks = function calcTicks(ax, opts) {
952944
axes.prepTicks(mockAx, opts);
953945
}
954946

955-
if(mockAx.tickmode === 'full domain') {
956-
var nt = mockAx.nticks; // does mockAx have nitkcs?
957-
if(nt === undefined) nt = 0;
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 - 1); // (nt-2) + 1
966-
tickVals.push(0);
967-
for(var tickIndex = 0; tickIndex < nt - 2; tickIndex++) {
968-
tickVals.push((tickIndex + 1) * increment);
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-
}
978-
// tickmode 'domain array' is just 'array' but with a pre-calc step
979-
// original comment:
980947
// now that we've figured out the auto values for formatting
981948
// in case we're missing some ticktext, we can break out for array ticks
982-
if(mockAx.tickmode === 'array' || mockAx.tickmode === 'domain array' || mockAx.tickmode === 'full domain') {
983-
// Mapping proportions to array:
984-
if(mockAx.tickmode === 'domain array' || mockAx.tickmode === 'full domain') {
985-
var width = (maxRange - minRange);
986-
if(axrev) width *= -1;
987-
var offset = !axrev ? minRange : maxRange;
988-
989-
var currentFractionalVals = [];
990-
var currentValsProp;
991-
if(major) {
992-
currentValsProp = Lib.nestedProperty(ax, 'tickvals'); // Do we need this?
993-
currentFractionalVals = tickFractionalVals = currentValsProp.get();
994-
tickFractionalVals._isSet = true;
995-
} else {
996-
currentValsProp = Lib.nestedProperty(ax.minor, 'tickvals');
997-
currentFractionalVals = minorTickFractionalVals = currentValsProp.get();
998-
minorTickFractionalVals._isSet = true;
999-
}
1000-
1001-
var mappedVals = Lib.simpleMap(currentFractionalVals,
1002-
function(fraction, offset, width, type) {
1003-
var mapped = offset + (width * fraction);
1004-
return (type === 'log') ? Math.pow(10, mapped) : mapped;
1005-
}, offset, width, type);
1006-
currentValsProp.set(mappedVals);
1007-
}
1008-
1009-
// Original 'array' only code
949+
if(mockAx.tickmode === 'array') {
1010950
if(major) {
1011951
tickVals = [];
1012952
ticksOut = arrayTicks(ax, !isMinor);
@@ -1264,7 +1204,6 @@ axes.calcTicks = function calcTicks(ax, opts) {
12641204
ticksOut.push(t);
12651205
}
12661206
}
1267-
12681207
ticksOut = ticksOut.concat(minorTicks);
12691208

12701209
ax._inCalcTicks = false;
@@ -1274,18 +1213,6 @@ axes.calcTicks = function calcTicks(ax, opts) {
12741213
ticksOut[0].noTick = true;
12751214
}
12761215

1277-
// Reset tickvals back to domain array
1278-
if(tickFractionalVals._isSet) {
1279-
delete tickFractionalVals._isSet;
1280-
if(ax.tickmode === 'full domain') tickFractionalVals = [];
1281-
Lib.nestedProperty(ax, 'tickvals').set(tickFractionalVals);
1282-
}
1283-
if(minorTickFractionalVals._isSet) {
1284-
delete tickFractionalVals._isSet;
1285-
if(ax.minor.tickmode === 'full domain') tickFractionalVals = [];
1286-
Lib.nestedProperty(ax.minor, 'tickvals').set(minorTickFractionalVals);
1287-
}
1288-
12891216
return ticksOut;
12901217
};
12911218

@@ -1690,7 +1617,7 @@ axes.tickFirst = function(ax, opts) {
16901617
// more precision for hovertext
16911618
axes.tickText = function(ax, x, hover, noSuffixPrefix) {
16921619
var out = tickTextObj(ax, x);
1693-
var arrayMode = (ax.tickmode === 'array' || ax.tickmode === 'domain array' || ax.tickmode === 'full domain');
1620+
var arrayMode = ax.tickmode === 'array';
16941621
var extraPrecision = hover || arrayMode;
16951622
var axType = ax.type;
16961623
// TODO multicategory, if we allow ticktext / tickvals
@@ -3406,7 +3333,7 @@ axes.drawGrid = function(gd, ax, opts) {
34063333

34073334
var counterAx = opts.counterAxis;
34083335
if(counterAx && axes.shouldShowZeroLine(gd, ax, counterAx)) {
3409-
var isArrayMode = (ax.tickmode === 'array' || ax.tickmode === 'domain array' || ax.tickmode === 'full domain');
3336+
var isArrayMode = ax.tickmode === 'array';
34103337
for(var i = 0; i < majorVals.length; i++) {
34113338
var xi = majorVals[i].x;
34123339
if(isArrayMode ? !xi : (Math.abs(xi) < ax.dtick / 100)) {

src/plots/cartesian/layout_attributes.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var DAY_OF_WEEK = constants.WEEKDAY_PATTERN;
1414

1515
var minorTickmode = {
1616
valType: 'enumerated',
17-
values: ['auto', 'linear', 'array', 'domain array', 'full domain'],
17+
values: ['auto', 'linear', 'array'],
1818
editType: 'ticks',
1919
impliedEdits: {tick0: undefined, dtick: undefined},
2020
description: [
@@ -23,16 +23,9 @@ var minorTickmode = {
2323
'If *linear*, the placement of the ticks is determined by',
2424
'a starting position `tick0` and a tick step `dtick`',
2525
'(*linear* is the default value if `tick0` and `dtick` are provided).',
26-
'If *array*, the placement of the ticks is set via `tickvals`,',
27-
'which are actual values, and the tick text is `ticktext`.',
28-
'(*array* is the default value if `tickvals` is provided).',
29-
'If *full domain*, the number of ticks is set bia `nticks` but ticks',
30-
'are placed first at both axis ends and then at equal proportions',
31-
'between the axis. So `nticks=5` would put ticks at both ends and',
32-
'every quarter.',
33-
'If *domain array*, the placement is similiar to *array* except that',
34-
'`tickvals` are fractions between 0 and 1 representing distance on',
35-
'the corresponding axis.'
26+
'If *array*, the placement of the ticks is set via `tickvals`',
27+
'and the tick text is `ticktext`.',
28+
'(*array* is the default value if `tickvals` is provided).'
3629
].join(' ')
3730
};
3831

src/plots/cartesian/tick_value_defaults.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ module.exports = function handleTickValueDefaults(containerIn, containerOut, coe
2929
_dtick ? 'linear' :
3030
'auto';
3131
var tickmode = coerce(prefix + 'tickmode', tickmodeDefault);
32-
if(tickmode === 'auto' || tickmode === 'sync' || tickmode === 'full domain') {
32+
33+
if(tickmode === 'auto' || tickmode === 'sync') {
3334
coerce(prefix + 'nticks');
3435
} else if(tickmode === 'linear') {
3536
// dtick is usually a positive number, but there are some

0 commit comments

Comments
 (0)