Skip to content

update comments about v2 changes that moved to another major #5415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2021
Merged
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
2 changes: 1 addition & 1 deletion src/components/annotations/click.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function getToggleSets(gd, hoverData) {
return {on: onSet, off: offSet, explicitOff: explicitOffSet};
}

// to handle log axes until v2
// to handle log axes until v3
function clickData2r(d, ax) {
return ax.type === 'log' ? ax.l2r(d) : ax.d2r(d);
}
2 changes: 1 addition & 1 deletion src/components/annotations/convert_coords.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var toLogRange = require('../../lib/to_log_range');
* convertCoords: when converting an axis between log and linear
* you need to alter any annotations on that axis to keep them
* pointing at the same data point.
* In v2.0 this will become obsolete
* In v3.0 this will become obsolete
*
* gd: the plot div
* ax: the axis being changed
Expand Down
2 changes: 1 addition & 1 deletion src/components/colorscale/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var letterAttrs = ['min', 'max', 'mid', 'auto'];
/**
* Extract 'c' / 'z', trace / color axis colorscale options
*
* Note that it would be nice to replace all z* with c* equivalents in v2
* Note that it would be nice to replace all z* with c* equivalents in v3
*
* @param {object} cont : attribute container
* @return {object}:
Expand Down
2 changes: 1 addition & 1 deletion src/components/images/convert_coords.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var toLogRange = require('../../lib/to_log_range');
* convertCoords: when converting an axis between log and linear
* you need to alter any images on that axis to keep them
* pointing at the same data point.
* In v2.0 this will become obsolete (or perhaps size will still need conversion?)
* In v3.0 this will become obsolete (or perhaps size will still need conversion?)
* we convert size by declaring that the maximum extent *in data units* should be
* the same, assuming the image is anchored by its center (could remove that restriction
* if we think it's important) even though the actual left and right values will not be
Expand Down
2 changes: 1 addition & 1 deletion src/components/legend/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) {
} else {
// maybe use y=1.1 / yanchor=bottom as above
// to avoid https://github.com/plotly/plotly.js/issues/1199
// in v2
// in v3
defaultY = -0.1;
defaultYAnchor = 'top';
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/shapes/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) {
var dflt0 = 0.25;
var dflt1 = 0.75;

// hack until V2.0 when log has regular range behavior - make it look like other
// hack until V3.0 when log has regular range behavior - make it look like other
// ranges to send to coerce, then put it back after
// this is all to give reasonable default position behavior on log axes, which is
// a pretty unimportant edge case so we could just ignore this.
Expand Down
2 changes: 1 addition & 1 deletion src/components/shapes/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var Lib = require('../../lib');
// so these have to be specified in terms of the category serial numbers,
// but can take fractional values. Other axis types we specify position based on
// the actual data values.
// TODO: in V2.0 (when log axis ranges are in data units) range and shape position
// TODO: in V3.0 (when log axis ranges are in data units) range and shape position
// will be identical, so rangeToShapePosition and shapePositionToRange can be
// removed entirely.

Expand Down
2 changes: 1 addition & 1 deletion src/plot_api/plot_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ var configAttributes = {
dflt: false,
description: [
'Determines whether to change the layout size when window is resized.',
'In v2, this option will be removed and will always be true.'
'In v3, this option will be removed and will always be true.'
].join(' ')
},
fillFrame: {
Expand Down
2 changes: 1 addition & 1 deletion src/plots/cartesian/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

var strTranslate = require('../../lib').strTranslate;

// in v2 (once log ranges are fixed),
// in v3 (once log ranges are fixed),
// we'll be able to p2r here for all axis types
function p2r(ax, v) {
switch(ax.type) {
Expand Down
4 changes: 2 additions & 2 deletions src/plots/cartesian/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ function prepSelect(e, startX, startY, dragOptions, mode) {
}

if(clickmode === 'event') {
// TODO: remove in v2 - this was probably never intended to work as it does,
// TODO: remove in v3 - this was probably never intended to work as it does,
// but in case anyone depends on it we don't want to break it now.
// Note that click-to-select introduced pre v2 also emitts proper
// Note that click-to-select introduced pre v3 also emitts proper
// event data when clickmode is having 'select' in its flag list.
gd.emit('plotly_selected', undefined);
}
Expand Down
4 changes: 2 additions & 2 deletions src/plots/cartesian/set_convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function isValidCategory(v) {
* - category: calcdata format (c), and will stay that way because
* the data format has no continuous mapping
* - log: linearized (l) format
* TODO: in v2.0 we plan to change it to data format. At that point
* TODO: in v3.0 we plan to change it to data format. At that point
* shapes will work the same way as ranges, tick0, and annotations
* so they can use this conversion too.
*
Expand Down Expand Up @@ -95,7 +95,7 @@ module.exports = function setConvert(ax, fullLayout) {
if((opts || {}).msUTC && isNumeric(v)) {
// For now it is only used
// to fix bar length in milliseconds & gl3d ticks
// It could be applied in other places in v2
// It could be applied in other places in v3
return +v;
}

Expand Down
4 changes: 2 additions & 2 deletions src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ function getFormatObj(gd, formatKeys) {
/**
* getFormatter: combine the final separators with the locale formatting object
* we pulled earlier to generate number and time formatters
* TODO: remove separators in v2, only use locale, so we don't need this step?
* TODO: remove separators in v3, only use locale, so we don't need this step?
*
* @param {object} formatObj: d3.locale format object
* @param {string} separators: length-2 string to override decimal and thousands
Expand Down Expand Up @@ -1496,7 +1496,7 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) {
// layouts with no set width and height were set temporary set to 'initial'
// to pass through the autosize routine
//
// This behavior is subject to change in v2.
// This behavior is subject to change in v3.
coerce('autosize', !(layoutIn.width && layoutIn.height));

coerce('width');
Expand Down
2 changes: 1 addition & 1 deletion src/traces/splom/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module.exports = {
].join(' ')
},

// TODO make 'true' the default in v2?
// TODO make 'true' the default in v3?
matches: {
valType: 'boolean',
dflt: false,
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/axes_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3857,7 +3857,7 @@ describe('Test axes', function() {
var dates = [[2000, 0, 1], [2001, 0, 1], [2002, 0, 1]]
.map(function(d) { return new Date(d[0], d[1], d[2]).getTime(); });

// We could make this work down the road (in v2),
// We could make this work down the road (in v3),
// when address our timezone problems.
var out = _makeCalcdata({
x: new Float64Array(dates)
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/histogram_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ describe('Test histogram', function() {

it('should update autobins correctly when restyling', function(done) {
// note: I'm *not* testing what this does to gd.data, as that's
// really a matter of convenience and will perhaps change later (v2?)
// really a matter of convenience and will perhaps change later (v3?)
var data1 = [1.5, 2, 2, 3, 3, 3, 4, 4, 5];
Plotly.newPlot(gd, [{x: data1, type: 'histogram' }])
.then(function() {
Expand Down
6 changes: 3 additions & 3 deletions test/jasmine/tests/plot_api_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('Test plot api', function() {
// some of these tests use the undo/redo queue
// OK, this is weird... the undo/redo queue length is a global config only.
// It's ignored on the plot, even though the queue itself is per-plot.
// We may ditch this later, but probably not until v2
// We may ditch this later, but probably not until v3
Plotly.setPlotConfig({queueLength: 3});
});

Expand Down Expand Up @@ -447,7 +447,7 @@ describe('Test plot api', function() {
.then(function() {
// Ideally we should change this to xaxis.autorange: 'reversed'
// but that's a weird disappearing setting used just to force
// an initial reversed autorange. Proposed v2 change at:
// an initial reversed autorange. Proposed v3 change at:
// https://github.com/plotly/plotly.js/issues/420#issuecomment-323435082
return Plotly.relayout(gd, 'xaxis.reverse', true);
})
Expand Down Expand Up @@ -1100,7 +1100,7 @@ describe('Test plot api', function() {
// some of these tests use the undo/redo queue
// OK, this is weird... the undo/redo queue length is a global config only.
// It's ignored on the plot, even though the queue itself is per-plot.
// We may ditch this later, but probably not until v2
// We may ditch this later, but probably not until v3
Plotly.setPlotConfig({queueLength: 3});
});

Expand Down
4 changes: 2 additions & 2 deletions test/jasmine/tests/select_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function assertEventCounts(selecting, selected, deselect, msg) {
expect(deselectCnt).toBe(deselect, 'plotly_deselect call count: ' + msg);
}

// TODO: in v2, when we get rid of the `plotly_selected->undefined` event, these will
// TODO: in v3, when we get rid of the `plotly_selected->undefined` event, these will
// change to BOXEVENTS = [1, 1, 1], LASSOEVENTS = [4, 1, 1]. See also _run down below
//
// events for box or lasso select mouse moves then a doubleclick
Expand Down Expand Up @@ -1837,7 +1837,7 @@ describe('Test select box and lasso per trace:', function() {
return (eventCounts[0] ? selectedPromise : Promise.resolve())
.then(afterDragFn)
.then(function() {
// TODO: in v2 when we remove the `plotly_selecting->undefined` the Math.max(...)
// TODO: in v3 when we remove the `plotly_selecting->undefined` the Math.max(...)
// in the middle here will turn into just eventCounts[1].
// It's just here because one of the selected events is generated during
// doubleclick so hasn't happened yet when we're testing this.
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/shapes_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('Test shapes defaults:', function() {
expect(shape1Out.x0).toBe(5);
expect(shape1Out.x1).toBe(15);

// shapes use data values for log axes (like everyone will in V2.0)
// shapes use data values for log axes (like everyone will in V3.0)
expect(shape1Out.y0).toBeWithin(100, 0.001);
expect(shape1Out.y1).toBeWithin(10000, 0.001);

Expand Down