Skip to content

Commit bd2b34d

Browse files
Domain refercing objects image test
1 parent fd07290 commit bd2b34d

File tree

6 files changed

+224
-5
lines changed

6 files changed

+224
-5
lines changed

test/image/baselines/domain_refs.png

37.4 KB
Loading

test/image/mocks/domain_refs.json

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
{
2+
"data": [{
3+
"type": "scatter",
4+
"x": [],
5+
"xaxis": "x",
6+
"y": [],
7+
"yaxis": "y"
8+
},
9+
{
10+
"type": "scatter",
11+
"x": [],
12+
"xaxis": "x2",
13+
"y": [],
14+
"yaxis": "y2"
15+
},
16+
{
17+
"type": "scatter",
18+
"x": [],
19+
"xaxis": "x3",
20+
"y": [],
21+
"yaxis": "y3"
22+
},
23+
{
24+
"type": "scatter",
25+
"x": [],
26+
"xaxis": "x4",
27+
"y": [],
28+
"yaxis": "y4"
29+
}
30+
],
31+
"layout": {
32+
"xaxis": {
33+
"anchor": "y",
34+
"domain": [
35+
0.0,
36+
0.45
37+
],
38+
"range": [
39+
1,
40+
10
41+
]
42+
},
43+
"xaxis2": {
44+
"anchor": "y2",
45+
"type": "log",
46+
"domain": [
47+
0.55,
48+
1.0
49+
],
50+
"range": [
51+
0,
52+
1
53+
]
54+
},
55+
"xaxis3": {
56+
"anchor": "y3",
57+
"domain": [
58+
0.0,
59+
0.45
60+
],
61+
"range": [
62+
1,
63+
10
64+
]
65+
},
66+
"xaxis4": {
67+
"anchor": "y4",
68+
"type": "log",
69+
"domain": [
70+
0.55,
71+
1.0
72+
],
73+
"range": [
74+
0,
75+
1
76+
]
77+
},
78+
"yaxis": {
79+
"anchor": "x",
80+
"type": "log",
81+
"domain": [
82+
0.575,
83+
1
84+
],
85+
"range": [
86+
0,
87+
1
88+
]
89+
},
90+
"yaxis2": {
91+
"anchor": "x2",
92+
"domain": [
93+
0.575,
94+
1
95+
],
96+
"range": [
97+
1,
98+
10
99+
]
100+
},
101+
"yaxis3": {
102+
"anchor": "x3",
103+
"type": "log",
104+
"domain": [
105+
0.0,
106+
0.425
107+
],
108+
"range": [
109+
0,
110+
1
111+
]
112+
},
113+
"yaxis4": {
114+
"anchor": "x4",
115+
"domain": [
116+
0.0,
117+
0.425
118+
],
119+
"range": [
120+
1,
121+
10
122+
]
123+
},
124+
"shapes": [{
125+
"type": "line",
126+
"xref": "x3",
127+
"yref": "y3 domain",
128+
"x0": 6,
129+
"y0": 0,
130+
"x1": 6,
131+
"y1": 1,
132+
"line": {
133+
"color": "rgb(10, 20, 30)"
134+
}
135+
}, {
136+
"type": "line",
137+
"xref": "x4 domain",
138+
"yref": "y4",
139+
"x0": 0,
140+
"y0": 8,
141+
"x1": 1,
142+
"y1": 8,
143+
"line": {
144+
"color": "rgb(10, 20, 31)"
145+
}
146+
},{
147+
"type": "rect",
148+
"xref": "x domain",
149+
"yref": "y",
150+
"x0": 0,
151+
"y0": 4,
152+
"x1": 1,
153+
"y1": 9,
154+
"line": {
155+
"color": "rgb(10, 20, 32)"
156+
}
157+
}, {
158+
"type": "rect",
159+
"xref": "x2",
160+
"yref": "y2 domain",
161+
"x0": 1,
162+
"y0": 0,
163+
"x1": 3,
164+
"y1": 1,
165+
"line": {
166+
"color": "rgb(10, 20, 33)"
167+
}
168+
}],
169+
"annotations": [{
170+
"text": "A",
171+
"bordercolor": "rgb(100, 200, 232)",
172+
"xref": "x3 domain",
173+
"yref": "y3 domain",
174+
"x": 0,
175+
"y": 0,
176+
"axref": "x3 domain",
177+
"ayref": "y3 domain",
178+
"ax": 0.5,
179+
"ay": 0.5,
180+
"arrowcolor": "rgb(231, 200, 100)"
181+
}, {
182+
"text": "B",
183+
"bordercolor": "rgb(200, 200, 232)",
184+
"xref": "x4 domain",
185+
"yref": "y4 domain",
186+
"x": 1,
187+
"y": 1,
188+
"axref": "x4 domain",
189+
"ayref": "y4 domain",
190+
"ax": 0.5,
191+
"ay": 0.5,
192+
"arrowcolor": "rgb(231, 200, 200)"
193+
}],
194+
"images": [{
195+
"source": "https://images.plot.ly/language-icons/api-home/js-logo.png",
196+
"xref": "x1 domain",
197+
"yref": "y1 domain",
198+
"x": 0,
199+
"y": 0,
200+
"xanchor": "left",
201+
"yanchor": "bottom",
202+
"sizex": 0.5,
203+
"sizey": 0.5,
204+
"sizing": "stretch"
205+
}, {
206+
"source": "https://images.plot.ly/language-icons/api-home/python-logo.png",
207+
"xref": "x2 domain",
208+
"yref": "y2 domain",
209+
"x": 1,
210+
"y": 1,
211+
"xanchor": "right",
212+
"yanchor": "top",
213+
"sizex": 0.5,
214+
"sizey": 0.5,
215+
"sizing": "stretch"
216+
}]
217+
},
218+
"config": {
219+
"editable": true
220+
}
221+
}

test/jasmine/assets/domain_ref/components.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var axisIds = require('../../../../src/plots/cartesian/axis_ids');
2323
var testImage = 'https://images.plot.ly/language-icons/api-home/js-logo.png';
2424
var iterable = require('extra-iterable');
2525

26-
var testMock = require('../../../image/mocks/domain_ref_base.json');
26+
var testMock = require('./domain_ref_base.json');
2727

2828
// NOTE: this tolerance is in pixels
2929
var EQUALITY_TOLERANCE = 1e-2;

test/jasmine/tests/domain_ref_interact_test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var Plotly = require('../../../lib/index');
77
var Lib = require('../../../src/lib');
88
var getSVGElemScreenBBox = require(
99
'../assets/get_svg_elem_screen_bbox');
10-
var testMock = require('../../image/mocks/domain_refs_editable.json');
10+
var testMock = require('../assets/domain_ref/domain_refs_editable.json');
1111
var delay = require('../assets/delay');
1212
var mouseEvent = require('../assets/mouse_event');
1313
// we have to use drag to move annotations for some reason
@@ -22,9 +22,7 @@ var rectColor4 = 'rgb(200, 200, 232)';
2222
var arrowColor1 = 'rgb(231, 200, 100)';
2323
var arrowColor2 = 'rgb(231, 200, 200)';
2424

25-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000000;
26-
27-
var DELAY_TIME = 1000;
25+
var DELAY_TIME = 10;
2826

2927
function svgRectToJSON(svgrect) {
3028
return JSON.stringify(SVGTools.svgRectToObj(svgrect));

0 commit comments

Comments
 (0)