Skip to content

Commit 54b3f1c

Browse files
committed
Merge branch 'master' into polar
2 parents 543b615 + 599dff9 commit 54b3f1c

File tree

113 files changed

+1181
-525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1181
-525
lines changed

dist/plotly-locale-en-us.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-locale-en.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/translation-keys.txt

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Autoscale // components/modebar/buttons.js:139
2+
Box Select // components/modebar/buttons.js:103
3+
Click to enter Colorscale title // plots/plots.js:437
4+
Click to enter Component A title // plots/ternary/ternary.js:386
5+
Click to enter Component B title // plots/ternary/ternary.js:400
6+
Click to enter Component C title // plots/ternary/ternary.js:411
7+
Click to enter Plot title // plot_api/plot_api.js:579
8+
Click to enter X axis title // plots/plots.js:435
9+
Click to enter Y axis title // plots/plots.js:436
10+
Compare data on hover // components/modebar/buttons.js:167
11+
Double-click on legend to isolate one trace // components/legend/handle_click.js:90
12+
Double-click to zoom back out // plots/cartesian/dragbox.js:299
13+
Download plot as a png // components/modebar/buttons.js:52
14+
Edit in Chart Studio // components/modebar/buttons.js:76
15+
IE only supports svg. Changing format to svg. // components/modebar/buttons.js:60
16+
Lasso Select // components/modebar/buttons.js:112
17+
Orbital rotation // components/modebar/buttons.js:279
18+
Pan // components/modebar/buttons.js:94
19+
Produced with Plotly // components/modebar/modebar.js:256
20+
Reset // components/modebar/buttons.js:432
21+
Reset axes // components/modebar/buttons.js:148
22+
Reset camera to default // components/modebar/buttons.js:314
23+
Reset camera to last save // components/modebar/buttons.js:322
24+
Reset view // components/modebar/buttons.js:583
25+
Reset views // components/modebar/buttons.js:529
26+
Show closest data on hover // components/modebar/buttons.js:157
27+
Snapshot succeeded // components/modebar/buttons.js:66
28+
Sorry, there was a problem downloading your snapshot! // components/modebar/buttons.js:69
29+
Taking snapshot - this may take a few seconds // components/modebar/buttons.js:57
30+
Toggle Spike Lines // components/modebar/buttons.js:548
31+
Toggle show closest data on hover // components/modebar/buttons.js:353
32+
Turntable rotation // components/modebar/buttons.js:288
33+
Zoom // components/modebar/buttons.js:85
34+
Zoom in // components/modebar/buttons.js:121
35+
Zoom out // components/modebar/buttons.js:130
36+
close: // traces/ohlc/transform.js:139
37+
high: // traces/ohlc/transform.js:137
38+
incoming flow count: // traces/sankey/plot.js:142
39+
kde: // traces/violin/calc.js:73
40+
lat: // traces/scattergeo/calc.js:48
41+
lon: // traces/scattergeo/calc.js:49
42+
low: // traces/ohlc/transform.js:138
43+
lower fence: // traces/box/calc.js:134
44+
max: // traces/box/calc.js:132
45+
mean ± σ: // traces/box/calc.js:133
46+
mean: // traces/box/calc.js:133
47+
median: // traces/box/calc.js:128
48+
min: // traces/box/calc.js:129
49+
open: // traces/ohlc/transform.js:136
50+
outgoing flow count: // traces/sankey/plot.js:143
51+
q1: // traces/box/calc.js:130
52+
q3: // traces/box/calc.js:131
53+
source: // traces/sankey/plot.js:140
54+
target: // traces/sankey/plot.js:141
55+
trace // plots/plots.js:439
56+
upper fence: // traces/box/calc.js:135

lib/index-basic.js

+6
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,10 @@ Plotly.register([
1515
require('./pie')
1616
]);
1717

18+
// locales
19+
Plotly.register([
20+
require('./locale-en'),
21+
require('./locale-en-us')
22+
]);
23+
1824
module.exports = Plotly;

lib/index-cartesian.js

+6
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ Plotly.register([
2323
require('./violin')
2424
]);
2525

26+
// locales
27+
Plotly.register([
28+
require('./locale-en'),
29+
require('./locale-en-us')
30+
]);
31+
2632
module.exports = Plotly;

lib/index-finance.js

+6
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@ Plotly.register([
1818
require('./candlestick')
1919
]);
2020

21+
// locales
22+
Plotly.register([
23+
require('./locale-en'),
24+
require('./locale-en-us')
25+
]);
26+
2127
module.exports = Plotly;

lib/index-geo.js

+6
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,10 @@ Plotly.register([
1515
require('./choropleth')
1616
]);
1717

18+
// locales
19+
Plotly.register([
20+
require('./locale-en'),
21+
require('./locale-en-us')
22+
]);
23+
1824
module.exports = Plotly;

lib/index-gl2d.js

+6
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@ Plotly.register([
1818
require('./parcoords')
1919
]);
2020

21+
// locales
22+
Plotly.register([
23+
require('./locale-en'),
24+
require('./locale-en-us')
25+
]);
26+
2127
module.exports = Plotly;

lib/index-gl3d.js

+6
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ Plotly.register([
1616
require('./mesh3d')
1717
]);
1818

19+
// locales
20+
Plotly.register([
21+
require('./locale-en'),
22+
require('./locale-en-us')
23+
]);
24+
1925
module.exports = Plotly;

lib/index-mapbox.js

+6
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@ Plotly.register([
1414
require('./scattermapbox')
1515
]);
1616

17+
// locales
18+
Plotly.register([
19+
require('./locale-en'),
20+
require('./locale-en-us')
21+
]);
22+
1723
module.exports = Plotly;

lib/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,10 @@ Plotly.register([
7373
require('./calendars')
7474
]);
7575

76+
// locales
77+
Plotly.register([
78+
require('./locale-en.js'),
79+
require('./locale-en-us.js')
80+
]);
81+
7682
module.exports = Plotly;

lib/locale-en-us.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Copyright 2012-2017, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = {
12+
moduleType: 'locale',
13+
name: 'en-US',
14+
dictionary: {
15+
'Click to enter Colorscale title': 'Click to enter Colorscale title'
16+
}
17+
};

lib/locale-en.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Copyright 2012-2017, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = {
12+
moduleType: 'locale',
13+
name: 'en',
14+
dictionary: {
15+
'Click to enter Colorscale title': 'Click to enter Colourscale title'
16+
}
17+
};

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"bundle": "node tasks/bundle.js",
2626
"header": "node tasks/header.js",
2727
"stats": "node tasks/stats.js",
28-
"build": "npm run preprocess && npm run bundle && npm run header && npm run stats",
28+
"find-strings": "node tasks/find_locale_strings.js",
29+
"build": "npm run preprocess && npm run find-strings && npm run bundle && npm run header && npm run stats",
2930
"cibuild": "npm run preprocess && node tasks/cibundle.js",
3031
"watch": "node tasks/watch.js",
3132
"lint": "eslint --version && eslint .",
@@ -36,7 +37,7 @@
3637
"test-image": "node tasks/test_image.js",
3738
"test-image-gl2d": "node tasks/test_image.js gl2d_* --queue",
3839
"test-export": "node tasks/test_export.js",
39-
"test-syntax": "node tasks/test_syntax.js",
40+
"test-syntax": "node tasks/test_syntax.js && npm run find-strings",
4041
"test-bundle": "node tasks/test_bundle.js",
4142
"test": "npm run test-jasmine && npm run test-bundle && npm run test-image && npm run test-image-gl2d && npm run test-syntax && npm run lint",
4243
"start-test_dashboard": "node devtools/test_dashboard/server.js",
@@ -86,6 +87,7 @@
8687
"has-hover": "^1.0.1",
8788
"mapbox-gl": "^0.22.0",
8889
"matrix-camera-controller": "^2.1.3",
90+
"minify-stream": "^1.1.0",
8991
"mouse-change": "^1.4.0",
9092
"mouse-event-offset": "^3.0.2",
9193
"mouse-wheel": "^1.0.2",
@@ -109,6 +111,7 @@
109111
"brfs": "^1.4.3",
110112
"browserify": "^14.1.0",
111113
"browserify-transform-tools": "^1.7.0",
114+
"cross-spawn": "^5.1.0",
112115
"deep-equal": "^1.0.1",
113116
"ecstatic": "^2.1.0",
114117
"eslint": "^3.17.1",
@@ -119,6 +122,7 @@
119122
"glslify": "^4.0.0",
120123
"gzip-size": "^3.0.0",
121124
"image-size": "^0.5.1",
125+
"into-stream": "^3.1.0",
122126
"jasmine-core": "^2.4.1",
123127
"jsdom": "^11.2.0",
124128
"karma": "^1.5.0",
@@ -140,7 +144,6 @@
140144
"read-last-lines": "^1.1.0",
141145
"requirejs": "^2.3.1",
142146
"through2": "^2.0.3",
143-
"uglify-js": "^2.8.12",
144147
"watchify": "^3.9.0",
145148
"xml2js": "^0.4.16"
146149
}

src/components/annotations/attributes.js

+46-3
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,25 @@ module.exports = {
173173
dflt: 1,
174174
role: 'style',
175175
editType: 'arraydraw',
176-
description: 'Sets the annotation arrow head style.'
176+
description: 'Sets the end annotation arrow head style.'
177+
},
178+
startarrowhead: {
179+
valType: 'integer',
180+
min: 0,
181+
max: ARROWPATHS.length,
182+
dflt: 1,
183+
role: 'style',
184+
editType: 'arraydraw',
185+
description: 'Sets the start annotation arrow head style.'
186+
},
187+
arrowside: {
188+
valType: 'flaglist',
189+
flags: ['end', 'start'],
190+
extras: ['none'],
191+
dflt: 'end',
192+
role: 'style',
193+
editType: 'arraydraw',
194+
description: 'Sets the annotation arrow head position.'
177195
},
178196
arrowsize: {
179197
valType: 'number',
@@ -182,7 +200,18 @@ module.exports = {
182200
role: 'style',
183201
editType: 'calcIfAutorange',
184202
description: [
185-
'Sets the size of the annotation arrow head, relative to `arrowwidth`.',
203+
'Sets the size of the end annotation arrow head, relative to `arrowwidth`.',
204+
'A value of 1 (default) gives a head about 3x as wide as the line.'
205+
].join(' ')
206+
},
207+
startarrowsize: {
208+
valType: 'number',
209+
min: 0.3,
210+
dflt: 1,
211+
role: 'style',
212+
editType: 'calcIfAutorange',
213+
description: [
214+
'Sets the size of the start annotation arrow head, relative to `arrowwidth`.',
186215
'A value of 1 (default) gives a head about 3x as wide as the line.'
187216
].join(' ')
188217
},
@@ -200,7 +229,21 @@ module.exports = {
200229
role: 'style',
201230
editType: 'calcIfAutorange',
202231
description: [
203-
'Sets a distance, in pixels, to move the arrowhead away from the',
232+
'Sets a distance, in pixels, to move the end arrowhead away from the',
233+
'position it is pointing at, for example to point at the edge of',
234+
'a marker independent of zoom. Note that this shortens the arrow',
235+
'from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`',
236+
'which moves everything by this amount.'
237+
].join(' ')
238+
},
239+
startstandoff: {
240+
valType: 'number',
241+
min: 0,
242+
dflt: 0,
243+
role: 'style',
244+
editType: 'calcIfAutorange',
245+
description: [
246+
'Sets a distance, in pixels, to move the start arrowhead away from the',
204247
'position it is pointing at, for example to point at the edge of',
205248
'a marker independent of zoom. Note that this shortens the arrow',
206249
'from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`',

src/components/annotations/calc_autorange.js

+19-10
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,16 @@ function annAutorange(gd) {
4848
Lib.filterVisible(fullLayout.annotations).forEach(function(ann) {
4949
var xa = Axes.getFromId(gd, ann.xref),
5050
ya = Axes.getFromId(gd, ann.yref),
51-
headSize = 3 * ann.arrowsize * ann.arrowwidth || 0;
51+
headSize = 3 * ann.arrowsize * ann.arrowwidth || 0,
52+
startHeadSize = 3 * ann.startarrowsize * ann.arrowwidth || 0;
5253

53-
var headPlus, headMinus;
54+
var headPlus, headMinus, startHeadPlus, startHeadMinus;
5455

5556
if(xa && xa.autorange) {
5657
headPlus = headSize + ann.xshift;
5758
headMinus = headSize - ann.xshift;
59+
startHeadPlus = startHeadSize + ann.xshift;
60+
startHeadMinus = startHeadSize - ann.xshift;
5861

5962
if(ann.axref === ann.xref) {
6063
// expand for the arrowhead (padded by arrowhead)
@@ -64,36 +67,42 @@ function annAutorange(gd) {
6467
});
6568
// again for the textbox (padded by textbox)
6669
Axes.expand(xa, [xa.r2c(ann.ax)], {
67-
ppadplus: ann._xpadplus,
68-
ppadminus: ann._xpadminus
70+
ppadplus: Math.max(ann._xpadplus, startHeadPlus),
71+
ppadminus: Math.max(ann._xpadminus, startHeadMinus)
6972
});
7073
}
7174
else {
75+
startHeadPlus = ann.ax ? startHeadPlus + ann.ax : startHeadPlus;
76+
startHeadMinus = ann.ax ? startHeadMinus - ann.ax : startHeadMinus;
7277
Axes.expand(xa, [xa.r2c(ann.x)], {
73-
ppadplus: Math.max(ann._xpadplus, headPlus),
74-
ppadminus: Math.max(ann._xpadminus, headMinus)
78+
ppadplus: Math.max(ann._xpadplus, headPlus, startHeadPlus),
79+
ppadminus: Math.max(ann._xpadminus, headMinus, startHeadMinus)
7580
});
7681
}
7782
}
7883

7984
if(ya && ya.autorange) {
8085
headPlus = headSize - ann.yshift;
8186
headMinus = headSize + ann.yshift;
87+
startHeadPlus = startHeadSize - ann.yshift;
88+
startHeadMinus = startHeadSize + ann.yshift;
8289

8390
if(ann.ayref === ann.yref) {
8491
Axes.expand(ya, [ya.r2c(ann.y)], {
8592
ppadplus: headPlus,
8693
ppadminus: headMinus
8794
});
8895
Axes.expand(ya, [ya.r2c(ann.ay)], {
89-
ppadplus: ann._ypadplus,
90-
ppadminus: ann._ypadminus
96+
ppadplus: Math.max(ann._ypadplus, startHeadPlus),
97+
ppadminus: Math.max(ann._ypadminus, startHeadMinus)
9198
});
9299
}
93100
else {
101+
startHeadPlus = ann.ay ? startHeadPlus + ann.ay : startHeadPlus;
102+
startHeadMinus = ann.ay ? startHeadMinus - ann.ay : startHeadMinus;
94103
Axes.expand(ya, [ya.r2c(ann.y)], {
95-
ppadplus: Math.max(ann._ypadplus, headPlus),
96-
ppadminus: Math.max(ann._ypadminus, headMinus)
104+
ppadplus: Math.max(ann._ypadplus, headPlus, startHeadPlus),
105+
ppadminus: Math.max(ann._ypadminus, headMinus, startHeadMinus)
97106
});
98107
}
99108
}

0 commit comments

Comments
 (0)