Skip to content

Commit c9103df

Browse files
Domain referenced shapes are visible outside the plotting area
This is like paper referenced images
1 parent 83834f8 commit c9103df

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/images/draw.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
var d3 = require('d3');
1212
var Drawing = require('../drawing');
1313
var Axes = require('../../plots/cartesian/axes');
14+
var axisIds = require('../../plots/cartesian/axis_ids');
1415
var xmlnsNamespaces = require('../../constants/xmlns_namespaces');
1516

1617
module.exports = function draw(gd) {
@@ -27,7 +28,7 @@ module.exports = function draw(gd) {
2728

2829
if(img.visible) {
2930
if(img.layer === 'below' && img.xref !== 'paper' && img.yref !== 'paper') {
30-
subplot = img.xref + img.yref;
31+
subplot = axisIds.ref2id(img.xref) + axisIds.ref2id(img.yref);
3132

3233
var plotinfo = fullLayout._plots[subplot];
3334

@@ -205,8 +206,8 @@ module.exports = function draw(gd) {
205206

206207

207208
// Set proper clipping on images
208-
var xId = xa ? xa._id : '';
209-
var yId = ya ? ya._id : '';
209+
var xId = xa && (Axes.getRefType(d.xref) != 'domain') ? xa._id : '';
210+
var yId = ya && (Axes.getRefType(d.yref) != 'domain') ? ya._id : '';
210211
var clipAxes = xId + yId;
211212

212213
Drawing.setClipUrl(

0 commit comments

Comments
 (0)