Skip to content

Commit 0a1f133

Browse files
committed
Merge remote-tracking branch 'origin/master' into cam/5192/add-min-max-scale-limits
2 parents 5f0083f + d407172 commit 0a1f133

File tree

15 files changed

+395
-22
lines changed

15 files changed

+395
-22
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ To see all merged commits on the master branch that will be part of the next plo
99

1010
where X.Y.Z is the semver of most recent plotly.js release.
1111

12+
13+
## [3.0.2] -- 2025-07-22
14+
15+
### Fixed
16+
- Fix installing dependencies in node v22 [[#7381](https://github.com/plotly/plotly.js/pull/7381)], with thanks to @chaigh-uk for the contribution!
17+
- Fix Persian calendar leap year [[#7456](https://github.com/plotly/plotly.js/pull/7456)]
18+
- Fix scroll wheel zoom for geo subplots in Safari [#7474](https://github.com/plotly/plotly.js/pull/7474)
19+
- Add method to check for WebKit WebView user agent string [[#7479](https://github.com/plotly/plotly.js/pull/7479)]
20+
- Fix edit colorbar title [7487](https://github.com/plotly/plotly.js/pull/7487)
21+
22+
1223
## [3.1.0-rc.0] -- 2025-07-15
1324

1425
### Added
@@ -19,7 +30,7 @@ where X.Y.Z is the semver of most recent plotly.js release.
1930
with thanks to @my-tien for the contribution!
2031

2132
### Changed
22-
- Switch to United Nations (coastlines, countries, land, ocean) + Natural Earth (lakes, rivers, subunits) geodata for building topojson used in geo plot
33+
- Switch to United Nations (coastlines, countries, land, ocean) + Natural Earth (lakes, rivers, subunits) geodata for building topojson used in geo plot [[#7393](https://github.com/plotly/plotly.js/pull/7393)]
2334
- Make 'png' all caps [[#7400](https://github.com/plotly/plotly.js/pull/7400)]
2435

2536
### Fixed

draftlogs/7470_fix.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Fix editable shapes (regression introduced in 2.34.0) [[#7470](https://github.com/plotly/plotly.js/pull/7470)],
2+
with thanks to @my-tien for the contribution!

draftlogs/7479_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Add method to check for WebKit WebView user agent string [[#7479](https://github.com/plotly/plotly.js/pull/7479)]

draftlogs/7481_change.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Refactor files related to UN topojson [[#7481](https://github.com/plotly/plotly.js/pull/7481)]

draftlogs/7487_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix edit colorbar title [7487](https://github.com/plotly/plotly.js/pull/7487)

src/assets/geo_assets.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
'use strict';
22

3-
// TODO: Remove comments from Antarctica, Oceania during new maps release PR
43
const topojson = {
54
africa_110m: require('../../dist/topojson/africa_110m.json'),
6-
// antarctica_110m: require('../../dist/topojson/antarctica_110m.json'),
5+
antarctica_110m: require('../../dist/topojson/antarctica_110m.json'),
76
asia_110m: require('../../dist/topojson/asia_110m.json'),
87
europe_110m: require('../../dist/topojson/europe_110m.json'),
98
'north-america_110m': require('../../dist/topojson/north-america_110m.json'),
10-
// oceania_110m: require('../../dist/topojson/oceania_110m.json'),
9+
oceania_110m: require('../../dist/topojson/oceania_110m.json'),
1110
'south-america_110m': require('../../dist/topojson/south-america_110m.json'),
1211
usa_110m: require('../../dist/topojson/usa_110m.json'),
1312
world_110m: require('../../dist/topojson/world_110m.json'),
1413
africa_50m: require('../../dist/topojson/africa_50m.json'),
15-
// antarctica_50m: require('../../dist/topojson/antarctica_50m.json'),
14+
antarctica_50m: require('../../dist/topojson/antarctica_50m.json'),
1615
asia_50m: require('../../dist/topojson/asia_50m.json'),
1716
europe_50m: require('../../dist/topojson/europe_50m.json'),
1817
'north-america_50m': require('../../dist/topojson/north-america_50m.json'),
19-
// oceania_50m: require('../../dist/topojson/oceania_50m.json'),
18+
oceania_50m: require('../../dist/topojson/oceania_50m.json'),
2019
'south-america_50m': require('../../dist/topojson/south-america_50m.json'),
2120
usa_50m: require('../../dist/topojson/usa_50m.json'),
2221
world_50m: require('../../dist/topojson/world_50m.json'),

src/components/shapes/draw_newshape/newshapes.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
var axis_ids = require('../../../plots/cartesian/axis_ids');
4+
35
var dragHelpers = require('../../dragelement/helpers');
46
var drawMode = dragHelpers.drawMode;
57
var openMode = dragHelpers.openMode;
@@ -84,10 +86,23 @@ function newShapes(outlines, dragOptions) {
8486
case 'line':
8587
case 'rect':
8688
case 'circle':
87-
modifyItem('x0', afterEdit.x0 - (beforeEdit.x0shift || 0));
88-
modifyItem('x1', afterEdit.x1 - (beforeEdit.x1shift || 0));
89-
modifyItem('y0', afterEdit.y0 - (beforeEdit.y0shift || 0));
90-
modifyItem('y1', afterEdit.y1 - (beforeEdit.y1shift || 0));
89+
90+
var xaxis = axis_ids.getFromId(gd, beforeEdit.xref);
91+
if (beforeEdit.xref.charAt(0) === 'x' && xaxis.type.includes('category')) {
92+
modifyItem('x0', afterEdit.x0 - (beforeEdit.x0shift || 0));
93+
modifyItem('x1', afterEdit.x1 - (beforeEdit.x1shift || 0));
94+
} else {
95+
modifyItem('x0', afterEdit.x0);
96+
modifyItem('x1', afterEdit.x1);
97+
}
98+
var yaxis = axis_ids.getFromId(gd, beforeEdit.yref);
99+
if (beforeEdit.yref.charAt(0) === 'y' && yaxis.type.includes('category')) {
100+
modifyItem('y0', afterEdit.y0 - (beforeEdit.y0shift || 0));
101+
modifyItem('y1', afterEdit.y1 - (beforeEdit.y1shift || 0));
102+
} else {
103+
modifyItem('y0', afterEdit.y0);
104+
modifyItem('y1', afterEdit.y1);
105+
}
91106
break;
92107

93108
case 'path':

src/components/titles/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var SUBTITLE_PADDING_EM = 1.6;
2222
* @param {DOM element} gd - the graphDiv
2323
* @param {string} titleClass - the css class of this title
2424
* @param {object} options - how and what to draw
25-
* propContainer - the layout object containing the `title` attribute that
25+
* propContainer - the layout object containing the `title` attribute that
2626
* applies to this title
2727
* propName - the full name of the title property (for Plotly.relayout)
2828
* [traceIndex] - include only if this property applies to one trace
@@ -102,7 +102,7 @@ function draw(gd, titleClass, options) {
102102
var editAttr;
103103
if(prop === 'title.text') editAttr = 'titleText';
104104
else if(prop.indexOf('axis') !== -1) editAttr = 'axisTitleText';
105-
else if(prop.indexOf('colorbar' !== -1)) editAttr = 'colorbarTitleText';
105+
else if(prop.indexOf('colorbar') !== -1) editAttr = 'colorbarTitleText';
106106
var editable = gd._context.edits[editAttr];
107107

108108
function matchesPlaceholder(text, placeholder) {

src/lib/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,12 @@ lib.isIOS = function() {
765765
return IS_IOS_REGEX.test(window.navigator.userAgent);
766766
};
767767

768+
// The WKWebView user agent string doesn't include 'Safari', so we need a separate test
769+
// for a UA string like this:
770+
// Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)
771+
const IS_MAC_WKWEBVIEW_REGEX = /Macintosh.+AppleWebKit.+Gecko\)$/;
772+
lib.isMacWKWebView = () => IS_MAC_WKWEBVIEW_REGEX.test(window.navigator.userAgent);
773+
768774
var FIREFOX_VERSION_REGEX = /Firefox\/(\d+)\.\d+/;
769775
lib.getFirefoxVersion = function() {
770776
var match = FIREFOX_VERSION_REGEX.exec(window.navigator.userAgent);

src/lib/supports_pixelated_image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function supportsPixelatedImage() {
1919
_supportsPixelated = false;
2020

2121
// @see https://github.com/plotly/plotly.js/issues/6604
22-
var unsupportedBrowser = Lib.isSafari() || Lib.isIOS();
22+
var unsupportedBrowser = Lib.isSafari() || Lib.isMacWKWebView() || Lib.isIOS();
2323

2424
if(window.navigator.userAgent && !unsupportedBrowser) {
2525
var declarations = Array.from(constants.CSS_DECLARATIONS).reverse();

0 commit comments

Comments
 (0)