Comments (4)
@Jianan-Li to set the rotation/scale programmatically you don't need this module. You can do it directly on the D3 projection itself, with https://github.com/d3/d3-geo#projection_rotate and https://github.com/d3/d3-geo#projection_scale.
This module is simply aconvenience layer to control those projection parameters by means of user interaction.
from d3-geo-zoom.
I think this is the same thing I am experiencing...
After a user zoom and then a programmatic change of the scale via projection.scale, the next user interaction reverts the scale to the pre-programmatic value, if that makes sense. My hunch is something is storing the scale internally somewhere and ignoring the projection's current scale.
from d3-geo-zoom.
I'm not sure what all ev.transform.k on https://github.com/vasturiano/d3-geo-zoom/blob/master/src/geoZoom.js#L51 is based on. It seems to be 'remembering' previous zooms, which I think it needs to in order to know the change, but I don't know how to influence it so it "sees" programmatic changes to zoom/scale.
from d3-geo-zoom.
Found a solution. My specific case was programmatically resetting to the original orientation/scale as when zoom was added, so returning to the zoomIdentity makes geozoom aware of that.
d3.select(canvas).call(d3.zoom().transform,d3.zoomIdentity);
from d3-geo-zoom.
Related Issues (9)
- Canvas implementation? HOT 1
- add mouse event handlers as passive HOT 2
- Trying to keep the mouse over the same point while pan/zooming HOT 9
- Fingers Gesture incorrectly zooming HOT 1
- Firefox error HOT 3
- Zoom affecting multiple projections HOT 2
- Error while importing d3GeoZoom as ES6 module HOT 1
- On mobile device example of library flickers a lot while zooming HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-geo-zoom.