Skip to content

Commit f5c0382

Browse files
committed
add category autorange mock for annotations and shapes
1 parent ffb3791 commit f5c0382

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed
20.8 KB
Loading
+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"data":[{
3+
"mode": "markers",
4+
"x": ["a", "b", "c"],
5+
"y": ["X", "Y", "Z"]
6+
}, {
7+
"mode": "markers",
8+
"x": ["a", "b", "c"],
9+
"y": ["X", "Y", "Z"],
10+
"xaxis": "x2",
11+
"yaxis": "y2"
12+
}],
13+
"layout":{
14+
"autosize":false,
15+
"xaxis":{
16+
"domain": [0, 0.48],
17+
"ticks": "outside",
18+
"mirror":"allticks",
19+
"zeroline":false,
20+
"showline":true
21+
},
22+
"xaxis2":{
23+
"anchor": "y2",
24+
"domain": [0.52, 1],
25+
"ticks": "outside",
26+
"mirror":"allticks",
27+
"zeroline":false,
28+
"showline":true,
29+
"range": [-0.5, 2.5]
30+
},
31+
"yaxis":{
32+
"ticks": "outside",
33+
"mirror":"allticks",
34+
"zeroline":false,
35+
"showline":true
36+
},
37+
"yaxis2":{
38+
"anchor": "x2",
39+
"side": "right",
40+
"ticks": "outside",
41+
"mirror":"allticks",
42+
"zeroline":false,
43+
"showline":true,
44+
"range": [-0.5, 2.5]
45+
},
46+
"height":360,
47+
"width":600,
48+
"showlegend": false,
49+
"margin":{"r":40,"b":40,"l":40,"t":40},
50+
"title": "left: auto range || right: set range",
51+
"titlefont": {"size": 12},
52+
"annotations":[{
53+
"axref": "x", "ayref": "y",
54+
"text": "bump yrange up",
55+
"x": "a", "y": 3,
56+
"ax": "c", "ay": "3.5",
57+
"xanchor": "left",
58+
"borderpad": 10
59+
}, {
60+
"axref": "x", "ayref": "y",
61+
"text": "bump xrange<br>to the left",
62+
"x": "-1", "y": "Y",
63+
"ax": 0, "ay": "X"
64+
}, {
65+
"xref": "x2", "yref": "y2",
66+
"text": "should not see this",
67+
"x": "a", "y": 3
68+
}, {
69+
"xref": "x2", "yref": "y2",
70+
"text": "should not see this",
71+
"x": "-1", "y": "Y"
72+
}],
73+
"shapes": [{
74+
"type": "rectangle",
75+
"line": {"color": "purple"},
76+
"x0": "b", "x1": 4.5,
77+
"y0": -1, "y1": "Z"
78+
}, {
79+
"xref": "x2", "yref": "y2",
80+
"type": "rectangle",
81+
"line": {"color": "purple"},
82+
"x0": "b", "x1": 4.5,
83+
"y0": -1, "y1": "Z"
84+
}]
85+
}
86+
}

0 commit comments

Comments
 (0)