Skip to content

Commit

Permalink
2.26.1
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Sep 22, 2023
1 parent f138672 commit 915a52b
Show file tree
Hide file tree
Showing 26 changed files with 361 additions and 165 deletions.
46 changes: 23 additions & 23 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ The main plotly.js bundles weight in at:
| 8.2 MB | 3.4 MB | 1 MB | 8.4 MB |

#### CDN links
> https://cdn.plot.ly/plotly-2.26.0.js
> https://cdn.plot.ly/plotly-2.26.1.js
> https://cdn.plot.ly/plotly-2.26.0.min.js
> https://cdn.plot.ly/plotly-2.26.1.min.js

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 2.6 MB | 973.8 kB | 325.6 kB |
| 2.6 MB | 973.9 kB | 325.6 kB |

#### CDN links
> https://cdn.plot.ly/plotly-basic-2.26.0.js
> https://cdn.plot.ly/plotly-basic-2.26.1.js
> https://cdn.plot.ly/plotly-basic-2.26.0.min.js
> https://cdn.plot.ly/plotly-basic-2.26.1.min.js

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 3.3 MB | 1.2 MB | 411.9 kB |
| 3.3 MB | 1.2 MB | 412 kB |

#### CDN links
> https://cdn.plot.ly/plotly-cartesian-2.26.0.js
> https://cdn.plot.ly/plotly-cartesian-2.26.1.js
> https://cdn.plot.ly/plotly-cartesian-2.26.0.min.js
> https://cdn.plot.ly/plotly-cartesian-2.26.1.min.js

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

#### CDN links
> https://cdn.plot.ly/plotly-geo-2.26.0.js
> https://cdn.plot.ly/plotly-geo-2.26.1.js
> https://cdn.plot.ly/plotly-geo-2.26.0.min.js
> https://cdn.plot.ly/plotly-geo-2.26.1.min.js

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 3.6 MB | 1.5 MB | 490.2 kB |
| 3.6 MB | 1.5 MB | 490.3 kB |

#### CDN links
> https://cdn.plot.ly/plotly-gl3d-2.26.0.js
> https://cdn.plot.ly/plotly-gl3d-2.26.1.js
> https://cdn.plot.ly/plotly-gl3d-2.26.0.min.js
> https://cdn.plot.ly/plotly-gl3d-2.26.1.min.js

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 4.4 MB | 1.8 MB | 596.1 kB |
| 4.4 MB | 1.8 MB | 596.2 kB |

#### CDN links
> https://cdn.plot.ly/plotly-gl2d-2.26.0.js
> https://cdn.plot.ly/plotly-gl2d-2.26.1.js
> https://cdn.plot.ly/plotly-gl2d-2.26.0.min.js
> https://cdn.plot.ly/plotly-gl2d-2.26.1.min.js

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 4.4 MB | 1.7 MB | 526.8 kB |
| 4.4 MB | 1.7 MB | 526.9 kB |

#### CDN links
> https://cdn.plot.ly/plotly-mapbox-2.26.0.js
> https://cdn.plot.ly/plotly-mapbox-2.26.1.js
> https://cdn.plot.ly/plotly-mapbox-2.26.0.min.js
> https://cdn.plot.ly/plotly-mapbox-2.26.1.min.js

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

#### CDN links
> https://cdn.plot.ly/plotly-finance-2.26.0.js
> https://cdn.plot.ly/plotly-finance-2.26.1.js
> https://cdn.plot.ly/plotly-finance-2.26.0.min.js
> https://cdn.plot.ly/plotly-finance-2.26.1.min.js

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

#### CDN links
> https://cdn.plot.ly/plotly-strict-2.26.0.js
> https://cdn.plot.ly/plotly-strict-2.26.1.js
> https://cdn.plot.ly/plotly-strict-2.26.0.min.js
> https://cdn.plot.ly/plotly-strict-2.26.1.min.js

#### npm packages
Expand Down
41 changes: 30 additions & 11 deletions dist/plotly-basic.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* plotly.js (basic) v2.26.0
* plotly.js (basic) v2.26.1
* Copyright 2012-2023, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
Expand Down Expand Up @@ -11204,6 +11204,23 @@ module.exports = function draw(gd, opts) {
}
}
};

// After legend dimensions are calculated the title can be aligned horizontally left, center, right
function horizontalAlignTitle(titleEl, legendObj, bw) {
if (legendObj.title.side !== 'top center' && legendObj.title.side !== 'top right') return;
var font = legendObj.title.font;
var lineHeight = font.size * LINE_SPACING;
var titleOffset = 0;
var textNode = titleEl.node();
var width = Drawing.bBox(textNode).width; // width of the title text

if (legendObj.title.side === 'top center') {
titleOffset = 0.5 * (legendObj._width - 2 * bw - 2 * constants.titlePad - width);
} else if (legendObj.title.side === 'top right') {
titleOffset = legendObj._width - 2 * bw - 2 * constants.titlePad - width;
}
svgTextUtils.positionText(titleEl, bw + constants.titlePad + titleOffset, bw + lineHeight);
}
function drawOne(gd, opts) {
var legendObj = opts || {};
var fullLayout = gd._fullLayout;
Expand Down Expand Up @@ -11280,8 +11297,9 @@ function drawOne(gd, opts) {
var title = legendObj.title;
legendObj._titleWidth = 0;
legendObj._titleHeight = 0;
var titleEl;
if (title.text) {
var titleEl = Lib.ensureSingle(scrollBox, 'text', legendId + 'titletext');
titleEl = Lib.ensureSingle(scrollBox, 'text', legendId + 'titletext');
titleEl.attr('text-anchor', 'start').call(Drawing.font, title.font).text(title.text);
textLayout(titleEl, scrollBox, gd, legendObj, MAIN_TITLE); // handle mathjax or multi-line text and compute title height
} else {
Expand Down Expand Up @@ -11315,6 +11333,11 @@ function drawOne(gd, opts) {
var bw = legendObj.borderwidth;
var isPaperX = legendObj.xref === 'paper';
var isPaperY = legendObj.yref === 'paper';

// re-calculate title position after legend width is derived. To allow for horizontal alignment
if (title.text) {
horizontalAlignTitle(titleEl, legendObj, bw);
}
if (!inHover) {
var lx, ly;
if (isPaperX) {
Expand Down Expand Up @@ -11531,8 +11554,8 @@ function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {
evtData.label = legendItem.datum()[0].label;
}
var clickVal = Events.triggerHandler(gd, 'plotly_legendclick', evtData);
if (clickVal === false) return;
if (numClicks === 1) {
if (clickVal === false) return;
legend._clickTimeout = setTimeout(function () {
if (!gd._fullLayout) return;
handleClick(legendItem, gd, numClicks);
Expand All @@ -11541,7 +11564,8 @@ function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {
if (legend._clickTimeout) clearTimeout(legend._clickTimeout);
gd._legendMouseDownTime = 0;
var dblClickVal = Events.triggerHandler(gd, 'plotly_legenddoubleclick', evtData);
if (dblClickVal !== false) handleClick(legendItem, gd, numClicks);
// Activate default double click behaviour only when both single click and double click values are not false
if (dblClickVal !== false && clickVal !== false) handleClick(legendItem, gd, numClicks);
}
}
function drawTexts(g, gd, legendObj) {
Expand Down Expand Up @@ -11693,16 +11717,11 @@ function computeTextDimensions(g, gd, legendObj, aTitle) {
// approximation to height offset to center the font
// to avoid getBoundingClientRect
if (aTitle === MAIN_TITLE) {
var titleOffset = 0;
if (legendObj.title.side === 'left') {
// add extra space between legend title and itmes
width += constants.itemGap * 2;
} else if (legendObj.title.side === 'top center') {
if (legendObj._width) titleOffset = 0.5 * (legendObj._width - 2 * bw - 2 * constants.titlePad - width);
} else if (legendObj.title.side === 'top right') {
if (legendObj._width) titleOffset = legendObj._width - 2 * bw - 2 * constants.titlePad - width;
}
svgTextUtils.positionText(textEl, bw + constants.titlePad + titleOffset, bw + lineHeight);
svgTextUtils.positionText(textEl, bw + constants.titlePad, bw + lineHeight);
} else {
// legend item
var x = constants.itemGap * 2 + legendObj.itemwidth;
Expand Down Expand Up @@ -60536,7 +60555,7 @@ function getSortFunc(opts, d2c) {


// package version injected by `npm run preprocess`
exports.version = '2.26.0';
exports.version = '2.26.1';

/***/ }),

Expand Down
4 changes: 2 additions & 2 deletions dist/plotly-basic.min.js

Large diffs are not rendered by default.

44 changes: 32 additions & 12 deletions dist/plotly-cartesian.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* plotly.js (cartesian) v2.26.0
* plotly.js (cartesian) v2.26.1
* Copyright 2012-2023, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
Expand Down Expand Up @@ -11294,6 +11294,23 @@ module.exports = function draw(gd, opts) {
}
}
};

// After legend dimensions are calculated the title can be aligned horizontally left, center, right
function horizontalAlignTitle(titleEl, legendObj, bw) {
if (legendObj.title.side !== 'top center' && legendObj.title.side !== 'top right') return;
var font = legendObj.title.font;
var lineHeight = font.size * LINE_SPACING;
var titleOffset = 0;
var textNode = titleEl.node();
var width = Drawing.bBox(textNode).width; // width of the title text

if (legendObj.title.side === 'top center') {
titleOffset = 0.5 * (legendObj._width - 2 * bw - 2 * constants.titlePad - width);
} else if (legendObj.title.side === 'top right') {
titleOffset = legendObj._width - 2 * bw - 2 * constants.titlePad - width;
}
svgTextUtils.positionText(titleEl, bw + constants.titlePad + titleOffset, bw + lineHeight);
}
function drawOne(gd, opts) {
var legendObj = opts || {};
var fullLayout = gd._fullLayout;
Expand Down Expand Up @@ -11370,8 +11387,9 @@ function drawOne(gd, opts) {
var title = legendObj.title;
legendObj._titleWidth = 0;
legendObj._titleHeight = 0;
var titleEl;
if (title.text) {
var titleEl = Lib.ensureSingle(scrollBox, 'text', legendId + 'titletext');
titleEl = Lib.ensureSingle(scrollBox, 'text', legendId + 'titletext');
titleEl.attr('text-anchor', 'start').call(Drawing.font, title.font).text(title.text);
textLayout(titleEl, scrollBox, gd, legendObj, MAIN_TITLE); // handle mathjax or multi-line text and compute title height
} else {
Expand Down Expand Up @@ -11405,6 +11423,11 @@ function drawOne(gd, opts) {
var bw = legendObj.borderwidth;
var isPaperX = legendObj.xref === 'paper';
var isPaperY = legendObj.yref === 'paper';

// re-calculate title position after legend width is derived. To allow for horizontal alignment
if (title.text) {
horizontalAlignTitle(titleEl, legendObj, bw);
}
if (!inHover) {
var lx, ly;
if (isPaperX) {
Expand Down Expand Up @@ -11621,8 +11644,8 @@ function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {
evtData.label = legendItem.datum()[0].label;
}
var clickVal = Events.triggerHandler(gd, 'plotly_legendclick', evtData);
if (clickVal === false) return;
if (numClicks === 1) {
if (clickVal === false) return;
legend._clickTimeout = setTimeout(function () {
if (!gd._fullLayout) return;
handleClick(legendItem, gd, numClicks);
Expand All @@ -11631,7 +11654,8 @@ function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {
if (legend._clickTimeout) clearTimeout(legend._clickTimeout);
gd._legendMouseDownTime = 0;
var dblClickVal = Events.triggerHandler(gd, 'plotly_legenddoubleclick', evtData);
if (dblClickVal !== false) handleClick(legendItem, gd, numClicks);
// Activate default double click behaviour only when both single click and double click values are not false
if (dblClickVal !== false && clickVal !== false) handleClick(legendItem, gd, numClicks);
}
}
function drawTexts(g, gd, legendObj) {
Expand Down Expand Up @@ -11783,16 +11807,11 @@ function computeTextDimensions(g, gd, legendObj, aTitle) {
// approximation to height offset to center the font
// to avoid getBoundingClientRect
if (aTitle === MAIN_TITLE) {
var titleOffset = 0;
if (legendObj.title.side === 'left') {
// add extra space between legend title and itmes
width += constants.itemGap * 2;
} else if (legendObj.title.side === 'top center') {
if (legendObj._width) titleOffset = 0.5 * (legendObj._width - 2 * bw - 2 * constants.titlePad - width);
} else if (legendObj.title.side === 'top right') {
if (legendObj._width) titleOffset = legendObj._width - 2 * bw - 2 * constants.titlePad - width;
}
svgTextUtils.positionText(textEl, bw + constants.titlePad + titleOffset, bw + lineHeight);
svgTextUtils.positionText(textEl, bw + constants.titlePad, bw + lineHeight);
} else {
// legend item
var x = constants.itemGap * 2 + legendObj.itemwidth;
Expand Down Expand Up @@ -62258,7 +62277,8 @@ function calcAllAutoBins(gd, trace, pa, mainData, _overlayEdgeCase) {

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


// package version injected by `npm run preprocess`
exports.version = '2.26.0';
exports.version = '2.26.1';

/***/ }),

Expand Down
4 changes: 2 additions & 2 deletions dist/plotly-cartesian.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 915a52b

Please sign in to comment.