plotly.js 1.52.1 → 1.52.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.fossa.yml +58 -0
- package/.ignore +3 -0
- package/CHANGELOG.md +21 -0
- package/dist/README.md +25 -25
- package/dist/plot-schema.json +8 -8
- package/dist/plotly-basic.js +187 -54
- package/dist/plotly-basic.min.js +2 -2
- package/dist/plotly-cartesian.js +187 -54
- package/dist/plotly-cartesian.min.js +2 -2
- package/dist/plotly-finance.js +187 -54
- package/dist/plotly-finance.min.js +2 -2
- package/dist/plotly-geo-assets.js +2 -2
- package/dist/plotly-geo.js +168 -49
- package/dist/plotly-geo.min.js +2 -2
- package/dist/plotly-gl2d.js +173 -51
- package/dist/plotly-gl2d.min.js +2 -2
- package/dist/plotly-gl3d.js +668 -449
- package/dist/plotly-gl3d.min.js +2 -2
- package/dist/plotly-mapbox.js +170 -50
- package/dist/plotly-mapbox.min.js +2 -2
- package/dist/plotly-with-meta.js +823 -533
- package/dist/plotly.js +814 -525
- package/dist/plotly.min.js +2 -2
- package/package.json +24 -23
- package/src/assets/geo_assets.js +1 -1
- package/src/components/annotations/attributes.js +1 -1
- package/src/core.js +1 -1
- package/src/lib/index.js +6 -3
- package/src/plot_api/subroutines.js +6 -0
- package/src/plot_api/validate.js +4 -3
- package/src/plots/cartesian/axes.js +6 -2
- package/src/plots/cartesian/constants.js +1 -2
- package/src/plots/cartesian/layout_defaults.js +112 -27
- package/src/plots/gl3d/scene.js +361 -323
- package/src/plots/layout_attributes.js +2 -2
- package/src/plots/mapbox/layers.js +2 -1
- package/src/plots/plots.js +30 -9
- package/src/traces/bar/hover.js +6 -1
- package/src/traces/bar/plot.js +13 -4
- package/src/traces/mesh3d/convert.js +9 -5
- package/src/traces/pie/attributes.js +7 -6
- package/src/traces/treemap/plot.js +2 -0
- package/tasks/test_syntax.js +1 -1
|
@@ -269,7 +269,7 @@ module.exports = {
|
|
|
269
269
|
role: 'style',
|
|
270
270
|
dflt: colorAttrs.background,
|
|
271
271
|
editType: 'plot',
|
|
272
|
-
description: 'Sets the color of paper where the graph is drawn.'
|
|
272
|
+
description: 'Sets the background color of the paper where the graph is drawn.'
|
|
273
273
|
},
|
|
274
274
|
plot_bgcolor: {
|
|
275
275
|
// defined here, but set in cartesian.supplyLayoutDefaults
|
|
@@ -279,7 +279,7 @@ module.exports = {
|
|
|
279
279
|
dflt: colorAttrs.background,
|
|
280
280
|
editType: 'layoutstyle',
|
|
281
281
|
description: [
|
|
282
|
-
'Sets the color of plotting area in-between x and y axes.'
|
|
282
|
+
'Sets the background color of the plotting area in-between x and y axes.'
|
|
283
283
|
].join(' ')
|
|
284
284
|
},
|
|
285
285
|
separators: {
|
package/src/plots/plots.js
CHANGED
|
@@ -1272,10 +1272,13 @@ plots.supplyTraceDefaults = function(traceIn, traceOut, colorIndex, layout, trac
|
|
|
1272
1272
|
var subplots = layout._subplots;
|
|
1273
1273
|
var subplotId = '';
|
|
1274
1274
|
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1275
|
+
if(
|
|
1276
|
+
visible ||
|
|
1277
|
+
basePlotModule.name !== 'gl2d' // for now just drop empty gl2d subplots
|
|
1278
|
+
// TODO - currently if we draw an empty gl2d subplot, it draws
|
|
1279
|
+
// nothing then gets stuck and you can't get it back without newPlot
|
|
1280
|
+
// sort this out in the regl refactor?
|
|
1281
|
+
) {
|
|
1279
1282
|
if(Array.isArray(subplotAttr)) {
|
|
1280
1283
|
for(i = 0; i < subplotAttr.length; i++) {
|
|
1281
1284
|
var attri = subplotAttr[i];
|
|
@@ -2934,7 +2937,7 @@ plots.doCalcdata = function(gd, traces) {
|
|
|
2934
2937
|
calcdata[i] = cd;
|
|
2935
2938
|
}
|
|
2936
2939
|
|
|
2937
|
-
setupAxisCategories(axList, fullData);
|
|
2940
|
+
setupAxisCategories(axList, fullData, fullLayout);
|
|
2938
2941
|
|
|
2939
2942
|
// 'transform' loop - must calc container traces first
|
|
2940
2943
|
// so that if their dependent traces can get transform properly
|
|
@@ -2942,7 +2945,7 @@ plots.doCalcdata = function(gd, traces) {
|
|
|
2942
2945
|
for(i = 0; i < fullData.length; i++) transformCalci(i);
|
|
2943
2946
|
|
|
2944
2947
|
// clear stuff that should recomputed in 'regular' loop
|
|
2945
|
-
if(hasCalcTransform) setupAxisCategories(axList, fullData);
|
|
2948
|
+
if(hasCalcTransform) setupAxisCategories(axList, fullData, fullLayout);
|
|
2946
2949
|
|
|
2947
2950
|
// 'regular' loop - make sure container traces (eg carpet) calc before
|
|
2948
2951
|
// contained traces (eg contourcarpet)
|
|
@@ -3147,13 +3150,31 @@ function sortAxisCategoriesByValue(axList, gd) {
|
|
|
3147
3150
|
return affectedTraces;
|
|
3148
3151
|
}
|
|
3149
3152
|
|
|
3150
|
-
function setupAxisCategories(axList, fullData) {
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
+
function setupAxisCategories(axList, fullData, fullLayout) {
|
|
3154
|
+
var axLookup = {};
|
|
3155
|
+
var i, ax, axId;
|
|
3156
|
+
|
|
3157
|
+
for(i = 0; i < axList.length; i++) {
|
|
3158
|
+
ax = axList[i];
|
|
3159
|
+
axId = ax._id;
|
|
3160
|
+
|
|
3153
3161
|
ax.clearCalc();
|
|
3154
3162
|
if(ax.type === 'multicategory') {
|
|
3155
3163
|
ax.setupMultiCategory(fullData);
|
|
3156
3164
|
}
|
|
3165
|
+
|
|
3166
|
+
axLookup[ax._id] = 1;
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
// look into match groups for 'missing' axes
|
|
3170
|
+
var matchGroups = fullLayout._axisMatchGroups || [];
|
|
3171
|
+
for(i = 0; i < matchGroups.length; i++) {
|
|
3172
|
+
for(axId in matchGroups[i]) {
|
|
3173
|
+
if(!axLookup[axId]) {
|
|
3174
|
+
ax = fullLayout[axisIDs.id2name(axId)];
|
|
3175
|
+
ax.clearCalc();
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3157
3178
|
}
|
|
3158
3179
|
}
|
|
3159
3180
|
|
package/src/traces/bar/hover.js
CHANGED
|
@@ -91,7 +91,12 @@ function hoverOnBars(pointData, xval, yval, hovermode) {
|
|
|
91
91
|
var s = di[sizeLetter];
|
|
92
92
|
|
|
93
93
|
if(isWaterfall) {
|
|
94
|
-
|
|
94
|
+
var rawS = Math.abs(di.rawS) || 0;
|
|
95
|
+
if(v > 0) {
|
|
96
|
+
s += rawS;
|
|
97
|
+
} else if(v < 0) {
|
|
98
|
+
s -= rawS;
|
|
99
|
+
}
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
// add a gradient so hovering near the end of a
|
package/src/traces/bar/plot.js
CHANGED
|
@@ -147,6 +147,7 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
|
|
|
147
147
|
!isNumeric(y0) ||
|
|
148
148
|
!isNumeric(y1)
|
|
149
149
|
);
|
|
150
|
+
|
|
150
151
|
// display zeros if line.width > 0
|
|
151
152
|
if(isBlank && shouldDisplayZeros && helpers.getLineWidth(trace, di) && (isHorizontal ? x1 - x0 === 0 : y1 - y0 === 0)) {
|
|
152
153
|
isBlank = false;
|
|
@@ -156,6 +157,9 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
|
|
|
156
157
|
if(isBlank && isHorizontal) x1 = x0;
|
|
157
158
|
if(isBlank && !isHorizontal) y1 = y0;
|
|
158
159
|
|
|
160
|
+
var spansHorizontal = isHorizontal && (x0 !== x1);
|
|
161
|
+
var spansVertical = !isHorizontal && (y0 !== y1);
|
|
162
|
+
|
|
159
163
|
// in waterfall mode `between` we need to adjust bar end points to match the connector width
|
|
160
164
|
if(adjustPixel && !isBlank) {
|
|
161
165
|
if(isHorizontal) {
|
|
@@ -210,10 +214,15 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
|
|
|
210
214
|
|
|
211
215
|
var op = Color.opacity(mc);
|
|
212
216
|
var fixpx = (op < 1 || lw > 0.01) ? roundWithLine : expandToVisible;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
|
|
218
|
+
if(spansHorizontal) {
|
|
219
|
+
x0 = fixpx(x0, x1);
|
|
220
|
+
x1 = fixpx(x1, x0);
|
|
221
|
+
}
|
|
222
|
+
if(spansVertical) {
|
|
223
|
+
y0 = fixpx(y0, y1);
|
|
224
|
+
y1 = fixpx(y1, y0);
|
|
225
|
+
}
|
|
217
226
|
}
|
|
218
227
|
|
|
219
228
|
var sel = transition(Lib.ensureSingle(bar, 'path'), fullLayout, opts, makeOnCompleteCallback);
|
|
@@ -34,11 +34,15 @@ proto.handlePick = function(selection) {
|
|
|
34
34
|
if(selection.object === this.mesh) {
|
|
35
35
|
var selectIndex = selection.index = selection.data.index;
|
|
36
36
|
|
|
37
|
-
selection.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
if(selection.data._cellCenter) {
|
|
38
|
+
selection.traceCoordinate = selection.data.dataCoordinate;
|
|
39
|
+
} else {
|
|
40
|
+
selection.traceCoordinate = [
|
|
41
|
+
this.data.x[selectIndex],
|
|
42
|
+
this.data.y[selectIndex],
|
|
43
|
+
this.data.z[selectIndex]
|
|
44
|
+
];
|
|
45
|
+
}
|
|
42
46
|
|
|
43
47
|
var text = this.data.hovertext || this.data.text;
|
|
44
48
|
if(Array.isArray(text) && text[selectIndex] !== undefined) {
|
|
@@ -188,12 +188,13 @@ module.exports = {
|
|
|
188
188
|
dflt: 'auto',
|
|
189
189
|
editType: 'plot',
|
|
190
190
|
description: [
|
|
191
|
-
'
|
|
192
|
-
'
|
|
193
|
-
'
|
|
194
|
-
'
|
|
195
|
-
'
|
|
196
|
-
'
|
|
191
|
+
'Controls the orientation of the text inside chart sectors.',
|
|
192
|
+
'When set to *auto*, text may be oriented in any direction in order',
|
|
193
|
+
'to be as big as possible in the middle of a sector.',
|
|
194
|
+
'The *horizontal* option orients text to be parallel with the bottom',
|
|
195
|
+
'of the chart, and may make text smaller in order to achieve that goal.',
|
|
196
|
+
'The *radial* option orients text along the radius of the sector.',
|
|
197
|
+
'The *tangential* option orients text perpendicular to the radius of the sector.'
|
|
197
198
|
].join(' ')
|
|
198
199
|
},
|
|
199
200
|
insidetextfont: extendFlat({}, textFontAttrs, {
|
package/tasks/test_syntax.js
CHANGED
|
@@ -6,7 +6,7 @@ var glob = require('glob');
|
|
|
6
6
|
var madge = require('madge');
|
|
7
7
|
var readLastLines = require('read-last-lines');
|
|
8
8
|
var eslint = require('eslint');
|
|
9
|
-
var trueCasePath = require('true-case-path');
|
|
9
|
+
var trueCasePath = require('true-case-path').trueCasePathSync;
|
|
10
10
|
|
|
11
11
|
var common = require('./util/common');
|
|
12
12
|
var isJasmineTestIt = common.isJasmineTestIt;
|