Skip to content

Commit

Permalink
1.45.1
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard committed Mar 5, 2019
1 parent aaa6e63 commit bcf05db
Show file tree
Hide file tree
Showing 23 changed files with 3,777 additions and 3,954 deletions.
50 changes: 25 additions & 25 deletions dist/README.md
Expand Up @@ -51,7 +51,7 @@ object. This property must be set before the plotly.js script tag, for example:
Plotly.js defaults to US English (en-US) and includes British English (en) in the standard bundle.
Many other localizations are available - here is an example using Swiss-German (de-CH),
see the contents of this directory for the full list.
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
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
Note that the file names are all lowercase, even though the region is uppercase when you apply a locale.

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

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

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

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`
Expand All @@ -88,7 +88,7 @@ The main plotly.js bundle weights in at:

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

## Partial bundles

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 2.3 MB | 816.8 kB | 266.8 kB |
| 2.3 MB | 817.1 kB | 267 kB |

#### CDN links

| Flavor | URL |
| ------ | --- |
| Latest | https://cdn.plot.ly/plotly-basic-latest.js |
| Latest minified | https://cdn.plot.ly/plotly-basic-latest.min.js |
| Tagged | https://cdn.plot.ly/plotly-basic-1.45.0.js |
| Tagged minified | https://cdn.plot.ly/plotly-basic-1.45.0.min.js |
| Tagged | https://cdn.plot.ly/plotly-basic-1.45.1.js |
| Tagged minified | https://cdn.plot.ly/plotly-basic-1.45.1.min.js |

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

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 2.6 MB | 932.3 kB | 303.2 kB |
| 2.6 MB | 932.7 kB | 303.4 kB |

#### CDN links

| Flavor | URL |
| ------ | --- |
| Latest | https://cdn.plot.ly/plotly-cartesian-latest.js |
| Latest minified | https://cdn.plot.ly/plotly-cartesian-latest.min.js |
| Tagged | https://cdn.plot.ly/plotly-cartesian-1.45.0.js |
| Tagged minified | https://cdn.plot.ly/plotly-cartesian-1.45.0.min.js |
| Tagged | https://cdn.plot.ly/plotly-cartesian-1.45.1.js |
| Tagged minified | https://cdn.plot.ly/plotly-cartesian-1.45.1.min.js |

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

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 2.3 MB | 834 kB | 274.5 kB |
| 2.3 MB | 834.4 kB | 274.8 kB |

#### CDN links

| Flavor | URL |
| ------ | --- |
| Latest | https://cdn.plot.ly/plotly-geo-latest.js |
| Latest minified | https://cdn.plot.ly/plotly-geo-latest.min.js |
| Tagged | https://cdn.plot.ly/plotly-geo-1.45.0.js |
| Tagged minified | https://cdn.plot.ly/plotly-geo-1.45.0.min.js |
| Tagged | https://cdn.plot.ly/plotly-geo-1.45.1.js |
| Tagged minified | https://cdn.plot.ly/plotly-geo-1.45.1.min.js |

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

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 3.4 MB | 1.3 MB | 426.8 kB |
| 3.4 MB | 1.3 MB | 425.5 kB |

#### CDN links

| Flavor | URL |
| ------ | --- |
| Latest | https://cdn.plot.ly/plotly-gl3d-latest.js |
| Latest minified | https://cdn.plot.ly/plotly-gl3d-latest.min.js |
| Tagged | https://cdn.plot.ly/plotly-gl3d-1.45.0.js |
| Tagged minified | https://cdn.plot.ly/plotly-gl3d-1.45.0.min.js |
| Tagged | https://cdn.plot.ly/plotly-gl3d-1.45.1.js |
| Tagged minified | https://cdn.plot.ly/plotly-gl3d-1.45.1.min.js |

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

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 3.4 MB | 1.4 MB | 444.3 kB |
| 3.4 MB | 1.4 MB | 444.6 kB |

#### CDN links

| Flavor | URL |
| ------ | --- |
| Latest | https://cdn.plot.ly/plotly-gl2d-latest.js |
| Latest minified | https://cdn.plot.ly/plotly-gl2d-latest.min.js |
| Tagged | https://cdn.plot.ly/plotly-gl2d-1.45.0.js |
| Tagged minified | https://cdn.plot.ly/plotly-gl2d-1.45.0.min.js |
| Tagged | https://cdn.plot.ly/plotly-gl2d-1.45.1.js |
| Tagged minified | https://cdn.plot.ly/plotly-gl2d-1.45.1.min.js |

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

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 2.8 MB | 1.4 MB | 412.5 kB |
| 2.8 MB | 1.4 MB | 412.7 kB |

#### CDN links

| Flavor | URL |
| ------ | --- |
| Latest | https://cdn.plot.ly/plotly-mapbox-latest.js |
| Latest minified | https://cdn.plot.ly/plotly-mapbox-latest.min.js |
| Tagged | https://cdn.plot.ly/plotly-mapbox-1.45.0.js |
| Tagged minified | https://cdn.plot.ly/plotly-mapbox-1.45.0.min.js |
| Tagged | https://cdn.plot.ly/plotly-mapbox-1.45.1.js |
| Tagged minified | https://cdn.plot.ly/plotly-mapbox-1.45.1.min.js |

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

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

| Raw size | Minified size | Minified + gzip size |
|------|-----------------|------------------------|
| 2.4 MB | 850.3 kB | 277.1 kB |
| 2.4 MB | 850.7 kB | 277.3 kB |

#### CDN links

| Flavor | URL |
| ------ | --- |
| Latest | https://cdn.plot.ly/plotly-finance-latest.js |
| Latest minified | https://cdn.plot.ly/plotly-finance-latest.min.js |
| Tagged | https://cdn.plot.ly/plotly-finance-1.45.0.js |
| Tagged minified | https://cdn.plot.ly/plotly-finance-1.45.0.min.js |
| Tagged | https://cdn.plot.ly/plotly-finance-1.45.1.js |
| Tagged minified | https://cdn.plot.ly/plotly-finance-1.45.1.min.js |

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

Expand Down
104 changes: 67 additions & 37 deletions dist/plotly-basic.js
@@ -1,5 +1,5 @@
/**
* plotly.js (basic) v1.45.0
* plotly.js (basic) v1.45.1
* Copyright 2012-2019, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
Expand Down Expand Up @@ -23149,13 +23149,15 @@ function createHoverText(hoverData, opts, gd) {
}

// hovertemplate
var d3locale = gd._fullLayout._d3locale;
var hovertemplate = d.hovertemplate || false;
var hovertemplateLabels = d.hovertemplateLabels || d;
var eventData = d.eventData[0] || {};
if(hovertemplate) {
text = Lib.hovertemplateString(
hovertemplate,
hovertemplateLabels,
d3locale,
eventData,
{meta: fullLayout.meta}
);
Expand Down Expand Up @@ -27125,14 +27127,14 @@ function handleCamera3d(gd, ev) {
var key = sceneId + '.camera';
var scene = fullLayout[sceneId]._scene;

if(attr === 'resetDefault') {
aobj[key] = Lib.extendDeep({}, scene.cameraInitial);
aobj[key].up = null;
aobj[key].eye = null;
aobj[key].center = null;
}
else if(attr === 'resetLastSave') {
aobj[key] = Lib.extendDeep({}, scene.cameraInitial);
if(attr === 'resetLastSave') {
aobj[key + '.up'] = scene.viewInitial.up;
aobj[key + '.eye'] = scene.viewInitial.eye;
aobj[key + '.center'] = scene.viewInitial.center;
} else if(attr === 'resetDefault') {
aobj[key + '.up'] = null;
aobj[key + '.eye'] = null;
aobj[key + '.center'] = null;
}
}

Expand Down Expand Up @@ -33844,7 +33846,7 @@ exports.svgAttrs = {
'use strict';

// package version injected by `npm run preprocess`
exports.version = '1.45.0';
exports.version = '1.45.1';

// inject promise polyfill
_dereq_('es6-promise').polyfill();
Expand Down Expand Up @@ -37284,25 +37286,26 @@ var maximumNumberOfHoverTemplateWarnings = 10;
* or fallback to associated labels.
*
* Examples:
* Lib.templateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'
* Lib.templateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'
* Lib.templateString('price: %{y:$.2f}', {y: 1}) --> 'price: $1.00'
* Lib.hovertemplateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'
* Lib.hovertemplateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'
* Lib.hovertemplateString('price: %{y:$.2f}', {y: 1}) --> 'price: $1.00'
*
* @param {obj} d3 locale
* @param {string} input string containing %{...:...} template strings
* @param {obj} data object containing fallback text when no formatting is specified, ex.: {yLabel: 'formattedYValue'}
* @param {obj} data objects containing substitution values
*
* @return {string} templated string
*/
lib.hovertemplateString = function(string, labels) {
lib.hovertemplateString = function(string, labels, d3locale) {
var args = arguments;
// Not all that useful, but cache nestedProperty instantiation
// just in case it speeds things up *slightly*:
var getterCache = {};

return string.replace(lib.TEMPLATE_STRING_REGEX, function(match, key, format) {
var obj, value, i;
for(i = 2; i < args.length; i++) {
for(i = 3; i < args.length; i++) {
obj = args[i];
if(obj.hasOwnProperty(key)) {
value = obj[key];
Expand All @@ -37329,7 +37332,13 @@ lib.hovertemplateString = function(string, labels) {
}

if(format) {
value = d3.format(format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''))(value);
var fmt;
if(d3locale) {
fmt = d3locale.numberFormat;
} else {
fmt = d3.format;
}
value = fmt(format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''))(value);
} else {
if(labels.hasOwnProperty(key + 'Label')) value = labels[key + 'Label'];
}
Expand Down Expand Up @@ -43047,7 +43056,7 @@ function _restyle(gd, aobj, traces) {
// and figure out what kind of graphics update we need to do
for(var ai in aobj) {
if(helpers.hasParent(aobj, ai)) {
throw new Error('cannot set ' + ai + 'and a parent attribute simultaneously');
throw new Error('cannot set ' + ai + ' and a parent attribute simultaneously');
}

var vi = aobj[ai];
Expand Down Expand Up @@ -43553,7 +43562,7 @@ function _relayout(gd, aobj) {
// alter gd.layout
for(var ai in aobj) {
if(helpers.hasParent(aobj, ai)) {
throw new Error('cannot set ' + ai + 'and a parent attribute simultaneously');
throw new Error('cannot set ' + ai + ' and a parent attribute simultaneously');
}

var p = layoutNP(layout, ai);
Expand Down Expand Up @@ -51385,6 +51394,30 @@ axes.drawOne = function(gd, ax, opts) {
if(ax.title.text !== fullLayout._dfltTitle[axLetter]) {
push[s] += ax.title.font.size;
}

if(axLetter === 'x' && bbox.width > 0) {
var rExtra = bbox.right - (ax._offset + ax._length);
if(rExtra > 0) {
push.x = 1;
push.r = rExtra;
}
var lExtra = ax._offset - bbox.left;
if(lExtra > 0) {
push.x = 0;
push.l = lExtra;
}
} else if(axLetter === 'y' && bbox.height > 0) {
var bExtra = bbox.bottom - (ax._offset + ax._length);
if(bExtra > 0) {
push.y = 0;
push.b = bExtra;
}
var tExtra = ax._offset - bbox.top;
if(tExtra > 0) {
push.y = 1;
push.t = tExtra;
}
}
}

Plots.autoMargin(gd, axAutoMarginID(ax), push);
Expand Down Expand Up @@ -57877,15 +57910,14 @@ module.exports = function setConvert(ax, fullLayout) {
ax._length = gs.h * (ax.domain[1] - ax.domain[0]);
ax._m = ax._length / (rl0 - rl1);
ax._b = -ax._m * rl1;
}
else {
} else {
ax._offset = gs.l + ax.domain[0] * gs.w;
ax._length = gs.w * (ax.domain[1] - ax.domain[0]);
ax._m = ax._length / (rl1 - rl0);
ax._b = -ax._m * rl0;
}

if(!isFinite(ax._m) || !isFinite(ax._b)) {
if(!isFinite(ax._m) || !isFinite(ax._b) || ax._length < 0) {
fullLayout._replotting = false;
throw new Error('Something went wrong with axis scaling');
}
Expand Down Expand Up @@ -61566,6 +61598,8 @@ plots.doAutoMargin = function(gd) {
var mr = margin.r;
var mt = margin.t;
var mb = margin.b;
var width = fullLayout.width;
var height = fullLayout.height;
var pushMargin = fullLayout._pushmargin;
var pushMarginIds = fullLayout._pushmarginIds;

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

if(fr > fl) {
var newl = (pl * fr +
(pr - fullLayout.width) * fl) / (fr - fl);
var newr = (pr * (1 - fl) +
(pl - fullLayout.width) * (1 - fr)) / (fr - fl);
if(newl >= 0 && newr >= 0 && newl + newr > ml + mr) {
ml = newl;
mr = newr;
var newL = (pl * fr + (pr - width) * fl) / (fr - fl);
var newR = (pr * (1 - fl) + (pl - width) * (1 - fr)) / (fr - fl);
if(newL >= 0 && newR >= 0 && width - (newL + newR) > 0 && newL + newR > ml + mr) {
ml = newL;
mr = newR;
}
}
}
Expand All @@ -61617,13 +61649,11 @@ plots.doAutoMargin = function(gd) {
var pt = pushMargin[k2].t.size;

if(ft > fb) {
var newb = (pb * ft +
(pt - fullLayout.height) * fb) / (ft - fb);
var newt = (pt * (1 - fb) +
(pb - fullLayout.height) * (1 - ft)) / (ft - fb);
if(newb >= 0 && newt >= 0 && newb + newt > mb + mt) {
mb = newb;
mt = newt;
var newB = (pb * ft + (pt - height) * fb) / (ft - fb);
var newT = (pt * (1 - fb) + (pb - height) * (1 - ft)) / (ft - fb);
if(newB >= 0 && newT >= 0 && height - (newT + newB) > 0 && newB + newT > mb + mt) {
mb = newB;
mt = newT;
}
}
}
Expand All @@ -61636,8 +61666,8 @@ plots.doAutoMargin = function(gd) {
gs.t = Math.round(mt);
gs.b = Math.round(mb);
gs.p = Math.round(margin.pad);
gs.w = Math.round(fullLayout.width) - gs.l - gs.r;
gs.h = Math.round(fullLayout.height) - gs.t - gs.b;
gs.w = Math.round(width) - gs.l - gs.r;
gs.h = Math.round(height) - gs.t - gs.b;

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

0 comments on commit bcf05db

Please sign in to comment.