Comments (5)
Hello there @wulucxy, glad it's useful. It's a pretty obvious feature indeed controlling zoom with other actions. Today you are able to double click to zoom, did you tried that? It is provided out of the box by the browser or d3 I'm not quite sure of the nature of the feature.
Regardless, I would challenge you to leave here a few suggestions of specific controls for zooming, or we could also go with a client configurable zoom ing actions (more generic).
from react-d3-graph.
Hi,@danielcaldas,I mean how can I control the zoom scale by outside props
,not only by inner state
。
Like I have three buttons,one for zoomIn
,one for zoomOut
,one for reset
,I think this is a general UI case。
from react-d3-graph.
So let's imagine something like 3 new properties in the config
object where you could pass in your own key bindings for zoom control, something like:
const graphConfig = {
...
zoomIn: 'w',
zoomOut: 's',
reset: 'r',
...
};
And you as client would have the hability to define those properties with other key bindings. How thus this sounds to you @wulucxy?
from react-d3-graph.
@danielcaldas actually I have found a solution for this, https://spotify.github.io/reactochart/docs/build/#/zoom-container。
you can control the zoom by props
, or you can only put it stateful
。
what I want is fully control of zoom,not just by mousewheel or dbclick event。
from react-d3-graph.
Oh well nice then, thanks for providing that link, others might find this useful as well. I didn't know the component, nice one.
from react-d3-graph.
Related Issues (20)
- Project Status: Active Maintainer Needed HOT 2
- Incorrect type for onMouseOverNode & onMosueOutNode callback
- Graph looks different with same data HOT 3
- I need a way to set the transofrm state that controls the position of the graph (which gets called on dragging the graph)
- Support react v17 and v18 HOT 1
- Console error while dragging and zooming the graph HOT 2
- Tooltip for Nodes HOT 1
- Show/Hide Label on click and pass a Label component
- High severity vulnerability with dependency
- Nodes are not loading in correct position HOT 9
- Unable to make it work with react 18.2.0
- How to make the nodes LIVE/interactive HOT 2
- Initial Positioning issue & Animation Stops working after few moves HOT 1
- How to handle UNSAFE_componentWillReceiveProps ?
- Can we persist the graph (node positions and links ) ?
- Module not found: Can't resolve 'd3-drag' in Next.js
- Working with react 17.0.2
- Separate Labels from Links and Nodes HOT 1
- Link forces or distances
- minimal usage example in doc doesn't work properly
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 react-d3-graph.