Skip to content

Commit bcf05db

Browse files
committed
1.45.1
1 parent aaa6e63 commit bcf05db

23 files changed

+3777
-3954
lines changed

dist/README.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ object. This property must be set before the plotly.js script tag, for example:
5151
Plotly.js defaults to US English (en-US) and includes British English (en) in the standard bundle.
5252
Many other localizations are available - here is an example using Swiss-German (de-CH),
5353
see the contents of this directory for the full list.
54-
They are also available on our CDN as https://cdn.plot.ly/plotly-locale-de-ch-latest.js OR https://cdn.plot.ly/plotly-locale-de-ch-1.45.0.js
54+
They are also available on our CDN as https://cdn.plot.ly/plotly-locale-de-ch-latest.js OR https://cdn.plot.ly/plotly-locale-de-ch-1.45.1.js
5555
Note that the file names are all lowercase, even though the region is uppercase when you apply a locale.
5656

5757
*After* the plotly.js script tag, add:
@@ -74,12 +74,12 @@ The main plotly.js bundle includes all the official (non-beta) trace modules.
7474

7575
It be can imported as minified javascript
7676
- using dist file `dist/plotly.min.js`
77-
- using CDN URL https://cdn.plot.ly/plotly-latest.min.js OR https://cdn.plot.ly/plotly-1.45.0.min.js
77+
- using CDN URL https://cdn.plot.ly/plotly-latest.min.js OR https://cdn.plot.ly/plotly-1.45.1.min.js
7878

7979
or as raw javascript:
8080
- using the `plotly.js-dist` npm package (starting in `v1.39.0`)
8181
- using dist file `dist/plotly.js`
82-
- using CDN URL https://cdn.plot.ly/plotly-latest.js OR https://cdn.plot.ly/plotly-1.45.0.js
82+
- using CDN URL https://cdn.plot.ly/plotly-latest.js OR https://cdn.plot.ly/plotly-1.45.1.js
8383
- using CommonJS with `require('plotly.js')`
8484

8585
If you would like to have access to the attribute meta information (including attribute descriptions as on the [schema reference page](https://plot.ly/javascript/reference/)), use dist file `dist/plotly-with-meta.js`
@@ -88,7 +88,7 @@ The main plotly.js bundle weights in at:
8888

8989
| plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js |
9090
|-----------|---------------|----------------------|---------------------|
91-
| 6.2 MB | 2.9 MB | 866.6 kB | 6.5 MB |
91+
| 6.2 MB | 2.9 MB | 865.3 kB | 6.5 MB |
9292

9393
## Partial bundles
9494

@@ -111,16 +111,16 @@ The `basic` partial bundle contains trace modules `scatter`, `bar` and `pie`.
111111

112112
| Raw size | Minified size | Minified + gzip size |
113113
|------|-----------------|------------------------|
114-
| 2.3 MB | 816.8 kB | 266.8 kB |
114+
| 2.3 MB | 817.1 kB | 267 kB |
115115

116116
#### CDN links
117117

118118
| Flavor | URL |
119119
| ------ | --- |
120120
| Latest | https://cdn.plot.ly/plotly-basic-latest.js |
121121
| Latest minified | https://cdn.plot.ly/plotly-basic-latest.min.js |
122-
| Tagged | https://cdn.plot.ly/plotly-basic-1.45.0.js |
123-
| Tagged minified | https://cdn.plot.ly/plotly-basic-1.45.0.min.js |
122+
| Tagged | https://cdn.plot.ly/plotly-basic-1.45.1.js |
123+
| Tagged minified | https://cdn.plot.ly/plotly-basic-1.45.1.min.js |
124124

125125
#### npm package (starting in `v1.39.0`)
126126

@@ -157,16 +157,16 @@ The `cartesian` partial bundle contains trace modules `scatter`, `bar`, `box`, `
157157

158158
| Raw size | Minified size | Minified + gzip size |
159159
|------|-----------------|------------------------|
160-
| 2.6 MB | 932.3 kB | 303.2 kB |
160+
| 2.6 MB | 932.7 kB | 303.4 kB |
161161

162162
#### CDN links
163163

164164
| Flavor | URL |
165165
| ------ | --- |
166166
| Latest | https://cdn.plot.ly/plotly-cartesian-latest.js |
167167
| Latest minified | https://cdn.plot.ly/plotly-cartesian-latest.min.js |
168-
| Tagged | https://cdn.plot.ly/plotly-cartesian-1.45.0.js |
169-
| Tagged minified | https://cdn.plot.ly/plotly-cartesian-1.45.0.min.js |
168+
| Tagged | https://cdn.plot.ly/plotly-cartesian-1.45.1.js |
169+
| Tagged minified | https://cdn.plot.ly/plotly-cartesian-1.45.1.min.js |
170170

171171
#### npm package (starting in `v1.39.0`)
172172

@@ -203,16 +203,16 @@ The `geo` partial bundle contains trace modules `scatter`, `scattergeo` and `cho
203203

204204
| Raw size | Minified size | Minified + gzip size |
205205
|------|-----------------|------------------------|
206-
| 2.3 MB | 834 kB | 274.5 kB |
206+
| 2.3 MB | 834.4 kB | 274.8 kB |
207207

208208
#### CDN links
209209

210210
| Flavor | URL |
211211
| ------ | --- |
212212
| Latest | https://cdn.plot.ly/plotly-geo-latest.js |
213213
| Latest minified | https://cdn.plot.ly/plotly-geo-latest.min.js |
214-
| Tagged | https://cdn.plot.ly/plotly-geo-1.45.0.js |
215-
| Tagged minified | https://cdn.plot.ly/plotly-geo-1.45.0.min.js |
214+
| Tagged | https://cdn.plot.ly/plotly-geo-1.45.1.js |
215+
| Tagged minified | https://cdn.plot.ly/plotly-geo-1.45.1.min.js |
216216

217217
#### npm package (starting in `v1.39.0`)
218218

@@ -249,16 +249,16 @@ The `gl3d` partial bundle contains trace modules `scatter`, `scatter3d`, `surfac
249249

250250
| Raw size | Minified size | Minified + gzip size |
251251
|------|-----------------|------------------------|
252-
| 3.4 MB | 1.3 MB | 426.8 kB |
252+
| 3.4 MB | 1.3 MB | 425.5 kB |
253253

254254
#### CDN links
255255

256256
| Flavor | URL |
257257
| ------ | --- |
258258
| Latest | https://cdn.plot.ly/plotly-gl3d-latest.js |
259259
| Latest minified | https://cdn.plot.ly/plotly-gl3d-latest.min.js |
260-
| Tagged | https://cdn.plot.ly/plotly-gl3d-1.45.0.js |
261-
| Tagged minified | https://cdn.plot.ly/plotly-gl3d-1.45.0.min.js |
260+
| Tagged | https://cdn.plot.ly/plotly-gl3d-1.45.1.js |
261+
| Tagged minified | https://cdn.plot.ly/plotly-gl3d-1.45.1.min.js |
262262

263263
#### npm package (starting in `v1.39.0`)
264264

@@ -295,16 +295,16 @@ The `gl2d` partial bundle contains trace modules `scatter`, `scattergl`, `splom`
295295

296296
| Raw size | Minified size | Minified + gzip size |
297297
|------|-----------------|------------------------|
298-
| 3.4 MB | 1.4 MB | 444.3 kB |
298+
| 3.4 MB | 1.4 MB | 444.6 kB |
299299

300300
#### CDN links
301301

302302
| Flavor | URL |
303303
| ------ | --- |
304304
| Latest | https://cdn.plot.ly/plotly-gl2d-latest.js |
305305
| Latest minified | https://cdn.plot.ly/plotly-gl2d-latest.min.js |
306-
| Tagged | https://cdn.plot.ly/plotly-gl2d-1.45.0.js |
307-
| Tagged minified | https://cdn.plot.ly/plotly-gl2d-1.45.0.min.js |
306+
| Tagged | https://cdn.plot.ly/plotly-gl2d-1.45.1.js |
307+
| Tagged minified | https://cdn.plot.ly/plotly-gl2d-1.45.1.min.js |
308308

309309
#### npm package (starting in `v1.39.0`)
310310

@@ -341,16 +341,16 @@ The `mapbox` partial bundle contains trace modules `scatter` and `scattermapbox`
341341

342342
| Raw size | Minified size | Minified + gzip size |
343343
|------|-----------------|------------------------|
344-
| 2.8 MB | 1.4 MB | 412.5 kB |
344+
| 2.8 MB | 1.4 MB | 412.7 kB |
345345

346346
#### CDN links
347347

348348
| Flavor | URL |
349349
| ------ | --- |
350350
| Latest | https://cdn.plot.ly/plotly-mapbox-latest.js |
351351
| Latest minified | https://cdn.plot.ly/plotly-mapbox-latest.min.js |
352-
| Tagged | https://cdn.plot.ly/plotly-mapbox-1.45.0.js |
353-
| Tagged minified | https://cdn.plot.ly/plotly-mapbox-1.45.0.min.js |
352+
| Tagged | https://cdn.plot.ly/plotly-mapbox-1.45.1.js |
353+
| Tagged minified | https://cdn.plot.ly/plotly-mapbox-1.45.1.min.js |
354354

355355
#### npm package (starting in `v1.39.0`)
356356

@@ -387,16 +387,16 @@ The `finance` partial bundle contains trace modules `scatter`, `bar`, `histogram
387387

388388
| Raw size | Minified size | Minified + gzip size |
389389
|------|-----------------|------------------------|
390-
| 2.4 MB | 850.3 kB | 277.1 kB |
390+
| 2.4 MB | 850.7 kB | 277.3 kB |
391391

392392
#### CDN links
393393

394394
| Flavor | URL |
395395
| ------ | --- |
396396
| Latest | https://cdn.plot.ly/plotly-finance-latest.js |
397397
| Latest minified | https://cdn.plot.ly/plotly-finance-latest.min.js |
398-
| Tagged | https://cdn.plot.ly/plotly-finance-1.45.0.js |
399-
| Tagged minified | https://cdn.plot.ly/plotly-finance-1.45.0.min.js |
398+
| Tagged | https://cdn.plot.ly/plotly-finance-1.45.1.js |
399+
| Tagged minified | https://cdn.plot.ly/plotly-finance-1.45.1.min.js |
400400

401401
#### npm package (starting in `v1.39.0`)
402402

dist/plotly-basic.js

+67-37
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* plotly.js (basic) v1.45.0
2+
* plotly.js (basic) v1.45.1
33
* Copyright 2012-2019, Plotly, Inc.
44
* All rights reserved.
55
* Licensed under the MIT license
@@ -23149,13 +23149,15 @@ function createHoverText(hoverData, opts, gd) {
2314923149
}
2315023150

2315123151
// hovertemplate
23152+
var d3locale = gd._fullLayout._d3locale;
2315223153
var hovertemplate = d.hovertemplate || false;
2315323154
var hovertemplateLabels = d.hovertemplateLabels || d;
2315423155
var eventData = d.eventData[0] || {};
2315523156
if(hovertemplate) {
2315623157
text = Lib.hovertemplateString(
2315723158
hovertemplate,
2315823159
hovertemplateLabels,
23160+
d3locale,
2315923161
eventData,
2316023162
{meta: fullLayout.meta}
2316123163
);
@@ -27125,14 +27127,14 @@ function handleCamera3d(gd, ev) {
2712527127
var key = sceneId + '.camera';
2712627128
var scene = fullLayout[sceneId]._scene;
2712727129

27128-
if(attr === 'resetDefault') {
27129-
aobj[key] = Lib.extendDeep({}, scene.cameraInitial);
27130-
aobj[key].up = null;
27131-
aobj[key].eye = null;
27132-
aobj[key].center = null;
27133-
}
27134-
else if(attr === 'resetLastSave') {
27135-
aobj[key] = Lib.extendDeep({}, scene.cameraInitial);
27130+
if(attr === 'resetLastSave') {
27131+
aobj[key + '.up'] = scene.viewInitial.up;
27132+
aobj[key + '.eye'] = scene.viewInitial.eye;
27133+
aobj[key + '.center'] = scene.viewInitial.center;
27134+
} else if(attr === 'resetDefault') {
27135+
aobj[key + '.up'] = null;
27136+
aobj[key + '.eye'] = null;
27137+
aobj[key + '.center'] = null;
2713627138
}
2713727139
}
2713827140

@@ -33844,7 +33846,7 @@ exports.svgAttrs = {
3384433846
'use strict';
3384533847

3384633848
// package version injected by `npm run preprocess`
33847-
exports.version = '1.45.0';
33849+
exports.version = '1.45.1';
3384833850

3384933851
// inject promise polyfill
3385033852
_dereq_('es6-promise').polyfill();
@@ -37284,25 +37286,26 @@ var maximumNumberOfHoverTemplateWarnings = 10;
3728437286
* or fallback to associated labels.
3728537287
*
3728637288
* Examples:
37287-
* Lib.templateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'
37288-
* Lib.templateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'
37289-
* Lib.templateString('price: %{y:$.2f}', {y: 1}) --> 'price: $1.00'
37289+
* Lib.hovertemplateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'
37290+
* Lib.hovertemplateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'
37291+
* Lib.hovertemplateString('price: %{y:$.2f}', {y: 1}) --> 'price: $1.00'
3729037292
*
37293+
* @param {obj} d3 locale
3729137294
* @param {string} input string containing %{...:...} template strings
3729237295
* @param {obj} data object containing fallback text when no formatting is specified, ex.: {yLabel: 'formattedYValue'}
3729337296
* @param {obj} data objects containing substitution values
3729437297
*
3729537298
* @return {string} templated string
3729637299
*/
37297-
lib.hovertemplateString = function(string, labels) {
37300+
lib.hovertemplateString = function(string, labels, d3locale) {
3729837301
var args = arguments;
3729937302
// Not all that useful, but cache nestedProperty instantiation
3730037303
// just in case it speeds things up *slightly*:
3730137304
var getterCache = {};
3730237305

3730337306
return string.replace(lib.TEMPLATE_STRING_REGEX, function(match, key, format) {
3730437307
var obj, value, i;
37305-
for(i = 2; i < args.length; i++) {
37308+
for(i = 3; i < args.length; i++) {
3730637309
obj = args[i];
3730737310
if(obj.hasOwnProperty(key)) {
3730837311
value = obj[key];
@@ -37329,7 +37332,13 @@ lib.hovertemplateString = function(string, labels) {
3732937332
}
3733037333

3733137334
if(format) {
37332-
value = d3.format(format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''))(value);
37335+
var fmt;
37336+
if(d3locale) {
37337+
fmt = d3locale.numberFormat;
37338+
} else {
37339+
fmt = d3.format;
37340+
}
37341+
value = fmt(format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''))(value);
3733337342
} else {
3733437343
if(labels.hasOwnProperty(key + 'Label')) value = labels[key + 'Label'];
3733537344
}
@@ -43047,7 +43056,7 @@ function _restyle(gd, aobj, traces) {
4304743056
// and figure out what kind of graphics update we need to do
4304843057
for(var ai in aobj) {
4304943058
if(helpers.hasParent(aobj, ai)) {
43050-
throw new Error('cannot set ' + ai + 'and a parent attribute simultaneously');
43059+
throw new Error('cannot set ' + ai + ' and a parent attribute simultaneously');
4305143060
}
4305243061

4305343062
var vi = aobj[ai];
@@ -43553,7 +43562,7 @@ function _relayout(gd, aobj) {
4355343562
// alter gd.layout
4355443563
for(var ai in aobj) {
4355543564
if(helpers.hasParent(aobj, ai)) {
43556-
throw new Error('cannot set ' + ai + 'and a parent attribute simultaneously');
43565+
throw new Error('cannot set ' + ai + ' and a parent attribute simultaneously');
4355743566
}
4355843567

4355943568
var p = layoutNP(layout, ai);
@@ -51385,6 +51394,30 @@ axes.drawOne = function(gd, ax, opts) {
5138551394
if(ax.title.text !== fullLayout._dfltTitle[axLetter]) {
5138651395
push[s] += ax.title.font.size;
5138751396
}
51397+
51398+
if(axLetter === 'x' && bbox.width > 0) {
51399+
var rExtra = bbox.right - (ax._offset + ax._length);
51400+
if(rExtra > 0) {
51401+
push.x = 1;
51402+
push.r = rExtra;
51403+
}
51404+
var lExtra = ax._offset - bbox.left;
51405+
if(lExtra > 0) {
51406+
push.x = 0;
51407+
push.l = lExtra;
51408+
}
51409+
} else if(axLetter === 'y' && bbox.height > 0) {
51410+
var bExtra = bbox.bottom - (ax._offset + ax._length);
51411+
if(bExtra > 0) {
51412+
push.y = 0;
51413+
push.b = bExtra;
51414+
}
51415+
var tExtra = ax._offset - bbox.top;
51416+
if(tExtra > 0) {
51417+
push.y = 1;
51418+
push.t = tExtra;
51419+
}
51420+
}
5138851421
}
5138951422

5139051423
Plots.autoMargin(gd, axAutoMarginID(ax), push);
@@ -57877,15 +57910,14 @@ module.exports = function setConvert(ax, fullLayout) {
5787757910
ax._length = gs.h * (ax.domain[1] - ax.domain[0]);
5787857911
ax._m = ax._length / (rl0 - rl1);
5787957912
ax._b = -ax._m * rl1;
57880-
}
57881-
else {
57913+
} else {
5788257914
ax._offset = gs.l + ax.domain[0] * gs.w;
5788357915
ax._length = gs.w * (ax.domain[1] - ax.domain[0]);
5788457916
ax._m = ax._length / (rl1 - rl0);
5788557917
ax._b = -ax._m * rl0;
5788657918
}
5788757919

57888-
if(!isFinite(ax._m) || !isFinite(ax._b)) {
57920+
if(!isFinite(ax._m) || !isFinite(ax._b) || ax._length < 0) {
5788957921
fullLayout._replotting = false;
5789057922
throw new Error('Something went wrong with axis scaling');
5789157923
}
@@ -61566,6 +61598,8 @@ plots.doAutoMargin = function(gd) {
6156661598
var mr = margin.r;
6156761599
var mt = margin.t;
6156861600
var mb = margin.b;
61601+
var width = fullLayout.width;
61602+
var height = fullLayout.height;
6156961603
var pushMargin = fullLayout._pushmargin;
6157061604
var pushMarginIds = fullLayout._pushmarginIds;
6157161605

@@ -61601,13 +61635,11 @@ plots.doAutoMargin = function(gd) {
6160161635
var pr = pushMargin[k2].r.size;
6160261636

6160361637
if(fr > fl) {
61604-
var newl = (pl * fr +
61605-
(pr - fullLayout.width) * fl) / (fr - fl);
61606-
var newr = (pr * (1 - fl) +
61607-
(pl - fullLayout.width) * (1 - fr)) / (fr - fl);
61608-
if(newl >= 0 && newr >= 0 && newl + newr > ml + mr) {
61609-
ml = newl;
61610-
mr = newr;
61638+
var newL = (pl * fr + (pr - width) * fl) / (fr - fl);
61639+
var newR = (pr * (1 - fl) + (pl - width) * (1 - fr)) / (fr - fl);
61640+
if(newL >= 0 && newR >= 0 && width - (newL + newR) > 0 && newL + newR > ml + mr) {
61641+
ml = newL;
61642+
mr = newR;
6161161643
}
6161261644
}
6161361645
}
@@ -61617,13 +61649,11 @@ plots.doAutoMargin = function(gd) {
6161761649
var pt = pushMargin[k2].t.size;
6161861650

6161961651
if(ft > fb) {
61620-
var newb = (pb * ft +
61621-
(pt - fullLayout.height) * fb) / (ft - fb);
61622-
var newt = (pt * (1 - fb) +
61623-
(pb - fullLayout.height) * (1 - ft)) / (ft - fb);
61624-
if(newb >= 0 && newt >= 0 && newb + newt > mb + mt) {
61625-
mb = newb;
61626-
mt = newt;
61652+
var newB = (pb * ft + (pt - height) * fb) / (ft - fb);
61653+
var newT = (pt * (1 - fb) + (pb - height) * (1 - ft)) / (ft - fb);
61654+
if(newB >= 0 && newT >= 0 && height - (newT + newB) > 0 && newB + newT > mb + mt) {
61655+
mb = newB;
61656+
mt = newT;
6162761657
}
6162861658
}
6162961659
}
@@ -61636,8 +61666,8 @@ plots.doAutoMargin = function(gd) {
6163661666
gs.t = Math.round(mt);
6163761667
gs.b = Math.round(mb);
6163861668
gs.p = Math.round(margin.pad);
61639-
gs.w = Math.round(fullLayout.width) - gs.l - gs.r;
61640-
gs.h = Math.round(fullLayout.height) - gs.t - gs.b;
61669+
gs.w = Math.round(width) - gs.l - gs.r;
61670+
gs.h = Math.round(height) - gs.t - gs.b;
6164161671

6164261672
// if things changed and we're not already redrawing, trigger a redraw
6164361673
if(!fullLayout._replotting &&

0 commit comments

Comments
 (0)