Skip to content

Commit 0fc37d6

Browse files
committed
1.20.5
1 parent f35313a commit 0fc37d6

23 files changed

+899
-423
lines changed

dist/README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ The main plotly.js bundle includes all the official (non-beta) trace modules.
3737

3838
It be can imported as minified javascript
3939
- using dist file `dist/plotly.min.js`
40-
- using CDN URL https://cdn.plot.ly/plotly-latest.min.js OR https://cdn.plot.ly/plotly-1.20.4.min.js
40+
- using CDN URL https://cdn.plot.ly/plotly-latest.min.js OR https://cdn.plot.ly/plotly-1.20.5.min.js
4141

4242
or as raw javascript:
4343
- using dist file `dist/plotly.js`
44-
- using CDN URL https://cdn.plot.ly/plotly-latest.js OR https://cdn.plot.ly/plotly-1.20.4.js
44+
- using CDN URL https://cdn.plot.ly/plotly-latest.js OR https://cdn.plot.ly/plotly-1.20.5.js
4545
- using CommonJS with `require('plotly.js')`
4646

4747
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`
@@ -50,7 +50,7 @@ The main plotly.js bundle weights in at:
5050

5151
| plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js |
5252
|-----------|---------------|----------------------|---------------------|
53-
| 4.2 MB | 1.7 MB | 526.3 kB | 4.3 MB |
53+
| 4.2 MB | 1.7 MB | 526.5 kB | 4.3 MB |
5454

5555
## Partial bundles
5656

@@ -74,13 +74,13 @@ The `basic` partial bundle contains the `scatter`, `bar` and `pie` trace modules
7474
| dist bundle (minified) | `dist/plotly-basic.min.js` |
7575
| CDN URL (latest) | https://cdn.plot.ly/plotly-basic-latest.js |
7676
| CDN URL (latest minified) | https://cdn.plot.ly/plotly-basic-latest.min.js |
77-
| CDN URL (tagged) | https://cdn.plot.ly/plotly-basic-1.20.4.js |
78-
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-basic-1.20.4.min.js |
77+
| CDN URL (tagged) | https://cdn.plot.ly/plotly-basic-1.20.5.js |
78+
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-basic-1.20.5.min.js |
7979
| CommonJS | `require('plotly.js/lib/index-basic')` |
8080

8181
| Raw size | Minified size | Minified + gzip size |
8282
|------|-----------------|------------------------|
83-
| 1.6 MB | 606.6 kB | 196.6 kB |
83+
| 1.6 MB | 607 kB | 196.7 kB |
8484

8585
### plotly.js cartesian
8686

@@ -92,13 +92,13 @@ The `cartesian` partial bundle contains the `scatter`, `bar`, `box`, `heatmap`,
9292
| dist bundle (minified) | `dist/plotly-cartesian.min.js` |
9393
| CDN URL (latest) | https://cdn.plot.ly/plotly-cartesian-latest.js |
9494
| CDN URL (latest minified) | https://cdn.plot.ly/plotly-cartesian-latest.min.js |
95-
| CDN URL (tagged) | https://cdn.plot.ly/plotly-cartesian-1.20.4.js |
96-
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-cartesian-1.20.4.min.js |
95+
| CDN URL (tagged) | https://cdn.plot.ly/plotly-cartesian-1.20.5.js |
96+
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-cartesian-1.20.5.min.js |
9797
| CommonJS | `require('plotly.js/lib/index-cartesian')` |
9898

9999
| Raw size | Minified size | Minified + gzip size |
100100
|------|-----------------|------------------------|
101-
| 1.8 MB | 677.3 kB | 217.8 kB |
101+
| 1.8 MB | 677.8 kB | 218 kB |
102102

103103
### plotly.js geo
104104

@@ -110,13 +110,13 @@ The `geo` partial bundle contains the `scatter`, `scattergeo` and `choropleth` t
110110
| dist bundle (minified) | `dist/plotly-geo.min.js` |
111111
| CDN URL (latest) | https://cdn.plot.ly/plotly-geo-latest.js |
112112
| CDN URL (latest minified) | https://cdn.plot.ly/plotly-geo-latest.min.js |
113-
| CDN URL (tagged) | https://cdn.plot.ly/plotly-geo-1.20.4.js |
114-
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-geo-1.20.4.min.js |
113+
| CDN URL (tagged) | https://cdn.plot.ly/plotly-geo-1.20.5.js |
114+
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-geo-1.20.5.min.js |
115115
| CommonJS | `require('plotly.js/lib/index-geo')` |
116116

117117
| Raw size | Minified size | Minified + gzip size |
118118
|------|-----------------|------------------------|
119-
| 1.6 MB | 635.1 kB | 207.2 kB |
119+
| 1.6 MB | 635.5 kB | 207.3 kB |
120120

121121
### plotly.js gl3d
122122

@@ -128,13 +128,13 @@ The `gl3d` partial bundle contains the `scatter`, `scatter3d`, `surface` and `me
128128
| dist bundle (minified) | `dist/plotly-gl3d.min.js` |
129129
| CDN URL (latest) | https://cdn.plot.ly/plotly-gl3d-latest.js |
130130
| CDN URL (latest minified) | https://cdn.plot.ly/plotly-gl3d-latest.min.js |
131-
| CDN URL (tagged) | https://cdn.plot.ly/plotly-gl3d-1.20.4.js |
132-
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-gl3d-1.20.4.min.js |
131+
| CDN URL (tagged) | https://cdn.plot.ly/plotly-gl3d-1.20.5.js |
132+
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-gl3d-1.20.5.min.js |
133133
| CommonJS | `require('plotly.js/lib/index-gl3d')` |
134134

135135
| Raw size | Minified size | Minified + gzip size |
136136
|------|-----------------|------------------------|
137-
| 2.5 MB | 1 MB | 327.9 kB |
137+
| 2.5 MB | 1 MB | 328.1 kB |
138138

139139
### plotly.js gl2d
140140

@@ -146,13 +146,13 @@ The `gl2d` partial bundle contains the `scatter`, `scattergl`, `pointcloud`, `he
146146
| dist bundle (minified) | `dist/plotly-gl2d.min.js` |
147147
| CDN URL (latest) | https://cdn.plot.ly/plotly-gl2d-latest.js |
148148
| CDN URL (latest minified) | https://cdn.plot.ly/plotly-gl2d-latest.min.js |
149-
| CDN URL (tagged) | https://cdn.plot.ly/plotly-gl2d-1.20.4.js |
150-
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-gl2d-1.20.4.min.js |
149+
| CDN URL (tagged) | https://cdn.plot.ly/plotly-gl2d-1.20.5.js |
150+
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-gl2d-1.20.5.min.js |
151151
| CommonJS | `require('plotly.js/lib/index-gl2d')` |
152152

153153
| Raw size | Minified size | Minified + gzip size |
154154
|------|-----------------|------------------------|
155-
| 2.2 MB | 929 kB | 290.7 kB |
155+
| 2.2 MB | 929.5 kB | 290.9 kB |
156156

157157
### plotly.js mapbox
158158

@@ -164,13 +164,13 @@ The `mapbox` partial bundle contains the `scatter` and `scattermapbox` trace mod
164164
| dist bundle (minified) | `dist/plotly-mapbox.min.js` |
165165
| CDN URL (latest) | https://cdn.plot.ly/plotly-mapbox-latest.js |
166166
| CDN URL (latest minified) | https://cdn.plot.ly/plotly-mapbox-latest.min.js |
167-
| CDN URL (tagged) | https://cdn.plot.ly/plotly-mapbox-1.20.4.js |
168-
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-mapbox-1.20.4.min.js |
167+
| CDN URL (tagged) | https://cdn.plot.ly/plotly-mapbox-1.20.5.js |
168+
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-mapbox-1.20.5.min.js |
169169
| CommonJS | `require('plotly.js/lib/index-mapbox')` |
170170

171171
| Raw size | Minified size | Minified + gzip size |
172172
|------|-----------------|------------------------|
173-
| 2.6 MB | 1 MB | 310.6 kB |
173+
| 2.6 MB | 1 MB | 310.8 kB |
174174

175175
### plotly.js finance
176176

@@ -182,13 +182,13 @@ The `finance` partial bundle contains the `scatter`, `bar`, `histogram`, `pie`,
182182
| dist bundle (minified) | `dist/plotly-finance.min.js` |
183183
| CDN URL (latest) | https://cdn.plot.ly/plotly-finance-latest.js |
184184
| CDN URL (latest minified) | https://cdn.plot.ly/plotly-finance-latest.min.js |
185-
| CDN URL (tagged) | https://cdn.plot.ly/plotly-finance-1.20.4.js |
186-
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-finance-1.20.4.min.js |
185+
| CDN URL (tagged) | https://cdn.plot.ly/plotly-finance-1.20.5.js |
186+
| CDN URL (tagged minified) | https://cdn.plot.ly/plotly-finance-1.20.5.min.js |
187187
| CommonJS | `require('plotly.js/lib/index-finance')` |
188188

189189
| Raw size | Minified size | Minified + gzip size |
190190
|------|-----------------|------------------------|
191-
| 1.6 MB | 631.8 kB | 203.5 kB |
191+
| 1.6 MB | 632.3 kB | 203.6 kB |
192192

193193
----------------
194194

dist/npm-ls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plotly.js",
3-
"version": "1.20.4",
3+
"version": "1.20.5",
44
"dependencies": {
55
"3d-view": {
66
"version": "2.0.0",

dist/plotly-basic.js

Lines changed: 69 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* plotly.js (basic) v1.20.4
2+
* plotly.js (basic) v1.20.5
33
* Copyright 2012-2016, Plotly, Inc.
44
* All rights reserved.
55
* Licensed under the MIT license
@@ -25304,7 +25304,7 @@ exports.svgAttrs = {
2530425304
var Plotly = require('./plotly');
2530525305

2530625306
// package version injected by `npm run preprocess`
25307-
exports.version = '1.20.4';
25307+
exports.version = '1.20.5';
2530825308

2530925309
// inject promise polyfill
2531025310
require('es6-promise').polyfill();
@@ -25414,17 +25414,16 @@ var isNumeric = require('fast-isnumeric');
2541425414

2541525415
var BADNUM = require('../constants/numerical').BADNUM;
2541625416

25417-
// precompile these regex's for speed
25418-
var FRONTJUNK = /^['"%,$#\s']+/;
25419-
var ENDJUNK = /['"%,$#\s']+$/;
25417+
// precompile for speed
25418+
var JUNK = /^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;
2542025419

2542125420
/**
2542225421
* cleanNumber: remove common leading and trailing cruft
2542325422
* Always returns either a number or BADNUM.
2542425423
*/
2542525424
module.exports = function cleanNumber(v) {
2542625425
if(typeof v === 'string') {
25427-
v = v.replace(FRONTJUNK, '').replace(ENDJUNK, '');
25426+
v = v.replace(JUNK, '');
2542825427
}
2542925428

2543025429
if(isNumeric(v)) return Number(v);
@@ -34456,8 +34455,6 @@ axes.autoBin = function(data, ax, nbins, is2d) {
3445634455
// in any case, set tickround to # of digits to round tick labels to,
3445734456
// or codes to this effect for log and date scales
3445834457
axes.calcTicks = function calcTicks(ax) {
34459-
if(ax.tickmode === 'array') return arrayTicks(ax);
34460-
3446134458
var rng = ax.range.map(ax.r2l);
3446234459

3446334460
// calculate max number of (auto) ticks to display based on plot size
@@ -34474,6 +34471,11 @@ axes.calcTicks = function calcTicks(ax) {
3447434471
nt = Lib.constrain(ax._length / minPx, 4, 9) + 1;
3447534472
}
3447634473
}
34474+
34475+
// add a couple of extra digits for filling in ticks when we
34476+
// have explicit tickvals without tick text
34477+
if(ax.tickmode === 'array') nt *= 100;
34478+
3447734479
axes.autoTicks(ax, Math.abs(rng[1] - rng[0]) / nt);
3447834480
// check for a forced minimum dtick
3447934481
if(ax._minDtick > 0 && ax.dtick < ax._minDtick * 2) {
@@ -34490,6 +34492,10 @@ axes.calcTicks = function calcTicks(ax) {
3449034492
// now figure out rounding of tick values
3449134493
autoTickRound(ax);
3449234494

34495+
// now that we've figured out the auto values for formatting
34496+
// in case we're missing some ticktext, we can break out for array ticks
34497+
if(ax.tickmode === 'array') return arrayTicks(ax);
34498+
3449334499
// find the first tick
3449434500
ax._tmin = axes.tickFirst(ax);
3449534501

@@ -34517,11 +34523,11 @@ axes.calcTicks = function calcTicks(ax) {
3451734523
// show the exponent only on the last one
3451834524
ax._tmax = vals[vals.length - 1];
3451934525

34520-
// for showing date suffixes: ax._prevSuffix holds what we showed most
34521-
// recently. Start with it cleared and mark that we're in calcTicks (ie
34522-
// calculating a whole string of these so we should care what the previous
34523-
// suffix was!)
34524-
ax._prevSuffix = '';
34526+
// for showing the rest of a date when the main tick label is only the
34527+
// latter part: ax._prevDateHead holds what we showed most recently.
34528+
// Start with it cleared and mark that we're in calcTicks (ie calculating a
34529+
// whole string of these so we should care what the previous date head was!)
34530+
ax._prevDateHead = '';
3452534531
ax._inCalcTicks = true;
3452634532

3452734533
var ticksOut = new Array(vals.length);
@@ -34549,8 +34555,17 @@ function arrayTicks(ax) {
3454934555
// except with more precision to the numbers
3455034556
if(!Array.isArray(text)) text = [];
3455134557

34558+
// make sure showing ticks doesn't accidentally add new categories
34559+
var tickVal2l = ax.type === 'category' ? ax.d2l_noadd : ax.d2l;
34560+
34561+
// array ticks on log axes always show the full number
34562+
// (if no explicit ticktext overrides it)
34563+
if(ax.type === 'log' && String(ax.dtick).charAt(0) !== 'L') {
34564+
ax.dtick = 'L' + Math.pow(10, Math.floor(Math.min(ax.range[0], ax.range[1])) - 1);
34565+
}
34566+
3455234567
for(i = 0; i < vals.length; i++) {
34553-
vali = ax.d2l(vals[i]);
34568+
vali = tickVal2l(vals[i]);
3455434569
if(vali > tickMin && vali < tickMax) {
3455534570
if(text[i] === undefined) ticksOut[j] = axes.tickText(ax, vali);
3455634571
else ticksOut[j] = tickTextObj(ax, vali, String(text[i]));
@@ -34875,13 +34890,14 @@ axes.tickText = function(ax, x, hover) {
3487534890
hideexp,
3487634891
arrayMode = ax.tickmode === 'array',
3487734892
extraPrecision = hover || arrayMode,
34878-
i;
34893+
i,
34894+
tickVal2l = ax.type === 'category' ? ax.d2l_noadd : ax.d2l;
3487934895

3488034896
if(arrayMode && Array.isArray(ax.ticktext)) {
3488134897
var rng = ax.range.map(ax.r2l),
3488234898
minDiff = Math.abs(rng[1] - rng[0]) / 10000;
3488334899
for(i = 0; i < ax.ticktext.length; i++) {
34884-
if(Math.abs(x - ax.d2l(ax.tickvals[i])) < minDiff) break;
34900+
if(Math.abs(x - tickVal2l(ax.tickvals[i])) < minDiff) break;
3488534901
}
3488634902
if(i < ax.ticktext.length) {
3488734903
out.text = String(ax.ticktext[i]);
@@ -34934,12 +34950,11 @@ function tickTextObj(ax, x, text) {
3493434950
function formatDate(ax, out, hover, extraPrecision) {
3493534951
var x = out.x,
3493634952
tr = ax._tickround,
34937-
trOriginal = tr,
3493834953
d = new Date(x),
34939-
// suffix completes the full date info, to be included
34954+
// headPart completes the full date info, to be included
3494034955
// with only the first tick or if any info before what's
3494134956
// shown has changed
34942-
suffix,
34957+
headPart,
3494334958
tt;
3494434959
if(hover && ax.hoverformat) {
3494534960
tt = modDateFormat(ax.hoverformat, x);
@@ -34958,12 +34973,12 @@ function formatDate(ax, out, hover, extraPrecision) {
3495834973
else if(tr === 'm') tt = monthFormat(d);
3495934974
else {
3496034975
if(tr === 'd') {
34961-
if(!hover) suffix = '<br>' + yearFormat(d);
34976+
headPart = yearFormat(d);
3496234977

3496334978
tt = dayFormat(d);
3496434979
}
3496534980
else {
34966-
if(!hover) suffix = '<br>' + yearMonthDayFormat(d);
34981+
headPart = yearMonthDayFormat(d);
3496734982

3496834983
tt = minuteFormat(d);
3496934984
if(tr !== 'M') {
@@ -34973,17 +34988,34 @@ function formatDate(ax, out, hover, extraPrecision) {
3497334988
.substr(1);
3497434989
}
3497534990
}
34976-
else if(trOriginal === 'd') {
34977-
// for hover on axes with day ticks, minuteFormat (which
34978-
// only includes %H:%M) isn't enough, you want the date too
34979-
tt = dayFormat(d) + ' ' + tt;
34980-
}
3498134991
}
3498234992
}
3498334993
}
34984-
if(suffix && (!ax._inCalcTicks || (suffix !== ax._prevSuffix))) {
34985-
tt += suffix;
34986-
ax._prevSuffix = suffix;
34994+
if(hover || ax.tickmode === 'array') {
34995+
// we get extra precision in array mode or hover,
34996+
// but it may be useless, strip it off
34997+
if(tt === '00:00:00' || tt === '00:00') {
34998+
tt = headPart;
34999+
headPart = '';
35000+
}
35001+
else if(tt.length === 8) {
35002+
// strip off seconds if they're zero (zero fractional seconds
35003+
// are already omitted)
35004+
tt = tt.replace(/:00$/, '');
35005+
}
35006+
}
35007+
35008+
if(headPart) {
35009+
if(hover) {
35010+
// hover puts it all on one line, so headPart works best up front
35011+
// except for year headPart: turn this into "Jan 1, 2000" etc.
35012+
if(tr === 'd') tt += ', ' + headPart;
35013+
else tt = headPart + (tt ? ', ' + tt : '');
35014+
}
35015+
else if(!ax._inCalcTicks || (headPart !== ax._prevDateHead)) {
35016+
tt += '<br>' + headPart;
35017+
ax._prevDateHead = headPart;
35018+
}
3498735019
}
3498835020
out.text = tt;
3498935021
}
@@ -40186,6 +40218,14 @@ module.exports = function setConvert(ax) {
4018640218
return c === -1 ? BADNUM : c;
4018740219
};
4018840220

40221+
ax.d2l_noadd = function(v) {
40222+
// d2c variant that that won't add categories but will also
40223+
// allow numbers to be mapped to the linearized axis positions
40224+
var index = ax._categories.indexOf(v);
40225+
if(index !== -1) return index;
40226+
if(typeof v === 'number') return v;
40227+
};
40228+
4018940229
ax.d2l = ax.d2c;
4019040230
ax.r2l = num;
4019140231
ax.l2r = num;

dist/plotly-basic.min.js

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)