Skip to content

Add tests for standoff position PR 6889 #6914

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 6 commits into from
Mar 6, 2024
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: 2 additions & 0 deletions draftlogs/6889_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix standoff position [[#6889](https://github.com/plotly/plotly.js/pull/6889), [#6914](https://github.com/plotly/plotly.js/pull/6914)],
with thanks to @ayjayt for the contribution!
2 changes: 1 addition & 1 deletion src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2898,7 +2898,7 @@ function calcLabelLevelBbox(ax, cls, mainLinePositionShift) {
});
} else {
var dummyCalc = axes.makeLabelFns(ax, mainLinePositionShift);
top = bottom = dummyCalc.yFn({dx: 0, dy: 0, fontSize: 0}); // I don't know what dx, dy is
top = bottom = dummyCalc.yFn({dx: 0, dy: 0, fontSize: 0});
left = right = dummyCalc.xFn({dx: 0, dy: 0, fontSize: 0});
}

Expand Down
1 change: 1 addition & 0 deletions tasks/test_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ function notBlackListed(name) {
'pattern_bars',
'pattern_fgcolor_overlay_fillmode',
'pattern_with_colorscale',
'zz-petrophysics',
'plot_types',
'polar_blank',
'polar_dates',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/image/baselines/zz-petrophysics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions test/image/mocks/zz-line_scatter_change_side.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"data": [
{
"x": [
1,
2,
3,
4
],
"y": [
10,
15,
13,
17
],
"mode": "markers",
"type": "scatter",
"marker": {
"opacity": 0.5
}
},
{
"x": [
2,
3,
4,
5
],
"y": [
16,
5,
11,
9
],
"mode": "lines",
"type": "scatter",
"opacity": 0.5
},
{
"x": [
1,
2,
3,
4
],
"y": [
12,
9,
15,
12
],
"mode": "lines+markers",
"type": "scatter",
"opacity": 0.707,
"marker": {
"opacity": 0.707
}
},
{
"x": [1, 2, 3],
"y": [1, 2, 3],
"opacity": 0.2,
"line": { "width": 10, "color": "red"},
"marker": { "size": 20, "color": "blue"}
}
],
"layout": {
"yaxis": { "title": {"text": "yaxis", "standoff": 0}, "side": "right", "showticklabels": false, "domain": [0, 1]},
"xaxis": { "title": {"text": "xaxis", "standoff": 0}, "side": "top", "showticklabels": false, "domain": [0, 1]}
}
}
71 changes: 71 additions & 0 deletions test/image/mocks/zz-line_scatter_change_side_shrunk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"data": [
{
"x": [
1,
2,
3,
4
],
"y": [
10,
15,
13,
17
],
"mode": "markers",
"type": "scatter",
"marker": {
"opacity": 0.5
}
},
{
"x": [
2,
3,
4,
5
],
"y": [
16,
5,
11,
9
],
"mode": "lines",
"type": "scatter",
"opacity": 0.5
},
{
"x": [
1,
2,
3,
4
],
"y": [
12,
9,
15,
12
],
"mode": "lines+markers",
"type": "scatter",
"opacity": 0.707,
"marker": {
"opacity": 0.707
}
},
{
"x": [1, 2, 3],
"y": [1, 2, 3],
"opacity": 0.2,
"line": { "width": 10, "color": "red"},
"marker": { "size": 20, "color": "blue"}
}
],
"layout": {
"yaxis": { "title": {"text": "yaxis", "standoff": 0}, "side": "right", "showticklabels": false, "domain": [0.2, 0.8]},
"xaxis": { "title": {"text": "xaxis", "standoff": 0}, "side": "top", "showticklabels": false, "domain": [0.2, 0.8]}
}
}
71 changes: 71 additions & 0 deletions test/image/mocks/zz-line_scatter_regular_side.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"data": [
{
"x": [
1,
2,
3,
4
],
"y": [
10,
15,
13,
17
],
"mode": "markers",
"type": "scatter",
"marker": {
"opacity": 0.5
}
},
{
"x": [
2,
3,
4,
5
],
"y": [
16,
5,
11,
9
],
"mode": "lines",
"type": "scatter",
"opacity": 0.5
},
{
"x": [
1,
2,
3,
4
],
"y": [
12,
9,
15,
12
],
"mode": "lines+markers",
"type": "scatter",
"opacity": 0.707,
"marker": {
"opacity": 0.707
}
},
{
"x": [1, 2, 3],
"y": [1, 2, 3],
"opacity": 0.2,
"line": { "width": 10, "color": "red"},
"marker": { "size": 20, "color": "blue"}
}
],
"layout": {
"yaxis": { "title": {"text": "yaxis", "standoff": 0}, "side": "left", "showticklabels": false, "domain": [0, 1]},
"xaxis": { "title": {"text": "xaxis", "standoff": 0}, "side": "bottom", "showticklabels": false, "domain": [0, 1]}
}
}
71 changes: 71 additions & 0 deletions test/image/mocks/zz-line_scatter_regular_side_shrunk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"data": [
{
"x": [
1,
2,
3,
4
],
"y": [
10,
15,
13,
17
],
"mode": "markers",
"type": "scatter",
"marker": {
"opacity": 0.5
}
},
{
"x": [
2,
3,
4,
5
],
"y": [
16,
5,
11,
9
],
"mode": "lines",
"type": "scatter",
"opacity": 0.5
},
{
"x": [
1,
2,
3,
4
],
"y": [
12,
9,
15,
12
],
"mode": "lines+markers",
"type": "scatter",
"opacity": 0.707,
"marker": {
"opacity": 0.707
}
},
{
"x": [1, 2, 3],
"y": [1, 2, 3],
"opacity": 0.2,
"line": { "width": 10, "color": "red"},
"marker": { "size": 20, "color": "blue"}
}
],
"layout": {
"yaxis": { "title": {"text": "yaxis", "standoff": 0}, "side": "left", "showticklabels": false, "domain": [0.2, 0.8]},
"xaxis": { "title": {"text": "xaxis", "standoff": 0}, "side": "bottom", "showticklabels": false, "domain": [0.2, 0.8]}
}
}
1 change: 1 addition & 0 deletions test/image/mocks/zz-petrophysics.json

Large diffs are not rendered by default.