Skip to content

Commit 47c320c

Browse files
committed
Images: Change width/height to sizex/sizey
1 parent 66c8702 commit 47c320c

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/components/images/attributes.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ module.exports = {
3737
].join(' ')
3838
},
3939

40-
width: {
40+
sizey: {
4141
valType: 'number',
4242
role: 'info',
4343
dflt: 0,
4444
description: [
45-
'Sets the image container width.',
45+
'Sets the image container size horizontally.',
4646
'The image will be sized based on the `position` value.',
4747
'When `xref` is set to `paper`, units are sized relative',
4848
'to the plot width.'
4949
].join(' ')
5050
},
5151

52-
height: {
52+
sizex: {
5353
valType: 'number',
5454
role: 'info',
5555
dflt: 0,
5656
description: [
57-
'Sets the image container height.',
57+
'Sets the image container size vertically.',
5858
'The image will be sized based on the `position` value.',
5959
'When `yref` is set to `paper`, units are sized relative',
6060
'to the plot height.'

src/components/images/defaults.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ function imageDefaults(imageIn, imageOut, fullLayout) {
4747
coerce('y');
4848
coerce('xanchor');
4949
coerce('yanchor');
50-
coerce('width');
51-
coerce('height');
50+
coerce('sizex');
51+
coerce('sizey');
5252
coerce('sizing');
5353
coerce('opacity');
5454

src/components/images/draw.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ module.exports = function draw(gd) {
6161
var size = fullLayout._size,
6262
width = xref ? Math.abs(xref.l2p(d.width) - xref.l2p(0)) : d.width * size.w,
6363
height = yref ? Math.abs(yref.l2p(d.height) - yref.l2p(0)) : d.width * size.h;
64+
width = xref ? Math.abs(xref.l2p(d.sizex) - xref.l2p(0)) : d.sizex * size.w,
65+
height = yref ? Math.abs(yref.l2p(d.sizey) - yref.l2p(0)) : d.sizey * size.h;
6466

6567
// Offsets for anchor positioning
6668
var xOffset = width * anchors.x[d.xanchor].offset + size.l,

0 commit comments

Comments
 (0)