Skip to content

Commit 0e5fcf7

Browse files
committed
fix postings line legend spacing issue + build dist files
1 parent fa73561 commit 0e5fcf7

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

dist/plotly.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -98939,6 +98939,7 @@ module.exports = function style(s, gd, legend) {
9893998939
if(!legend) legend = fullLayout.legend;
9894098940
var constantItemSizing = legend.itemsizing === 'constant';
9894198941
var itemWidth = legend.itemwidth;
98942+
var itemWidthCustom = itemWidth - 10;
9894298943
var centerPos = (itemWidth + constants.itemGap * 2) / 2;
9894398944
var centerTransform = strTranslate(centerPos, 0);
9894498945

@@ -99072,7 +99073,7 @@ module.exports = function style(s, gd, legend) {
9907299073
.data(showFill || showGradientFill ? [d] : []);
9907399074
fill.enter().append('path').classed('js-fill', true);
9907499075
fill.exit().remove();
99075-
fill.attr('d', pathStart + 'h' + itemWidth + 'v6h-' + itemWidth + 'z')
99076+
fill.attr('d', pathStart + 'h' + itemWidthCustom + 'v6h-' + itemWidthCustom + 'z')
9907699077
.call(showFill ? Drawing.fillGroupStyle : fillGradient);
9907799078

9907899079
if(showLine || showGradientLine) {
@@ -99092,7 +99093,7 @@ module.exports = function style(s, gd, legend) {
9909299093
// though there *is* no vertical variation in this case.
9909399094
// so add an invisibly small angle to the line
9909499095
// This issue (and workaround) exist across (Mac) Chrome, FF, and Safari
99095-
line.attr('d', pathStart + (showGradientLine ? 'l' + itemWidth + ',0.0001' : 'h' + itemWidth))
99096+
line.attr('d', pathStart + (showGradientLine ? 'l' + itemWidthCustom + ',0.0001' : 'h' + itemWidthCustom))
9909699097
.call(showLine ? Drawing.lineGroupStyle : lineGradient);
9909799098
}
9909899099

dist/plotly.min.js

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

src/components/legend/style.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module.exports = function style(s, gd, legend) {
3434
if(!legend) legend = fullLayout.legend;
3535
var constantItemSizing = legend.itemsizing === 'constant';
3636
var itemWidth = legend.itemwidth;
37+
var itemWidthCustom = itemWidth - 10;
3738
var centerPos = (itemWidth + constants.itemGap * 2) / 2;
3839
var centerTransform = strTranslate(centerPos, 0);
3940

@@ -167,7 +168,7 @@ module.exports = function style(s, gd, legend) {
167168
.data(showFill || showGradientFill ? [d] : []);
168169
fill.enter().append('path').classed('js-fill', true);
169170
fill.exit().remove();
170-
fill.attr('d', pathStart + 'h' + itemWidth + 'v6h-' + itemWidth + 'z')
171+
fill.attr('d', pathStart + 'h' + itemWidthCustom + 'v6h-' + itemWidthCustom + 'z')
171172
.call(showFill ? Drawing.fillGroupStyle : fillGradient);
172173

173174
if(showLine || showGradientLine) {
@@ -187,7 +188,7 @@ module.exports = function style(s, gd, legend) {
187188
// though there *is* no vertical variation in this case.
188189
// so add an invisibly small angle to the line
189190
// This issue (and workaround) exist across (Mac) Chrome, FF, and Safari
190-
line.attr('d', pathStart + (showGradientLine ? 'l' + itemWidth + ',0.0001' : 'h' + itemWidth))
191+
line.attr('d', pathStart + (showGradientLine ? 'l' + itemWidthCustom + ',0.0001' : 'h' + itemWidthCustom))
191192
.call(showLine ? Drawing.lineGroupStyle : lineGradient);
192193
}
193194

0 commit comments

Comments
 (0)