Skip to content

Commit 2dfec94

Browse files
committed
Merge remote-tracking branch 'origin/master' into parcoords-constraintrange-valtype
2 parents a3274c6 + 5114dbb commit 2dfec94

File tree

168 files changed

+17436
-772
lines changed

Some content is hidden

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

168 files changed

+17436
-772
lines changed

.circleci/config.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,34 @@ jobs:
185185
command: .circleci/env_build.sh
186186
- run:
187187
name: Preview CHANGELOG for next release (only on master)
188-
command: if [ $CIRCLE_BRANCH == "master" ]; then npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true; fi
188+
command: |
189+
if [ $CIRCLE_BRANCH == "master" ]
190+
then npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true
191+
fi
192+
- run:
193+
name: Set draft version in package.json
194+
command: |
195+
node --eval "var fs = require('fs'); var inOut = './package.json'; var data = JSON.parse(fs.readFileSync(inOut)); var a = process.argv; data.version = a[a.length - 1].replace('v', ''); fs.writeFileSync(inOut, JSON.stringify(data, null, 2) + '\n');" `git describe`
196+
- run:
197+
name: View package.json diff between previous and next releases (including above draft version change)
198+
command: git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true
189199
- run:
190200
name: Build dist/
191201
command: npm run build
192202
- store_artifacts:
193203
path: dist
194204
destination: dist
205+
- run:
206+
name: Preview plot-schema diff between previous and next releases (only on master)
207+
command: |
208+
if [ $CIRCLE_BRANCH == "master" ]
209+
then git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true
210+
fi
195211
- run:
196212
name: Pack tarball
197213
command: |
198214
npm pack
199-
version=$(node -e "console.log(require('./package.json').version)")
215+
version=$(node --eval "console.log(require('./package.json').version)")
200216
mv plotly.js-$version.tgz plotly.js.tgz
201217
- store_artifacts:
202218
path: plotly.js.tgz

CONTRIBUTING.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,33 @@ We use the following [labels](https://github.com/plotly/plotly.js/labels) to tra
8484
[`package-lock.json`](https://docs.npmjs.com/files/package-lock.json) file is
8585
used and updated correctly.
8686

87-
#### Step 1: Clone the plotly.js repo and install its dependencies
87+
#### Step 1: Fork the plotly.js repository, clone your fork and step into it
8888

8989
```bash
90-
git clone https://github.com/plotly/plotly.js.git
90+
git clone --depth 1 git@github.com:<your-GitHub-username>/plotly.js.git
9191
cd plotly.js
92+
```
93+
94+
#### Step 2: Switch to a dev branch
95+
96+
```bash
97+
# please do not use master or main for your dev branch
98+
git checkout dev-branch-name
99+
```
100+
101+
#### Step 3: Install dependencies
102+
103+
```bash
92104
npm install
93105
```
94106

95-
#### Step 2: Setup test environment
107+
#### Step 4: Setup test environment
96108

97109
```bash
98110
npm run pretest
99111
```
100112

101-
#### Step 3: Start the test dashboard
113+
#### Step 5: Start the test dashboard
102114

103115
```bash
104116
npm start
@@ -110,7 +122,7 @@ This command bundles up the source files with source maps using
110122
dev plotly.js bundle update every time a source file is saved) and opens up a
111123
tab in your browser.
112124

113-
#### Step 4: Open up the console and start developing
125+
#### Step 6: Open up the console and start developing
114126

115127
A typical workflow is to make some modifications to the source, update the
116128
test dashboard, inspect and debug the changes, then repeat. The test dashboard
@@ -138,13 +150,13 @@ Three additional helpers exist that are refreshed every second:
138150
There is also a search bar in the top right of the dashboard. This fuzzy-searches
139151
image mocks based on their file name and trace type.
140152

141-
#### Step 5: Regenerate plot-schema in "test" folder then review & commit potential changes
153+
#### Step 7: Regenerate plot-schema in "test" folder then review & commit potential changes
142154

143155
```bash
144156
npm run schema
145157
```
146158

147-
#### Step 6: Review & commit potential changes made to test/plot-schema.json
159+
#### Step 8: Review & commit potential changes made to test/plot-schema.json
148160

149161
> If you are editing attribute descriptions or implementing a new feature this file located in the test folder records the proposed changes to the API. Note that there is another plot-schema.json file located in the dist folder, which should only be updated by the maintainers at release time.
150162

draftlogs/5500_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Improve rendering of scattergl, splom and parcoords by implementing plotGlPixelRatio for those traces [[#5500](https://github.com/plotly/plotly.js/pull/5500)]

draftlogs/5791_change.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Adjust CONTRIBUTING document on how to clone plotly.js and submit pull requests from your fork [[#5791](https://github.com/plotly/plotly.js/pull/5791)]

draftlogs/5801_add.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Add satellite and various projection types to geo subplots [[#5801](https://github.com/plotly/plotly.js/pull/5801)]

draftlogs/5813_change.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Sort object key values in schema [[#5813](https://github.com/plotly/plotly.js/pull/5813)]

draftlogs/5814_add.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Preview plot-schema changes between previous and next release when building dist on master [[#5814](https://github.com/plotly/plotly.js/pull/5814)]

draftlogs/5815_change.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Label draft bundles and show package.json diff between versions when publishing dist artifacts on CircleCI [[#5815](https://github.com/plotly/plotly.js/pull/5815)]

draftlogs/5818_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Adjust links to time format options so that they point to the d3-time-format v2.2.3 applied not the latest [[#5818](https://github.com/plotly/plotly.js/pull/5818)]

draftlogs/5826_change.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- replace `d3.interpolate` method with `d3-interpolate` module in `icicle`, `indicator`, `parcats`, `sunburst` and `treemap` [[#5826](https://github.com/plotly/plotly.js/pull/5826)]

src/components/calendars/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var ONEDAY = constants.ONEDAY;
1010

1111
var attributes = {
1212
valType: 'enumerated',
13-
values: Object.keys(calendars.calendars),
13+
values: Lib.sortObjectKeys(calendars.calendars),
1414
editType: 'calc',
1515
dflt: 'gregorian'
1616
};

src/components/colorscale/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
var colorbarAttrs = require('../colorbar/attributes');
44
var counterRegex = require('../../lib/regex').counter;
5+
var sortObjectKeys = require('../../lib/sort_object_keys');
56

67
var palettes = require('./scales.js').scales;
7-
var paletteStr = Object.keys(palettes);
8+
var paletteStr = sortObjectKeys(palettes);
89

910
function code(s) {
1011
return '`' + s + '`';

src/constants/docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
module.exports = {
44
FORMAT_LINK: 'https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format',
5-
DATE_FORMAT_LINK: 'https://github.com/d3/d3-time-format#locale_format'
5+
DATE_FORMAT_LINK: 'https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format'
66
};

src/lib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ var MAX_SAFE = numConstants.FP_SAFE;
99
var MIN_SAFE = -MAX_SAFE;
1010
var BADNUM = numConstants.BADNUM;
1111

12-
var lib = module.exports = {};
12+
var lib = module.exports = {
13+
_numberFormat: d3.format // simply to test d3.format before switching to d3-format
14+
};
1315

1416
lib.nestedProperty = require('./nested_property');
1517
lib.keyedContainer = require('./keyed_container');
@@ -65,6 +67,8 @@ lib.roundUp = searchModule.roundUp;
6567
lib.sort = searchModule.sort;
6668
lib.findIndexOfMin = searchModule.findIndexOfMin;
6769

70+
lib.sortObjectKeys = require('./sort_object_keys');
71+
6872
var statsModule = require('./stats');
6973
lib.aggNums = statsModule.aggNums;
7074
lib.len = statsModule.len;

src/lib/sort_object_keys.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
module.exports = function sortObjectKeys(obj) {
4+
return Object.keys(obj).sort();
5+
};

src/plot_api/plot_api.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,20 @@ function _doPlot(gd, data, layout, config) {
222222
});
223223
}
224224

225+
var plotGlPixelRatio = gd._context.plotGlPixelRatio;
225226
if(fullLayout._glcanvas) {
226227
fullLayout._glcanvas
227-
.attr('width', fullLayout.width)
228-
.attr('height', fullLayout.height);
228+
.attr('width', fullLayout.width * plotGlPixelRatio)
229+
.attr('height', fullLayout.height * plotGlPixelRatio)
230+
.style('width', fullLayout.width + 'px')
231+
.style('height', fullLayout.height + 'px');
229232

230233
var regl = fullLayout._glcanvas.data()[0].regl;
231234
if(regl) {
232235
// Unfortunately, this can happen when relayouting to large
233236
// width/height on some browsers.
234-
if(Math.floor(fullLayout.width) !== regl._gl.drawingBufferWidth ||
235-
Math.floor(fullLayout.height) !== regl._gl.drawingBufferHeight
237+
if(Math.floor(fullLayout.width * plotGlPixelRatio) !== regl._gl.drawingBufferWidth ||
238+
Math.floor(fullLayout.height * plotGlPixelRatio) !== regl._gl.drawingBufferHeight
236239
) {
237240
var msg = 'WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.';
238241
if(drawFrameworkCalls) {

src/plots/cartesian/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,8 @@ exports.toSVG = function(gd) {
596596
preserveAspectRatio: 'none',
597597
x: 0,
598598
y: 0,
599-
width: canvas.width,
600-
height: canvas.height
599+
width: canvas.style.width,
600+
height: canvas.style.height
601601
});
602602
}
603603

src/plots/geo/constants.js

Lines changed: 52 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,128 +2,120 @@
22

33
// projection names to d3 function name
44
exports.projNames = {
5-
'equirectangular': 'equirectangular',
6-
'mercator': 'mercator',
7-
'orthographic': 'orthographic',
8-
'natural earth': 'naturalEarth',
9-
'kavrayskiy7': 'kavrayskiy7',
10-
'miller': 'miller',
11-
'robinson': 'robinson',
12-
'eckert4': 'eckert4',
13-
'azimuthal equal area': 'azimuthalEqualArea',
14-
'azimuthal equidistant': 'azimuthalEquidistant',
15-
'conic equal area': 'conicEqualArea',
16-
'conic conformal': 'conicConformal',
17-
'conic equidistant': 'conicEquidistant',
18-
'gnomonic': 'gnomonic',
19-
'stereographic': 'stereographic',
20-
'mollweide': 'mollweide',
21-
'hammer': 'hammer',
22-
'transverse mercator': 'transverseMercator',
23-
'albers usa': 'albersUsa',
24-
'winkel tripel': 'winkel3',
25-
'aitoff': 'aitoff',
26-
'sinusoidal': 'sinusoidal',
27-
/*
28-
// potential projections that could be added to the API
29-
305
'airy': 'airy',
31-
// 'albers': 'albers',
32-
'armadillo': 'armadillo',
6+
'aitoff': 'aitoff',
7+
'albers usa': 'albersUsa',
8+
'albers': 'albers',
9+
// 'armadillo': 'armadillo',
3310
'august': 'august',
11+
'azimuthal equal area': 'azimuthalEqualArea',
12+
'azimuthal equidistant': 'azimuthalEquidistant',
3413
'baker': 'baker',
35-
'berghaus': 'berghaus',
14+
// 'berghaus': 'berghaus',
3615
'bertin1953': 'bertin1953',
3716
'boggs': 'boggs',
3817
'bonne': 'bonne',
3918
'bottomley': 'bottomley',
4019
'bromley': 'bromley',
20+
// 'chamberlin africa': 'chamberlinAfrica',
4121
// 'chamberlin': 'chamberlin',
42-
'chamberlin africa': 'chamberlinAfrica',
4322
'collignon': 'collignon',
23+
'conic conformal': 'conicConformal',
24+
'conic equal area': 'conicEqualArea',
25+
'conic equidistant': 'conicEquidistant',
4426
'craig': 'craig',
4527
'craster': 'craster',
4628
'cylindrical equal area': 'cylindricalEqualArea',
4729
'cylindrical stereographic': 'cylindricalStereographic',
4830
'eckert1': 'eckert1',
4931
'eckert2': 'eckert2',
5032
'eckert3': 'eckert3',
33+
'eckert4': 'eckert4',
5134
'eckert5': 'eckert5',
5235
'eckert6': 'eckert6',
5336
'eisenlohr': 'eisenlohr',
37+
'equirectangular': 'equirectangular',
5438
'fahey': 'fahey',
55-
'foucaut': 'foucaut',
5639
'foucaut sinusoidal': 'foucautSinusoidal',
57-
'gilbert': 'gilbert',
58-
'gingery': 'gingery',
40+
'foucaut': 'foucaut',
41+
// 'gilbert': 'gilbert',
42+
// 'gingery': 'gingery',
5943
'ginzburg4': 'ginzburg4',
6044
'ginzburg5': 'ginzburg5',
6145
'ginzburg6': 'ginzburg6',
6246
'ginzburg8': 'ginzburg8',
6347
'ginzburg9': 'ginzburg9',
48+
'gnomonic': 'gnomonic',
49+
'gringorten quincuncial': 'gringortenQuincuncial',
6450
'gringorten': 'gringorten',
6551
'guyou': 'guyou',
66-
'hammer retroazimuthal': 'hammerRetroazimuthal',
67-
'healpix': 'healpix',
52+
// 'hammer retroazimuthal': 'hammerRetroazimuthal',
53+
'hammer': 'hammer',
54+
// 'healpix': 'healpix',
6855
'hill': 'hill',
6956
'homolosine': 'homolosine',
7057
'hufnagel': 'hufnagel',
7158
'hyperelliptical': 'hyperelliptical',
59+
// 'interrupted boggs': 'interruptedBoggs',
60+
// 'interrupted homolosine': 'interruptedHomolosine',
61+
// 'interrupted mollweide hemispheres': 'interruptedMollweideHemispheres',
62+
// 'interrupted mollweide': 'interruptedMollweide',
63+
// 'interrupted quartic authalic': 'interruptedQuarticAuthalic',
64+
// 'interrupted sinu mollweide': 'interruptedSinuMollweide',
65+
// 'interrupted sinusoidal': 'interruptedSinusoidal',
66+
'kavrayskiy7': 'kavrayskiy7',
7267
'lagrange': 'lagrange',
7368
'larrivee': 'larrivee',
7469
'laskowski': 'laskowski',
75-
'littrow': 'littrow',
70+
// 'littrow': 'littrow',
7671
'loximuthal': 'loximuthal',
72+
'mercator': 'mercator',
73+
'miller': 'miller',
74+
// 'modified stereographic alaska': 'modifiedStereographicAlaska',
75+
// 'modified stereographic gs48': 'modifiedStereographicGs48',
76+
// 'modified stereographic gs50': 'modifiedStereographicGs50',
77+
// 'modified stereographic lee': 'modifiedStereographicLee',
78+
// 'modified stereographic miller': 'modifiedStereographicMiller',
7779
// 'modified stereographic': 'modifiedStereographic',
78-
'modified stereographic alaska': 'modifiedStereographicAlaska',
79-
'modified stereographic gs48': 'modifiedStereographicGs48',
80-
'modified stereographic gs50': 'modifiedStereographicGs50',
81-
'modified stereographic miller': 'modifiedStereographicMiller',
82-
'modified stereographic lee': 'modifiedStereographicLee',
80+
'mollweide': 'mollweide',
8381
'mt flat polar parabolic': 'mtFlatPolarParabolic',
8482
'mt flat polar quartic': 'mtFlatPolarQuartic',
8583
'mt flat polar sinusoidal': 'mtFlatPolarSinusoidal',
84+
'natural earth': 'naturalEarth',
8685
'natural earth1': 'naturalEarth1',
8786
'natural earth2': 'naturalEarth2',
8887
'nell hammer': 'nellHammer',
8988
'nicolosi': 'nicolosi',
89+
'orthographic': 'orthographic',
9090
'patterson': 'patterson',
91+
'peirce quincuncial': 'peirceQuincuncial',
9192
'polyconic': 'polyconic',
93+
// 'polyhedral butterfly': 'polyhedralButterfly',
94+
// 'polyhedral collignon': 'polyhedralCollignon',
95+
// 'polyhedral waterman': 'polyhedralWaterman',
9296
'rectangular polyconic': 'rectangularPolyconic',
97+
'robinson': 'robinson',
9398
'satellite': 'satellite',
9499
'sinu mollweide': 'sinuMollweide',
100+
'sinusoidal': 'sinusoidal',
101+
'stereographic': 'stereographic',
95102
'times': 'times',
96-
// 'two point azimuthal': 'twoPointAzimuthal',
103+
'transverse mercator': 'transverseMercator',
97104
// 'two point azimuthalUsa': 'twoPointAzimuthalUsa',
98-
// 'two point equidistant': 'twoPointEquidistant',
105+
// 'two point azimuthal': 'twoPointAzimuthal',
99106
// 'two point equidistantUsa': 'twoPointEquidistantUsa',
107+
// 'two point equidistant': 'twoPointEquidistant',
100108
'van der grinten': 'vanDerGrinten',
101109
'van der grinten2': 'vanDerGrinten2',
102110
'van der grinten3': 'vanDerGrinten3',
103111
'van der grinten4': 'vanDerGrinten4',
104-
// 'wagner': 'wagner',
105112
'wagner4': 'wagner4',
106113
'wagner6': 'wagner6',
107114
// 'wagner7': 'wagner7',
115+
// 'wagner': 'wagner',
108116
'wiechel': 'wiechel',
117+
'winkel tripel': 'winkel3',
109118
'winkel3': 'winkel3',
110-
111-
// 'interrupt': 'interrupt',
112-
'interrupted homolosine': 'interruptedHomolosine',
113-
'interrupted sinusoidal': 'interruptedSinusoidal',
114-
'interrupted boggs': 'interruptedBoggs',
115-
'interrupted sinu mollweide': 'interruptedSinuMollweide',
116-
'interrupted mollweide': 'interruptedMollweide',
117-
'interrupted mollweide hemispheres': 'interruptedMollweideHemispheres',
118-
'interrupted quartic authalic': 'interruptedQuarticAuthalic',
119-
120-
'polyhedral butterfly': 'polyhedralButterfly',
121-
'polyhedral collignon': 'polyhedralCollignon',
122-
'polyhedral waterman': 'polyhedralWaterman',
123-
124-
'gringorten quincuncial': 'gringortenQuincuncial',
125-
'peirce quincuncial': 'peirceQuincuncial',
126-
*/
127119
};
128120

129121
// name of the axes

0 commit comments

Comments
 (0)