score:1
Accepted answer
One easy approach to this is to limit the zoom by setting a maximum scaling factor.
For instance in clicked
you could add a line like this:
scale = Math.min(1 << 14, scale);
(based your previous scale extent of [1 << 11, 1 << 14]
)
Here's the updated fiddle: https://jsfiddle.net/5Lf0w3sm/17/
Source: stackoverflow.com
Related Query
- Limit zoom to a 'maximum' in d3 geo tiles
- d3 limit zoom level for time axis
- How to limit the zoom of a time scale in d3.js to the minute?
- Matching leaflet zoom level with d3 geo scale
- Map zoom and pan in d3 js v4 + scale limit
- Javascript D3: zoom limit
- d3.js zoom transition with map tiles
- d3 world map -- calculate geo bounds on zoom
- Maximum distance limit for D3 Force Layout?
- D3 Geo map zoom is not working correctly (Canvas)
- d3 GEO - Zoom to fit bounding box
- Display alternative images / tiles where tile display fails (D3 Geo Tiles)
- D3.js can't zoom or pan tiles
- d3 v4 how to limit left/right panning on an x zoom line-graph
- Is there a maximum node limit in a Sankey diagram?
- D3 v5 zoom limit pan
- D3js Geo unzoom element when zoom map
- Is there a way to zoom into a D3 force layout graph?
- How to disable double click zoom for d3.behavior.zoom?
- How to limit d3.svg.axis to integer labels?
- D3.js Set initial zoom level
- d3 synchronizing 2 separate zoom behaviors
- How to disable legend in nvd3 or limit it's size
- Achieving animated zoom with d3 and Leaflet
- d3 zoom and pan upgrade to version 4
- How to get maximum value from an array of objects to use in d3.scale.linear().domain()
- How to show full text when zoom in & truncate it when zoom out
- d3.js rewriting zoom example in version4
- D3 v4: Reset zoom state
- how to know the current Zoom level in D3.js
More Query from same tag
- Animating wrapped text in d3
- Example of D3 USA Map done in angular2
- Comparison of two network graphs
- Plotting the x intercept of an analytical function
- d3js: Apply animation together on bubbles and texts
- d3 and connection charts are owning me
- Creating a legend for a bubble chart using D3
- When using d3, how to trigger drag with only mouse events?
- D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing - Need orientation changed
- How to dynamically add,edit,remove nodes to tree in d3.js tree
- Add text before array elements
- Implement d3 Click-to-zoom
- d3.js zoom behavior: changing the scale while keeping translation consistent
- Getting Sankey diagram in D3 from csv file
- Unable to determine correct version D3 for sample code I found
- How to add laced color band in d3 js?
- d3js - Column Graph - data point alignment
- How can i group elements that are bound to different data (to be used with forcesimulatoin) in D3 so that I can sort them
- Add text/label onto links in D3 force directed graph
- Function to create key-value pairs from two object properties
- Using leaflet-d3 on svelte
- cubism.js and Internet Explorer
- CSV import undefined data
- how to nest selections in d3?
- Unable to properly remove a D3 element
- What ever happend to the d3j.s force directed graph cluster example see on this image?
- github pages serve javascript / d3 visualizations
- In D3 force-directed layout, how can I position fixed nodes programmatically, without dragging?
- d3 vertical bar chart
- D3 updating local data and redrawing pie as it is updated