Skip to content

Commit 915a52b

Browse files
committed
2.26.1
1 parent f138672 commit 915a52b

26 files changed

+361
-165
lines changed

dist/README.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ The main plotly.js bundles weight in at:
4646
| 8.2 MB | 3.4 MB | 1 MB | 8.4 MB |
4747

4848
#### CDN links
49-
> https://cdn.plot.ly/plotly-2.26.0.js
49+
> https://cdn.plot.ly/plotly-2.26.1.js
5050
51-
> https://cdn.plot.ly/plotly-2.26.0.min.js
51+
> https://cdn.plot.ly/plotly-2.26.1.min.js
5252
5353

5454
#### npm packages
@@ -91,12 +91,12 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`.
9191

9292
| Raw size | Minified size | Minified + gzip size |
9393
|------|-----------------|------------------------|
94-
| 2.6 MB | 973.8 kB | 325.6 kB |
94+
| 2.6 MB | 973.9 kB | 325.6 kB |
9595

9696
#### CDN links
97-
> https://cdn.plot.ly/plotly-basic-2.26.0.js
97+
> https://cdn.plot.ly/plotly-basic-2.26.1.js
9898
99-
> https://cdn.plot.ly/plotly-basic-2.26.0.min.js
99+
> https://cdn.plot.ly/plotly-basic-2.26.1.min.js
100100
101101

102102
#### npm packages
@@ -114,12 +114,12 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, `
114114

115115
| Raw size | Minified size | Minified + gzip size |
116116
|------|-----------------|------------------------|
117-
| 3.3 MB | 1.2 MB | 411.9 kB |
117+
| 3.3 MB | 1.2 MB | 412 kB |
118118

119119
#### CDN links
120-
> https://cdn.plot.ly/plotly-cartesian-2.26.0.js
120+
> https://cdn.plot.ly/plotly-cartesian-2.26.1.js
121121
122-
> https://cdn.plot.ly/plotly-cartesian-2.26.0.min.js
122+
> https://cdn.plot.ly/plotly-cartesian-2.26.1.min.js
123123
124124

125125
#### npm packages
@@ -140,9 +140,9 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca
140140
| 3.1 MB | 1.1 MB | 369.7 kB |
141141

142142
#### CDN links
143-
> https://cdn.plot.ly/plotly-geo-2.26.0.js
143+
> https://cdn.plot.ly/plotly-geo-2.26.1.js
144144
145-
> https://cdn.plot.ly/plotly-geo-2.26.0.min.js
145+
> https://cdn.plot.ly/plotly-geo-2.26.1.min.js
146146
147147

148148
#### npm packages
@@ -160,12 +160,12 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`,
160160

161161
| Raw size | Minified size | Minified + gzip size |
162162
|------|-----------------|------------------------|
163-
| 3.6 MB | 1.5 MB | 490.2 kB |
163+
| 3.6 MB | 1.5 MB | 490.3 kB |
164164

165165
#### CDN links
166-
> https://cdn.plot.ly/plotly-gl3d-2.26.0.js
166+
> https://cdn.plot.ly/plotly-gl3d-2.26.1.js
167167
168-
> https://cdn.plot.ly/plotly-gl3d-2.26.0.min.js
168+
> https://cdn.plot.ly/plotly-gl3d-2.26.1.min.js
169169
170170

171171
#### npm packages
@@ -183,12 +183,12 @@ The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `poin
183183

184184
| Raw size | Minified size | Minified + gzip size |
185185
|------|-----------------|------------------------|
186-
| 4.4 MB | 1.8 MB | 596.1 kB |
186+
| 4.4 MB | 1.8 MB | 596.2 kB |
187187

188188
#### CDN links
189-
> https://cdn.plot.ly/plotly-gl2d-2.26.0.js
189+
> https://cdn.plot.ly/plotly-gl2d-2.26.1.js
190190
191-
> https://cdn.plot.ly/plotly-gl2d-2.26.0.min.js
191+
> https://cdn.plot.ly/plotly-gl2d-2.26.1.min.js
192192
193193

194194
#### npm packages
@@ -206,12 +206,12 @@ The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitym
206206

207207
| Raw size | Minified size | Minified + gzip size |
208208
|------|-----------------|------------------------|
209-
| 4.4 MB | 1.7 MB | 526.8 kB |
209+
| 4.4 MB | 1.7 MB | 526.9 kB |
210210

211211
#### CDN links
212-
> https://cdn.plot.ly/plotly-mapbox-2.26.0.js
212+
> https://cdn.plot.ly/plotly-mapbox-2.26.1.js
213213
214-
> https://cdn.plot.ly/plotly-mapbox-2.26.0.min.js
214+
> https://cdn.plot.ly/plotly-mapbox-2.26.1.min.js
215215
216216

217217
#### npm packages
@@ -232,9 +232,9 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne
232232
| 2.8 MB | 1 MB | 354.4 kB |
233233

234234
#### CDN links
235-
> https://cdn.plot.ly/plotly-finance-2.26.0.js
235+
> https://cdn.plot.ly/plotly-finance-2.26.1.js
236236
237-
> https://cdn.plot.ly/plotly-finance-2.26.0.min.js
237+
> https://cdn.plot.ly/plotly-finance-2.26.1.min.js
238238
239239

240240
#### npm packages
@@ -255,9 +255,9 @@ The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `ca
255255
| 8.6 MB | 3.7 MB | 1.1 MB |
256256

257257
#### CDN links
258-
> https://cdn.plot.ly/plotly-strict-2.26.0.js
258+
> https://cdn.plot.ly/plotly-strict-2.26.1.js
259259
260-
> https://cdn.plot.ly/plotly-strict-2.26.0.min.js
260+
> https://cdn.plot.ly/plotly-strict-2.26.1.min.js
261261
262262

263263
#### npm packages

dist/plotly-basic.js

+30-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* plotly.js (basic) v2.26.0
2+
* plotly.js (basic) v2.26.1
33
* Copyright 2012-2023, Plotly, Inc.
44
* All rights reserved.
55
* Licensed under the MIT license
@@ -11204,6 +11204,23 @@ module.exports = function draw(gd, opts) {
1120411204
}
1120511205
}
1120611206
};
11207+
11208+
// After legend dimensions are calculated the title can be aligned horizontally left, center, right
11209+
function horizontalAlignTitle(titleEl, legendObj, bw) {
11210+
if (legendObj.title.side !== 'top center' && legendObj.title.side !== 'top right') return;
11211+
var font = legendObj.title.font;
11212+
var lineHeight = font.size * LINE_SPACING;
11213+
var titleOffset = 0;
11214+
var textNode = titleEl.node();
11215+
var width = Drawing.bBox(textNode).width; // width of the title text
11216+
11217+
if (legendObj.title.side === 'top center') {
11218+
titleOffset = 0.5 * (legendObj._width - 2 * bw - 2 * constants.titlePad - width);
11219+
} else if (legendObj.title.side === 'top right') {
11220+
titleOffset = legendObj._width - 2 * bw - 2 * constants.titlePad - width;
11221+
}
11222+
svgTextUtils.positionText(titleEl, bw + constants.titlePad + titleOffset, bw + lineHeight);
11223+
}
1120711224
function drawOne(gd, opts) {
1120811225
var legendObj = opts || {};
1120911226
var fullLayout = gd._fullLayout;
@@ -11280,8 +11297,9 @@ function drawOne(gd, opts) {
1128011297
var title = legendObj.title;
1128111298
legendObj._titleWidth = 0;
1128211299
legendObj._titleHeight = 0;
11300+
var titleEl;
1128311301
if (title.text) {
11284-
var titleEl = Lib.ensureSingle(scrollBox, 'text', legendId + 'titletext');
11302+
titleEl = Lib.ensureSingle(scrollBox, 'text', legendId + 'titletext');
1128511303
titleEl.attr('text-anchor', 'start').call(Drawing.font, title.font).text(title.text);
1128611304
textLayout(titleEl, scrollBox, gd, legendObj, MAIN_TITLE); // handle mathjax or multi-line text and compute title height
1128711305
} else {
@@ -11315,6 +11333,11 @@ function drawOne(gd, opts) {
1131511333
var bw = legendObj.borderwidth;
1131611334
var isPaperX = legendObj.xref === 'paper';
1131711335
var isPaperY = legendObj.yref === 'paper';
11336+
11337+
// re-calculate title position after legend width is derived. To allow for horizontal alignment
11338+
if (title.text) {
11339+
horizontalAlignTitle(titleEl, legendObj, bw);
11340+
}
1131811341
if (!inHover) {
1131911342
var lx, ly;
1132011343
if (isPaperX) {
@@ -11531,8 +11554,8 @@ function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {
1153111554
evtData.label = legendItem.datum()[0].label;
1153211555
}
1153311556
var clickVal = Events.triggerHandler(gd, 'plotly_legendclick', evtData);
11534-
if (clickVal === false) return;
1153511557
if (numClicks === 1) {
11558+
if (clickVal === false) return;
1153611559
legend._clickTimeout = setTimeout(function () {
1153711560
if (!gd._fullLayout) return;
1153811561
handleClick(legendItem, gd, numClicks);
@@ -11541,7 +11564,8 @@ function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {
1154111564
if (legend._clickTimeout) clearTimeout(legend._clickTimeout);
1154211565
gd._legendMouseDownTime = 0;
1154311566
var dblClickVal = Events.triggerHandler(gd, 'plotly_legenddoubleclick', evtData);
11544-
if (dblClickVal !== false) handleClick(legendItem, gd, numClicks);
11567+
// Activate default double click behaviour only when both single click and double click values are not false
11568+
if (dblClickVal !== false && clickVal !== false) handleClick(legendItem, gd, numClicks);
1154511569
}
1154611570
}
1154711571
function drawTexts(g, gd, legendObj) {
@@ -11693,16 +11717,11 @@ function computeTextDimensions(g, gd, legendObj, aTitle) {
1169311717
// approximation to height offset to center the font
1169411718
// to avoid getBoundingClientRect
1169511719
if (aTitle === MAIN_TITLE) {
11696-
var titleOffset = 0;
1169711720
if (legendObj.title.side === 'left') {
1169811721
// add extra space between legend title and itmes
1169911722
width += constants.itemGap * 2;
11700-
} else if (legendObj.title.side === 'top center') {
11701-
if (legendObj._width) titleOffset = 0.5 * (legendObj._width - 2 * bw - 2 * constants.titlePad - width);
11702-
} else if (legendObj.title.side === 'top right') {
11703-
if (legendObj._width) titleOffset = legendObj._width - 2 * bw - 2 * constants.titlePad - width;
1170411723
}
11705-
svgTextUtils.positionText(textEl, bw + constants.titlePad + titleOffset, bw + lineHeight);
11724+
svgTextUtils.positionText(textEl, bw + constants.titlePad, bw + lineHeight);
1170611725
} else {
1170711726
// legend item
1170811727
var x = constants.itemGap * 2 + legendObj.itemwidth;
@@ -60536,7 +60555,7 @@ function getSortFunc(opts, d2c) {
6053660555

6053760556

6053860557
// package version injected by `npm run preprocess`
60539-
exports.version = '2.26.0';
60558+
exports.version = '2.26.1';
6054060559

6054160560
/***/ }),
6054260561

dist/plotly-basic.min.js

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

dist/plotly-cartesian.js

+32-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* plotly.js (cartesian) v2.26.0
2+
* plotly.js (cartesian) v2.26.1
33
* Copyright 2012-2023, Plotly, Inc.
44
* All rights reserved.
55
* Licensed under the MIT license
@@ -11294,6 +11294,23 @@ module.exports = function draw(gd, opts) {
1129411294
}
1129511295
}
1129611296
};
11297+
11298+
// After legend dimensions are calculated the title can be aligned horizontally left, center, right
11299+
function horizontalAlignTitle(titleEl, legendObj, bw) {
11300+
if (legendObj.title.side !== 'top center' && legendObj.title.side !== 'top right') return;
11301+
var font = legendObj.title.font;
11302+
var lineHeight = font.size * LINE_SPACING;
11303+
var titleOffset = 0;
11304+
var textNode = titleEl.node();
11305+
var width = Drawing.bBox(textNode).width; // width of the title text
11306+
11307+
if (legendObj.title.side === 'top center') {
11308+
titleOffset = 0.5 * (legendObj._width - 2 * bw - 2 * constants.titlePad - width);
11309+
} else if (legendObj.title.side === 'top right') {
11310+
titleOffset = legendObj._width - 2 * bw - 2 * constants.titlePad - width;
11311+
}
11312+
svgTextUtils.positionText(titleEl, bw + constants.titlePad + titleOffset, bw + lineHeight);
11313+
}
1129711314
function drawOne(gd, opts) {
1129811315
var legendObj = opts || {};
1129911316
var fullLayout = gd._fullLayout;
@@ -11370,8 +11387,9 @@ function drawOne(gd, opts) {
1137011387
var title = legendObj.title;
1137111388
legendObj._titleWidth = 0;
1137211389
legendObj._titleHeight = 0;
11390+
var titleEl;
1137311391
if (title.text) {
11374-
var titleEl = Lib.ensureSingle(scrollBox, 'text', legendId + 'titletext');
11392+
titleEl = Lib.ensureSingle(scrollBox, 'text', legendId + 'titletext');
1137511393
titleEl.attr('text-anchor', 'start').call(Drawing.font, title.font).text(title.text);
1137611394
textLayout(titleEl, scrollBox, gd, legendObj, MAIN_TITLE); // handle mathjax or multi-line text and compute title height
1137711395
} else {
@@ -11405,6 +11423,11 @@ function drawOne(gd, opts) {
1140511423
var bw = legendObj.borderwidth;
1140611424
var isPaperX = legendObj.xref === 'paper';
1140711425
var isPaperY = legendObj.yref === 'paper';
11426+
11427+
// re-calculate title position after legend width is derived. To allow for horizontal alignment
11428+
if (title.text) {
11429+
horizontalAlignTitle(titleEl, legendObj, bw);
11430+
}
1140811431
if (!inHover) {
1140911432
var lx, ly;
1141011433
if (isPaperX) {
@@ -11621,8 +11644,8 @@ function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {
1162111644
evtData.label = legendItem.datum()[0].label;
1162211645
}
1162311646
var clickVal = Events.triggerHandler(gd, 'plotly_legendclick', evtData);
11624-
if (clickVal === false) return;
1162511647
if (numClicks === 1) {
11648+
if (clickVal === false) return;
1162611649
legend._clickTimeout = setTimeout(function () {
1162711650
if (!gd._fullLayout) return;
1162811651
handleClick(legendItem, gd, numClicks);
@@ -11631,7 +11654,8 @@ function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {
1163111654
if (legend._clickTimeout) clearTimeout(legend._clickTimeout);
1163211655
gd._legendMouseDownTime = 0;
1163311656
var dblClickVal = Events.triggerHandler(gd, 'plotly_legenddoubleclick', evtData);
11634-
if (dblClickVal !== false) handleClick(legendItem, gd, numClicks);
11657+
// Activate default double click behaviour only when both single click and double click values are not false
11658+
if (dblClickVal !== false && clickVal !== false) handleClick(legendItem, gd, numClicks);
1163511659
}
1163611660
}
1163711661
function drawTexts(g, gd, legendObj) {
@@ -11783,16 +11807,11 @@ function computeTextDimensions(g, gd, legendObj, aTitle) {
1178311807
// approximation to height offset to center the font
1178411808
// to avoid getBoundingClientRect
1178511809
if (aTitle === MAIN_TITLE) {
11786-
var titleOffset = 0;
1178711810
if (legendObj.title.side === 'left') {
1178811811
// add extra space between legend title and itmes
1178911812
width += constants.itemGap * 2;
11790-
} else if (legendObj.title.side === 'top center') {
11791-
if (legendObj._width) titleOffset = 0.5 * (legendObj._width - 2 * bw - 2 * constants.titlePad - width);
11792-
} else if (legendObj.title.side === 'top right') {
11793-
if (legendObj._width) titleOffset = legendObj._width - 2 * bw - 2 * constants.titlePad - width;
1179411813
}
11795-
svgTextUtils.positionText(textEl, bw + constants.titlePad + titleOffset, bw + lineHeight);
11814+
svgTextUtils.positionText(textEl, bw + constants.titlePad, bw + lineHeight);
1179611815
} else {
1179711816
// legend item
1179811817
var x = constants.itemGap * 2 + legendObj.itemwidth;
@@ -62258,7 +62277,8 @@ function calcAllAutoBins(gd, trace, pa, mainData, _overlayEdgeCase) {
6225862277

6225962278
// Edge case: single-valued histogram overlaying others
6226062279
// Use them all together to calculate the bin size for the single-valued one
62261-
if (isOverlay && !Registry.traceIs(trace, '2dMap') && newBinSpec._dataSpan === 0 && pa.type !== 'category' && pa.type !== 'multicategory') {
62280+
// Don't re-calculate bin width if user manually specified it (checing in bingroup=='' or xbins is defined)
62281+
if (isOverlay && !Registry.traceIs(trace, '2dMap') && newBinSpec._dataSpan === 0 && pa.type !== 'category' && pa.type !== 'multicategory' && trace.bingroup === '' && typeof trace.xbins === 'undefined') {
6226262282
// Several single-valued histograms! Stop infinite recursion,
6226362283
// just return an extra flag that tells handleSingleValueOverlays
6226462284
// to sort out this trace too
@@ -70977,7 +70997,7 @@ function getSortFunc(opts, d2c) {
7097770997

7097870998

7097970999
// package version injected by `npm run preprocess`
70980-
exports.version = '2.26.0';
71000+
exports.version = '2.26.1';
7098171001

7098271002
/***/ }),
7098371003

dist/plotly-cartesian.min.js

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

0 commit comments

Comments
 (0)