Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/plots/cartesian/dragbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,10 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
for(i = 0; i < axList.length; i++) {
var axListI = axList[i];
var axListIType = axListI[axisType];
if(!axListI.fixedrange && axListIType.tickmode === 'sync') activeAxIds.push(axListIType._id);
var axId = axListIType._id;
if(!axListI.fixedrange && axListIType.tickmode === 'sync' && activeAxIds.indexOf(axId) === -1) {
activeAxIds.push(axId);
}
}
}

Expand Down
38 changes: 21 additions & 17 deletions src/plots/cartesian/tick_value_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,47 @@ var isTypedArraySpec = require('../../lib/array').isTypedArraySpec;
var decodeTypedArraySpec = require('../../lib/array').decodeTypedArraySpec;

module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts) {
if(!opts) opts = {};
if (!opts) opts = {};
var isMinor = opts.isMinor;
var cIn = isMinor ? containerIn.minor || {} : containerIn;
var cOut = isMinor ? containerOut.minor : containerOut;
var prefix = isMinor ? 'minor.' : '';

function readInput(attr) {
var v = cIn[attr];
if(isTypedArraySpec(v)) v = decodeTypedArraySpec(v);
if (isTypedArraySpec(v)) v = decodeTypedArraySpec(v);

return (
v !== undefined
) ? v : (cOut._template || {})[attr];
return v !== undefined ? v : (cOut._template || {})[attr];
}

var _tick0 = readInput('tick0');
var _dtick = readInput('dtick');
var _tickvals = readInput('tickvals');
var _overlaying = readInput('overlaying');

var tickmodeDefault = isArrayOrTypedArray(_tickvals) ? 'array' :
_dtick ? 'linear' :
'auto';
var tickmodeDefault;
if (isArrayOrTypedArray(_tickvals)) {
tickmodeDefault = 'array';
} else if (_dtick) {
tickmodeDefault = 'linear';
} else if (_overlaying) {
tickmodeDefault = 'sync';
} else {
tickmodeDefault = 'auto';
}
var tickmode = coerce(prefix + 'tickmode', tickmodeDefault);

if(tickmode === 'auto' || tickmode === 'sync') {
if (tickmode === 'auto' || tickmode === 'sync') {
coerce(prefix + 'nticks');
} else if(tickmode === 'linear') {
} else if (tickmode === 'linear') {
// dtick is usually a positive number, but there are some
// special strings available for log or date axes
// tick0 also has special logic
var dtick = cOut.dtick = cleanTicks.dtick(
_dtick, axType);
cOut.tick0 = cleanTicks.tick0(
_tick0, axType, containerOut.calendar, dtick);
} else if(axType !== 'multicategory') {
var dtick = (cOut.dtick = cleanTicks.dtick(_dtick, axType));
cOut.tick0 = cleanTicks.tick0(_tick0, axType, containerOut.calendar, dtick);
} else if (axType !== 'multicategory') {
var tickvals = coerce(prefix + 'tickvals');
if(tickvals === undefined) cOut.tickmode = 'auto';
else if(!isMinor) coerce('ticktext');
if (tickvals === undefined) cOut.tickmode = 'auto';
else if (!isMinor) coerce('ticktext');
}
};
Binary file modified test/image/baselines/20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/autorange-tozero-rangemode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/candlestick_double-y-axis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/candlestick_rangeslider_thai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl2d_multiple-traces-axes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/insiderange-x-multi-y.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/insiderange-y-multi-x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/legend_scroll_beyond_plotarea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/legend_visibility.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/long_axis_labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_angles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_bubbles-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_bubbles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_carto-style.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_carto-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_choropleth-multiple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_choropleth-raw-geojson.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_connectgaps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_density-multiple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_density-multiple_legend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_density0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_geojson-attributes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/map_symbol-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/mult-yaxes-manual-shift.png
Binary file modified test/image/baselines/mult-yaxes-redraw.png
Binary file modified test/image/baselines/mult-yaxes-simple.png
Binary file modified test/image/baselines/mult-yaxes-subplots-stacked.png
Binary file modified test/image/baselines/multicategory_series.png
Binary file modified test/image/baselines/multiple_axes_double.png
Binary file modified test/image/baselines/multiple_axes_multiple.png
Binary file modified test/image/baselines/overlaying-axis-lines.png
Binary file modified test/image/baselines/range_slider_axes_double.png
Binary file modified test/image/baselines/range_slider_legend_left.png
Binary file modified test/image/baselines/shapes_layer_below_traces.png
Binary file modified test/image/baselines/ticklabelposition-overlay.png
Binary file modified test/image/baselines/ticklabelposition-overlay2.png
Binary file modified test/image/baselines/yaxis-over-yaxis2.png
Binary file modified test/image/baselines/zorder-overlayed-subplots.png
Binary file modified test/image/baselines/zzz_zerolinelayer_above.png
Binary file modified test/image/baselines/zzz_zerolinelayer_below.png