Skip to content

Commit e44aa4d

Browse files
committed
improve cliponaxis_false mock
- show off `(x|y)axis.layer` - lock down behavior for `cliponaxis: true` traces on hasClipOnAxisFalse subplot - add annotations for more descriptive mock
1 parent 1c85de6 commit e44aa4d

File tree

2 files changed

+63
-4
lines changed

2 files changed

+63
-4
lines changed
13 KB
Loading

test/image/mocks/cliponaxis_false.json

+63-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"opacity": 1
2222
},
2323
"text": "not<br>clipped",
24-
"textposition": ["left", "left", "bottom", "right", "right", "top"],
24+
"textposition": ["left", "left", "bottom", "bottom left", "top left", "top"],
2525
"error_y": {
2626
"array": [0.1, 0.2, 0.3, 0.1, 0.3, 0.2],
2727
"arrayminus": [0.1, 0.2, 0.1, 0.1, 0.1, 0.2]
@@ -32,23 +32,82 @@
3232
},
3333
"cliponaxis": false
3434

35+
},
36+
{
37+
"mode": "markers",
38+
"x": [1, 1, 2, 3, 3, 2],
39+
"y": [2, 1, 1, 1, 2, 2],
40+
"marker": {
41+
"size": [15, 20, 40, 25, 50, 40],
42+
"opacity": 1
43+
},
44+
"cliponaxis": false,
45+
"xaxis": "x2",
46+
"yaxis": "y2"
47+
},
48+
{
49+
"mode": "markers+text",
50+
"x": [1, 1.5, 2.5, 3, 2.5, 1.5],
51+
"y": [1.5, 1, 1, 1.5, 2, 2],
52+
"marker": {
53+
"size": 30
54+
},
55+
"text": "clipped<br>should not see this!",
56+
"textposition": ["left", "bottom", "bottom", "right", "top", "top"],
57+
"cliponaxis": true
3558
}
3659
],
3760
"layout": {
3861
"xaxis": {
62+
"domain": [0, 0.48],
3963
"range": [1, 3],
4064
"showline": true,
4165
"linewidth": 2,
42-
"mirror": "all"
66+
"mirror": "all",
67+
"layer": "below traces"
4368
},
4469
"yaxis": {
4570
"range": [1, 2],
4671
"showline": true,
4772
"linewidth": 2,
48-
"mirror": "all"
73+
"mirror": "all",
74+
"layer": "below traces"
75+
},
76+
"xaxis2": {
77+
"anchor": "y2",
78+
"range": [1, 3],
79+
"domain": [0.52, 1],
80+
"showline": true,
81+
"linewidth": 2,
82+
"mirror": "all",
83+
"layer": "above traces"
84+
},
85+
"yaxis2": {
86+
"anchor": "x2",
87+
"range": [1, 2],
88+
"showline": true,
89+
"linewidth": 2,
90+
"mirror": "all",
91+
"side": "right",
92+
"layer": "above traces"
4993
},
94+
"annotations": [{
95+
"showarrow": false,
96+
"xref": "paper", "yref": "paper",
97+
"x": 0.24, "y": 0.5,
98+
"xanchor": "center",
99+
"text": "axis layer<br>below traces"
100+
}, {
101+
"showarrow": false,
102+
"xref": "paper", "yref": "paper",
103+
"x": 0.74, "y": 0.5,
104+
"xanchor": "center",
105+
"text": "axis layer<br>above traces"
106+
}],
50107
"showlegend": false,
51108
"dragmode": "pan",
52-
"hovermode": "closest"
109+
"hovermode": "closest",
110+
"height": 500,
111+
"width": 800
53112
}
54113
}

0 commit comments

Comments
 (0)