Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 81eff54

Browse files
committed
refactor: rename min/max scale limits
1 parent 423738f commit 81eff54

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

‎src/components/modebar/buttons.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,16 +548,16 @@ function handleGeo(gd, ev) {
548548

549549
if(attr === 'zoom') {
550550
var scale = geoLayout.projection.scale;
551-
var minScale = geoLayout.projection.minScale;
552-
var maxScale = geoLayout.projection.maxScale;
551+
var minscale = geoLayout.projection.minscale;
552+
var maxscale = geoLayout.projection.maxscale;
553553

554554
var newScale = (val === 'in') ? 2 * scale : 0.5 * scale;
555555

556556
// make sure the scale is within the min/max bounds
557-
if(newScale > maxScale) {
558-
newScale = maxScale;
559-
} else if(newScale < minScale) {
560-
newScale = minScale;
557+
if(newScale > maxscale) {
558+
newScale = maxscale;
559+
} else if(newScale < minscale) {
560+
newScale = minscale;
561561
}
562562

563563
Registry.call('_guiRelayout', gd, id + '.projection.scale', newScale);

‎src/plots/geo/layout_attributes.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ var attrs = module.exports = overrideAll({
177177
'that fits the map\'s lon and lat ranges. '
178178
].join(' ')
179179
},
180-
minScale: {
180+
minscale: {
181181
valType: 'number',
182182
min: 0,
183183
dflt: 0,
@@ -187,10 +187,10 @@ var attrs = module.exports = overrideAll({
187187
'where the map has half the size of base zoom level.'
188188
].join(' ')
189189
},
190-
maxScale: {
190+
maxscale: {
191191
valType: 'number',
192192
min: 0,
193-
dflt: Infinity,
193+
dflt: null,
194194
description: [
195195
'Maximal zoom level of the map view.',
196196
'A maxScale of *2* (200%) corresponds to a zoom level',

‎src/plots/geo/layout_defaults.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce, opts) {
161161
}
162162

163163
coerce('projection.scale');
164-
coerce('projection.minScale');
165-
coerce('projection.maxScale');
164+
coerce('projection.minscale');
165+
coerce('projection.maxscale');
166166

167167
show = coerce('showland', !visible ? false : undefined);
168168
if(show) coerce('landcolor');
@@ -207,8 +207,8 @@ function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce, opts) {
207207
// clear attributes that will get auto-filled later
208208
if(fitBounds) {
209209
delete geoLayoutOut.projection.scale;
210-
delete geoLayoutOut.projection.minScale;
211-
delete geoLayoutOut.projection.maxScale;
210+
delete geoLayoutOut.projection.minscale;
211+
delete geoLayoutOut.projection.maxscale;
212212

213213
if(isScoped) {
214214
delete geoLayoutOut.center.lon;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /