Skip to content

Commit ad43b10

Browse files
committed
Pie chart now expands better when legend hidden at small sizes.
Revert file wrongly committed.
1 parent 75481ed commit ad43b10

File tree

9 files changed

+18
-23
lines changed

9 files changed

+18
-23
lines changed

CHANGELOG_ION.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# plotly.js ION changelog
22

3+
## [1.33.1-ion37] -- 2020-05-18
4+
5+
### Reverted file committed wrongly.
6+
7+
38
## [1.33.1-ion36] -- 2020-05-18
49

510
### Vertical legend in pie chart sizing caused call stack exception.

dist_ion/plotly-ion.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25065,7 +25065,7 @@ module.exports = function draw(gd) {
2506525065
// result in covering the chart
2506625066
if((opts.orientation === "v" && opts.width > fullLayout.width * 0.45 && !fullLayout._hasPie) ||
2506725067
(opts.orientation === "v" && opts.width > fullLayout.width * 0.5 && fullLayout._hasPie) ||
25068-
(opts.orientation === "h" && opts.height > fullLayout.height * 0.4) ||
25068+
(opts.orientation === "h" && opts.height > fullLayout.height * 0.38) ||
2506925069
( (opts.xanchor !== 'left' && opts.xanchor !== 'right') && opts.orientation === "v" && opts.height > fullLayout.height * 0.4) ) {
2507025070
fullLayout._infolayer.selectAll('.legend').remove();
2507125071
fullLayout._topdefs.select('#' + clipId).remove();
@@ -32811,7 +32811,7 @@ exports.svgAttrs = {
3281132811
var Plotly = require('./plotly');
3281232812

3281332813
// package version injected by `npm run preprocess`
32814-
exports.version = '1.33.1-ion36';
32814+
exports.version = '1.33.1-ion37';
3281532815

3281632816
// inject promise polyfill
3281732817
require('es6-promise').polyfill();
@@ -33104,7 +33104,7 @@ exports.valObjectMeta = {
3310433104
},
3310533105
colorlist: {
3310633106

33107-
33107+
requiredOpts: [],
3310833108

3310933109
coerceFunction: function(v, propOut, dflt) {
3311033110
function isColor(color) {
@@ -54825,7 +54825,7 @@ module.exports = overrideAll({
5482554825
showcountries: {
5482654826
valType: 'boolean',
5482754827

54828-
54828+
description: 'Sets whether or not country boundaries are drawn.'
5482954829
},
5483054830
countrycolor: {
5483154831
valType: 'color',
@@ -57691,7 +57691,7 @@ plots.autoMargin = function(gd, id, o) {
5769157691
// if the item is too big, just give it enough automargin to
5769257692
// make sure you can still grab it and bring it back
5769357693
if(o.l + o.r > fullLayout.width * 0.45) o.l = o.r = 0;
57694-
if(o.b + o.t > fullLayout.height * 0.4) o.b = o.t = 0;
57694+
if(o.b + o.t > fullLayout.height * 0.38) o.b = o.t = 0;
5769557695

5769657696
fullLayout._pushmargin[id] = {
5769757697
l: {val: o.x, size: o.l + pad},
@@ -67884,12 +67884,7 @@ function scalePies(cdpie, plotSize) {
6788467884

6788567885
cd0.r = Math.min(pieBoxWidth, pieBoxHeight) / (2 + 2 * maxPull);
6788667886

67887-
if (cdpie.length === 1) {
67888-
cd0.cx = plotSize.w * (trace.domain.x[1] + trace.domain.x[0]) / 2;
67889-
} else {
67890-
cd0.cx = plotSize.l + plotSize.w * (trace.domain.x[1] + trace.domain.x[0]) / 2;
67891-
}
67892-
67887+
cd0.cx = plotSize.l + plotSize.w * (trace.domain.x[1] + trace.domain.x[0]) / 2;
6789367888
cd0.cy = plotSize.t + plotSize.h * (2 - trace.domain.y[1] - trace.domain.y[0]) / 2;
6789467889

6789567890
if(trace.scalegroup && scaleGroups.indexOf(trace.scalegroup) === -1) {

dist_ion/plotly-ion.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plotly.js",
3-
"version": "1.33.1-ion36",
3+
"version": "1.33.1-ion37",
44
"description": "The open source javascript graphing library that powers plotly",
55
"license": "MIT",
66
"main": "./lib/index.js",

src/assets/geo_assets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ var saneTopojson = require('sane-topojson');
1212

1313

1414
// package version injected by `npm run preprocess`
15-
exports.version = '1.33.1-ion36';exports.topojson = saneTopojson;
15+
exports.version = '1.33.1-ion37';exports.topojson = saneTopojson;

src/components/legend/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ module.exports = function draw(gd) {
152152
// result in covering the chart
153153
if((opts.orientation === "v" && opts.width > fullLayout.width * 0.45 && !fullLayout._hasPie) ||
154154
(opts.orientation === "v" && opts.width > fullLayout.width * 0.5 && fullLayout._hasPie) ||
155-
(opts.orientation === "h" && opts.height > fullLayout.height * 0.4) ||
155+
(opts.orientation === "h" && opts.height > fullLayout.height * 0.38) ||
156156
( (opts.xanchor !== 'left' && opts.xanchor !== 'right') && opts.orientation === "v" && opts.height > fullLayout.height * 0.4) ) {
157157
fullLayout._infolayer.selectAll('.legend').remove();
158158
fullLayout._topdefs.select('#' + clipId).remove();

src/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
var Plotly = require('./plotly');
1616

1717
// package version injected by `npm run preprocess`
18-
exports.version = '1.33.1-ion36';
18+
exports.version = '1.33.1-ion37';
1919

2020
// inject promise polyfill
2121
require('es6-promise').polyfill();

src/plots/plots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ plots.autoMargin = function(gd, id, o) {
15491549
// if the item is too big, just give it enough automargin to
15501550
// make sure you can still grab it and bring it back
15511551
if(o.l + o.r > fullLayout.width * 0.45) o.l = o.r = 0;
1552-
if(o.b + o.t > fullLayout.height * 0.4) o.b = o.t = 0;
1552+
if(o.b + o.t > fullLayout.height * 0.38) o.b = o.t = 0;
15531553

15541554
fullLayout._pushmargin[id] = {
15551555
l: {val: o.x, size: o.l + pad},

src/traces/pie/plot.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,7 @@ function scalePies(cdpie, plotSize) {
592592

593593
cd0.r = Math.min(pieBoxWidth, pieBoxHeight) / (2 + 2 * maxPull);
594594

595-
if (cdpie.length === 1) {
596-
cd0.cx = plotSize.w * (trace.domain.x[1] + trace.domain.x[0]) / 2;
597-
} else {
598-
cd0.cx = plotSize.l + plotSize.w * (trace.domain.x[1] + trace.domain.x[0]) / 2;
599-
}
600-
595+
cd0.cx = plotSize.l + plotSize.w * (trace.domain.x[1] + trace.domain.x[0]) / 2;
601596
cd0.cy = plotSize.t + plotSize.h * (2 - trace.domain.y[1] - trace.domain.y[0]) / 2;
602597

603598
if(trace.scalegroup && scaleGroups.indexOf(trace.scalegroup) === -1) {

0 commit comments

Comments
 (0)