Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: use dflt: -1 instad of null
  • Loading branch information
mojoaxel authored and camdecoster committed Feb 18, 2025
commit 2d9e5f2726383a3cb6aa5dce4635733fd2d6f881
1 change: 1 addition & 0 deletions src/components/modebar/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ function handleGeo(gd, ev) {
var minscale = geoLayout.projection.minscale;
var maxscale = geoLayout.projection.maxscale;

if(maxscale < 0) maxscale = Infinity;
var newScale = (val === 'in') ? 2 * scale : 0.5 * scale;

// make sure the scale is within the min/max bounds
Expand Down
2 changes: 1 addition & 1 deletion src/plots/geo/layout_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ var attrs = module.exports = overrideAll({
maxscale: {
valType: 'number',
min: 0,
dflt: null,
dflt: -1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try setting dflt: 0 in the API and handle the case of zero instead of -1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We represent Infinity with -1 since Infinity isn't valid in JSON. If we made this change, how would we handle when a user wants to use Infinity instead of 0 (which is also a valid value).

description: [
'Maximal zoom level of the map view.',
'A maxScale of *2* (200%) corresponds to a zoom level',
Expand Down