Skip to content

Commit 586f2cc

Browse files
committed
define layout.computed in the schema
1 parent c44ff23 commit 586f2cc

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/plots/layout_attributes.js

+9
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,15 @@ module.exports = {
265265
},
266266
editType: 'plot'
267267
},
268+
computed: {
269+
valType: 'any',
270+
role: 'info',
271+
editType: 'none',
272+
description: [
273+
'Placeholder for exporting automargin-impacting values namely',
274+
'`margin.t`, `margin.b`, `margin.l` and `margin.r` in *full-json* mode.',
275+
].join(' ')
276+
},
268277
paper_bgcolor: {
269278
valType: 'color',
270279
role: 'style',

src/plots/plots.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ plots.graphJson = function(gd, dataonly, mode, output, useDefaults, includeConfi
21642164
obj.layout = stripObj(layout);
21652165
if(useDefaults) {
21662166
var gs = layout._size;
2167-
obj.layout._computed = {
2167+
obj.layout.computed = {
21682168
margin: {
21692169
b: gs.b,
21702170
l: gs.l,

test/jasmine/tests/toimage_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ describe('Plotly.toImage', function() {
307307
Plotly.toImage(pieAutoMargin, imgOpts)
308308
.then(function(fig) {
309309
fig = JSON.parse(fig);
310-
var computed = fig.layout._computed;
310+
var computed = fig.layout.computed;
311311
expect(computed).toBeDefined('no computed');
312312
expect(computed.margin).toBeDefined('no computed margin');
313313
expect(computed.margin.t).toBeDefined('no top');

0 commit comments

Comments
 (0)