Skip to content
This repository was archived by the owner on Apr 21, 2023. It is now read-only.
/ plotly.js Public archive
forked from plotly/plotly.js

Commit 7ff4e2d

Browse files
committed
Fix legend horizontal wrapping
1 parent 06bf98e commit 7ff4e2d

21 files changed

+123
-127
lines changed

dist/plotly-basic.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -25854,7 +25854,7 @@ function computeLegendDimensions(gd, groups, traces) {
2585425854
var opts = fullLayout.legend;
2585525855
var borderwidth = opts.borderwidth;
2585625856
var isGrouped = helpers.isGrouped(opts);
25857-
var isHorizontalColumn = helpers.isHorizontalColumn(opts);
25857+
var isHorizontalWrapped = helpers.isHorizontalWrapped(opts);
2585825858

2585925859
var extraWidth = 0;
2586025860

@@ -25978,11 +25978,11 @@ function computeLegendDimensions(gd, groups, traces) {
2597825978
});
2597925979

2598025980
// check if legend fits in one row
25981-
var oneRowLegend = !isHorizontalColumn || (fullLayout._size.w > borderwidth + fullTracesWidth - traceGap);
25981+
var oneRowLegend = fullLayout._size.w > borderwidth + fullTracesWidth - traceGap;
2598225982

2598325983
traces.each(function(d) {
2598425984
var legendItem = d[0];
25985-
var traceWidth = oneRowLegend ? 40 + d[0].width : maxTraceWidth;
25985+
var traceWidth = (oneRowLegend || isHorizontalWrapped) ? 40 + d[0].width : maxTraceWidth;
2598625986

2598725987
if((borderwidth + offsetX + traceGap + traceWidth) > fullLayout._size.w) {
2598825988
offsetX = 0;
@@ -26444,8 +26444,8 @@ exports.isReversed = function isReversed(legendLayout) {
2644426444
return (legendLayout.traceorder || '').indexOf('reversed') !== -1;
2644526445
};
2644626446

26447-
exports.isHorizontalColumn = function isHorizontalColumn(legendLayout) {
26448-
return legendLayout.horizontalspacing === 'column';
26447+
exports.isHorizontalWrapped = function isHorizontalWrapped(legendLayout) {
26448+
return legendLayout.horizontalspacing === 'wrapped';
2644926449
}
2645026450
},{}],98:[function(_dereq_,module,exports){
2645126451
/**

dist/plotly-basic.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-cartesian.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -25966,7 +25966,7 @@ function computeLegendDimensions(gd, groups, traces) {
2596625966
var opts = fullLayout.legend;
2596725967
var borderwidth = opts.borderwidth;
2596825968
var isGrouped = helpers.isGrouped(opts);
25969-
var isHorizontalColumn = helpers.isHorizontalColumn(opts);
25969+
var isHorizontalWrapped = helpers.isHorizontalWrapped(opts);
2597025970

2597125971
var extraWidth = 0;
2597225972

@@ -26090,11 +26090,11 @@ function computeLegendDimensions(gd, groups, traces) {
2609026090
});
2609126091

2609226092
// check if legend fits in one row
26093-
var oneRowLegend = !isHorizontalColumn || (fullLayout._size.w > borderwidth + fullTracesWidth - traceGap);
26093+
var oneRowLegend = fullLayout._size.w > borderwidth + fullTracesWidth - traceGap;
2609426094

2609526095
traces.each(function(d) {
2609626096
var legendItem = d[0];
26097-
var traceWidth = oneRowLegend ? 40 + d[0].width : maxTraceWidth;
26097+
var traceWidth = (oneRowLegend || isHorizontalWrapped) ? 40 + d[0].width : maxTraceWidth;
2609826098

2609926099
if((borderwidth + offsetX + traceGap + traceWidth) > fullLayout._size.w) {
2610026100
offsetX = 0;
@@ -26556,8 +26556,8 @@ exports.isReversed = function isReversed(legendLayout) {
2655626556
return (legendLayout.traceorder || '').indexOf('reversed') !== -1;
2655726557
};
2655826558

26559-
exports.isHorizontalColumn = function isHorizontalColumn(legendLayout) {
26560-
return legendLayout.horizontalspacing === 'column';
26559+
exports.isHorizontalWrapped = function isHorizontalWrapped(legendLayout) {
26560+
return legendLayout.horizontalspacing === 'wrapped';
2656126561
}
2656226562
},{}],106:[function(_dereq_,module,exports){
2656326563
/**

dist/plotly-cartesian.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-finance.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -25952,7 +25952,7 @@ function computeLegendDimensions(gd, groups, traces) {
2595225952
var opts = fullLayout.legend;
2595325953
var borderwidth = opts.borderwidth;
2595425954
var isGrouped = helpers.isGrouped(opts);
25955-
var isHorizontalColumn = helpers.isHorizontalColumn(opts);
25955+
var isHorizontalWrapped = helpers.isHorizontalWrapped(opts);
2595625956

2595725957
var extraWidth = 0;
2595825958

@@ -26076,11 +26076,11 @@ function computeLegendDimensions(gd, groups, traces) {
2607626076
});
2607726077

2607826078
// check if legend fits in one row
26079-
var oneRowLegend = !isHorizontalColumn || (fullLayout._size.w > borderwidth + fullTracesWidth - traceGap);
26079+
var oneRowLegend = fullLayout._size.w > borderwidth + fullTracesWidth - traceGap;
2608026080

2608126081
traces.each(function(d) {
2608226082
var legendItem = d[0];
26083-
var traceWidth = oneRowLegend ? 40 + d[0].width : maxTraceWidth;
26083+
var traceWidth = (oneRowLegend || isHorizontalWrapped) ? 40 + d[0].width : maxTraceWidth;
2608426084

2608526085
if((borderwidth + offsetX + traceGap + traceWidth) > fullLayout._size.w) {
2608626086
offsetX = 0;
@@ -26542,8 +26542,8 @@ exports.isReversed = function isReversed(legendLayout) {
2654226542
return (legendLayout.traceorder || '').indexOf('reversed') !== -1;
2654326543
};
2654426544

26545-
exports.isHorizontalColumn = function isHorizontalColumn(legendLayout) {
26546-
return legendLayout.horizontalspacing === 'column';
26545+
exports.isHorizontalWrapped = function isHorizontalWrapped(legendLayout) {
26546+
return legendLayout.horizontalspacing === 'wrapped';
2654726547
}
2654826548
},{}],105:[function(_dereq_,module,exports){
2654926549
/**

dist/plotly-finance.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-geo.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -26633,7 +26633,7 @@ function computeLegendDimensions(gd, groups, traces) {
2663326633
var opts = fullLayout.legend;
2663426634
var borderwidth = opts.borderwidth;
2663526635
var isGrouped = helpers.isGrouped(opts);
26636-
var isHorizontalColumn = helpers.isHorizontalColumn(opts);
26636+
var isHorizontalWrapped = helpers.isHorizontalWrapped(opts);
2663726637

2663826638
var extraWidth = 0;
2663926639

@@ -26757,11 +26757,11 @@ function computeLegendDimensions(gd, groups, traces) {
2675726757
});
2675826758

2675926759
// check if legend fits in one row
26760-
var oneRowLegend = !isHorizontalColumn || (fullLayout._size.w > borderwidth + fullTracesWidth - traceGap);
26760+
var oneRowLegend = fullLayout._size.w > borderwidth + fullTracesWidth - traceGap;
2676126761

2676226762
traces.each(function(d) {
2676326763
var legendItem = d[0];
26764-
var traceWidth = oneRowLegend ? 40 + d[0].width : maxTraceWidth;
26764+
var traceWidth = (oneRowLegend || isHorizontalWrapped) ? 40 + d[0].width : maxTraceWidth;
2676526765

2676626766
if((borderwidth + offsetX + traceGap + traceWidth) > fullLayout._size.w) {
2676726767
offsetX = 0;
@@ -27223,8 +27223,8 @@ exports.isReversed = function isReversed(legendLayout) {
2722327223
return (legendLayout.traceorder || '').indexOf('reversed') !== -1;
2722427224
};
2722527225

27226-
exports.isHorizontalColumn = function isHorizontalColumn(legendLayout) {
27227-
return legendLayout.horizontalspacing === 'column';
27226+
exports.isHorizontalWrapped = function isHorizontalWrapped(legendLayout) {
27227+
return legendLayout.horizontalspacing === 'wrapped';
2722827228
}
2722927229
},{}],100:[function(_dereq_,module,exports){
2723027230
/**

dist/plotly-geo.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-gl2d.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -59562,7 +59562,7 @@ function computeLegendDimensions(gd, groups, traces) {
5956259562
var opts = fullLayout.legend;
5956359563
var borderwidth = opts.borderwidth;
5956459564
var isGrouped = helpers.isGrouped(opts);
59565-
var isHorizontalColumn = helpers.isHorizontalColumn(opts);
59565+
var isHorizontalWrapped = helpers.isHorizontalWrapped(opts);
5956659566

5956759567
var extraWidth = 0;
5956859568

@@ -59686,11 +59686,11 @@ function computeLegendDimensions(gd, groups, traces) {
5968659686
});
5968759687

5968859688
// check if legend fits in one row
59689-
var oneRowLegend = !isHorizontalColumn || (fullLayout._size.w > borderwidth + fullTracesWidth - traceGap);
59689+
var oneRowLegend = fullLayout._size.w > borderwidth + fullTracesWidth - traceGap;
5969059690

5969159691
traces.each(function(d) {
5969259692
var legendItem = d[0];
59693-
var traceWidth = oneRowLegend ? 40 + d[0].width : maxTraceWidth;
59693+
var traceWidth = (oneRowLegend || isHorizontalWrapped) ? 40 + d[0].width : maxTraceWidth;
5969459694

5969559695
if((borderwidth + offsetX + traceGap + traceWidth) > fullLayout._size.w) {
5969659696
offsetX = 0;
@@ -60152,8 +60152,8 @@ exports.isReversed = function isReversed(legendLayout) {
6015260152
return (legendLayout.traceorder || '').indexOf('reversed') !== -1;
6015360153
};
6015460154

60155-
exports.isHorizontalColumn = function isHorizontalColumn(legendLayout) {
60156-
return legendLayout.horizontalspacing === 'column';
60155+
exports.isHorizontalWrapped = function isHorizontalWrapped(legendLayout) {
60156+
return legendLayout.horizontalspacing === 'wrapped';
6015760157
}
6015860158
},{}],379:[function(_dereq_,module,exports){
6015960159
/**

dist/plotly-gl2d.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-gl3d.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -66033,7 +66033,7 @@ function computeLegendDimensions(gd, groups, traces) {
6603366033
var opts = fullLayout.legend;
6603466034
var borderwidth = opts.borderwidth;
6603566035
var isGrouped = helpers.isGrouped(opts);
66036-
var isHorizontalColumn = helpers.isHorizontalColumn(opts);
66036+
var isHorizontalWrapped = helpers.isHorizontalWrapped(opts);
6603766037

6603866038
var extraWidth = 0;
6603966039

@@ -66157,11 +66157,11 @@ function computeLegendDimensions(gd, groups, traces) {
6615766157
});
6615866158

6615966159
// check if legend fits in one row
66160-
var oneRowLegend = !isHorizontalColumn || (fullLayout._size.w > borderwidth + fullTracesWidth - traceGap);
66160+
var oneRowLegend = fullLayout._size.w > borderwidth + fullTracesWidth - traceGap;
6616166161

6616266162
traces.each(function(d) {
6616366163
var legendItem = d[0];
66164-
var traceWidth = oneRowLegend ? 40 + d[0].width : maxTraceWidth;
66164+
var traceWidth = (oneRowLegend || isHorizontalWrapped) ? 40 + d[0].width : maxTraceWidth;
6616566165

6616666166
if((borderwidth + offsetX + traceGap + traceWidth) > fullLayout._size.w) {
6616766167
offsetX = 0;
@@ -66623,8 +66623,8 @@ exports.isReversed = function isReversed(legendLayout) {
6662366623
return (legendLayout.traceorder || '').indexOf('reversed') !== -1;
6662466624
};
6662566625

66626-
exports.isHorizontalColumn = function isHorizontalColumn(legendLayout) {
66627-
return legendLayout.horizontalspacing === 'column';
66626+
exports.isHorizontalWrapped = function isHorizontalWrapped(legendLayout) {
66627+
return legendLayout.horizontalspacing === 'wrapped';
6662866628
}
6662966629
},{}],433:[function(_dereq_,module,exports){
6663066630
/**

dist/plotly-gl3d.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-mapbox.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -28710,7 +28710,7 @@ function computeLegendDimensions(gd, groups, traces) {
2871028710
var opts = fullLayout.legend;
2871128711
var borderwidth = opts.borderwidth;
2871228712
var isGrouped = helpers.isGrouped(opts);
28713-
var isHorizontalColumn = helpers.isHorizontalColumn(opts);
28713+
var isHorizontalWrapped = helpers.isHorizontalWrapped(opts);
2871428714

2871528715
var extraWidth = 0;
2871628716

@@ -28834,11 +28834,11 @@ function computeLegendDimensions(gd, groups, traces) {
2883428834
});
2883528835

2883628836
// check if legend fits in one row
28837-
var oneRowLegend = !isHorizontalColumn || (fullLayout._size.w > borderwidth + fullTracesWidth - traceGap);
28837+
var oneRowLegend = fullLayout._size.w > borderwidth + fullTracesWidth - traceGap;
2883828838

2883928839
traces.each(function(d) {
2884028840
var legendItem = d[0];
28841-
var traceWidth = oneRowLegend ? 40 + d[0].width : maxTraceWidth;
28841+
var traceWidth = (oneRowLegend || isHorizontalWrapped) ? 40 + d[0].width : maxTraceWidth;
2884228842

2884328843
if((borderwidth + offsetX + traceGap + traceWidth) > fullLayout._size.w) {
2884428844
offsetX = 0;
@@ -29300,8 +29300,8 @@ exports.isReversed = function isReversed(legendLayout) {
2930029300
return (legendLayout.traceorder || '').indexOf('reversed') !== -1;
2930129301
};
2930229302

29303-
exports.isHorizontalColumn = function isHorizontalColumn(legendLayout) {
29304-
return legendLayout.horizontalspacing === 'column';
29303+
exports.isHorizontalWrapped = function isHorizontalWrapped(legendLayout) {
29304+
return legendLayout.horizontalspacing === 'wrapped';
2930529305
}
2930629306
},{}],106:[function(_dereq_,module,exports){
2930729307
/**

dist/plotly-mapbox.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-with-meta.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -96416,7 +96416,7 @@ function computeLegendDimensions(gd, groups, traces) {
9641696416
var opts = fullLayout.legend;
9641796417
var borderwidth = opts.borderwidth;
9641896418
var isGrouped = helpers.isGrouped(opts);
96419-
var isHorizontalColumn = helpers.isHorizontalColumn(opts);
96419+
var isHorizontalWrapped = helpers.isHorizontalWrapped(opts);
9642096420

9642196421
var extraWidth = 0;
9642296422

@@ -96540,11 +96540,11 @@ function computeLegendDimensions(gd, groups, traces) {
9654096540
});
9654196541

9654296542
// check if legend fits in one row
96543-
var oneRowLegend = !isHorizontalColumn || (fullLayout._size.w > borderwidth + fullTracesWidth - traceGap);
96543+
var oneRowLegend = fullLayout._size.w > borderwidth + fullTracesWidth - traceGap;
9654496544

9654596545
traces.each(function(d) {
9654696546
var legendItem = d[0];
96547-
var traceWidth = oneRowLegend ? 40 + d[0].width : maxTraceWidth;
96547+
var traceWidth = (oneRowLegend || isHorizontalWrapped) ? 40 + d[0].width : maxTraceWidth;
9654896548

9654996549
if((borderwidth + offsetX + traceGap + traceWidth) > fullLayout._size.w) {
9655096550
offsetX = 0;
@@ -97006,8 +97006,8 @@ exports.isReversed = function isReversed(legendLayout) {
9700697006
return (legendLayout.traceorder || '').indexOf('reversed') !== -1;
9700797007
};
9700897008

97009-
exports.isHorizontalColumn = function isHorizontalColumn(legendLayout) {
97010-
return legendLayout.horizontalspacing === 'column';
97009+
exports.isHorizontalWrapped = function isHorizontalWrapped(legendLayout) {
97010+
return legendLayout.horizontalspacing === 'wrapped';
9701197011
}
9701297012
},{}],649:[function(_dereq_,module,exports){
9701397013
/**

dist/plotly.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -43549,7 +43549,7 @@ var createShader = _dereq_('gl-shader')
4354943549

4355043550
var vertSrc = glslify(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n vec4 startPoint = project(position);\n vec4 endPoint = project(nextPosition);\n\n vec2 A = startPoint.xy / startPoint.w;\n vec2 B = endPoint.xy / endPoint.w;\n\n float clipAngle = atan(\n (B.y - A.y) * screenShape.y,\n (B.x - A.x) * screenShape.x\n );\n\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(\n sin(clipAngle),\n -cos(clipAngle)\n ) / screenShape;\n\n gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n"])
4355143551
var forwardFrag = glslify(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"])
43552-
var pickFrag = glslify(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\nlowp vec4 encode_float_1604150559(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, encode_float_1604150559(pixelArcLength).xyz);\n}"])
43552+
var pickFrag = glslify(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\nlowp vec4 encode_float_1540259130(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, encode_float_1540259130(pixelArcLength).xyz);\n}"])
4355343553

4355443554
var ATTRIBUTES = [
4355543555
{name: 'position', type: 'vec3'},
@@ -95823,7 +95823,7 @@ function computeLegendDimensions(gd, groups, traces) {
9582395823
var opts = fullLayout.legend;
9582495824
var borderwidth = opts.borderwidth;
9582595825
var isGrouped = helpers.isGrouped(opts);
95826-
var isHorizontalColumn = helpers.isHorizontalColumn(opts);
95826+
var isHorizontalWrapped = helpers.isHorizontalWrapped(opts);
9582795827

9582895828
var extraWidth = 0;
9582995829

@@ -95947,11 +95947,11 @@ function computeLegendDimensions(gd, groups, traces) {
9594795947
});
9594895948

9594995949
// check if legend fits in one row
95950-
var oneRowLegend = !isHorizontalColumn || (fullLayout._size.w > borderwidth + fullTracesWidth - traceGap);
95950+
var oneRowLegend = fullLayout._size.w > borderwidth + fullTracesWidth - traceGap;
9595195951

9595295952
traces.each(function(d) {
9595395953
var legendItem = d[0];
95954-
var traceWidth = oneRowLegend ? 40 + d[0].width : maxTraceWidth;
95954+
var traceWidth = (oneRowLegend || isHorizontalWrapped) ? 40 + d[0].width : maxTraceWidth;
9595595955

9595695956
if((borderwidth + offsetX + traceGap + traceWidth) > fullLayout._size.w) {
9595795957
offsetX = 0;
@@ -96413,8 +96413,8 @@ exports.isReversed = function isReversed(legendLayout) {
9641396413
return (legendLayout.traceorder || '').indexOf('reversed') !== -1;
9641496414
};
9641596415

96416-
exports.isHorizontalColumn = function isHorizontalColumn(legendLayout) {
96417-
return legendLayout.horizontalspacing === 'column';
96416+
exports.isHorizontalWrapped = function isHorizontalWrapped(legendLayout) {
96417+
return legendLayout.horizontalspacing === 'wrapped';
9641896418
}
9641996419
},{}],649:[function(_dereq_,module,exports){
9642096420
/**

dist/plotly.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)