Skip to content

Commit b0b8ab1

Browse files
committed
Merge branch 'master' into add-text-to-shapes
2 parents 095561f + 1d21d64 commit b0b8ab1

File tree

108 files changed

+1868
-1277
lines changed

Some content is hidden

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

108 files changed

+1868
-1277
lines changed

.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"no-floating-decimal": [2],
5656
"space-infix-ops": [2, {"int32Hint": true}],
5757
"quotes": [2, "single"],
58+
"quote-props": ["error", "as-needed"],
5859
"dot-notation": [2],
5960
"dot-location": [2, "property"],
6061
"operator-linebreak": [2, "after"],

devtools/regl_codegen/server.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,17 @@ function handleCodegen(data) {
207207
var pathToReglCodegenSrc = constants.pathToReglCodegenSrc;
208208
var pathToReglPrecompiledSrc = path.join(constants.pathToSrc, 'traces', trace, 'regl_precompiled.js');
209209

210-
var header = '\'use strict\';\n';
210+
var header = [
211+
'\'use strict\';',
212+
'',
213+
].join('\n');
211214
var imports = '';
212-
var exports = '\nmodule.exports = {\n';
215+
var exports = [
216+
'',
217+
'/* eslint-disable quote-props */',
218+
'module.exports = {',
219+
'',
220+
].join('\n');
213221
var varId = 0;
214222

215223
Object.entries(generated).forEach(function(kv) {

devtools/test_dashboard/server.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ var minimist = require('minimist');
99
var constants = require('../../tasks/util/constants');
1010
var config = require('../../webpack.config.js');
1111
config.optimization = { minimize: false };
12-
config.mode = 'development';
13-
config.devtool = 'eval';
1412

1513
var args = minimist(process.argv.slice(2), {});
1614
var PORT = args.port || 3000;
@@ -20,6 +18,12 @@ var mathjax3chtml = args.mathjax3chtml;
2018

2119
if(strict) config.entry = './lib/index-strict.js';
2220

21+
if(!strict) {
22+
config.mode = 'development';
23+
config.devtool = 'eval';
24+
}
25+
26+
2327
// mock list
2428
getMockFiles()
2529
.then(readFiles)

draftlogs/6442_fix.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Avoid overlap of point and axis hover labels for `hovermode: 'x'|'y'` [[#6442](https://github.com/plotly/plotly.js/pull/6442)]

draftlogs/6481_add.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Add `labelalias` to various axes namely cartesian, gl3d, polar, smith, ternary, carpet, indicator and colorbar [[#6481](https://github.com/plotly/plotly.js/pull/6481)]

lib/locales/.eslintrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../.eslintrc",
3+
"rules": {
4+
"quote-props": ["error", "consistent"]
5+
}
6+
}

src/components/annotations/draw_arrow_head.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ module.exports = function drawArrowHead(el3, ends, options) {
127127

128128
d3.select(el.parentNode).append('path')
129129
.attr({
130-
'class': el3.attr('class'),
130+
class: el3.attr('class'),
131131
d: arrowHeadStyle.path,
132132
transform:
133133
strTranslate(p.x, p.y) +

src/components/calendars/index.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,23 @@ var DFLTRANGE = {
9797
*/
9898
var UNKNOWN = '##';
9999
var d3ToWorldCalendars = {
100-
'd': {'0': 'dd', '-': 'd'}, // 2-digit or unpadded day of month
101-
'e': {'0': 'd', '-': 'd'}, // alternate, always unpadded day of month
102-
'a': {'0': 'D', '-': 'D'}, // short weekday name
103-
'A': {'0': 'DD', '-': 'DD'}, // full weekday name
104-
'j': {'0': 'oo', '-': 'o'}, // 3-digit or unpadded day of the year
105-
'W': {'0': 'ww', '-': 'w'}, // 2-digit or unpadded week of the year (Monday first)
106-
'm': {'0': 'mm', '-': 'm'}, // 2-digit or unpadded month number
107-
'b': {'0': 'M', '-': 'M'}, // short month name
108-
'B': {'0': 'MM', '-': 'MM'}, // full month name
109-
'y': {'0': 'yy', '-': 'yy'}, // 2-digit year (map unpadded to zero-padded)
110-
'Y': {'0': 'yyyy', '-': 'yyyy'}, // 4-digit year (map unpadded to zero-padded)
111-
'U': UNKNOWN, // Sunday-first week of the year
112-
'w': UNKNOWN, // day of the week [0(sunday),6]
100+
d: {0: 'dd', '-': 'd'}, // 2-digit or unpadded day of month
101+
e: {0: 'd', '-': 'd'}, // alternate, always unpadded day of month
102+
a: {0: 'D', '-': 'D'}, // short weekday name
103+
A: {0: 'DD', '-': 'DD'}, // full weekday name
104+
j: {0: 'oo', '-': 'o'}, // 3-digit or unpadded day of the year
105+
W: {0: 'ww', '-': 'w'}, // 2-digit or unpadded week of the year (Monday first)
106+
m: {0: 'mm', '-': 'm'}, // 2-digit or unpadded month number
107+
b: {0: 'M', '-': 'M'}, // short month name
108+
B: {0: 'MM', '-': 'MM'}, // full month name
109+
y: {0: 'yy', '-': 'yy'}, // 2-digit year (map unpadded to zero-padded)
110+
Y: {0: 'yyyy', '-': 'yyyy'}, // 4-digit year (map unpadded to zero-padded)
111+
U: UNKNOWN, // Sunday-first week of the year
112+
w: UNKNOWN, // day of the week [0(sunday),6]
113113
// combined format, we replace the date part with the world-calendar version
114114
// and the %X stays there for d3 to handle with time parts
115-
'c': {'0': 'D M d %X yyyy', '-': 'D M d %X yyyy'},
116-
'x': {'0': 'mm/dd/yyyy', '-': 'mm/dd/yyyy'}
115+
c: {0: 'D M d %X yyyy', '-': 'D M d %X yyyy'},
116+
x: {0: 'mm/dd/yyyy', '-': 'mm/dd/yyyy'}
117117
};
118118

119119
function worldCalFmt(fmt, x, calendar) {

src/components/color/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ color.contrast = function(cstr, lightAmount, darkAmount) {
7575

7676
color.stroke = function(s, c) {
7777
var tc = tinycolor(c);
78-
s.style({'stroke': color.tinyRGB(tc), 'stroke-opacity': tc.getAlpha()});
78+
s.style({stroke: color.tinyRGB(tc), 'stroke-opacity': tc.getAlpha()});
7979
};
8080

8181
color.fill = function(s, c) {
8282
var tc = tinycolor(c);
8383
s.style({
84-
'fill': color.tinyRGB(tc),
84+
fill: color.tinyRGB(tc),
8585
'fill-opacity': tc.getAlpha()
8686
});
8787
};

src/components/colorbar/attributes.js

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ module.exports = overrideAll({
168168
tickcolor: axesAttrs.tickcolor,
169169
ticklabelstep: axesAttrs.ticklabelstep,
170170
showticklabels: axesAttrs.showticklabels,
171+
labelalias: axesAttrs.labelalias,
171172
tickfont: fontAttrs({
172173
description: 'Sets the color bar\'s tick label font'
173174
}),

src/components/colorbar/draw.js

+1
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@ function mockColorBarAxis(gd, opts, zrange) {
931931
tickwidth: opts.tickwidth,
932932
tickcolor: opts.tickcolor,
933933
showticklabels: opts.showticklabels,
934+
labelalias: opts.labelalias,
934935
ticklabelposition: opts.ticklabelposition,
935936
ticklabeloverflow: opts.ticklabeloverflow,
936937
ticklabelstep: opts.ticklabelstep,

src/components/colorscale/scales.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,60 @@
33
var tinycolor = require('tinycolor2');
44

55
var scales = {
6-
'Greys': [
6+
Greys: [
77
[0, 'rgb(0,0,0)'], [1, 'rgb(255,255,255)']
88
],
99

10-
'YlGnBu': [
10+
YlGnBu: [
1111
[0, 'rgb(8,29,88)'], [0.125, 'rgb(37,52,148)'],
1212
[0.25, 'rgb(34,94,168)'], [0.375, 'rgb(29,145,192)'],
1313
[0.5, 'rgb(65,182,196)'], [0.625, 'rgb(127,205,187)'],
1414
[0.75, 'rgb(199,233,180)'], [0.875, 'rgb(237,248,217)'],
1515
[1, 'rgb(255,255,217)']
1616
],
1717

18-
'Greens': [
18+
Greens: [
1919
[0, 'rgb(0,68,27)'], [0.125, 'rgb(0,109,44)'],
2020
[0.25, 'rgb(35,139,69)'], [0.375, 'rgb(65,171,93)'],
2121
[0.5, 'rgb(116,196,118)'], [0.625, 'rgb(161,217,155)'],
2222
[0.75, 'rgb(199,233,192)'], [0.875, 'rgb(229,245,224)'],
2323
[1, 'rgb(247,252,245)']
2424
],
2525

26-
'YlOrRd': [
26+
YlOrRd: [
2727
[0, 'rgb(128,0,38)'], [0.125, 'rgb(189,0,38)'],
2828
[0.25, 'rgb(227,26,28)'], [0.375, 'rgb(252,78,42)'],
2929
[0.5, 'rgb(253,141,60)'], [0.625, 'rgb(254,178,76)'],
3030
[0.75, 'rgb(254,217,118)'], [0.875, 'rgb(255,237,160)'],
3131
[1, 'rgb(255,255,204)']
3232
],
3333

34-
'Bluered': [
34+
Bluered: [
3535
[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']
3636
],
3737

3838
// modified RdBu based on
3939
// http://www.kennethmoreland.com/color-maps/
40-
'RdBu': [
40+
RdBu: [
4141
[0, 'rgb(5,10,172)'], [0.35, 'rgb(106,137,247)'],
4242
[0.5, 'rgb(190,190,190)'], [0.6, 'rgb(220,170,132)'],
4343
[0.7, 'rgb(230,145,90)'], [1, 'rgb(178,10,28)']
4444
],
4545

4646
// Scale for non-negative numeric values
47-
'Reds': [
47+
Reds: [
4848
[0, 'rgb(220,220,220)'], [0.2, 'rgb(245,195,157)'],
4949
[0.4, 'rgb(245,160,105)'], [1, 'rgb(178,10,28)']
5050
],
5151

5252
// Scale for non-positive numeric values
53-
'Blues': [
53+
Blues: [
5454
[0, 'rgb(5,10,172)'], [0.35, 'rgb(40,60,190)'],
5555
[0.5, 'rgb(70,100,245)'], [0.6, 'rgb(90,120,245)'],
5656
[0.7, 'rgb(106,137,247)'], [1, 'rgb(220,220,220)']
5757
],
5858

59-
'Picnic': [
59+
Picnic: [
6060
[0, 'rgb(0,0,255)'], [0.1, 'rgb(51,153,255)'],
6161
[0.2, 'rgb(102,204,255)'], [0.3, 'rgb(153,204,255)'],
6262
[0.4, 'rgb(204,204,255)'], [0.5, 'rgb(255,255,255)'],
@@ -65,50 +65,50 @@ var scales = {
6565
[1, 'rgb(255,0,0)']
6666
],
6767

68-
'Rainbow': [
68+
Rainbow: [
6969
[0, 'rgb(150,0,90)'], [0.125, 'rgb(0,0,200)'],
7070
[0.25, 'rgb(0,25,255)'], [0.375, 'rgb(0,152,255)'],
7171
[0.5, 'rgb(44,255,150)'], [0.625, 'rgb(151,255,0)'],
7272
[0.75, 'rgb(255,234,0)'], [0.875, 'rgb(255,111,0)'],
7373
[1, 'rgb(255,0,0)']
7474
],
7575

76-
'Portland': [
76+
Portland: [
7777
[0, 'rgb(12,51,131)'], [0.25, 'rgb(10,136,186)'],
7878
[0.5, 'rgb(242,211,56)'], [0.75, 'rgb(242,143,56)'],
7979
[1, 'rgb(217,30,30)']
8080
],
8181

82-
'Jet': [
82+
Jet: [
8383
[0, 'rgb(0,0,131)'], [0.125, 'rgb(0,60,170)'],
8484
[0.375, 'rgb(5,255,255)'], [0.625, 'rgb(255,255,0)'],
8585
[0.875, 'rgb(250,0,0)'], [1, 'rgb(128,0,0)']
8686
],
8787

88-
'Hot': [
88+
Hot: [
8989
[0, 'rgb(0,0,0)'], [0.3, 'rgb(230,0,0)'],
9090
[0.6, 'rgb(255,210,0)'], [1, 'rgb(255,255,255)']
9191
],
9292

93-
'Blackbody': [
93+
Blackbody: [
9494
[0, 'rgb(0,0,0)'], [0.2, 'rgb(230,0,0)'],
9595
[0.4, 'rgb(230,210,0)'], [0.7, 'rgb(255,255,255)'],
9696
[1, 'rgb(160,200,255)']
9797
],
9898

99-
'Earth': [
99+
Earth: [
100100
[0, 'rgb(0,0,130)'], [0.1, 'rgb(0,180,180)'],
101101
[0.2, 'rgb(40,210,40)'], [0.4, 'rgb(230,230,50)'],
102102
[0.6, 'rgb(120,70,20)'], [1, 'rgb(255,255,255)']
103103
],
104104

105-
'Electric': [
105+
Electric: [
106106
[0, 'rgb(0,0,0)'], [0.15, 'rgb(30,0,100)'],
107107
[0.4, 'rgb(120,0,100)'], [0.6, 'rgb(160,90,0)'],
108108
[0.8, 'rgb(230,200,0)'], [1, 'rgb(255,250,220)']
109109
],
110110

111-
'Viridis': [
111+
Viridis: [
112112
[0, '#440154'], [0.06274509803921569, '#48186a'],
113113
[0.12549019607843137, '#472d7b'], [0.18823529411764706, '#424086'],
114114
[0.25098039215686274, '#3b528b'], [0.3137254901960784, '#33638d'],
@@ -120,7 +120,7 @@ var scales = {
120120
[1, '#fde725']
121121
],
122122

123-
'Cividis': [
123+
Cividis: [
124124
[0.000000, 'rgb(0,32,76)'], [0.058824, 'rgb(0,42,102)'],
125125
[0.117647, 'rgb(0,52,110)'], [0.176471, 'rgb(39,63,108)'],
126126
[0.235294, 'rgb(60,74,107)'], [0.294118, 'rgb(76,85,107)'],

0 commit comments

Comments
 (0)