You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+21
Original file line number
Diff line number
Diff line change
@@ -177,6 +177,27 @@ which shows the baseline image, the generated image, the diff and the json mocks
177
177
178
178
To view the results of a run on CircleCI, download the `build/test_images/` and `build/test_images_diff/` artifacts into your local repo and then run `npm run start-image_viewer`.
179
179
180
+
### Writing interaction tests
181
+
Keep in mind that the interaction coordinates are relative to the top-left corner of the plot, including the margins. To produce a reliable interaction test,
182
+
it may be necessary to fix the width, height, margins, X axis range and Y axis range of the plot. For example:
183
+
184
+
```
185
+
Plotly.newPlot(gd, [{
186
+
x: [1, 1, 1, 2, 2, 2, 3, 3, 3],
187
+
y: [1, 2, 3, 1, 2, 3, 1, 2, 3],
188
+
mode: 'markers'
189
+
}], {
190
+
width: 400, height: 400,
191
+
margin: {l: 100, r: 100, t: 100, b: 100},
192
+
xaxis: {range: [0, 4]},
193
+
yaxis: {range: [0, 4]}
194
+
});
195
+
```
196
+
197
+
This will produce the following plot, and say you want to simulate a selection path of (175, 175) to (225, 225):
0 commit comments